perf/x86: Fix wrmsrl() debug wrapper
Subsystems (2)
Commit-ID: 1c2ac3fde3e35279958e7b0408e2dcf866465301 Gitweb: http://git.kernel.org/tip/1c2ac3fde3e35279958e7b0408e2dcf866465301 Author: Peter Zijlstra <[email protected]> AuthorDate: Mon, 14 May 2012 15:25:34 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Wed, 6 Jun 2012 17:23:22 +0200
perf/x86: Fix wrmsrl() debug wrapper
Move the wrmslr() debug wrapper to the common header now that all the include games are gone. Also clean it up a bit to avoid multiple evaluation of the argument.
--- arch/x86/kernel/cpu/perf_event.c | 11 ----------- arch/x86/kernel/cpu/perf_event.h | 12 ++++++++++++ 2 files changed, 12 insertions(+), 11 deletions(-)
arch/x86/kernel/cpu/perf_event.c +0 -11
@@ -35,17 +35,6 @@#include "perf_event.h" -#if 0 -#undef wrmsrl -#define wrmsrl (msr, val) \ -do { \ - trace_printk("wrmsrl(%lx, %lx)\n", (unsigned long)(msr),\ - (unsigned long)(val)); \ - native_write_msr((msr), (u32)((u64)(val)), \ - (u32)((u64)(val) >> 32)); \ -} while (0) -#endif -struct x86_pmu x86_pmu__read_mostly ; DEFINE_PER_CPU(struct cpu_hw_events, cpu_hw_events) = {
arch/x86/kernel/cpu/perf_event.h +12 -0
@@ -14,6 +14,18 @@#include <linux/perf_event.h> +#if 0 +#undef wrmsrl +#define wrmsrl (msr, val) \ +do { \ + unsigned int _msr = (msr); \ + u64 _val = (val); \ + trace_printk("wrmsrl(%x, %Lx)\n", (unsigned int)(_msr), \ + (unsigned long long)(_val)); \ + native_write_msr((_msr), (u32)(_val), (u32)(_val >> 32)); \ +} while (0) +#endif +/* * | NHM/WSM | SNB | * register -------------------------------
H. Peter Anvin
reviewerQuoted 10 lines · tip-bot for Peter Zijlstra
perf/x86: Fix
wrmsrl()debug wrapperMove the
wrmslr()debug wrapper to the common header now that all the include games are gone. Also clean it up a bit to avoid multiple evaluation of the argument.Signed-off-by Peter Zijlstra <[email protected]>Signed-off-by Ingo Molnar <[email protected]>
Could you please call this something like trace_wrmsrl() instead of silently tacking something onto something else that already had meaning?
-hpa
Signature · 2 lines
H. Peter Anvin, Intel Open Source Technology Center I work for Intel. I don't speak on their behalf.
Quoted 8 lines · H. Peter Anvin
Quoted 7 lines · tip-bot for Peter Zijlstra
perf/x86: Fix
wrmsrl()debug wrapperMove the
wrmslr()debug wrapper to the common header now that all the include games are gone. Also clean it up a bit to avoid multiple evaluation of the argument.
Quoted 6 lines
Quoted 3 lines
Signed-off-by Peter Zijlstra <[email protected]>Signed-off-by Ingo Molnar <[email protected]>Could you please call this something like
trace_wrmsrl()instead of silently tacking something onto something else that already had meaning?
Its #if 0, its broken on CONFIG_PARAVIRT etc.. The whole purpose was to hijack wrmsrl() for perf_event*.c so that I don't have to do s/wrmsrl/trace_&/ on those files.
Its a crude debug aid, nothing more.