aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/ui/browsers/annotate.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2015-08-11 11:50:55 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-08-12 09:27:05 -0400
commit517dfdb315fa2da9b144f6fa494b4f54b490de7e (patch)
treeb04dc0e38c17cfe923d62cb187020a02ce12d741 /tools/perf/ui/browsers/annotate.c
parent26270a008251ec36431623bd992252934bbe529a (diff)
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.c19
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 @@
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,11 +133,13 @@ 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 ui_browser__write_nstring(browser, " ", 7 * ab->nr_events); 145 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
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 ui_browser__write_nstring(browser, " ", 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 ui_browser__write_nstring(browser, " ", CYCLES_WIDTH); 160 ui_browser__write_nstring(browser, " ", CYCLES_WIDTH);
160 } 161 }