aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDongsheng Yang <yangds.fnst@cn.fujitsu.com>2013-12-20 15:52:58 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-12-23 14:49:50 -0500
commit73547aacdcd45cdf8b53245ded9593d7c587501a (patch)
treefd3b716e5b2bba6ba76e79c06abfcfc3d46cd041
parent995634650ef1f907196bd7e9ae45354124a80e47 (diff)
perf tools: Set event->header.misc to PERF_RECORD_MISC_GUEST_USER if machine is guest.
When we synthesize the mmap events of user space, if machine is guest, we should set the event->header.misc to PERF_RECORD_MISC_GUEST_USER, rather than PERF_RECORD_MISC_USER. Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com> Cc: David Ahern <dsahern@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung.kim@lge.com> Link: http://lkml.kernel.org/r/e6f8ff6505d2db8a4b21bff8e448bb9be0bcff35.1387572416.git.yangds.fnst@cn.fujitsu.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/util/event.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index a61726ea01a9..07c07833de53 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -220,7 +220,10 @@ static int perf_event__synthesize_mmap_events(struct perf_tool *tool,
220 /* 220 /*
221 * Just like the kernel, see __perf_event_mmap in kernel/perf_event.c 221 * Just like the kernel, see __perf_event_mmap in kernel/perf_event.c
222 */ 222 */
223 event->header.misc = PERF_RECORD_MISC_USER; 223 if (machine__is_host(machine))
224 event->header.misc = PERF_RECORD_MISC_USER;
225 else
226 event->header.misc = PERF_RECORD_MISC_GUEST_USER;
224 227
225 if (prot[2] != 'x') { 228 if (prot[2] != 'x') {
226 if (!mmap_data || prot[0] != 'r') 229 if (!mmap_data || prot[0] != 'r')