]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/powerpc/oprofile/common.c
Merge branch 'drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
[linux-2.6-omap-h63xx.git] / arch / powerpc / oprofile / common.c
index 4908dc98f9caa2368129a7c7f16ed477ec1bebec..21f16edf6c8db48065a7f3019bc08ed53cb18f26 100644 (file)
@@ -65,7 +65,7 @@ static int op_powerpc_setup(void)
 
        /* Configure the registers on all cpus.  If an error occurs on one
         * of the cpus, op_per_cpu_rc will be set to the error */
-       on_each_cpu(op_powerpc_cpu_setup, NULL, 0, 1);
+       on_each_cpu(op_powerpc_cpu_setup, NULL, 1);
 
 out:   if (op_per_cpu_rc) {
                /* error on setup release the performance counter hardware */
@@ -100,7 +100,7 @@ static int op_powerpc_start(void)
        if (model->global_start)
                return model->global_start(ctr);
        if (model->start) {
-               on_each_cpu(op_powerpc_cpu_start, NULL, 0, 1);
+               on_each_cpu(op_powerpc_cpu_start, NULL, 1);
                return op_per_cpu_rc;
        }
        return -EIO; /* No start function is defined for this
@@ -115,7 +115,7 @@ static inline void op_powerpc_cpu_stop(void *dummy)
 static void op_powerpc_stop(void)
 {
        if (model->stop)
-               on_each_cpu(op_powerpc_cpu_stop, NULL, 0, 1);
+               on_each_cpu(op_powerpc_cpu_stop, NULL, 1);
         if (model->global_stop)
                 model->global_stop();
 }
@@ -132,6 +132,28 @@ static int op_powerpc_create_files(struct super_block *sb, struct dentry *root)
        oprofilefs_create_ulong(sb, root, "mmcr0", &sys.mmcr0);
        oprofilefs_create_ulong(sb, root, "mmcr1", &sys.mmcr1);
        oprofilefs_create_ulong(sb, root, "mmcra", &sys.mmcra);
+#ifdef CONFIG_OPROFILE_CELL
+       /* create a file the user tool can check to see what level of profiling
+        * support exits with this kernel. Initialize bit mask to indicate
+        * what support the kernel has:
+        * bit 0      -  Supports SPU event profiling in addition to PPU
+        *               event and cycles; and SPU cycle profiling
+        * bits 1-31  -  Currently unused.
+        *
+        * If the file does not exist, then the kernel only supports SPU
+        * cycle profiling, PPU event and cycle profiling.
+        */
+       oprofilefs_create_ulong(sb, root, "cell_support", &sys.cell_support);
+       sys.cell_support = 0x1; /* Note, the user OProfile tool must check
+                                * that this bit is set before attempting to
+                                * user SPU event profiling.  Older kernels
+                                * will not have this file, hence the user
+                                * tool is not allowed to do SPU event
+                                * profiling on older kernels.  Older kernels
+                                * will accept SPU events but collected data
+                                * is garbage.
+                                */
+#endif
 #endif
 
        for (i = 0; i < model->num_counters; ++i) {