summaryrefslogtreecommitdiff
path: root/tools/perf/ui/tui
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung.kim@lge.com>2012-11-13 17:30:32 +0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-11-14 23:52:39 +0400
commit688f2f5b99311b127ea43efdbf47bb2e3c7a2e32 (patch)
tree56dd40bff09afb0c276bbacf2a5624c1e5f8118b /tools/perf/ui/tui
parent7da5c85dd34dd67846fec965e4bf1f761eecca05 (diff)
downloadlinux-688f2f5b99311b127ea43efdbf47bb2e3c7a2e32.tar.xz
perf ui: Introduce generic ui_progress helper
Make ui_progress functions generic so that UI frontend code will add its callbacks. 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-2-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/ui/tui')
-rw-r--r--tools/perf/ui/tui/progress.c12
-rw-r--r--tools/perf/ui/tui/setup.c1
2 files changed, 12 insertions, 1 deletions
diff --git a/tools/perf/ui/tui/progress.c b/tools/perf/ui/tui/progress.c
index f8dc986e427d..6c2184d53cbf 100644
--- a/tools/perf/ui/tui/progress.c
+++ b/tools/perf/ui/tui/progress.c
@@ -4,7 +4,7 @@
#include "../ui.h"
#include "../browser.h"
-void ui_progress__update(u64 curr, u64 total, const char *title)
+static void tui_progress__update(u64 curr, u64 total, const char *title)
{
int bar, y;
/*
@@ -30,3 +30,13 @@ void ui_progress__update(u64 curr, u64 total, const char *title)
SLsmg_refresh();
pthread_mutex_unlock(&ui__lock);
}
+
+static struct ui_progress tui_progress_fns =
+{
+ .update = tui_progress__update,
+};
+
+void ui_progress__init(void)
+{
+ progress_fns = &tui_progress_fns;
+}
diff --git a/tools/perf/ui/tui/setup.c b/tools/perf/ui/tui/setup.c
index 60debb81537a..81efa192e86c 100644
--- a/tools/perf/ui/tui/setup.c
+++ b/tools/perf/ui/tui/setup.c
@@ -118,6 +118,7 @@ int ui__init(void)
newtSetSuspendCallback(newt_suspend, NULL);
ui_helpline__init();
ui_browser__init();
+ ui_progress__init();
signal(SIGSEGV, ui__signal);
signal(SIGFPE, ui__signal);