vserver 1.9.5.x5
[linux-2.6.git] / arch / ppc64 / oprofile / common.c
index bd0dcd2..a9a47ca 100644 (file)
@@ -112,24 +112,20 @@ static int op_ppc64_create_files(struct super_block *sb, struct dentry *root)
 
        oprofilefs_create_ulong(sb, root, "enable_kernel", &sys.enable_kernel);
        oprofilefs_create_ulong(sb, root, "enable_user", &sys.enable_user);
+       oprofilefs_create_ulong(sb, root, "backtrace_spinlocks",
+                               &sys.backtrace_spinlocks);
 
        /* Default to tracing both kernel and user */
        sys.enable_kernel = 1;
        sys.enable_user = 1;
 
+       /* Turn on backtracing through spinlocks by default */
+       sys.backtrace_spinlocks = 1;
+
        return 0;
 }
 
-static struct oprofile_operations oprof_ppc64_ops = {
-       .create_files   = op_ppc64_create_files,
-       .setup          = op_ppc64_setup,
-       .shutdown       = op_ppc64_shutdown,
-       .start          = op_ppc64_start,
-       .stop           = op_ppc64_stop,
-       .cpu_type       = NULL          /* To be filled in below. */
-};
-
-int __init oprofile_arch_init(struct oprofile_operations **ops)
+int __init oprofile_arch_init(struct oprofile_operations *ops)
 {
        unsigned int pvr;
 
@@ -140,7 +136,7 @@ int __init oprofile_arch_init(struct oprofile_operations **ops)
                case PV_630p:
                        model = &op_model_rs64;
                        model->num_counters = 8;
-                       oprof_ppc64_ops.cpu_type = "ppc64/power3";
+                       ops->cpu_type = "ppc64/power3";
                        break;
 
                case PV_NORTHSTAR:
@@ -149,38 +145,42 @@ int __init oprofile_arch_init(struct oprofile_operations **ops)
                case PV_SSTAR:
                        model = &op_model_rs64;
                        model->num_counters = 8;
-                       oprof_ppc64_ops.cpu_type = "ppc64/rs64";
+                       ops->cpu_type = "ppc64/rs64";
                        break;
 
                case PV_POWER4:
                case PV_POWER4p:
                        model = &op_model_power4;
                        model->num_counters = 8;
-                       oprof_ppc64_ops.cpu_type = "ppc64/power4";
+                       ops->cpu_type = "ppc64/power4";
                        break;
 
                case PV_970:
                case PV_970FX:
                        model = &op_model_power4;
                        model->num_counters = 8;
-                       oprof_ppc64_ops.cpu_type = "ppc64/970";
+                       ops->cpu_type = "ppc64/970";
                        break;
 
                case PV_POWER5:
                case PV_POWER5p:
                        model = &op_model_power4;
                        model->num_counters = 6;
-                       oprof_ppc64_ops.cpu_type = "ppc64/power5";
+                       ops->cpu_type = "ppc64/power5";
                        break;
 
                default:
                        return -ENODEV;
        }
 
-       *ops = &oprof_ppc64_ops;
+       ops->create_files = op_ppc64_create_files;
+       ops->setup = op_ppc64_setup;
+       ops->shutdown = op_ppc64_shutdown;
+       ops->start = op_ppc64_start;
+       ops->stop = op_ppc64_stop;
 
        printk(KERN_INFO "oprofile: using %s performance monitoring.\n",
-              oprof_ppc64_ops.cpu_type);
+              ops->cpu_type);
 
        return 0;
 }