Skip to content

Commit 380195e

Browse files
committed
perf annotate: Pass annotation_options to symbol__annotate()
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>
1 parent 6a53da0 commit 380195e

4 files changed

Lines changed: 8 additions & 4 deletions

File tree

‎tools/perf/builtin-top.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ static int perf_top__parse_source(struct perf_top *top, struct hist_entry *he)
133133
return err;
134134
}
135135

136-
err = symbol__annotate(sym, map, evsel, 0, NULL);
136+
err = symbol__annotate(sym, map, evsel, 0, &top->annotation_opts, NULL);
137137
if (err == 0) {
138138
top->sym_filter_entry = he;
139139
} else {

‎tools/perf/ui/gtk/annotate.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ static int symbol__gtk_annotate(struct symbol *sym, struct map *map,
169169
if (map->dso->annotate_warned)
170170
return -1;
171171

172-
err = symbol__annotate(sym, map, evsel, 0, NULL);
172+
err = symbol__annotate(sym, map, evsel, 0, &annotation__default_options, NULL);
173173
if (err) {
174174
char msg[BUFSIZ];
175175
symbol__strerror_disassemble(sym, map, err, msg, sizeof(msg));

‎tools/perf/util/annotate.c‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,6 +1067,7 @@ struct annotate_args {
10671067
struct arch *arch;
10681068
struct map_symbol ms;
10691069
struct perf_evsel *evsel;
1070+
struct annotation_options *options;
10701071
s64 offset;
10711072
char *line;
10721073
int line_nr;
@@ -1803,11 +1804,13 @@ void symbol__calc_percent(struct symbol *sym, struct perf_evsel *evsel)
18031804

18041805
int symbol__annotate(struct symbol *sym, struct map *map,
18051806
struct perf_evsel *evsel, size_t privsize,
1807+
struct annotation_options *options,
18061808
struct arch **parch)
18071809
{
18081810
struct annotate_args args = {
18091811
.privsize = privsize,
18101812
.evsel = evsel,
1813+
.options = options,
18111814
};
18121815
struct perf_env *env = perf_evsel__env(evsel);
18131816
const char *arch_name = perf_env__arch(env);
@@ -2409,7 +2412,7 @@ int symbol__tty_annotate(struct symbol *sym, struct map *map,
24092412
struct dso *dso = map->dso;
24102413
struct rb_root source_line = RB_ROOT;
24112414

2412-
if (symbol__annotate(sym, map, evsel, 0, NULL) < 0)
2415+
if (symbol__annotate(sym, map, evsel, 0, opts, NULL) < 0)
24132416
return -1;
24142417

24152418
symbol__calc_percent(sym, evsel);
@@ -2655,7 +2658,7 @@ int symbol__annotate2(struct symbol *sym, struct map *map, struct perf_evsel *ev
26552658
if (perf_evsel__is_group_event(evsel))
26562659
nr_pcnt = evsel->nr_members;
26572660

2658-
err = symbol__annotate(sym, map, evsel, 0, parch);
2661+
err = symbol__annotate(sym, map, evsel, 0, options, parch);
26592662
if (err)
26602663
goto out_free_offsets;
26612664

‎tools/perf/util/annotate.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ void symbol__annotate_zero_histograms(struct symbol *sym);
306306

307307
int symbol__annotate(struct symbol *sym, struct map *map,
308308
struct perf_evsel *evsel, size_t privsize,
309+
struct annotation_options *options,
309310
struct arch **parch);
310311
int symbol__annotate2(struct symbol *sym, struct map *map,
311312
struct perf_evsel *evsel,

0 commit comments

Comments
 (0)