Commit 22197fb2 authored by Namhyung Kim's avatar Namhyung Kim Committed by Arnaldo Carvalho de Melo

perf ui/browser/annotate: Use global annotation_options

Now it can use the global options and no need save local browser
options separately.
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-6-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 41fd3cac
...@@ -381,7 +381,7 @@ static void hists__find_annotations(struct hists *hists, ...@@ -381,7 +381,7 @@ static void hists__find_annotations(struct hists *hists,
/* skip missing symbols */ /* skip missing symbols */
nd = rb_next(nd); nd = rb_next(nd);
} else if (use_browser == 1) { } else if (use_browser == 1) {
key = hist_entry__tui_annotate(he, evsel, NULL, &annotate_opts); key = hist_entry__tui_annotate(he, evsel, NULL);
switch (key) { switch (key) {
case -1: case -1:
......
...@@ -540,8 +540,7 @@ static int evlist__tui_block_hists_browse(struct evlist *evlist, struct report * ...@@ -540,8 +540,7 @@ static int evlist__tui_block_hists_browse(struct evlist *evlist, struct report *
evlist__for_each_entry(evlist, pos) { evlist__for_each_entry(evlist, pos) {
ret = report__browse_block_hists(&rep->block_reports[i++].hist, ret = report__browse_block_hists(&rep->block_reports[i++].hist,
rep->min_percent, pos, rep->min_percent, pos,
&rep->session->header.env, &rep->session->header.env);
&annotate_opts);
if (ret != 0) if (ret != 0)
return ret; return ret;
} }
...@@ -573,8 +572,7 @@ static int evlist__tty_browse_hists(struct evlist *evlist, struct report *rep, c ...@@ -573,8 +572,7 @@ static int evlist__tty_browse_hists(struct evlist *evlist, struct report *rep, c
if (rep->total_cycles_mode) { if (rep->total_cycles_mode) {
report__browse_block_hists(&rep->block_reports[i++].hist, report__browse_block_hists(&rep->block_reports[i++].hist,
rep->min_percent, pos, rep->min_percent, pos, NULL);
NULL, NULL);
continue; continue;
} }
...@@ -669,7 +667,7 @@ static int report__browse_hists(struct report *rep) ...@@ -669,7 +667,7 @@ static int report__browse_hists(struct report *rep)
} }
ret = evlist__tui_browse_hists(evlist, help, NULL, rep->min_percent, ret = evlist__tui_browse_hists(evlist, help, NULL, rep->min_percent,
&session->header.env, true, &annotate_opts); &session->header.env, true);
/* /*
* Usually "ret" is the last pressed key, and we only * Usually "ret" is the last pressed key, and we only
* care if the key notifies us to switch data file. * care if the key notifies us to switch data file.
......
...@@ -646,8 +646,7 @@ static void *display_thread_tui(void *arg) ...@@ -646,8 +646,7 @@ static void *display_thread_tui(void *arg)
} }
ret = evlist__tui_browse_hists(top->evlist, help, &hbt, top->min_percent, ret = evlist__tui_browse_hists(top->evlist, help, &hbt, top->min_percent,
&top->session->header.env, !top->record_opts.overwrite, &top->session->header.env, !top->record_opts.overwrite);
&annotate_opts);
if (ret == K_RELOAD) { if (ret == K_RELOAD) {
top->zero = true; top->zero = true;
goto repeat; goto repeat;
......
...@@ -27,7 +27,6 @@ struct annotate_browser { ...@@ -27,7 +27,6 @@ struct annotate_browser {
struct rb_node *curr_hot; struct rb_node *curr_hot;
struct annotation_line *selection; struct annotation_line *selection;
struct arch *arch; struct arch *arch;
struct annotation_options *opts;
bool searching_backwards; bool searching_backwards;
char search_bf[128]; char search_bf[128];
}; };
...@@ -97,7 +96,7 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int ...@@ -97,7 +96,7 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int
struct annotation_write_ops ops = { struct annotation_write_ops ops = {
.first_line = row == 0, .first_line = row == 0,
.current_entry = is_current_entry, .current_entry = is_current_entry,
.change_color = (!notes->options->hide_src_code && .change_color = (!annotate_opts.hide_src_code &&
(!is_current_entry || (!is_current_entry ||
(browser->use_navkeypressed && (browser->use_navkeypressed &&
!browser->navkeypressed))), !browser->navkeypressed))),
...@@ -128,7 +127,7 @@ static int is_fused(struct annotate_browser *ab, struct disasm_line *cursor) ...@@ -128,7 +127,7 @@ static int is_fused(struct annotate_browser *ab, struct disasm_line *cursor)
while (pos && pos->al.offset == -1) { while (pos && pos->al.offset == -1) {
pos = list_prev_entry(pos, al.node); pos = list_prev_entry(pos, al.node);
if (!ab->opts->hide_src_code) if (!annotate_opts.hide_src_code)
diff++; diff++;
} }
...@@ -195,7 +194,7 @@ static void annotate_browser__draw_current_jump(struct ui_browser *browser) ...@@ -195,7 +194,7 @@ static void annotate_browser__draw_current_jump(struct ui_browser *browser)
return; return;
} }
if (notes->options->hide_src_code) { if (annotate_opts.hide_src_code) {
from = cursor->al.idx_asm; from = cursor->al.idx_asm;
to = target->idx_asm; to = target->idx_asm;
} else { } else {
...@@ -224,7 +223,7 @@ static unsigned int annotate_browser__refresh(struct ui_browser *browser) ...@@ -224,7 +223,7 @@ static unsigned int annotate_browser__refresh(struct ui_browser *browser)
int ret = ui_browser__list_head_refresh(browser); int ret = ui_browser__list_head_refresh(browser);
int pcnt_width = annotation__pcnt_width(notes); int pcnt_width = annotation__pcnt_width(notes);
if (notes->options->jump_arrows) if (annotate_opts.jump_arrows)
annotate_browser__draw_current_jump(browser); annotate_browser__draw_current_jump(browser);
ui_browser__set_color(browser, HE_COLORSET_NORMAL); ui_browser__set_color(browser, HE_COLORSET_NORMAL);
...@@ -258,7 +257,7 @@ static void disasm_rb_tree__insert(struct annotate_browser *browser, ...@@ -258,7 +257,7 @@ static void disasm_rb_tree__insert(struct annotate_browser *browser,
parent = *p; parent = *p;
l = rb_entry(parent, struct annotation_line, rb_node); l = rb_entry(parent, struct annotation_line, rb_node);
if (disasm__cmp(al, l, browser->opts->percent_type) < 0) if (disasm__cmp(al, l, annotate_opts.percent_type) < 0)
p = &(*p)->rb_left; p = &(*p)->rb_left;
else else
p = &(*p)->rb_right; p = &(*p)->rb_right;
...@@ -294,11 +293,10 @@ static void annotate_browser__set_top(struct annotate_browser *browser, ...@@ -294,11 +293,10 @@ static void annotate_browser__set_top(struct annotate_browser *browser,
static void annotate_browser__set_rb_top(struct annotate_browser *browser, static void annotate_browser__set_rb_top(struct annotate_browser *browser,
struct rb_node *nd) struct rb_node *nd)
{ {
struct annotation *notes = browser__annotation(&browser->b);
struct annotation_line * pos = rb_entry(nd, struct annotation_line, rb_node); struct annotation_line * pos = rb_entry(nd, struct annotation_line, rb_node);
u32 idx = pos->idx; u32 idx = pos->idx;
if (notes->options->hide_src_code) if (annotate_opts.hide_src_code)
idx = pos->idx_asm; idx = pos->idx_asm;
annotate_browser__set_top(browser, pos, idx); annotate_browser__set_top(browser, pos, idx);
browser->curr_hot = nd; browser->curr_hot = nd;
...@@ -331,7 +329,7 @@ static void annotate_browser__calc_percent(struct annotate_browser *browser, ...@@ -331,7 +329,7 @@ static void annotate_browser__calc_percent(struct annotate_browser *browser,
double percent; double percent;
percent = annotation_data__percent(&pos->al.data[i], percent = annotation_data__percent(&pos->al.data[i],
browser->opts->percent_type); annotate_opts.percent_type);
if (max_percent < percent) if (max_percent < percent)
max_percent = percent; max_percent = percent;
...@@ -380,12 +378,12 @@ static bool annotate_browser__toggle_source(struct annotate_browser *browser) ...@@ -380,12 +378,12 @@ static bool annotate_browser__toggle_source(struct annotate_browser *browser)
browser->b.seek(&browser->b, offset, SEEK_CUR); browser->b.seek(&browser->b, offset, SEEK_CUR);
al = list_entry(browser->b.top, struct annotation_line, node); al = list_entry(browser->b.top, struct annotation_line, node);
if (notes->options->hide_src_code) { if (annotate_opts.hide_src_code) {
if (al->idx_asm < offset) if (al->idx_asm < offset)
offset = al->idx; offset = al->idx;
browser->b.nr_entries = notes->src->nr_entries; browser->b.nr_entries = notes->src->nr_entries;
notes->options->hide_src_code = false; annotate_opts.hide_src_code = false;
browser->b.seek(&browser->b, -offset, SEEK_CUR); browser->b.seek(&browser->b, -offset, SEEK_CUR);
browser->b.top_idx = al->idx - offset; browser->b.top_idx = al->idx - offset;
browser->b.index = al->idx; browser->b.index = al->idx;
...@@ -403,7 +401,7 @@ static bool annotate_browser__toggle_source(struct annotate_browser *browser) ...@@ -403,7 +401,7 @@ static bool annotate_browser__toggle_source(struct annotate_browser *browser)
offset = al->idx_asm; offset = al->idx_asm;
browser->b.nr_entries = notes->src->nr_asm_entries; browser->b.nr_entries = notes->src->nr_asm_entries;
notes->options->hide_src_code = true; annotate_opts.hide_src_code = true;
browser->b.seek(&browser->b, -offset, SEEK_CUR); browser->b.seek(&browser->b, -offset, SEEK_CUR);
browser->b.top_idx = al->idx_asm - offset; browser->b.top_idx = al->idx_asm - offset;
browser->b.index = al->idx_asm; browser->b.index = al->idx_asm;
...@@ -483,8 +481,8 @@ static bool annotate_browser__callq(struct annotate_browser *browser, ...@@ -483,8 +481,8 @@ static bool annotate_browser__callq(struct annotate_browser *browser,
target_ms.map = ms->map; target_ms.map = ms->map;
target_ms.sym = dl->ops.target.sym; target_ms.sym = dl->ops.target.sym;
annotation__unlock(notes); annotation__unlock(notes);
symbol__tui_annotate(&target_ms, evsel, hbt, browser->opts); symbol__tui_annotate(&target_ms, evsel, hbt);
sym_title(ms->sym, ms->map, title, sizeof(title), browser->opts->percent_type); sym_title(ms->sym, ms->map, title, sizeof(title), annotate_opts.percent_type);
ui_browser__show_title(&browser->b, title); ui_browser__show_title(&browser->b, title);
return true; return true;
} }
...@@ -659,7 +657,6 @@ bool annotate_browser__continue_search_reverse(struct annotate_browser *browser, ...@@ -659,7 +657,6 @@ bool annotate_browser__continue_search_reverse(struct annotate_browser *browser,
static int annotate_browser__show(struct ui_browser *browser, char *title, const char *help) static int annotate_browser__show(struct ui_browser *browser, char *title, const char *help)
{ {
struct annotate_browser *ab = container_of(browser, struct annotate_browser, b);
struct map_symbol *ms = browser->priv; struct map_symbol *ms = browser->priv;
struct symbol *sym = ms->sym; struct symbol *sym = ms->sym;
char symbol_dso[SYM_TITLE_MAX_SIZE]; char symbol_dso[SYM_TITLE_MAX_SIZE];
...@@ -667,7 +664,7 @@ static int annotate_browser__show(struct ui_browser *browser, char *title, const ...@@ -667,7 +664,7 @@ static int annotate_browser__show(struct ui_browser *browser, char *title, const
if (ui_browser__show(browser, title, help) < 0) if (ui_browser__show(browser, title, help) < 0)
return -1; return -1;
sym_title(sym, ms->map, symbol_dso, sizeof(symbol_dso), ab->opts->percent_type); sym_title(sym, ms->map, symbol_dso, sizeof(symbol_dso), annotate_opts.percent_type);
ui_browser__gotorc_title(browser, 0, 0); ui_browser__gotorc_title(browser, 0, 0);
ui_browser__set_color(browser, HE_COLORSET_ROOT); ui_browser__set_color(browser, HE_COLORSET_ROOT);
...@@ -809,7 +806,7 @@ static int annotate_browser__run(struct annotate_browser *browser, ...@@ -809,7 +806,7 @@ static int annotate_browser__run(struct annotate_browser *browser,
annotate_browser__show(&browser->b, title, help); annotate_browser__show(&browser->b, title, help);
continue; continue;
case 'k': case 'k':
notes->options->show_linenr = !notes->options->show_linenr; annotate_opts.show_linenr = !annotate_opts.show_linenr;
continue; continue;
case 'l': case 'l':
annotate_browser__show_full_location (&browser->b); annotate_browser__show_full_location (&browser->b);
...@@ -822,18 +819,18 @@ static int annotate_browser__run(struct annotate_browser *browser, ...@@ -822,18 +819,18 @@ static int annotate_browser__run(struct annotate_browser *browser,
ui_helpline__puts(help); ui_helpline__puts(help);
continue; continue;
case 'o': case 'o':
notes->options->use_offset = !notes->options->use_offset; annotate_opts.use_offset = !annotate_opts.use_offset;
annotation__update_column_widths(notes); annotation__update_column_widths(notes);
continue; continue;
case 'O': case 'O':
if (++notes->options->offset_level > ANNOTATION__MAX_OFFSET_LEVEL) if (++annotate_opts.offset_level > ANNOTATION__MAX_OFFSET_LEVEL)
notes->options->offset_level = ANNOTATION__MIN_OFFSET_LEVEL; annotate_opts.offset_level = ANNOTATION__MIN_OFFSET_LEVEL;
continue; continue;
case 'j': case 'j':
notes->options->jump_arrows = !notes->options->jump_arrows; annotate_opts.jump_arrows = !annotate_opts.jump_arrows;
continue; continue;
case 'J': case 'J':
notes->options->show_nr_jumps = !notes->options->show_nr_jumps; annotate_opts.show_nr_jumps = !annotate_opts.show_nr_jumps;
annotation__update_column_widths(notes); annotation__update_column_widths(notes);
continue; continue;
case '/': case '/':
...@@ -897,15 +894,15 @@ static int annotate_browser__run(struct annotate_browser *browser, ...@@ -897,15 +894,15 @@ static int annotate_browser__run(struct annotate_browser *browser,
annotation__update_column_widths(notes); annotation__update_column_widths(notes);
continue; continue;
case 'c': case 'c':
if (notes->options->show_minmax_cycle) if (annotate_opts.show_minmax_cycle)
notes->options->show_minmax_cycle = false; annotate_opts.show_minmax_cycle = false;
else else
notes->options->show_minmax_cycle = true; annotate_opts.show_minmax_cycle = true;
annotation__update_column_widths(notes); annotation__update_column_widths(notes);
continue; continue;
case 'p': case 'p':
case 'b': case 'b':
switch_percent_type(browser->opts, key == 'b'); switch_percent_type(&annotate_opts, key == 'b');
hists__scnprintf_title(hists, title, sizeof(title)); hists__scnprintf_title(hists, title, sizeof(title));
annotate_browser__show(&browser->b, title, help); annotate_browser__show(&browser->b, title, help);
continue; continue;
...@@ -932,26 +929,23 @@ static int annotate_browser__run(struct annotate_browser *browser, ...@@ -932,26 +929,23 @@ static int annotate_browser__run(struct annotate_browser *browser,
} }
int map_symbol__tui_annotate(struct map_symbol *ms, struct evsel *evsel, int map_symbol__tui_annotate(struct map_symbol *ms, struct evsel *evsel,
struct hist_browser_timer *hbt, struct hist_browser_timer *hbt)
struct annotation_options *opts)
{ {
return symbol__tui_annotate(ms, evsel, hbt, opts); return symbol__tui_annotate(ms, evsel, hbt);
} }
int hist_entry__tui_annotate(struct hist_entry *he, struct evsel *evsel, int hist_entry__tui_annotate(struct hist_entry *he, struct evsel *evsel,
struct hist_browser_timer *hbt, struct hist_browser_timer *hbt)
struct annotation_options *opts)
{ {
/* reset abort key so that it can get Ctrl-C as a key */ /* reset abort key so that it can get Ctrl-C as a key */
SLang_reset_tty(); SLang_reset_tty();
SLang_init_tty(0, 0, 0); SLang_init_tty(0, 0, 0);
return map_symbol__tui_annotate(&he->ms, evsel, hbt, opts); return map_symbol__tui_annotate(&he->ms, evsel, hbt);
} }
int symbol__tui_annotate(struct map_symbol *ms, struct evsel *evsel, int symbol__tui_annotate(struct map_symbol *ms, struct evsel *evsel,
struct hist_browser_timer *hbt, struct hist_browser_timer *hbt)
struct annotation_options *opts)
{ {
struct symbol *sym = ms->sym; struct symbol *sym = ms->sym;
struct annotation *notes = symbol__annotation(sym); struct annotation *notes = symbol__annotation(sym);
...@@ -965,7 +959,6 @@ int symbol__tui_annotate(struct map_symbol *ms, struct evsel *evsel, ...@@ -965,7 +959,6 @@ int symbol__tui_annotate(struct map_symbol *ms, struct evsel *evsel,
.priv = ms, .priv = ms,
.use_navkeypressed = true, .use_navkeypressed = true,
}, },
.opts = opts,
}; };
struct dso *dso; struct dso *dso;
int ret = -1, err; int ret = -1, err;
...@@ -996,7 +989,7 @@ int symbol__tui_annotate(struct map_symbol *ms, struct evsel *evsel, ...@@ -996,7 +989,7 @@ int symbol__tui_annotate(struct map_symbol *ms, struct evsel *evsel,
browser.b.entries = &notes->src->source, browser.b.entries = &notes->src->source,
browser.b.width += 18; /* Percentage */ browser.b.width += 18; /* Percentage */
if (notes->options->hide_src_code) if (annotate_opts.hide_src_code)
ui_browser__init_asm_mode(&browser.b); ui_browser__init_asm_mode(&browser.b);
ret = annotate_browser__run(&browser, evsel, hbt); ret = annotate_browser__run(&browser, evsel, hbt);
......
...@@ -2250,8 +2250,7 @@ struct hist_browser *hist_browser__new(struct hists *hists) ...@@ -2250,8 +2250,7 @@ struct hist_browser *hist_browser__new(struct hists *hists)
static struct hist_browser * static struct hist_browser *
perf_evsel_browser__new(struct evsel *evsel, perf_evsel_browser__new(struct evsel *evsel,
struct hist_browser_timer *hbt, struct hist_browser_timer *hbt,
struct perf_env *env, struct perf_env *env)
struct annotation_options *annotation_opts)
{ {
struct hist_browser *browser = hist_browser__new(evsel__hists(evsel)); struct hist_browser *browser = hist_browser__new(evsel__hists(evsel));
...@@ -2259,7 +2258,6 @@ perf_evsel_browser__new(struct evsel *evsel, ...@@ -2259,7 +2258,6 @@ perf_evsel_browser__new(struct evsel *evsel,
browser->hbt = hbt; browser->hbt = hbt;
browser->env = env; browser->env = env;
browser->title = hists_browser__scnprintf_title; browser->title = hists_browser__scnprintf_title;
browser->annotation_opts = annotation_opts;
} }
return browser; return browser;
} }
...@@ -2432,8 +2430,8 @@ do_annotate(struct hist_browser *browser, struct popup_action *act) ...@@ -2432,8 +2430,8 @@ do_annotate(struct hist_browser *browser, struct popup_action *act)
struct hist_entry *he; struct hist_entry *he;
int err; int err;
if (!browser->annotation_opts->objdump_path && if (!annotate_opts.objdump_path &&
perf_env__lookup_objdump(browser->env, &browser->annotation_opts->objdump_path)) perf_env__lookup_objdump(browser->env, &annotate_opts.objdump_path))
return 0; return 0;
notes = symbol__annotation(act->ms.sym); notes = symbol__annotation(act->ms.sym);
...@@ -2445,8 +2443,7 @@ do_annotate(struct hist_browser *browser, struct popup_action *act) ...@@ -2445,8 +2443,7 @@ do_annotate(struct hist_browser *browser, struct popup_action *act)
else else
evsel = hists_to_evsel(browser->hists); evsel = hists_to_evsel(browser->hists);
err = map_symbol__tui_annotate(&act->ms, evsel, browser->hbt, err = map_symbol__tui_annotate(&act->ms, evsel, browser->hbt);
browser->annotation_opts);
he = hist_browser__selected_entry(browser); he = hist_browser__selected_entry(browser);
/* /*
* offer option to annotate the other branch source or target * offer option to annotate the other branch source or target
...@@ -2943,11 +2940,10 @@ static void hist_browser__update_percent_limit(struct hist_browser *hb, ...@@ -2943,11 +2940,10 @@ static void hist_browser__update_percent_limit(struct hist_browser *hb,
static int evsel__hists_browse(struct evsel *evsel, int nr_events, const char *helpline, static int evsel__hists_browse(struct evsel *evsel, int nr_events, const char *helpline,
bool left_exits, struct hist_browser_timer *hbt, float min_pcnt, bool left_exits, struct hist_browser_timer *hbt, float min_pcnt,
struct perf_env *env, bool warn_lost_event, struct perf_env *env, bool warn_lost_event)
struct annotation_options *annotation_opts)
{ {
struct hists *hists = evsel__hists(evsel); struct hists *hists = evsel__hists(evsel);
struct hist_browser *browser = perf_evsel_browser__new(evsel, hbt, env, annotation_opts); struct hist_browser *browser = perf_evsel_browser__new(evsel, hbt, env);
struct branch_info *bi = NULL; struct branch_info *bi = NULL;
#define MAX_OPTIONS 16 #define MAX_OPTIONS 16
char *options[MAX_OPTIONS]; char *options[MAX_OPTIONS];
...@@ -3398,7 +3394,6 @@ static int evsel__hists_browse(struct evsel *evsel, int nr_events, const char *h ...@@ -3398,7 +3394,6 @@ static int evsel__hists_browse(struct evsel *evsel, int nr_events, const char *h
struct evsel_menu { struct evsel_menu {
struct ui_browser b; struct ui_browser b;
struct evsel *selection; struct evsel *selection;
struct annotation_options *annotation_opts;
bool lost_events, lost_events_warned; bool lost_events, lost_events_warned;
float min_pcnt; float min_pcnt;
struct perf_env *env; struct perf_env *env;
...@@ -3499,8 +3494,7 @@ static int perf_evsel_menu__run(struct evsel_menu *menu, ...@@ -3499,8 +3494,7 @@ static int perf_evsel_menu__run(struct evsel_menu *menu,
hbt->timer(hbt->arg); hbt->timer(hbt->arg);
key = evsel__hists_browse(pos, nr_events, help, true, hbt, key = evsel__hists_browse(pos, nr_events, help, true, hbt,
menu->min_pcnt, menu->env, menu->min_pcnt, menu->env,
warn_lost_event, warn_lost_event);
menu->annotation_opts);
ui_browser__show_title(&menu->b, title); ui_browser__show_title(&menu->b, title);
switch (key) { switch (key) {
case K_TAB: case K_TAB:
...@@ -3557,7 +3551,7 @@ static bool filter_group_entries(struct ui_browser *browser __maybe_unused, ...@@ -3557,7 +3551,7 @@ static bool filter_group_entries(struct ui_browser *browser __maybe_unused,
static int __evlist__tui_browse_hists(struct evlist *evlist, int nr_entries, const char *help, static int __evlist__tui_browse_hists(struct evlist *evlist, int nr_entries, const char *help,
struct hist_browser_timer *hbt, float min_pcnt, struct perf_env *env, struct hist_browser_timer *hbt, float min_pcnt, struct perf_env *env,
bool warn_lost_event, struct annotation_options *annotation_opts) bool warn_lost_event)
{ {
struct evsel *pos; struct evsel *pos;
struct evsel_menu menu = { struct evsel_menu menu = {
...@@ -3572,7 +3566,6 @@ static int __evlist__tui_browse_hists(struct evlist *evlist, int nr_entries, con ...@@ -3572,7 +3566,6 @@ static int __evlist__tui_browse_hists(struct evlist *evlist, int nr_entries, con
}, },
.min_pcnt = min_pcnt, .min_pcnt = min_pcnt,
.env = env, .env = env,
.annotation_opts = annotation_opts,
}; };
ui_helpline__push("Press ESC to exit"); ui_helpline__push("Press ESC to exit");
...@@ -3607,8 +3600,7 @@ static bool evlist__single_entry(struct evlist *evlist) ...@@ -3607,8 +3600,7 @@ static bool evlist__single_entry(struct evlist *evlist)
} }
int evlist__tui_browse_hists(struct evlist *evlist, const char *help, struct hist_browser_timer *hbt, int evlist__tui_browse_hists(struct evlist *evlist, const char *help, struct hist_browser_timer *hbt,
float min_pcnt, struct perf_env *env, bool warn_lost_event, float min_pcnt, struct perf_env *env, bool warn_lost_event)
struct annotation_options *annotation_opts)
{ {
int nr_entries = evlist->core.nr_entries; int nr_entries = evlist->core.nr_entries;
...@@ -3617,7 +3609,7 @@ single_entry: { ...@@ -3617,7 +3609,7 @@ single_entry: {
struct evsel *first = evlist__first(evlist); struct evsel *first = evlist__first(evlist);
return evsel__hists_browse(first, nr_entries, help, false, hbt, min_pcnt, return evsel__hists_browse(first, nr_entries, help, false, hbt, min_pcnt,
env, warn_lost_event, annotation_opts); env, warn_lost_event);
} }
} }
...@@ -3635,7 +3627,7 @@ single_entry: { ...@@ -3635,7 +3627,7 @@ single_entry: {
} }
return __evlist__tui_browse_hists(evlist, nr_entries, help, hbt, min_pcnt, env, return __evlist__tui_browse_hists(evlist, nr_entries, help, hbt, min_pcnt, env,
warn_lost_event, annotation_opts); warn_lost_event);
} }
static int block_hists_browser__title(struct hist_browser *browser, char *bf, static int block_hists_browser__title(struct hist_browser *browser, char *bf,
...@@ -3654,8 +3646,7 @@ static int block_hists_browser__title(struct hist_browser *browser, char *bf, ...@@ -3654,8 +3646,7 @@ static int block_hists_browser__title(struct hist_browser *browser, char *bf,
} }
int block_hists_tui_browse(struct block_hist *bh, struct evsel *evsel, int block_hists_tui_browse(struct block_hist *bh, struct evsel *evsel,
float min_percent, struct perf_env *env, float min_percent, struct perf_env *env)
struct annotation_options *annotation_opts)
{ {
struct hists *hists = &bh->block_hists; struct hists *hists = &bh->block_hists;
struct hist_browser *browser; struct hist_browser *browser;
...@@ -3672,7 +3663,6 @@ int block_hists_tui_browse(struct block_hist *bh, struct evsel *evsel, ...@@ -3672,7 +3663,6 @@ int block_hists_tui_browse(struct block_hist *bh, struct evsel *evsel,
browser->title = block_hists_browser__title; browser->title = block_hists_browser__title;
browser->min_pcnt = min_percent; browser->min_pcnt = min_percent;
browser->env = env; browser->env = env;
browser->annotation_opts = annotation_opts;
/* reset abort key so that it can get Ctrl-C as a key */ /* reset abort key so that it can get Ctrl-C as a key */
SLang_reset_tty(); SLang_reset_tty();
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
#include "ui/browser.h" #include "ui/browser.h"
struct annotation_options;
struct evsel; struct evsel;
struct hist_browser { struct hist_browser {
...@@ -15,7 +14,6 @@ struct hist_browser { ...@@ -15,7 +14,6 @@ struct hist_browser {
struct hist_browser_timer *hbt; struct hist_browser_timer *hbt;
struct pstack *pstack; struct pstack *pstack;
struct perf_env *env; struct perf_env *env;
struct annotation_options *annotation_opts;
struct evsel *block_evsel; struct evsel *block_evsel;
int print_seq; int print_seq;
bool show_dso; bool show_dso;
......
...@@ -418,13 +418,11 @@ int symbol__tty_annotate2(struct map_symbol *ms, struct evsel *evsel); ...@@ -418,13 +418,11 @@ int symbol__tty_annotate2(struct map_symbol *ms, struct evsel *evsel);
#ifdef HAVE_SLANG_SUPPORT #ifdef HAVE_SLANG_SUPPORT
int symbol__tui_annotate(struct map_symbol *ms, struct evsel *evsel, int symbol__tui_annotate(struct map_symbol *ms, struct evsel *evsel,
struct hist_browser_timer *hbt, struct hist_browser_timer *hbt);
struct annotation_options *opts);
#else #else
static inline int symbol__tui_annotate(struct map_symbol *ms __maybe_unused, static inline int symbol__tui_annotate(struct map_symbol *ms __maybe_unused,
struct evsel *evsel __maybe_unused, struct evsel *evsel __maybe_unused,
struct hist_browser_timer *hbt __maybe_unused, struct hist_browser_timer *hbt __maybe_unused)
struct annotation_options *opts __maybe_unused)
{ {
return 0; return 0;
} }
......
...@@ -464,8 +464,7 @@ void block_info__free_report(struct block_report *reps, int nr_reps) ...@@ -464,8 +464,7 @@ void block_info__free_report(struct block_report *reps, int nr_reps)
} }
int report__browse_block_hists(struct block_hist *bh, float min_percent, int report__browse_block_hists(struct block_hist *bh, float min_percent,
struct evsel *evsel, struct perf_env *env, struct evsel *evsel, struct perf_env *env)
struct annotation_options *annotation_opts)
{ {
int ret; int ret;
...@@ -477,8 +476,7 @@ int report__browse_block_hists(struct block_hist *bh, float min_percent, ...@@ -477,8 +476,7 @@ int report__browse_block_hists(struct block_hist *bh, float min_percent,
return 0; return 0;
case 1: case 1:
symbol_conf.report_individual_block = true; symbol_conf.report_individual_block = true;
ret = block_hists_tui_browse(bh, evsel, min_percent, ret = block_hists_tui_browse(bh, evsel, min_percent, env);
env, annotation_opts);
return ret; return ret;
default: default:
return -1; return -1;
......
...@@ -78,8 +78,7 @@ struct block_report *block_info__create_report(struct evlist *evlist, ...@@ -78,8 +78,7 @@ struct block_report *block_info__create_report(struct evlist *evlist,
void block_info__free_report(struct block_report *reps, int nr_reps); void block_info__free_report(struct block_report *reps, int nr_reps);
int report__browse_block_hists(struct block_hist *bh, float min_percent, int report__browse_block_hists(struct block_hist *bh, float min_percent,
struct evsel *evsel, struct perf_env *env, struct evsel *evsel, struct perf_env *env);
struct annotation_options *annotation_opts);
float block_info__total_cycles_percent(struct hist_entry *he); float block_info__total_cycles_percent(struct hist_entry *he);
......
...@@ -457,7 +457,6 @@ struct hist_browser_timer { ...@@ -457,7 +457,6 @@ struct hist_browser_timer {
int refresh; int refresh;
}; };
struct annotation_options;
struct res_sample; struct res_sample;
enum rstype { enum rstype {
...@@ -473,16 +472,13 @@ struct block_hist; ...@@ -473,16 +472,13 @@ struct block_hist;
void attr_to_script(char *buf, struct perf_event_attr *attr); void attr_to_script(char *buf, struct perf_event_attr *attr);
int map_symbol__tui_annotate(struct map_symbol *ms, struct evsel *evsel, int map_symbol__tui_annotate(struct map_symbol *ms, struct evsel *evsel,
struct hist_browser_timer *hbt, struct hist_browser_timer *hbt);
struct annotation_options *annotation_opts);
int hist_entry__tui_annotate(struct hist_entry *he, struct evsel *evsel, int hist_entry__tui_annotate(struct hist_entry *he, struct evsel *evsel,
struct hist_browser_timer *hbt, struct hist_browser_timer *hbt);
struct annotation_options *annotation_opts);
int evlist__tui_browse_hists(struct evlist *evlist, const char *help, struct hist_browser_timer *hbt, int evlist__tui_browse_hists(struct evlist *evlist, const char *help, struct hist_browser_timer *hbt,
float min_pcnt, struct perf_env *env, bool warn_lost_event, float min_pcnt, struct perf_env *env, bool warn_lost_event);
struct annotation_options *annotation_options);
int script_browse(const char *script_opt, struct evsel *evsel); int script_browse(const char *script_opt, struct evsel *evsel);
...@@ -492,8 +488,7 @@ int res_sample_browse(struct res_sample *res_samples, int num_res, ...@@ -492,8 +488,7 @@ int res_sample_browse(struct res_sample *res_samples, int num_res,
void res_sample_init(void); void res_sample_init(void);
int block_hists_tui_browse(struct block_hist *bh, struct evsel *evsel, int block_hists_tui_browse(struct block_hist *bh, struct evsel *evsel,
float min_percent, struct perf_env *env, float min_percent, struct perf_env *env);
struct annotation_options *annotation_opts);
#else #else
static inline static inline
int evlist__tui_browse_hists(struct evlist *evlist __maybe_unused, int evlist__tui_browse_hists(struct evlist *evlist __maybe_unused,
...@@ -501,23 +496,20 @@ int evlist__tui_browse_hists(struct evlist *evlist __maybe_unused, ...@@ -501,23 +496,20 @@ int evlist__tui_browse_hists(struct evlist *evlist __maybe_unused,
struct hist_browser_timer *hbt __maybe_unused, struct hist_browser_timer *hbt __maybe_unused,
float min_pcnt __maybe_unused, float min_pcnt __maybe_unused,
struct perf_env *env __maybe_unused, struct perf_env *env __maybe_unused,
bool warn_lost_event __maybe_unused, bool warn_lost_event __maybe_unused)
struct annotation_options *annotation_options __maybe_unused)
{ {
return 0; return 0;
} }
static inline int map_symbol__tui_annotate(struct map_symbol *ms __maybe_unused, static inline int map_symbol__tui_annotate(struct map_symbol *ms __maybe_unused,
struct evsel *evsel __maybe_unused, struct evsel *evsel __maybe_unused,
struct hist_browser_timer *hbt __maybe_unused, struct hist_browser_timer *hbt __maybe_unused)
struct annotation_options *annotation_options __maybe_unused)
{ {
return 0; return 0;
} }
static inline int hist_entry__tui_annotate(struct hist_entry *he __maybe_unused, static inline int hist_entry__tui_annotate(struct hist_entry *he __maybe_unused,
struct evsel *evsel __maybe_unused, struct evsel *evsel __maybe_unused,
struct hist_browser_timer *hbt __maybe_unused, struct hist_browser_timer *hbt __maybe_unused)
struct annotation_options *annotation_opts __maybe_unused)
{ {
return 0; return 0;
} }
...@@ -541,8 +533,7 @@ static inline void res_sample_init(void) {} ...@@ -541,8 +533,7 @@ static inline void res_sample_init(void) {}
static inline int block_hists_tui_browse(struct block_hist *bh __maybe_unused, static inline int block_hists_tui_browse(struct block_hist *bh __maybe_unused,
struct evsel *evsel __maybe_unused, struct evsel *evsel __maybe_unused,
float min_percent __maybe_unused, float min_percent __maybe_unused,
struct perf_env *env __maybe_unused, struct perf_env *env __maybe_unused)
struct annotation_options *annotation_opts __maybe_unused)
{ {
return 0; return 0;
} }
......
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