aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/oprofile/oprof.c
diff options
context:
space:
mode:
authorBob Nelson <rrnelson@linux.vnet.ibm.com>2007-07-20 15:39:53 -0400
committerArnd Bergmann <arnd@klappe.arndb.de>2007-07-20 15:42:24 -0400
commit1474855d0878cced6f39f51f3c2bd7428b44cb1e (patch)
treecbad42404bfc0f7222d0a88e4ed9b0e9e0d0cb50 /drivers/oprofile/oprof.c
parent36aaccc1e96481e8310b1d13600096da0f24ff43 (diff)
[CELL] oprofile: add support to OProfile for profiling CELL BE SPUs
From: Maynard Johnson <mpjohn@us.ibm.com> This patch updates the existing arch/powerpc/oprofile/op_model_cell.c to add in the SPU profiling capabilities. In addition, a 'cell' subdirectory was added to arch/powerpc/oprofile to hold Cell-specific SPU profiling code. Exports spu_set_profile_private_kref and spu_get_profile_private_kref which are used by OProfile to store private profile information in spufs data structures. Also incorporated several fixes from other patches (rrn). Check pointer returned from kzalloc. Eliminated unnecessary cast. Better error handling and cleanup in the related area. 64-bit unsigned long parameter was being demoted to 32-bit unsigned int and eventually promoted back to unsigned long. Signed-off-by: Carl Love <carll@us.ibm.com> Signed-off-by: Maynard Johnson <mpjohn@us.ibm.com> Signed-off-by: Bob Nelson <rrnelson@us.ibm.com> Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com> Acked-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'drivers/oprofile/oprof.c')
-rw-r--r--drivers/oprofile/oprof.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/oprofile/oprof.c b/drivers/oprofile/oprof.c
index e5162a64018b..2c645170f06e 100644
--- a/drivers/oprofile/oprof.c
+++ b/drivers/oprofile/oprof.c
@@ -53,9 +53,24 @@ int oprofile_setup(void)
53 * us missing task deaths and eventually oopsing 53 * us missing task deaths and eventually oopsing
54 * when trying to process the event buffer. 54 * when trying to process the event buffer.
55 */ 55 */
56 if (oprofile_ops.sync_start) {
57 int sync_ret = oprofile_ops.sync_start();
58 switch (sync_ret) {
59 case 0:
60 goto post_sync;
61 case 1:
62 goto do_generic;
63 case -1:
64 goto out3;
65 default:
66 goto out3;
67 }
68 }
69do_generic:
56 if ((err = sync_start())) 70 if ((err = sync_start()))
57 goto out3; 71 goto out3;
58 72
73post_sync:
59 is_setup = 1; 74 is_setup = 1;
60 mutex_unlock(&start_mutex); 75 mutex_unlock(&start_mutex);
61 return 0; 76 return 0;
@@ -118,7 +133,20 @@ out:
118void oprofile_shutdown(void) 133void oprofile_shutdown(void)
119{ 134{
120 mutex_lock(&start_mutex); 135 mutex_lock(&start_mutex);
136 if (oprofile_ops.sync_stop) {
137 int sync_ret = oprofile_ops.sync_stop();
138 switch (sync_ret) {
139 case 0:
140 goto post_sync;
141 case 1:
142 goto do_generic;
143 default:
144 goto post_sync;
145 }
146 }
147do_generic:
121 sync_stop(); 148 sync_stop();
149post_sync:
122 if (oprofile_ops.shutdown) 150 if (oprofile_ops.shutdown)
123 oprofile_ops.shutdown(); 151 oprofile_ops.shutdown();
124 is_setup = 0; 152 is_setup = 0;