Merge branch 'perf/core' into oprofile/master
Merge reason: Resolve conflicts with Don's NMI rework:
commit 9c48f1c629
Author: Don Zickus <dzickus@redhat.com>
Date: Fri Sep 30 15:06:21 2011 -0400
x86, nmi: Wire up NMI handlers to new routines
Conflicts:
arch/x86/oprofile/nmi_timer_int.c
Signed-off-by: Robert Richter <robert.richter@amd.com>
这个提交包含在:
@@ -61,26 +61,15 @@ u64 op_x86_get_ctrl(struct op_x86_model_spec const *model,
|
||||
}
|
||||
|
||||
|
||||
static int profile_exceptions_notify(struct notifier_block *self,
|
||||
unsigned long val, void *data)
|
||||
static int profile_exceptions_notify(unsigned int val, struct pt_regs *regs)
|
||||
{
|
||||
struct die_args *args = (struct die_args *)data;
|
||||
int ret = NOTIFY_DONE;
|
||||
|
||||
switch (val) {
|
||||
case DIE_NMI:
|
||||
if (ctr_running)
|
||||
model->check_ctrs(args->regs, &__get_cpu_var(cpu_msrs));
|
||||
else if (!nmi_enabled)
|
||||
break;
|
||||
else
|
||||
model->stop(&__get_cpu_var(cpu_msrs));
|
||||
ret = NOTIFY_STOP;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return ret;
|
||||
if (ctr_running)
|
||||
model->check_ctrs(regs, &__get_cpu_var(cpu_msrs));
|
||||
else if (!nmi_enabled)
|
||||
return NMI_DONE;
|
||||
else
|
||||
model->stop(&__get_cpu_var(cpu_msrs));
|
||||
return NMI_HANDLED;
|
||||
}
|
||||
|
||||
static void nmi_cpu_save_registers(struct op_msrs *msrs)
|
||||
@@ -363,12 +352,6 @@ static void nmi_cpu_setup(void *dummy)
|
||||
apic_write(APIC_LVTPC, APIC_DM_NMI);
|
||||
}
|
||||
|
||||
static struct notifier_block profile_exceptions_nb = {
|
||||
.notifier_call = profile_exceptions_notify,
|
||||
.next = NULL,
|
||||
.priority = NMI_LOCAL_LOW_PRIOR,
|
||||
};
|
||||
|
||||
static void nmi_cpu_restore_registers(struct op_msrs *msrs)
|
||||
{
|
||||
struct op_msr *counters = msrs->counters;
|
||||
@@ -508,7 +491,8 @@ static int nmi_setup(void)
|
||||
ctr_running = 0;
|
||||
/* make variables visible to the nmi handler: */
|
||||
smp_mb();
|
||||
err = register_die_notifier(&profile_exceptions_nb);
|
||||
err = register_nmi_handler(NMI_LOCAL, profile_exceptions_notify,
|
||||
0, "oprofile");
|
||||
if (err)
|
||||
goto fail;
|
||||
|
||||
@@ -538,7 +522,7 @@ static void nmi_shutdown(void)
|
||||
put_online_cpus();
|
||||
/* make variables visible to the nmi handler: */
|
||||
smp_mb();
|
||||
unregister_die_notifier(&profile_exceptions_nb);
|
||||
unregister_nmi_handler(NMI_LOCAL, "oprofile");
|
||||
msrs = &get_cpu_var(cpu_msrs);
|
||||
model->shutdown(msrs);
|
||||
free_msrs();
|
||||
|
在新工单中引用
屏蔽一个用户