public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf: Fix hypervisor sample reporting
@ 2010-02-09  3:43 Anton Blanchard
  2010-02-09 10:52 ` [tip:perf/urgent] " tip-bot for Anton Blanchard
  0 siblings, 1 reply; 2+ messages in thread
From: Anton Blanchard @ 2010-02-09  3:43 UTC (permalink / raw)
  To: Peter Zijlstra, Paul Mackerras, Ingo Molnar,
	Arnaldo Carvalho de Melo, fweisbec
  Cc: linux-kernel


cpumode bits are defined as such:

#define PERF_RECORD_MISC_KERNEL                 (1 << 0)
#define PERF_RECORD_MISC_USER                   (2 << 0)
#define PERF_RECORD_MISC_HYPERVISOR             (3 << 0)

We need to compare against the complete value of cpumode, otherwise hypervisor
samples get incorrectly attributed as userspace.

Signed-off-by: Anton Blanchard <anton@samba.org>
---

diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index c3831f6..5a99e61 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -436,10 +436,10 @@ void thread__find_addr_map(struct thread *self,
 	al->thread = self;
 	al->addr = addr;
 
-	if (cpumode & PERF_RECORD_MISC_KERNEL) {
+	if (cpumode == PERF_RECORD_MISC_KERNEL) {
 		al->level = 'k';
 		mg = &session->kmaps;
-	} else if (cpumode & PERF_RECORD_MISC_USER)
+	} else if (cpumode == PERF_RECORD_MISC_USER)
 		al->level = '.';
 	else {
 		al->level = 'H';

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [tip:perf/urgent] perf: Fix hypervisor sample reporting
  2010-02-09  3:43 [PATCH] perf: Fix hypervisor sample reporting Anton Blanchard
@ 2010-02-09 10:52 ` tip-bot for Anton Blanchard
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Anton Blanchard @ 2010-02-09 10:52 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, acme, paulus, anton, hpa, mingo, a.p.zijlstra, tglx,
	mingo

Commit-ID:  7fbfc683f1cc4051aa095ebe48d9d1e8b015682d
Gitweb:     http://git.kernel.org/tip/7fbfc683f1cc4051aa095ebe48d9d1e8b015682d
Author:     Anton Blanchard <anton@samba.org>
AuthorDate: Tue, 9 Feb 2010 14:43:05 +1100
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Tue, 9 Feb 2010 10:52:40 +0100

perf: Fix hypervisor sample reporting

cpumode bits are defined as such:

 #define PERF_RECORD_MISC_KERNEL                 (1 << 0)
 #define PERF_RECORD_MISC_USER                   (2 << 0)
 #define PERF_RECORD_MISC_HYPERVISOR             (3 << 0)

We need to compare against the complete value of cpumode,
otherwise hypervisor samples get incorrectly attributed as
userspace.

Signed-off-by: Anton Blanchard <anton@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: fweisbec@gmail.com
LKML-Reference: <20100209034304.GA3702@kryten>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 tools/perf/util/event.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index bb0fd6d..8a9e6ba 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -295,10 +295,10 @@ void thread__find_addr_location(struct thread *self,
 	al->thread = self;
 	al->addr = addr;
 
-	if (cpumode & PERF_RECORD_MISC_KERNEL) {
+	if (cpumode == PERF_RECORD_MISC_KERNEL) {
 		al->level = 'k';
 		mg = &session->kmaps;
-	} else if (cpumode & PERF_RECORD_MISC_USER)
+	} else if (cpumode == PERF_RECORD_MISC_USER)
 		al->level = '.';
 	else {
 		al->level = 'H';

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-02-09 10:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-09  3:43 [PATCH] perf: Fix hypervisor sample reporting Anton Blanchard
2010-02-09 10:52 ` [tip:perf/urgent] " tip-bot for Anton Blanchard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox