Commit 41fd3cac authored by Namhyung Kim's avatar Namhyung Kim Committed by Arnaldo Carvalho de Melo

perf annotate: Use global annotation_options

Now it can directly use the global options and no need to pass it as an
argument.
Reviewed-by: default avatarIan Rogers <irogers@google.com>
Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20231128175441.721579-5-namhyung@kernel.org
[ Fixup build with GTK2=1 ]
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent c9a21a87
......@@ -317,9 +317,9 @@ static int hist_entry__tty_annotate(struct hist_entry *he,
struct perf_annotate *ann)
{
if (!ann->use_stdio2)
return symbol__tty_annotate(&he->ms, evsel, &annotate_opts);
return symbol__tty_annotate(&he->ms, evsel);
return symbol__tty_annotate2(&he->ms, evsel, &annotate_opts);
return symbol__tty_annotate2(&he->ms, evsel);
}
static void hists__find_annotations(struct hists *hists,
......@@ -365,7 +365,6 @@ static void hists__find_annotations(struct hists *hists,
int ret;
int (*annotate)(struct hist_entry *he,
struct evsel *evsel,
struct annotation_options *options,
struct hist_browser_timer *hbt);
annotate = dlsym(perf_gtk_handle,
......@@ -375,7 +374,7 @@ static void hists__find_annotations(struct hists *hists,
return;
}
ret = annotate(he, evsel, &annotate_opts, NULL);
ret = annotate(he, evsel, NULL);
if (!ret || !ann->skip_missing)
return;
......
......@@ -744,7 +744,7 @@ static int hists__resort_cb(struct hist_entry *he, void *arg)
if (rep->symbol_ipc && sym && !sym->annotate2) {
struct evsel *evsel = hists_to_evsel(he->hists);
symbol__annotate2(&he->ms, evsel, &annotate_opts, NULL);
symbol__annotate2(&he->ms, evsel, NULL);
}
return 0;
......
......@@ -147,7 +147,7 @@ static int perf_top__parse_source(struct perf_top *top, struct hist_entry *he)
return err;
}
err = symbol__annotate(&he->ms, evsel, &annotate_opts, NULL);
err = symbol__annotate(&he->ms, evsel, NULL);
if (err == 0) {
top->sym_filter_entry = he;
} else {
......@@ -263,7 +263,7 @@ static void perf_top__show_details(struct perf_top *top)
printf("Showing %s for %s\n", evsel__name(top->sym_evsel), symbol->name);
printf(" Events Pcnt (>=%d%%)\n", annotate_opts.min_pcnt);
more = symbol__annotate_printf(&he->ms, top->sym_evsel, &annotate_opts);
more = symbol__annotate_printf(&he->ms, top->sym_evsel);
if (top->evlist->enabled) {
if (top->zero)
......
......@@ -114,7 +114,7 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int
if (!browser->navkeypressed)
ops.width += 1;
annotation_line__write(al, notes, &ops, ab->opts);
annotation_line__write(al, notes, &ops);
if (ops.current_entry)
ab->selection = al;
......@@ -884,7 +884,7 @@ static int annotate_browser__run(struct annotate_browser *browser,
continue;
}
case 'P':
map_symbol__annotation_dump(ms, evsel, browser->opts);
map_symbol__annotation_dump(ms, evsel);
continue;
case 't':
if (symbol_conf.show_total_period) {
......@@ -979,7 +979,7 @@ int symbol__tui_annotate(struct map_symbol *ms, struct evsel *evsel,
return -1;
if (not_annotated) {
err = symbol__annotate2(ms, evsel, opts, &browser.arch);
err = symbol__annotate2(ms, evsel, &browser.arch);
if (err) {
char msg[BUFSIZ];
dso->annotate_warned = true;
......
......@@ -162,7 +162,6 @@ static int perf_gtk__annotate_symbol(GtkWidget *window, struct map_symbol *ms,
}
static int symbol__gtk_annotate(struct map_symbol *ms, struct evsel *evsel,
struct annotation_options *options,
struct hist_browser_timer *hbt)
{
struct dso *dso = map__dso(ms->map);
......@@ -176,7 +175,7 @@ static int symbol__gtk_annotate(struct map_symbol *ms, struct evsel *evsel,
if (dso->annotate_warned)
return -1;
err = symbol__annotate(ms, evsel, options, NULL);
err = symbol__annotate(ms, evsel, NULL);
if (err) {
char msg[BUFSIZ];
dso->annotate_warned = true;
......@@ -244,10 +243,9 @@ static int symbol__gtk_annotate(struct map_symbol *ms, struct evsel *evsel,
int hist_entry__gtk_annotate(struct hist_entry *he,
struct evsel *evsel,
struct annotation_options *options,
struct hist_browser_timer *hbt)
{
return symbol__gtk_annotate(&he->ms, evsel, options, hbt);
return symbol__gtk_annotate(&he->ms, evsel, hbt);
}
void perf_gtk__show_annotations(void)
......
......@@ -56,13 +56,11 @@ struct evsel;
struct evlist;
struct hist_entry;
struct hist_browser_timer;
struct annotation_options;
int evlist__gtk_browse_hists(struct evlist *evlist, const char *help,
struct hist_browser_timer *hbt, float min_pcnt);
int hist_entry__gtk_annotate(struct hist_entry *he,
struct evsel *evsel,
struct annotation_options *options,
struct hist_browser_timer *hbt);
void perf_gtk__show_annotations(void);
......
This diff is collapsed.
......@@ -224,8 +224,7 @@ struct annotation_write_ops {
};
void annotation_line__write(struct annotation_line *al, struct annotation *notes,
struct annotation_write_ops *ops,
struct annotation_options *opts);
struct annotation_write_ops *ops);
int __annotation__scnprintf_samples_period(struct annotation *notes,
char *bf, size_t size,
......@@ -375,11 +374,9 @@ void symbol__annotate_zero_histograms(struct symbol *sym);
int symbol__annotate(struct map_symbol *ms,
struct evsel *evsel,
struct annotation_options *options,
struct arch **parch);
int symbol__annotate2(struct map_symbol *ms,
struct evsel *evsel,
struct annotation_options *options,
struct arch **parch);
enum symbol_disassemble_errno {
......@@ -406,20 +403,18 @@ enum symbol_disassemble_errno {
int symbol__strerror_disassemble(struct map_symbol *ms, int errnum, char *buf, size_t buflen);
int symbol__annotate_printf(struct map_symbol *ms, struct evsel *evsel,
struct annotation_options *options);
int symbol__annotate_printf(struct map_symbol *ms, struct evsel *evsel);
void symbol__annotate_zero_histogram(struct symbol *sym, int evidx);
void symbol__annotate_decay_histogram(struct symbol *sym, int evidx);
void annotated_source__purge(struct annotated_source *as);
int map_symbol__annotation_dump(struct map_symbol *ms, struct evsel *evsel,
struct annotation_options *opts);
int map_symbol__annotation_dump(struct map_symbol *ms, struct evsel *evsel);
bool ui__has_annotation(void);
int symbol__tty_annotate(struct map_symbol *ms, struct evsel *evsel, struct annotation_options *opts);
int symbol__tty_annotate(struct map_symbol *ms, struct evsel *evsel);
int symbol__tty_annotate2(struct map_symbol *ms, struct evsel *evsel, struct annotation_options *opts);
int symbol__tty_annotate2(struct map_symbol *ms, struct evsel *evsel);
#ifdef HAVE_SLANG_SUPPORT
int symbol__tui_annotate(struct map_symbol *ms, struct evsel *evsel,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment