Merge branch 'core-iommu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[sfrench/cifs-2.6.git] / arch / powerpc / oprofile / common.c
index 17807acb05d998da3fdf6e9af0f459b00bb0d8f0..d65e68f3cb25c16762347c7e24303caaa2647533 100644 (file)
@@ -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) {
@@ -177,7 +199,7 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
                return -ENODEV;
 
        switch (cur_cpu_spec->oprofile_type) {
-#ifdef CONFIG_PPC64
+#ifdef CONFIG_PPC_BOOK3S_64
 #ifdef CONFIG_OPROFILE_CELL
                case PPC_OPROFILE_CELL:
                        if (firmware_has_feature(FW_FEATURE_LPAR))