diff options
| author | Ingo Molnar <mingo@kernel.org> | 2015-08-13 03:23:53 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2015-08-13 03:23:53 -0400 |
| commit | a897b5f0393a8a05d230c9248dc5324fb30720a0 (patch) | |
| tree | 8b0ed53246df201d073e8fd6dd47304994b15f5b /tools/perf/ui/browsers | |
| parent | 5f1230c9b80b89f404938ff88dfa64a963f74f2c (diff) | |
| parent | 71ef150ee06df29c5b427307dc0bacfe06a8baea (diff) | |
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:
User visible changes:
- Allow selecting the type of callchains per event, including disabling
callchains in all but one entry in an event list, to save space, and also
to ask for the callchains collected in one event to be used in other
events. (Kan Liang)
- Beautify more syscall arguments in 'perf trace': (Arnaldo Carvalho de Melo)
- A bunch more translate file/pathnames from pointers to strings.
- Convert numbers to strings for the 'keyctl' syscall 'option' arg.
- Add missing 'clockid' entries.
- Fix 'perf probe -L sys_*' as it was not showing all the source code for
syscall functions in the kernel. (Masami Hiramatsu)
- Make ESC unzoom as well in the hists browser, i.e. in 'report' and 'top',
as we're considering repurposing the right and left arrow keys to use in
horizontal scrolling, i.e. leave just ESC to be used for what <- works
now, and ENTER for what -> does (they are already aliases for ages).
(Arnaldo Carvalho de Melo)
Infrastructure fixes:
- Check for SRCLINE_UNKNOWN case in "srcfile" processing (Andi Kleen)
- Wrap the slsmg_{printf,write_nstring} slang functions behind ui_browser, so
that we can make the ui_browser based browsers (annotate, menus, hists, etc) UI
library agnostic and usable with multiple backends (slang now, GTK+ and others
in the future, maybe) (Arnaldo Carvalho de Melo)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/ui/browsers')
| -rw-r--r-- | tools/perf/ui/browsers/annotate.c | 43 | ||||
| -rw-r--r-- | tools/perf/ui/browsers/header.c | 2 | ||||
| -rw-r--r-- | tools/perf/ui/browsers/hists.c | 54 | ||||
| -rw-r--r-- | tools/perf/ui/browsers/map.c | 11 | ||||
| -rw-r--r-- | tools/perf/ui/browsers/scripts.c | 2 |
5 files changed, 57 insertions, 55 deletions
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c index b5fc847f9660..29739b347599 100644 --- a/tools/perf/ui/browsers/annotate.c +++ b/tools/perf/ui/browsers/annotate.c | |||
| @@ -1,7 +1,6 @@ | |||
| 1 | #include "../../util/util.h" | 1 | #include "../../util/util.h" |
| 2 | #include "../browser.h" | 2 | #include "../browser.h" |
| 3 | #include "../helpline.h" | 3 | #include "../helpline.h" |
| 4 | #include "../libslang.h" | ||
| 5 | #include "../ui.h" | 4 | #include "../ui.h" |
| 6 | #include "../util.h" | 5 | #include "../util.h" |
| 7 | #include "../../util/annotate.h" | 6 | #include "../../util/annotate.h" |
| @@ -134,29 +133,31 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int | |||
| 134 | ui_browser__set_percent_color(browser, | 133 | ui_browser__set_percent_color(browser, |
| 135 | bdl->samples[i].percent, | 134 | bdl->samples[i].percent, |
| 136 | current_entry); | 135 | current_entry); |
| 137 | if (annotate_browser__opts.show_total_period) | 136 | if (annotate_browser__opts.show_total_period) { |
| 138 | slsmg_printf("%6" PRIu64 " ", | 137 | ui_browser__printf(browser, "%6" PRIu64 " ", |
| 139 | bdl->samples[i].nr); | 138 | bdl->samples[i].nr); |
| 140 | else | 139 | } else { |
| 141 | slsmg_printf("%6.2f ", bdl->samples[i].percent); | 140 | ui_browser__printf(browser, "%6.2f ", |
| 141 | bdl->samples[i].percent); | ||
| 142 | } | ||
| 142 | } | 143 | } |
| 143 | } else { | 144 | } else { |
| 144 | slsmg_write_nstring(" ", 7 * ab->nr_events); | 145 | ui_browser__write_nstring(browser, " ", 7 * ab->nr_events); |
| 145 | } | 146 | } |
| 146 | } else { | 147 | } else { |
| 147 | ui_browser__set_percent_color(browser, 0, current_entry); | 148 | ui_browser__set_percent_color(browser, 0, current_entry); |
| 148 | slsmg_write_nstring(" ", 7 * ab->nr_events); | 149 | ui_browser__write_nstring(browser, " ", 7 * ab->nr_events); |
| 149 | } | 150 | } |
| 150 | if (ab->have_cycles) { | 151 | if (ab->have_cycles) { |
| 151 | if (dl->ipc) | 152 | if (dl->ipc) |
| 152 | slsmg_printf("%*.2f ", IPC_WIDTH - 1, dl->ipc); | 153 | ui_browser__printf(browser, "%*.2f ", IPC_WIDTH - 1, dl->ipc); |
| 153 | else | 154 | else |
| 154 | slsmg_write_nstring(" ", IPC_WIDTH); | 155 | ui_browser__write_nstring(browser, " ", IPC_WIDTH); |
| 155 | if (dl->cycles) | 156 | if (dl->cycles) |
| 156 | slsmg_printf("%*" PRIu64 " ", | 157 | ui_browser__printf(browser, "%*" PRIu64 " ", |
| 157 | CYCLES_WIDTH - 1, dl->cycles); | 158 | CYCLES_WIDTH - 1, dl->cycles); |
| 158 | else | 159 | else |
| 159 | slsmg_write_nstring(" ", CYCLES_WIDTH); | 160 | ui_browser__write_nstring(browser, " ", CYCLES_WIDTH); |
| 160 | } | 161 | } |
| 161 | 162 | ||
| 162 | SLsmg_write_char(' '); | 163 | SLsmg_write_char(' '); |
| @@ -166,7 +167,7 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int | |||
| 166 | width += 1; | 167 | width += 1; |
| 167 | 168 | ||
| 168 | if (!*dl->line) | 169 | if (!*dl->line) |
| 169 | slsmg_write_nstring(" ", width - pcnt_width); | 170 | ui_browser__write_nstring(browser, " ", width - pcnt_width); |
| 170 | else if (dl->offset == -1) { | 171 | else if (dl->offset == -1) { |
| 171 | if (dl->line_nr && annotate_browser__opts.show_linenr) | 172 | if (dl->line_nr && annotate_browser__opts.show_linenr) |
| 172 | printed = scnprintf(bf, sizeof(bf), "%-*d ", | 173 | printed = scnprintf(bf, sizeof(bf), "%-*d ", |
| @@ -174,8 +175,8 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int | |||
| 174 | else | 175 | else |
| 175 | printed = scnprintf(bf, sizeof(bf), "%*s ", | 176 | printed = scnprintf(bf, sizeof(bf), "%*s ", |
| 176 | ab->addr_width, " "); | 177 | ab->addr_width, " "); |
| 177 | slsmg_write_nstring(bf, printed); | 178 | ui_browser__write_nstring(browser, bf, printed); |
| 178 | slsmg_write_nstring(dl->line, width - printed - pcnt_width + 1); | 179 | ui_browser__write_nstring(browser, dl->line, width - printed - pcnt_width + 1); |
| 179 | } else { | 180 | } else { |
| 180 | u64 addr = dl->offset; | 181 | u64 addr = dl->offset; |
| 181 | int color = -1; | 182 | int color = -1; |
| @@ -194,7 +195,7 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int | |||
| 194 | bdl->jump_sources); | 195 | bdl->jump_sources); |
| 195 | prev = annotate_browser__set_jumps_percent_color(ab, bdl->jump_sources, | 196 | prev = annotate_browser__set_jumps_percent_color(ab, bdl->jump_sources, |
| 196 | current_entry); | 197 | current_entry); |
| 197 | slsmg_write_nstring(bf, printed); | 198 | ui_browser__write_nstring(browser, bf, printed); |
| 198 | ui_browser__set_color(browser, prev); | 199 | ui_browser__set_color(browser, prev); |
| 199 | } | 200 | } |
| 200 | 201 | ||
| @@ -208,7 +209,7 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int | |||
| 208 | 209 | ||
| 209 | if (change_color) | 210 | if (change_color) |
| 210 | color = ui_browser__set_color(browser, HE_COLORSET_ADDR); | 211 | color = ui_browser__set_color(browser, HE_COLORSET_ADDR); |
| 211 | slsmg_write_nstring(bf, printed); | 212 | ui_browser__write_nstring(browser, bf, printed); |
| 212 | if (change_color) | 213 | if (change_color) |
| 213 | ui_browser__set_color(browser, color); | 214 | ui_browser__set_color(browser, color); |
| 214 | if (dl->ins && dl->ins->ops->scnprintf) { | 215 | if (dl->ins && dl->ins->ops->scnprintf) { |
| @@ -222,11 +223,11 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int | |||
| 222 | ui_browser__write_graph(browser, SLSMG_RARROW_CHAR); | 223 | ui_browser__write_graph(browser, SLSMG_RARROW_CHAR); |
| 223 | SLsmg_write_char(' '); | 224 | SLsmg_write_char(' '); |
| 224 | } else { | 225 | } else { |
| 225 | slsmg_write_nstring(" ", 2); | 226 | ui_browser__write_nstring(browser, " ", 2); |
| 226 | } | 227 | } |
| 227 | } else { | 228 | } else { |
| 228 | if (strcmp(dl->name, "retq")) { | 229 | if (strcmp(dl->name, "retq")) { |
| 229 | slsmg_write_nstring(" ", 2); | 230 | ui_browser__write_nstring(browser, " ", 2); |
| 230 | } else { | 231 | } else { |
| 231 | ui_browser__write_graph(browser, SLSMG_LARROW_CHAR); | 232 | ui_browser__write_graph(browser, SLSMG_LARROW_CHAR); |
| 232 | SLsmg_write_char(' '); | 233 | SLsmg_write_char(' '); |
| @@ -234,7 +235,7 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int | |||
| 234 | } | 235 | } |
| 235 | 236 | ||
| 236 | disasm_line__scnprintf(dl, bf, sizeof(bf), !annotate_browser__opts.use_offset); | 237 | disasm_line__scnprintf(dl, bf, sizeof(bf), !annotate_browser__opts.use_offset); |
| 237 | slsmg_write_nstring(bf, width - pcnt_width - 3 - printed); | 238 | ui_browser__write_nstring(browser, bf, width - pcnt_width - 3 - printed); |
| 238 | } | 239 | } |
| 239 | 240 | ||
| 240 | if (current_entry) | 241 | if (current_entry) |
diff --git a/tools/perf/ui/browsers/header.c b/tools/perf/ui/browsers/header.c index e8278c558d4a..f10681717f93 100644 --- a/tools/perf/ui/browsers/header.c +++ b/tools/perf/ui/browsers/header.c | |||
| @@ -25,7 +25,7 @@ static void ui_browser__argv_write(struct ui_browser *browser, | |||
| 25 | ui_browser__set_color(browser, current_entry ? HE_COLORSET_SELECTED : | 25 | ui_browser__set_color(browser, current_entry ? HE_COLORSET_SELECTED : |
| 26 | HE_COLORSET_NORMAL); | 26 | HE_COLORSET_NORMAL); |
| 27 | 27 | ||
| 28 | slsmg_write_nstring(str, browser->width); | 28 | ui_browser__write_nstring(browser, str, browser->width); |
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | static int list_menu__run(struct ui_browser *menu) | 31 | static int list_menu__run(struct ui_browser *menu) |
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index fa67613976a8..10c7ec041039 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c | |||
| @@ -1,5 +1,4 @@ | |||
| 1 | #include <stdio.h> | 1 | #include <stdio.h> |
| 2 | #include "../libslang.h" | ||
| 3 | #include <stdlib.h> | 2 | #include <stdlib.h> |
| 4 | #include <string.h> | 3 | #include <string.h> |
| 5 | #include <linux/rbtree.h> | 4 | #include <linux/rbtree.h> |
| @@ -540,10 +539,10 @@ static void hist_browser__show_callchain_entry(struct hist_browser *browser, | |||
| 540 | 539 | ||
| 541 | ui_browser__set_color(&browser->b, color); | 540 | ui_browser__set_color(&browser->b, color); |
| 542 | hist_browser__gotorc(browser, row, 0); | 541 | hist_browser__gotorc(browser, row, 0); |
| 543 | slsmg_write_nstring(" ", offset); | 542 | ui_browser__write_nstring(&browser->b, " ", offset); |
| 544 | slsmg_printf("%c", folded_sign); | 543 | ui_browser__printf(&browser->b, "%c", folded_sign); |
| 545 | ui_browser__write_graph(&browser->b, show_annotated ? SLSMG_RARROW_CHAR : ' '); | 544 | ui_browser__write_graph(&browser->b, show_annotated ? SLSMG_RARROW_CHAR : ' '); |
| 546 | slsmg_write_nstring(str, width); | 545 | ui_browser__write_nstring(&browser->b, str, width); |
| 547 | } | 546 | } |
| 548 | 547 | ||
| 549 | static void hist_browser__fprintf_callchain_entry(struct hist_browser *b __maybe_unused, | 548 | static void hist_browser__fprintf_callchain_entry(struct hist_browser *b __maybe_unused, |
| @@ -680,7 +679,7 @@ static int __hpp__slsmg_color_printf(struct perf_hpp *hpp, const char *fmt, ...) | |||
| 680 | ui_browser__set_percent_color(arg->b, percent, arg->current_entry); | 679 | ui_browser__set_percent_color(arg->b, percent, arg->current_entry); |
| 681 | 680 | ||
| 682 | ret = scnprintf(hpp->buf, hpp->size, fmt, len, percent); | 681 | ret = scnprintf(hpp->buf, hpp->size, fmt, len, percent); |
| 683 | slsmg_printf("%s", hpp->buf); | 682 | ui_browser__printf(arg->b, "%s", hpp->buf); |
| 684 | 683 | ||
| 685 | advance_hpp(hpp, ret); | 684 | advance_hpp(hpp, ret); |
| 686 | return ret; | 685 | return ret; |
| @@ -713,10 +712,11 @@ hist_browser__hpp_color_##_type(struct perf_hpp_fmt *fmt, \ | |||
| 713 | struct hist_entry *he) \ | 712 | struct hist_entry *he) \ |
| 714 | { \ | 713 | { \ |
| 715 | if (!symbol_conf.cumulate_callchain) { \ | 714 | if (!symbol_conf.cumulate_callchain) { \ |
| 715 | struct hpp_arg *arg = hpp->ptr; \ | ||
| 716 | int len = fmt->user_len ?: fmt->len; \ | 716 | int len = fmt->user_len ?: fmt->len; \ |
| 717 | int ret = scnprintf(hpp->buf, hpp->size, \ | 717 | int ret = scnprintf(hpp->buf, hpp->size, \ |
| 718 | "%*s", len, "N/A"); \ | 718 | "%*s", len, "N/A"); \ |
| 719 | slsmg_printf("%s", hpp->buf); \ | 719 | ui_browser__printf(arg->b, "%s", hpp->buf); \ |
| 720 | \ | 720 | \ |
| 721 | return ret; \ | 721 | return ret; \ |
| 722 | } \ | 722 | } \ |
| @@ -801,12 +801,12 @@ static int hist_browser__show_entry(struct hist_browser *browser, | |||
| 801 | 801 | ||
| 802 | if (first) { | 802 | if (first) { |
| 803 | if (symbol_conf.use_callchain) { | 803 | if (symbol_conf.use_callchain) { |
| 804 | slsmg_printf("%c ", folded_sign); | 804 | ui_browser__printf(&browser->b, "%c ", folded_sign); |
| 805 | width -= 2; | 805 | width -= 2; |
| 806 | } | 806 | } |
| 807 | first = false; | 807 | first = false; |
| 808 | } else { | 808 | } else { |
| 809 | slsmg_printf(" "); | 809 | ui_browser__printf(&browser->b, " "); |
| 810 | width -= 2; | 810 | width -= 2; |
| 811 | } | 811 | } |
| 812 | 812 | ||
| @@ -814,7 +814,7 @@ static int hist_browser__show_entry(struct hist_browser *browser, | |||
| 814 | width -= fmt->color(fmt, &hpp, entry); | 814 | width -= fmt->color(fmt, &hpp, entry); |
| 815 | } else { | 815 | } else { |
| 816 | width -= fmt->entry(fmt, &hpp, entry); | 816 | width -= fmt->entry(fmt, &hpp, entry); |
| 817 | slsmg_printf("%s", s); | 817 | ui_browser__printf(&browser->b, "%s", s); |
| 818 | } | 818 | } |
| 819 | } | 819 | } |
| 820 | 820 | ||
| @@ -822,7 +822,7 @@ static int hist_browser__show_entry(struct hist_browser *browser, | |||
| 822 | if (!browser->b.navkeypressed) | 822 | if (!browser->b.navkeypressed) |
| 823 | width += 1; | 823 | width += 1; |
| 824 | 824 | ||
| 825 | slsmg_write_nstring("", width); | 825 | ui_browser__write_nstring(&browser->b, "", width); |
| 826 | 826 | ||
| 827 | ++row; | 827 | ++row; |
| 828 | ++printed; | 828 | ++printed; |
| @@ -899,7 +899,7 @@ static void hist_browser__show_headers(struct hist_browser *browser) | |||
| 899 | hists__scnprintf_headers(headers, sizeof(headers), browser->hists); | 899 | hists__scnprintf_headers(headers, sizeof(headers), browser->hists); |
| 900 | ui_browser__gotorc(&browser->b, 0, 0); | 900 | ui_browser__gotorc(&browser->b, 0, 0); |
| 901 | ui_browser__set_color(&browser->b, HE_COLORSET_ROOT); | 901 | ui_browser__set_color(&browser->b, HE_COLORSET_ROOT); |
| 902 | slsmg_write_nstring(headers, browser->b.width + 1); | 902 | ui_browser__write_nstring(&browser->b, headers, browser->b.width + 1); |
| 903 | } | 903 | } |
| 904 | 904 | ||
| 905 | static void ui_browser__hists_init_top(struct ui_browser *browser) | 905 | static void ui_browser__hists_init_top(struct ui_browser *browser) |
| @@ -1267,6 +1267,8 @@ static int hists__browser_title(struct hists *hists, | |||
| 1267 | const char *ev_name = perf_evsel__name(evsel); | 1267 | const char *ev_name = perf_evsel__name(evsel); |
| 1268 | char buf[512]; | 1268 | char buf[512]; |
| 1269 | size_t buflen = sizeof(buf); | 1269 | size_t buflen = sizeof(buf); |
| 1270 | char ref[30] = " show reference callgraph, "; | ||
| 1271 | bool enable_ref = false; | ||
| 1270 | 1272 | ||
| 1271 | if (symbol_conf.filter_relative) { | 1273 | if (symbol_conf.filter_relative) { |
| 1272 | nr_samples = hists->stats.nr_non_filtered_samples; | 1274 | nr_samples = hists->stats.nr_non_filtered_samples; |
| @@ -1292,10 +1294,13 @@ static int hists__browser_title(struct hists *hists, | |||
| 1292 | } | 1294 | } |
| 1293 | } | 1295 | } |
| 1294 | 1296 | ||
| 1297 | if (symbol_conf.show_ref_callgraph && | ||
| 1298 | strstr(ev_name, "call-graph=no")) | ||
| 1299 | enable_ref = true; | ||
| 1295 | nr_samples = convert_unit(nr_samples, &unit); | 1300 | nr_samples = convert_unit(nr_samples, &unit); |
| 1296 | printed = scnprintf(bf, size, | 1301 | printed = scnprintf(bf, size, |
| 1297 | "Samples: %lu%c of event '%s', Event count (approx.): %" PRIu64, | 1302 | "Samples: %lu%c of event '%s',%sEvent count (approx.): %" PRIu64, |
| 1298 | nr_samples, unit, ev_name, nr_events); | 1303 | nr_samples, unit, ev_name, enable_ref ? ref : " ", nr_events); |
| 1299 | 1304 | ||
| 1300 | 1305 | ||
| 1301 | if (hists->uid_filter_str) | 1306 | if (hists->uid_filter_str) |
| @@ -1868,6 +1873,7 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events, | |||
| 1868 | case K_RIGHT: | 1873 | case K_RIGHT: |
| 1869 | /* menu */ | 1874 | /* menu */ |
| 1870 | break; | 1875 | break; |
| 1876 | case K_ESC: | ||
| 1871 | case K_LEFT: { | 1877 | case K_LEFT: { |
| 1872 | const void *top; | 1878 | const void *top; |
| 1873 | 1879 | ||
| @@ -1877,6 +1883,12 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events, | |||
| 1877 | */ | 1883 | */ |
| 1878 | if (left_exits) | 1884 | if (left_exits) |
| 1879 | goto out_free_stack; | 1885 | goto out_free_stack; |
| 1886 | |||
| 1887 | if (key == K_ESC && | ||
| 1888 | ui_browser__dialog_yesno(&browser->b, | ||
| 1889 | "Do you really want to exit?")) | ||
| 1890 | goto out_free_stack; | ||
| 1891 | |||
| 1880 | continue; | 1892 | continue; |
| 1881 | } | 1893 | } |
| 1882 | top = pstack__peek(browser->pstack); | 1894 | top = pstack__peek(browser->pstack); |
| @@ -1892,12 +1904,6 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events, | |||
| 1892 | do_zoom_thread(browser, actions); | 1904 | do_zoom_thread(browser, actions); |
| 1893 | continue; | 1905 | continue; |
| 1894 | } | 1906 | } |
| 1895 | case K_ESC: | ||
| 1896 | if (!left_exits && | ||
| 1897 | !ui_browser__dialog_yesno(&browser->b, | ||
| 1898 | "Do you really want to exit?")) | ||
| 1899 | continue; | ||
| 1900 | /* Fall thru */ | ||
| 1901 | case 'q': | 1907 | case 'q': |
| 1902 | case CTRL('c'): | 1908 | case CTRL('c'): |
| 1903 | goto out_free_stack; | 1909 | goto out_free_stack; |
| @@ -2044,7 +2050,7 @@ static void perf_evsel_menu__write(struct ui_browser *browser, | |||
| 2044 | nr_events = convert_unit(nr_events, &unit); | 2050 | nr_events = convert_unit(nr_events, &unit); |
| 2045 | printed = scnprintf(bf, sizeof(bf), "%lu%c%s%s", nr_events, | 2051 | printed = scnprintf(bf, sizeof(bf), "%lu%c%s%s", nr_events, |
| 2046 | unit, unit == ' ' ? "" : " ", ev_name); | 2052 | unit, unit == ' ' ? "" : " ", ev_name); |
| 2047 | slsmg_printf("%s", bf); | 2053 | ui_browser__printf(browser, "%s", bf); |
| 2048 | 2054 | ||
| 2049 | nr_events = hists->stats.nr_events[PERF_RECORD_LOST]; | 2055 | nr_events = hists->stats.nr_events[PERF_RECORD_LOST]; |
| 2050 | if (nr_events != 0) { | 2056 | if (nr_events != 0) { |
| @@ -2057,7 +2063,7 @@ static void perf_evsel_menu__write(struct ui_browser *browser, | |||
| 2057 | warn = bf; | 2063 | warn = bf; |
| 2058 | } | 2064 | } |
| 2059 | 2065 | ||
| 2060 | slsmg_write_nstring(warn, browser->width - printed); | 2066 | ui_browser__write_nstring(browser, warn, browser->width - printed); |
| 2061 | 2067 | ||
| 2062 | if (current_entry) | 2068 | if (current_entry) |
| 2063 | menu->selection = evsel; | 2069 | menu->selection = evsel; |
| @@ -2120,15 +2126,11 @@ browse_hists: | |||
| 2120 | else | 2126 | else |
| 2121 | pos = perf_evsel__prev(pos); | 2127 | pos = perf_evsel__prev(pos); |
| 2122 | goto browse_hists; | 2128 | goto browse_hists; |
| 2123 | case K_ESC: | ||
| 2124 | if (!ui_browser__dialog_yesno(&menu->b, | ||
| 2125 | "Do you really want to exit?")) | ||
| 2126 | continue; | ||
| 2127 | /* Fall thru */ | ||
| 2128 | case K_SWITCH_INPUT_DATA: | 2129 | case K_SWITCH_INPUT_DATA: |
| 2129 | case 'q': | 2130 | case 'q': |
| 2130 | case CTRL('c'): | 2131 | case CTRL('c'): |
| 2131 | goto out; | 2132 | goto out; |
| 2133 | case K_ESC: | ||
| 2132 | default: | 2134 | default: |
| 2133 | continue; | 2135 | continue; |
| 2134 | } | 2136 | } |
diff --git a/tools/perf/ui/browsers/map.c b/tools/perf/ui/browsers/map.c index b11639f33682..8c154c7d4669 100644 --- a/tools/perf/ui/browsers/map.c +++ b/tools/perf/ui/browsers/map.c | |||
| @@ -1,4 +1,3 @@ | |||
| 1 | #include "../libslang.h" | ||
| 2 | #include <elf.h> | 1 | #include <elf.h> |
| 3 | #include <inttypes.h> | 2 | #include <inttypes.h> |
| 4 | #include <sys/ttydefaults.h> | 3 | #include <sys/ttydefaults.h> |
| @@ -26,13 +25,13 @@ static void map_browser__write(struct ui_browser *browser, void *nd, int row) | |||
| 26 | int width; | 25 | int width; |
| 27 | 26 | ||
| 28 | ui_browser__set_percent_color(browser, 0, current_entry); | 27 | ui_browser__set_percent_color(browser, 0, current_entry); |
| 29 | slsmg_printf("%*" PRIx64 " %*" PRIx64 " %c ", | 28 | ui_browser__printf(browser, "%*" PRIx64 " %*" PRIx64 " %c ", |
| 30 | mb->addrlen, sym->start, mb->addrlen, sym->end, | 29 | mb->addrlen, sym->start, mb->addrlen, sym->end, |
| 31 | sym->binding == STB_GLOBAL ? 'g' : | 30 | sym->binding == STB_GLOBAL ? 'g' : |
| 32 | sym->binding == STB_LOCAL ? 'l' : 'w'); | 31 | sym->binding == STB_LOCAL ? 'l' : 'w'); |
| 33 | width = browser->width - ((mb->addrlen * 2) + 4); | 32 | width = browser->width - ((mb->addrlen * 2) + 4); |
| 34 | if (width > 0) | 33 | if (width > 0) |
| 35 | slsmg_write_nstring(sym->name, width); | 34 | ui_browser__write_nstring(browser, sym->name, width); |
| 36 | } | 35 | } |
| 37 | 36 | ||
| 38 | /* FIXME uber-kludgy, see comment on cmd_report... */ | 37 | /* FIXME uber-kludgy, see comment on cmd_report... */ |
diff --git a/tools/perf/ui/browsers/scripts.c b/tools/perf/ui/browsers/scripts.c index 402d2bd30b09..e13b48d705ef 100644 --- a/tools/perf/ui/browsers/scripts.c +++ b/tools/perf/ui/browsers/scripts.c | |||
| @@ -81,7 +81,7 @@ static void script_browser__write(struct ui_browser *browser, | |||
| 81 | ui_browser__set_color(browser, current_entry ? HE_COLORSET_SELECTED : | 81 | ui_browser__set_color(browser, current_entry ? HE_COLORSET_SELECTED : |
| 82 | HE_COLORSET_NORMAL); | 82 | HE_COLORSET_NORMAL); |
| 83 | 83 | ||
| 84 | slsmg_write_nstring(sline->line, browser->width); | 84 | ui_browser__write_nstring(browser, sline->line, browser->width); |
| 85 | } | 85 | } |
| 86 | 86 | ||
| 87 | static int script_browser__run(struct perf_script_browser *browser) | 87 | static int script_browser__run(struct perf_script_browser *browser) |
