x86/oprofile: pass the model to setup_ctrs() functions
authorRobert Richter <robert.richter@amd.com>
Mon, 25 May 2009 17:31:44 +0000 (19:31 +0200)
committerRobert Richter <robert.richter@amd.com>
Thu, 11 Jun 2009 17:42:14 +0000 (19:42 +0200)
In follow-on patches the setup_ctrs() functions will need data that
describes the model. This patch extends the function argument list to
pass a pointer of the model to these function.

Signed-off-by: Robert Richter <robert.richter@amd.com>
arch/x86/oprofile/nmi_int.c
arch/x86/oprofile/op_model_amd.c
arch/x86/oprofile/op_model_p4.c
arch/x86/oprofile/op_model_ppro.c
arch/x86/oprofile/op_x86_model.h

index ae0ab03959b420fa2d4a39ec4e2d62b979686d0f..c31f87bbf4362b8453ff71c045197cec3dd5a9ae 100644 (file)
@@ -125,7 +125,7 @@ static void nmi_cpu_setup(void *dummy)
        int cpu = smp_processor_id();
        struct op_msrs *msrs = &per_cpu(cpu_msrs, cpu);
        spin_lock(&oprofilefs_lock);
-       model->setup_ctrs(msrs);
+       model->setup_ctrs(model, msrs);
        spin_unlock(&oprofilefs_lock);
        per_cpu(saved_lvtpc, cpu) = apic_read(APIC_LVTPC);
        apic_write(APIC_LVTPC, APIC_DM_NMI);
index aaa7ffaed6b985e9192f92b31285b214d233b645..86e0a01ba125c16dc821825f740f13680ee4dab7 100644 (file)
@@ -85,7 +85,8 @@ static void op_amd_fill_in_addresses(struct op_msrs * const msrs)
 }
 
 
-static void op_amd_setup_ctrs(struct op_msrs const * const msrs)
+static void op_amd_setup_ctrs(struct op_x86_model_spec const *model,
+                             struct op_msrs const * const msrs)
 {
        unsigned int low, high;
        int i;
index 365d8a9c03d35668c755f112e4398d7769627da6..05ba0287b1f72a7db6ada823a0cf982f49a29283 100644 (file)
@@ -542,7 +542,8 @@ static void pmc_setup_one_p4_counter(unsigned int ctr)
 }
 
 
-static void p4_setup_ctrs(struct op_msrs const * const msrs)
+static void p4_setup_ctrs(struct op_x86_model_spec const *model,
+                         struct op_msrs const * const msrs)
 {
        unsigned int i;
        unsigned int low, high;
index 61ee8f640535a9d37261bee7e31d9b4282eca79d..40b44ee521d5423f042d9bc61ba129c14690dd05 100644 (file)
@@ -51,7 +51,8 @@ static void ppro_fill_in_addresses(struct op_msrs * const msrs)
 }
 
 
-static void ppro_setup_ctrs(struct op_msrs const * const msrs)
+static void ppro_setup_ctrs(struct op_x86_model_spec const *model,
+                           struct op_msrs const * const msrs)
 {
        unsigned int low, high;
        int i;
index a207b1c46e26cf4f84d73d8ee168be78a78ce18e..6161c7f0e7fbe8f687d28fcf3cf816be97b1117a 100644 (file)
@@ -48,7 +48,8 @@ struct op_x86_model_spec {
        int             (*init)(struct oprofile_operations *ops);
        void            (*exit)(void);
        void            (*fill_in_addresses)(struct op_msrs * const msrs);
-       void            (*setup_ctrs)(struct op_msrs const * const msrs);
+       void            (*setup_ctrs)(struct op_x86_model_spec const *model,
+                                     struct op_msrs const * const msrs);
        int             (*check_ctrs)(struct pt_regs * const regs,
                                      struct op_msrs const * const msrs);
        void            (*start)(struct op_msrs const * const msrs);