Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5b75af0a authored by Mike Galbraith's avatar Mike Galbraith Committed by Ingo Molnar
Browse files

perfcounters: fix "perf counters kill oprofile" bug



With oprofile as a module, and unloaded by profiling script,
both oprofile and kerneltop work fine.. unless you leave kerneltop
running when you start profiling, then you may see badness.

Signed-off-by: default avatarMike Galbraith <efault@gmx.de>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 15081c61
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -643,7 +643,9 @@ perf_counter_nmi_handler(struct notifier_block *self,
}
}


static __read_mostly struct notifier_block perf_counter_nmi_notifier = {
static __read_mostly struct notifier_block perf_counter_nmi_notifier = {
	.notifier_call		= perf_counter_nmi_handler
	.notifier_call		= perf_counter_nmi_handler,
	.next			= NULL,
	.priority		= 1
};
};


void __init init_hw_perf_counters(void)
void __init init_hw_perf_counters(void)
+4 −3
Original line number Original line Diff line number Diff line
@@ -40,7 +40,8 @@ static int profile_exceptions_notify(struct notifier_block *self,


	switch (val) {
	switch (val) {
	case DIE_NMI:
	case DIE_NMI:
		if (model->check_ctrs(args->regs, &per_cpu(cpu_msrs, cpu)))
	case DIE_NMI_IPI:
		model->check_ctrs(args->regs, &per_cpu(cpu_msrs, cpu));
		ret = NOTIFY_STOP;
		ret = NOTIFY_STOP;
		break;
		break;
	default:
	default:
@@ -134,7 +135,7 @@ static void nmi_cpu_setup(void *dummy)
static struct notifier_block profile_exceptions_nb = {
static struct notifier_block profile_exceptions_nb = {
	.notifier_call = profile_exceptions_notify,
	.notifier_call = profile_exceptions_notify,
	.next = NULL,
	.next = NULL,
	.priority = 0
	.priority = 2
};
};


static int nmi_setup(void)
static int nmi_setup(void)