diff options
author | Namhyung Kim <namhyung.kim@lge.com> | 2012-11-13 22:30:32 +0900 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-11-14 16:52:39 -0300 |
commit | 688f2f5b99311b127ea43efdbf47bb2e3c7a2e32 (patch) | |
tree | 56dd40bff09afb0c276bbacf2a5624c1e5f8118b /tools/perf/ui/tui | |
parent | 7da5c85dd34dd67846fec965e4bf1f761eecca05 (diff) |
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.c | 12 | ||||
-rw-r--r-- | tools/perf/ui/tui/setup.c | 1 |
2 files changed, 12 insertions, 1 deletions
diff --git a/tools/perf/ui/tui/progress.c b/tools/perf/ui/tui/progress.c index f8dc986e427..6c2184d53cb 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 60debb81537..81efa192e86 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); |