perf annotate: Re-add annotate_warned functionality
authorJames Clark <james.clark@arm.com>
Thu, 29 Jul 2021 15:58:01 +0000 (16:58 +0100)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 3 Aug 2021 20:04:04 +0000 (17:04 -0300)
Setting annotate_warned to true on errors was removed in
commit ee51d851392e ("perf annotate: Introduce strerror for handling
symbol__disassemble() errors") which means when 'perf annotate
--skip-missing' is used warnings are shown multiple times for the same
DSO.

Setting this again restores the original behavior of only one warning
each.

Signed-off-by: James Clark <james.clark@arm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: John Garry <john.garry@huawei.com>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: coresight@lists.linaro.org
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lore.kernel.org/lkml/20210729155805.2830-3-james.clark@arm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/ui/browsers/annotate.c
tools/perf/ui/gtk/annotate.c

index 701130a..ef4da42 100644 (file)
@@ -966,6 +966,7 @@ int symbol__tui_annotate(struct map_symbol *ms, struct evsel *evsel,
        err = symbol__annotate2(ms, evsel, opts, &browser.arch);
        if (err) {
                char msg[BUFSIZ];
+               ms->map->dso->annotate_warned = true;
                symbol__strerror_disassemble(ms, err, msg, sizeof(msg));
                ui__error("Couldn't annotate %s:\n%s", sym->name, msg);
                goto out_free_offsets;
index 94167bf..0a50e96 100644 (file)
@@ -177,6 +177,7 @@ static int symbol__gtk_annotate(struct map_symbol *ms, struct evsel *evsel,
        err = symbol__annotate(ms, evsel, &annotation__default_options, NULL);
        if (err) {
                char msg[BUFSIZ];
+               ms->map->dso->annotate_warned = true;
                symbol__strerror_disassemble(ms, err, msg, sizeof(msg));
                ui__error("Couldn't annotate %s: %s\n", sym->name, msg);
                return -1;