diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-08-11 18:50:55 +0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-08-12 16:27:05 +0300 |
commit | 517dfdb315fa2da9b144f6fa494b4f54b490de7e (patch) | |
tree | b04dc0e38c17cfe923d62cb187020a02ce12d741 /tools/perf/ui/browsers/annotate.c | |
parent | 26270a008251ec36431623bd992252934bbe529a (diff) | |
download | linux-517dfdb315fa2da9b144f6fa494b4f54b490de7e.tar.xz |
perf ui browser: Introduce ui_browser__printf()
To remove direct access to libslang functions, with the immediate goal
of implementing horizontal scrolling at the ui_browser level, but also
because we may at some point want to implement ui_browser with other UIs
in addition to the current libslang implementation.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-w0niblabqrkecs4o0eogfy6c@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/ui/browsers/annotate.c')
-rw-r--r-- | tools/perf/ui/browsers/annotate.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c index c14f8f9e0b6a..29739b347599 100644 --- a/tools/perf/ui/browsers/annotate.c +++ b/tools/perf/ui/browsers/annotate.c @@ -1,7 +1,6 @@ #include "../../util/util.h" #include "../browser.h" #include "../helpline.h" -#include "../libslang.h" #include "../ui.h" #include "../util.h" #include "../../util/annotate.h" @@ -134,11 +133,13 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int ui_browser__set_percent_color(browser, bdl->samples[i].percent, current_entry); - if (annotate_browser__opts.show_total_period) - slsmg_printf("%6" PRIu64 " ", - bdl->samples[i].nr); - else - slsmg_printf("%6.2f ", bdl->samples[i].percent); + if (annotate_browser__opts.show_total_period) { + ui_browser__printf(browser, "%6" PRIu64 " ", + bdl->samples[i].nr); + } else { + ui_browser__printf(browser, "%6.2f ", + bdl->samples[i].percent); + } } } else { ui_browser__write_nstring(browser, " ", 7 * ab->nr_events); @@ -149,12 +150,12 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int } if (ab->have_cycles) { if (dl->ipc) - slsmg_printf("%*.2f ", IPC_WIDTH - 1, dl->ipc); + ui_browser__printf(browser, "%*.2f ", IPC_WIDTH - 1, dl->ipc); else ui_browser__write_nstring(browser, " ", IPC_WIDTH); if (dl->cycles) - slsmg_printf("%*" PRIu64 " ", - CYCLES_WIDTH - 1, dl->cycles); + ui_browser__printf(browser, "%*" PRIu64 " ", + CYCLES_WIDTH - 1, dl->cycles); else ui_browser__write_nstring(browser, " ", CYCLES_WIDTH); } |