From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754223Ab2GWSLZ (ORCPT ); Mon, 23 Jul 2012 14:11:25 -0400 Received: from mail-gh0-f174.google.com ([209.85.160.174]:53284 "EHLO mail-gh0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753968Ab2GWSLY (ORCPT ); Mon, 23 Jul 2012 14:11:24 -0400 Date: Mon, 23 Jul 2012 20:11:17 +0200 From: Arnaldo Carvalho de Melo To: David Ahern Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Jiri Olsa , Namhyung Kim , Frederic Weisbecker , Peter Zijlstra Subject: Re: [PATCH 06/11] perf kvm: limit repetitive guestmount message to once per directory Message-ID: <20120723181117.GB6717@infradead.org> References: <1342826756-64663-1-git-send-email-dsahern@gmail.com> <1342826756-64663-7-git-send-email-dsahern@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1342826756-64663-7-git-send-email-dsahern@gmail.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Fri, Jul 20, 2012 at 05:25:51PM -0600, David Ahern escreveu: > After 7ed97ad use of the guestmount option without a subdir for *each* > VM generates an error message for each sample related to that VM. Once > per VM is enough. > > Signed-off-by: David Ahern > Cc: Arnaldo Carvalho de Melo > Cc: Ingo Molnar > Cc: Jiri Olsa > Cc: Namhyung Kim > Cc: Frederic Weisbecker > Cc: Peter Zijlstra > --- > tools/perf/util/map.c | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > > diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c > index 16d783d..cc33486 100644 > --- a/tools/perf/util/map.c > +++ b/tools/perf/util/map.c > @@ -8,6 +8,7 @@ > #include > #include "map.h" > #include "thread.h" > +#include "strlist.h" > > const char *map_type__name[MAP__NR_TYPES] = { > [MAP__FUNCTION] = "Functions", > @@ -695,7 +696,15 @@ struct machine *machines__findnew(struct rb_root *self, pid_t pid) > (symbol_conf.guestmount)) { > sprintf(path, "%s/%d", symbol_conf.guestmount, pid); > if (access(path, R_OK)) { > - pr_err("Can't access file %s\n", path); > + static struct strlist *seen; > + > + if (!seen) > + seen = strlist__new(true, NULL); > + > + if (!strlist__has_entry(seen, path)) { > + pr_err("Can't access file %s\n", path); > + strlist__add(seen, path); > + } At some point we'll need to have __exit functions in userland perf so that we can delete this when using mem leak detectors :-\ Applying anyway. - Arnaldo