2009-06-30 23:19:00

by Anton Blanchard

[permalink] [raw]
Subject: [patch 5/8] perf report: Fix reporting of hypervisor

PERF_EVENT_MISC_* is not a bitmask, so we have to mask and compare.

Signed-off-by: Anton Blanchard <[email protected]>
---

Index: linux-2.6-tip/tools/perf/builtin-report.c
===================================================================
--- linux-2.6-tip.orig/tools/perf/builtin-report.c 2009-07-01 08:21:13.000000000 +1000
+++ linux-2.6-tip/tools/perf/builtin-report.c 2009-07-01 08:21:39.000000000 +1000
@@ -1210,6 +1210,7 @@
struct map *map = NULL;
void *more_data = event->ip.__more_data;
struct ip_callchain *chain = NULL;
+ int cpumode;

if (sample_type & PERF_SAMPLE_PERIOD) {
period = *(u64 *)more_data;
@@ -1250,7 +1251,9 @@
return -1;
}

- if (event->header.misc & PERF_EVENT_MISC_KERNEL) {
+ cpumode = event->header.misc & PERF_EVENT_MISC_CPUMODE_MASK;
+
+ if (cpumode == PERF_EVENT_MISC_KERNEL) {
show = SHOW_KERNEL;
level = 'k';

@@ -1258,7 +1261,7 @@

dprintf(" ...... dso: %s\n", dso->name);

- } else if (event->header.misc & PERF_EVENT_MISC_USER) {
+ } else if (cpumode == PERF_EVENT_MISC_USER) {

show = SHOW_USER;
level = '.';

--


2009-06-30 23:30:04

by Anton Blanchard

[permalink] [raw]
Subject: [tip:perfcounters/urgent] perf report: Fix reporting of hypervisor

Commit-ID: d8db1b57d31a6b30ea2f0df318eab50fc92b38d6
Gitweb: http://git.kernel.org/tip/d8db1b57d31a6b30ea2f0df318eab50fc92b38d6
Author: Anton Blanchard <[email protected]>
AuthorDate: Wed, 1 Jul 2009 09:00:48 +1000
Committer: Ingo Molnar <[email protected]>
CommitDate: Wed, 1 Jul 2009 01:25:20 +0200

perf report: Fix reporting of hypervisor

PERF_EVENT_MISC_* is not a bitmask, so we have to mask and compare.

Signed-off-by: Anton Blanchard <[email protected]>
Cc: [email protected]
Cc: [email protected]
LKML-Reference: <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>


---
tools/perf/builtin-report.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 135b783..88e88c5 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -1213,6 +1213,7 @@ process_sample_event(event_t *event, unsigned long offset, unsigned long head)
struct map *map = NULL;
void *more_data = event->ip.__more_data;
struct ip_callchain *chain = NULL;
+ int cpumode;

if (sample_type & PERF_SAMPLE_PERIOD) {
period = *(u64 *)more_data;
@@ -1256,7 +1257,9 @@ process_sample_event(event_t *event, unsigned long offset, unsigned long head)
if (comm_list && !strlist__has_entry(comm_list, thread->comm))
return 0;

- if (event->header.misc & PERF_EVENT_MISC_KERNEL) {
+ cpumode = event->header.misc & PERF_EVENT_MISC_CPUMODE_MASK;
+
+ if (cpumode == PERF_EVENT_MISC_KERNEL) {
show = SHOW_KERNEL;
level = 'k';

@@ -1264,7 +1267,7 @@ process_sample_event(event_t *event, unsigned long offset, unsigned long head)

dprintf(" ...... dso: %s\n", dso->name);

- } else if (event->header.misc & PERF_EVENT_MISC_USER) {
+ } else if (cpumode == PERF_EVENT_MISC_USER) {

show = SHOW_USER;
level = '.';