[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <500EAB0C.8090504@gmail.com>
Date: Tue, 24 Jul 2012 08:02:52 -0600
From: David Ahern <dsahern@...il.com>
To: Arnaldo Carvalho de Melo <acme@...stprotocols.net>
CC: linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...nel.org>,
Jiri Olsa <jolsa@...hat.com>,
Namhyung Kim <namhyung@...nel.org>,
Frederic Weisbecker <fweisbec@...il.com>,
Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH 11/11] perf kvm top: limit guest kernel info message to
once
On 7/23/12 12:17 PM, Arnaldo Carvalho de Melo wrote:
> Em Fri, Jul 20, 2012 at 05:25:56PM -0600, David Ahern escreveu:
>> '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@...il.com>
>> Cc: Arnaldo Carvalho de Melo <acme@...stprotocols.net>
>> Cc: Ingo Molnar <mingo@...nel.org>
>> Cc: Jiri Olsa <jolsa@...hat.com>
>> Cc: Namhyung Kim <namhyung@...nel.org>
>> Cc: Frederic Weisbecker <fweisbec@...il.com>
>> Cc: Peter Zijlstra <peterz@...radead.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);
>> + }
>
> Abuse of strlist? Can't we have an intlist?
Use of existing facility. :-) I'll look at adding an intlist facility.
David
--
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