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>
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c
index c14f8f9..29739b3 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 @@
 				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 @@
 	}
 	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);
 	}