Lines Matching refs:browser
30 static void perf_top_browser__write(struct ui_browser *browser, void *entry, int row) in perf_top_browser__write() argument
32 struct perf_top_browser *top_browser = container_of(browser, struct perf_top_browser, b); in perf_top_browser__write()
34 bool current_entry = ui_browser__is_current_entry(browser, row); in perf_top_browser__write()
36 struct perf_top *top = browser->priv; in perf_top_browser__write()
37 int width = browser->width; in perf_top_browser__write()
42 ui_browser__set_percent_color(browser, pcnt, current_entry); in perf_top_browser__write()
71 static void perf_top_browser__update_rb_tree(struct perf_top_browser *browser) in perf_top_browser__update_rb_tree() argument
73 struct perf_top *top = browser->b.priv; in perf_top_browser__update_rb_tree()
74 u64 top_idx = browser->b.top_idx; in perf_top_browser__update_rb_tree()
76 browser->root = RB_ROOT; in perf_top_browser__update_rb_tree()
77 browser->b.top = NULL; in perf_top_browser__update_rb_tree()
78 browser->sum_ksamples = perf_top__decay_samples(top, &browser->root); in perf_top_browser__update_rb_tree()
85 perf_top__find_widths(top, &browser->root, &browser->dso_width, in perf_top_browser__update_rb_tree()
86 &browser->dso_short_width, in perf_top_browser__update_rb_tree()
87 &browser->sym_width); in perf_top_browser__update_rb_tree()
88 if (browser->sym_width + browser->dso_width > browser->b.width - 29) { in perf_top_browser__update_rb_tree()
89 browser->dso_width = browser->dso_short_width; in perf_top_browser__update_rb_tree()
90 if (browser->sym_width + browser->dso_width > browser->b.width - 29) in perf_top_browser__update_rb_tree()
91 browser->sym_width = browser->b.width - browser->dso_width - 29; in perf_top_browser__update_rb_tree()
99 browser->b.nr_entries = top->rb_entries; in perf_top_browser__update_rb_tree()
101 if (top_idx >= browser->b.nr_entries) { in perf_top_browser__update_rb_tree()
102 if (browser->b.height >= browser->b.nr_entries) in perf_top_browser__update_rb_tree()
103 top_idx = browser->b.nr_entries - browser->b.height; in perf_top_browser__update_rb_tree()
108 if (browser->b.index >= top_idx + browser->b.height) in perf_top_browser__update_rb_tree()
109 browser->b.index = top_idx + browser->b.index - browser->b.top_idx; in perf_top_browser__update_rb_tree()
111 if (browser->b.index >= browser->b.nr_entries) in perf_top_browser__update_rb_tree()
112 browser->b.index = browser->b.nr_entries - 1; in perf_top_browser__update_rb_tree()
114 browser->b.top_idx = top_idx; in perf_top_browser__update_rb_tree()
115 browser->b.seek(&browser->b, top_idx, SEEK_SET); in perf_top_browser__update_rb_tree()
118 static void perf_top_browser__annotate(struct perf_top_browser *browser) in perf_top_browser__annotate() argument
120 struct sym_entry *syme = browser->selection; in perf_top_browser__annotate()
123 struct perf_top *top = browser->b.priv; in perf_top_browser__annotate()
146 static int perf_top_browser__run(struct perf_top_browser *browser) in perf_top_browser__run() argument
150 struct perf_top *top = browser->b.priv; in perf_top_browser__run()
154 perf_top_browser__update_rb_tree(browser); in perf_top_browser__run()
158 if (ui_browser__show(&browser->b, title, in perf_top_browser__run()
162 newtFormSetTimer(browser->b.form, delay_msecs); in perf_top_browser__run()
163 ui_browser__add_exit_keys(&browser->b, exit_keys); in perf_top_browser__run()
166 key = ui_browser__run(&browser->b); in perf_top_browser__run()
171 perf_top_browser__update_rb_tree(browser); in perf_top_browser__run()
174 ui_browser__set_color(&browser->b, NEWT_COLORSET_ROOT); in perf_top_browser__run()
176 slsmg_write_nstring(title, browser->b.width); in perf_top_browser__run()
181 if (browser->selection) in perf_top_browser__run()
182 perf_top_browser__annotate(browser); in perf_top_browser__run()
195 ui_browser__hide(&browser->b); in perf_top_browser__run()
201 struct perf_top_browser browser = { in perf_top__tui_browser() local
203 .entries = &browser.root, in perf_top__tui_browser()
212 return perf_top_browser__run(&browser); in perf_top__tui_browser()