lkml.org 
[lkml]   [2012]   [Jul]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 11/11] perf kvm top: limit guest kernel info message to once
Date
'perf kvm top' shows a continual flurry of:
Can't find guest [5201]'s kernel information

if it can't find the guest info and with a lot of VMs running a user
has no chance of reading them all. Limit message to once per guest.

Signed-off-by: David Ahern <dsahern@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
---
tools/perf/builtin-top.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 1706dc9..6285374 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -706,8 +706,18 @@ static void perf_event__process_sample(struct perf_tool *tool,
int err;

if (!machine && perf_guest) {
- pr_err("Can't find guest [%d]'s kernel information\n",
- event->ip.pid);
+ static struct strlist *seen;
+ char pidstr[8];
+
+ if (!seen)
+ seen = strlist__new(true, NULL);
+
+ scnprintf(pidstr, sizeof(pidstr), "%d", event->ip.pid);
+ if (!strlist__has_entry(seen, pidstr)) {
+ pr_err("Can't find guest [%d]'s kernel information\n",
+ event->ip.pid);
+ strlist__add(seen, pidstr);
+ }
return;
}

--
1.7.10.1


\
 
 \ /
  Last update: 2012-07-21 02:01    [W:0.396 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site