Commit 6b118e92cc78ccef7b54a296158d4738fd377bcc

Authored by David Ahern
Committed by Arnaldo Carvalho de Melo
1 parent 70b40c4a43

perf kvm top: Limit guest kernel info message to once

'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: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1343709095-7089-5-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Showing 1 changed file with 11 additions and 2 deletions Side-by-side Diff

tools/perf/builtin-top.c
... ... @@ -38,6 +38,7 @@
38 38 #include "util/cpumap.h"
39 39 #include "util/xyarray.h"
40 40 #include "util/sort.h"
  41 +#include "util/intlist.h"
41 42  
42 43 #include "util/debug.h"
43 44  
... ... @@ -706,8 +707,16 @@
706 707 int err;
707 708  
708 709 if (!machine && perf_guest) {
709   - pr_err("Can't find guest [%d]'s kernel information\n",
710   - event->ip.pid);
  710 + static struct intlist *seen;
  711 +
  712 + if (!seen)
  713 + seen = intlist__new();
  714 +
  715 + if (!intlist__has_entry(seen, event->ip.pid)) {
  716 + pr_err("Can't find guest [%d]'s kernel information\n",
  717 + event->ip.pid);
  718 + intlist__add(seen, event->ip.pid);
  719 + }
711 720 return;
712 721 }
713 722