From: tip-bot for Robert Richter <robert.richter@amd.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
robert.richter@amd.com, a.p.zijlstra@chello.nl,
tglx@linutronix.de
Subject: [tip:perf/core] perf/x86: Improve debug output in check_hw_exists( )
Date: Thu, 5 Jul 2012 23:27:46 -0700 [thread overview]
Message-ID: <tip-f285f92f7e4c9af20149130c8fd5027131b39b0e@git.kernel.org> (raw)
In-Reply-To: <1340217996-2254-5-git-send-email-robert.richter@amd.com>
Commit-ID: f285f92f7e4c9af20149130c8fd5027131b39b0e
Gitweb: http://git.kernel.org/tip/f285f92f7e4c9af20149130c8fd5027131b39b0e
Author: Robert Richter <robert.richter@amd.com>
AuthorDate: Wed, 20 Jun 2012 20:46:36 +0200
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 5 Jul 2012 21:19:42 +0200
perf/x86: Improve debug output in check_hw_exists()
It might be of interest which perfctr msr failed.
Signed-off-by: Robert Richter <robert.richter@amd.com>
[ added hunk to avoid GCC warn ]
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1340217996-2254-5-git-send-email-robert.richter@amd.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/x86/kernel/cpu/perf_event.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
index 7b4f1e8..3eb88eb 100644
--- a/arch/x86/kernel/cpu/perf_event.c
+++ b/arch/x86/kernel/cpu/perf_event.c
@@ -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 @@ bios_fail:
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;
}
next prev parent reply other threads:[~2012-07-06 6:28 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-20 18:46 [PATCH 0/4] perf, x86: Updates and cleanups Robert Richter
2012-06-20 18:46 ` [PATCH 1/4] perf, x86: Rename Intel specific macros Robert Richter
2012-07-06 6:25 ` [tip:perf/core] perf/x86: " tip-bot for Robert Richter
2012-06-20 18:46 ` [PATCH 2/4] perf, x86: Move Intel specific code to intel_pmu_init() Robert Richter
2012-07-06 6:26 ` [tip:perf/core] perf/x86: " tip-bot for Robert Richter
2012-06-20 18:46 ` [PATCH 3/4] perf, amd: Unify AMD's generic and family 15h pmus Robert Richter
2012-07-06 6:26 ` [tip:perf/core] perf/x86/amd: Unify AMD' s " tip-bot for Robert Richter
2012-06-20 18:46 ` [PATCH 4/4] perf, x86: Improve debug output in check_hw_exists() Robert Richter
2012-06-22 15:53 ` Peter Zijlstra
2012-06-22 16:36 ` Robert Richter
2012-06-27 9:59 ` Peter Zijlstra
2012-07-06 6:27 ` tip-bot for Robert Richter [this message]
2012-06-20 20:09 ` [PATCH 0/4] perf, x86: Updates and cleanups Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-f285f92f7e4c9af20149130c8fd5027131b39b0e@git.kernel.org \
--to=robert.richter@amd.com \
--cc=a.p.zijlstra@chello.nl \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox