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

From: Anton Blanchard
Date: Tue Jun 30 2009 - 19:19:05 EST


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

Signed-off-by: Anton Blanchard <anton@xxxxxxxxx>
---

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 = '.';

--

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/