Skip to content

Commit

Permalink
perf kvm top: Limit guest kernel info message to once
Browse files Browse the repository at this point in the history
'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 <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
dsahern authored and acmel committed Aug 3, 2012
1 parent 70b40c4 commit 6b118e9
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tools/perf/builtin-top.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "util/cpumap.h"
#include "util/xyarray.h"
#include "util/sort.h"
#include "util/intlist.h"

#include "util/debug.h"

Expand Down Expand Up @@ -706,8 +707,16 @@ 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 intlist *seen;

if (!seen)
seen = intlist__new();

if (!intlist__has_entry(seen, event->ip.pid)) {
pr_err("Can't find guest [%d]'s kernel information\n",
event->ip.pid);
intlist__add(seen, event->ip.pid);
}
return;
}

Expand Down

0 comments on commit 6b118e9

Please sign in to comment.