aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/ui/progress.c
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung.kim@lge.com>2012-11-13 08:30:31 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-11-14 14:52:33 -0500
commit7da5c85dd34dd67846fec965e4bf1f761eecca05 (patch)
tree65e45f829df49b79a3222a60a56bb62bdd8fd65d /tools/perf/ui/progress.c
parent534123f458f196bcc269f97d20ccf125925c2e7b (diff)
perf ui tui: Move progress.c under ui/tui directory
Current ui_progress functions are implemented for TUI only. So move the file under the tui directory. This is needed for providing an UI- agnostic wrapper. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: Pekka Enberg <penberg@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1352813436-14173-1-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/ui/progress.c')
-rw-r--r--tools/perf/ui/progress.c32
1 files changed, 0 insertions, 32 deletions
diff --git a/tools/perf/ui/progress.c b/tools/perf/ui/progress.c
deleted file mode 100644
index 13aa64e50e11..000000000000
--- a/tools/perf/ui/progress.c
+++ /dev/null
@@ -1,32 +0,0 @@
1#include "../cache.h"
2#include "progress.h"
3#include "libslang.h"
4#include "ui.h"
5#include "browser.h"
6
7void ui_progress__update(u64 curr, u64 total, const char *title)
8{
9 int bar, y;
10 /*
11 * FIXME: We should have a per UI backend way of showing progress,
12 * stdio will just show a percentage as NN%, etc.
13 */
14 if (use_browser <= 0)
15 return;
16
17 if (total == 0)
18 return;
19
20 ui__refresh_dimensions(true);
21 pthread_mutex_lock(&ui__lock);
22 y = SLtt_Screen_Rows / 2 - 2;
23 SLsmg_set_color(0);
24 SLsmg_draw_box(y, 0, 3, SLtt_Screen_Cols);
25 SLsmg_gotorc(y++, 1);
26 SLsmg_write_string((char *)title);
27 SLsmg_set_color(HE_COLORSET_SELECTED);
28 bar = ((SLtt_Screen_Cols - 2) * curr) / total;
29 SLsmg_fill_region(y, 1, 1, bar, ' ');
30 SLsmg_refresh();
31 pthread_mutex_unlock(&ui__lock);
32}