Skip to content

Commit 65d71fe

Browse files
Peter Zijlstra (Intel)Ingo Molnar
authored andcommitted
perf: Fix bogus kernel printk
Andy spotted the fail in what was intended as a conditional printk level. Reported-by: Andy Lutomirski <[email protected]> Fixes: cc6cd47 ("perf/x86: Tone down kernel messages when the PMU check fails in a virtual environment") Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Linus Torvalds <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent e53f612 commit 65d71fe

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

arch/x86/kernel/cpu/perf_event.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,9 @@ static bool check_hw_exists(void)
243243

244244
msr_fail:
245245
printk(KERN_CONT "Broken PMU hardware detected, using software events only.\n");
246-
printk(boot_cpu_has(X86_FEATURE_HYPERVISOR) ? KERN_INFO : KERN_ERR
247-
"Failed to access perfctr msr (MSR %x is %Lx)\n", reg, val_new);
246+
printk("%sFailed to access perfctr msr (MSR %x is %Lx)\n",
247+
boot_cpu_has(X86_FEATURE_HYPERVISOR) ? KERN_INFO : KERN_ERR,
248+
reg, val_new);
248249

249250
return false;
250251
}

0 commit comments

Comments
 (0)