x86/oprofile: pass the model to setup_ctrs() functions
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>
This commit is contained in:
parent
9c59354b48
commit
ef8828ddf8
arch/x86/oprofile
|
@ -125,7 +125,7 @@ static void nmi_cpu_setup(void *dummy)
|
||||||
int cpu = smp_processor_id();
|
int cpu = smp_processor_id();
|
||||||
struct op_msrs *msrs = &per_cpu(cpu_msrs, cpu);
|
struct op_msrs *msrs = &per_cpu(cpu_msrs, cpu);
|
||||||
spin_lock(&oprofilefs_lock);
|
spin_lock(&oprofilefs_lock);
|
||||||
model->setup_ctrs(msrs);
|
model->setup_ctrs(model, msrs);
|
||||||
spin_unlock(&oprofilefs_lock);
|
spin_unlock(&oprofilefs_lock);
|
||||||
per_cpu(saved_lvtpc, cpu) = apic_read(APIC_LVTPC);
|
per_cpu(saved_lvtpc, cpu) = apic_read(APIC_LVTPC);
|
||||||
apic_write(APIC_LVTPC, APIC_DM_NMI);
|
apic_write(APIC_LVTPC, APIC_DM_NMI);
|
||||||
|
|
|
@ -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;
|
unsigned int low, high;
|
||||||
int i;
|
int i;
|
||||||
|
|
|
@ -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 i;
|
||||||
unsigned int low, high;
|
unsigned int low, high;
|
||||||
|
|
|
@ -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;
|
unsigned int low, high;
|
||||||
int i;
|
int i;
|
||||||
|
|
|
@ -48,7 +48,8 @@ struct op_x86_model_spec {
|
||||||
int (*init)(struct oprofile_operations *ops);
|
int (*init)(struct oprofile_operations *ops);
|
||||||
void (*exit)(void);
|
void (*exit)(void);
|
||||||
void (*fill_in_addresses)(struct op_msrs * const msrs);
|
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,
|
int (*check_ctrs)(struct pt_regs * const regs,
|
||||||
struct op_msrs const * const msrs);
|
struct op_msrs const * const msrs);
|
||||||
void (*start)(struct op_msrs const * const msrs);
|
void (*start)(struct op_msrs const * const msrs);
|
||||||
|
|
Loading…
Reference in New Issue