]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
perf annotate: Pass annotation_options to symbol__annotate()
authorArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 28 May 2018 14:27:40 +0000 (11:27 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 4 Jun 2018 13:28:53 +0000 (10:28 -0300)
Now all callers to symbol__disassemble() can hand it the per-tool
annotation_options, which will allow us to remove lots of stuff
from symbol_options, the kitchen sink of perf configs, reducing its
size and getting annotation specific stuff grouped together.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/n/tip-vpr7ys7ggvs2fzpg8wbjcw7e@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-top.c
tools/perf/ui/gtk/annotate.c
tools/perf/util/annotate.c
tools/perf/util/annotate.h

index 5e58cd4de90b0936676c3244dd9e9ec99facad80..2c14ca61c657c1db9cc4086e74bdea38bf1d6c80 100644 (file)
@@ -133,7 +133,7 @@ static int perf_top__parse_source(struct perf_top *top, struct hist_entry *he)
                return err;
        }
 
-       err = symbol__annotate(sym, map, evsel, 0, NULL);
+       err = symbol__annotate(sym, map, evsel, 0, &top->annotation_opts, NULL);
        if (err == 0) {
                top->sym_filter_entry = he;
        } else {
index aeeaf15029f09798c1eabb15470c593b990ccac8..48428c9acd89e59149a53a12e5d4ee3123e4ef98 100644 (file)
@@ -169,7 +169,7 @@ static int symbol__gtk_annotate(struct symbol *sym, struct map *map,
        if (map->dso->annotate_warned)
                return -1;
 
-       err = symbol__annotate(sym, map, evsel, 0, NULL);
+       err = symbol__annotate(sym, map, evsel, 0, &annotation__default_options, NULL);
        if (err) {
                char msg[BUFSIZ];
                symbol__strerror_disassemble(sym, map, err, msg, sizeof(msg));
index abcc7e24c365fa99e29eeec83fb3452eaa6246d3..502f9d124a44ea38bca6dd88576090d2d188ea1d 100644 (file)
@@ -1067,6 +1067,7 @@ struct annotate_args {
        struct arch             *arch;
        struct map_symbol        ms;
        struct perf_evsel       *evsel;
+       struct annotation_options *options;
        s64                      offset;
        char                    *line;
        int                      line_nr;
@@ -1803,11 +1804,13 @@ void symbol__calc_percent(struct symbol *sym, struct perf_evsel *evsel)
 
 int symbol__annotate(struct symbol *sym, struct map *map,
                     struct perf_evsel *evsel, size_t privsize,
+                    struct annotation_options *options,
                     struct arch **parch)
 {
        struct annotate_args args = {
                .privsize       = privsize,
                .evsel          = evsel,
+               .options        = options,
        };
        struct perf_env *env = perf_evsel__env(evsel);
        const char *arch_name = perf_env__arch(env);
@@ -2409,7 +2412,7 @@ int symbol__tty_annotate(struct symbol *sym, struct map *map,
        struct dso *dso = map->dso;
        struct rb_root source_line = RB_ROOT;
 
-       if (symbol__annotate(sym, map, evsel, 0, NULL) < 0)
+       if (symbol__annotate(sym, map, evsel, 0, opts, NULL) < 0)
                return -1;
 
        symbol__calc_percent(sym, evsel);
@@ -2655,7 +2658,7 @@ int symbol__annotate2(struct symbol *sym, struct map *map, struct perf_evsel *ev
        if (perf_evsel__is_group_event(evsel))
                nr_pcnt = evsel->nr_members;
 
-       err = symbol__annotate(sym, map, evsel, 0, parch);
+       err = symbol__annotate(sym, map, evsel, 0, options, parch);
        if (err)
                goto out_free_offsets;
 
index 20f3326cc64044b5937f45e1842904eebe64d846..013d414b0e5778a09b7f0c95d3dc509e81d400aa 100644 (file)
@@ -306,6 +306,7 @@ void symbol__annotate_zero_histograms(struct symbol *sym);
 
 int symbol__annotate(struct symbol *sym, struct map *map,
                     struct perf_evsel *evsel, size_t privsize,
+                    struct annotation_options *options,
                     struct arch **parch);
 int symbol__annotate2(struct symbol *sym, struct map *map,
                      struct perf_evsel *evsel,