[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-7c0f4a4113ba5de7898c246eeaeee4c23d94b887@git.kernel.org>
Date: Wed, 25 Jul 2012 12:18:18 -0700
From: tip-bot for David Ahern <dsahern@...il.com>
To: linux-tip-commits@...r.kernel.org
Cc: acme@...hat.com, linux-kernel@...r.kernel.org, hpa@...or.com,
mingo@...nel.org, peterz@...radead.org, namhyung@...nel.org,
jolsa@...hat.com, fweisbec@...il.com, dsahern@...il.com,
tglx@...utronix.de
Subject: [tip:perf/core] perf kvm:
Guest userspace samples should not be lumped with host uspace
Commit-ID: 7c0f4a4113ba5de7898c246eeaeee4c23d94b887
Gitweb: http://git.kernel.org/tip/7c0f4a4113ba5de7898c246eeaeee4c23d94b887
Author: David Ahern <dsahern@...il.com>
AuthorDate: Fri, 20 Jul 2012 17:25:48 -0600
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Wed, 25 Jul 2012 11:29:46 -0300
perf kvm: Guest userspace samples should not be lumped with host uspace
e.g., perf kvm --host --guest report -i perf.data --stdio -D
shows:
1 599127912065356 0x143b8 [0x48]: PERF_RECORD_SAMPLE(IP, 5): 5671/5676: 0x7fdf95a061c0 period: 1 addr: 0
... chain: nr:2
..... 0: ffffffffffffff80
..... 1: fffffffffffffe00
... thread: qemu-kvm:5671
...... dso: <not found>
(IP, 5) means sample in guest userspace. Those samples should not be lumped
into the VMM's host thread. i.e, the report output:
56.86% qemu-kvm [unknown] [u] 0x00007fdf95a061c0
With this patch the output emphasizes it is a guest userspace hit:
56.86% [guest/5671] [unknown] [u] 0x00007fdf95a061c0
Looking at 3 VMs (2 64-bit, 1 32-bit) with each running a CPU bound
process (openssl speed), perf report currently shows:
93.84% 117726 qemu-kvm [unknown] [u] 0x00007fd7dcaea8e5
which is wrong. With this patch you get:
31.50% 39258 [guest/18772] [unknown] [u] 0x00007fd7dcaea8e5
31.50% 39236 [guest/11230] [unknown] [u] 0x0000000000a57340
30.84% 39232 [guest/18395] [unknown] [u] 0x00007f66f641e107
Tested-by: Jiri Olsa <jolsa@...hat.com>
Signed-off-by: David Ahern <dsahern@...il.com>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: Ingo Molnar <mingo@...nel.org>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Link: http://lkml.kernel.org/r/1342826756-64663-4-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/util/session.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 8e48559..90ee39d 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -918,7 +918,9 @@ static struct machine *
{
const u8 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK;
- if (cpumode == PERF_RECORD_MISC_GUEST_KERNEL && perf_guest) {
+ if (perf_guest &&
+ ((cpumode == PERF_RECORD_MISC_GUEST_KERNEL) ||
+ (cpumode == PERF_RECORD_MISC_GUEST_USER))) {
u32 pid;
if (event->header.type == PERF_RECORD_MMAP)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists