Commit f285f92f authored by Robert Richter's avatar Robert Richter Committed by Ingo Molnar

perf/x86: Improve debug output in check_hw_exists()

It might be of interest which perfctr msr failed.
Signed-off-by: default avatarRobert Richter <robert.richter@amd.com>
[ added hunk to avoid GCC warn ]
Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1340217996-2254-5-git-send-email-robert.richter@amd.comSigned-off-by: Ingo Molnar's avatarIngo Molnar <mingo@kernel.org>
parent b1dc3c48
......@@ -178,7 +178,7 @@ static void release_pmc_hardware(void) {}
static bool check_hw_exists(void)
{
u64 val, val_new = 0;
u64 val, val_new = ~0;
int i, reg, ret = 0;
/*
......@@ -211,8 +211,9 @@ static bool check_hw_exists(void)
* that don't trap on the MSR access and always return 0s.
*/
val = 0xabcdUL;
ret = wrmsrl_safe(x86_pmu_event_addr(0), val);
ret |= rdmsrl_safe(x86_pmu_event_addr(0), &val_new);
reg = x86_pmu_event_addr(0);
ret = wrmsrl_safe(reg, val);
ret |= rdmsrl_safe(reg, &val_new);
if (ret || val != val_new)
goto msr_fail;
......@@ -229,6 +230,7 @@ static bool check_hw_exists(void)
msr_fail:
printk(KERN_CONT "Broken PMU hardware detected, using software events only.\n");
printk(KERN_ERR "Failed to access perfctr msr (MSR %x is %Lx)\n", reg, val_new);
return false;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment