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 06/11] perf kvm: limit repetitive guestmount message to once per directory
    Date
    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 <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/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 <unistd.h>
    #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);
    + }
    machine = NULL;
    goto out;
    }
    --
    1.7.10.1


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