]> Pileus Git - ~andy/linux/commitdiff
perf ui: Rename ui_progress to ui_progress_ops
authorArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 23 Oct 2013 17:08:48 +0000 (14:08 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 23 Oct 2013 17:41:23 +0000 (14:41 -0300)
Reserving 'struct ui_progress' to the per progress instances, not to the
particular set of operations used to implmenet a progress bar in the
current UI (GTK, TUI, etc).

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-zjqbfp9gx3yo45s0rp9uv42n@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/Makefile.perf
tools/perf/ui/gtk/gtk.h
tools/perf/ui/gtk/progress.c
tools/perf/ui/gtk/setup.c
tools/perf/ui/progress.c
tools/perf/ui/progress.h
tools/perf/ui/tui/progress.c
tools/perf/ui/tui/setup.c
tools/perf/ui/tui/tui.h [new file with mode: 0644]

index 326a26e5fc1c40bd7f75734305a126ecd6b29db8..8a9ca38360437de5bee17553b434d165d23e0668 100644 (file)
@@ -487,6 +487,7 @@ ifndef NO_SLANG
   LIB_OBJS += $(OUTPUT)ui/tui/util.o
   LIB_OBJS += $(OUTPUT)ui/tui/helpline.o
   LIB_OBJS += $(OUTPUT)ui/tui/progress.o
+  LIB_H += ui/tui/tui.h
   LIB_H += ui/browser.h
   LIB_H += ui/browsers/map.h
   LIB_H += ui/keysyms.h
index 8576cf194872da1065e90eb63a40482ebb63479e..0a9173ff9a61d16e804f27f7e4734b16166f696c 100644 (file)
@@ -34,7 +34,7 @@ struct perf_gtk_context *perf_gtk__activate_context(GtkWidget *window);
 int perf_gtk__deactivate_context(struct perf_gtk_context **ctx);
 
 void perf_gtk__init_helpline(void);
-void perf_gtk__init_progress(void);
+void gtk_ui_progress__init(void);
 void perf_gtk__init_hpp(void);
 
 void perf_gtk__signal(int sig);
index 482bcf3df9b7a293b16b4e2b4f0091d9ee87bb95..195c7f94f98eb3ee49bc7cae2568cf2bc14fbfbe 100644 (file)
@@ -7,7 +7,7 @@
 static GtkWidget *dialog;
 static GtkWidget *progress;
 
-static void gtk_progress_update(u64 curr, u64 total, const char *title)
+static void gtk_ui_progress__update(u64 curr, u64 total, const char *title)
 {
        double fraction = total ? 1.0 * curr / total : 0.0;
        char buf[1024];
@@ -40,7 +40,7 @@ static void gtk_progress_update(u64 curr, u64 total, const char *title)
                gtk_main_iteration();
 }
 
-static void gtk_progress_finish(void)
+static void gtk_ui_progress__finish(void)
 {
        /* this will also destroy all of its children */
        gtk_widget_destroy(dialog);
@@ -48,12 +48,12 @@ static void gtk_progress_finish(void)
        dialog = NULL;
 }
 
-static struct ui_progress gtk_progress_fns = {
-       .update         = gtk_progress_update,
-       .finish         = gtk_progress_finish,
+static struct ui_progress_ops gtk_ui_progress__ops = {
+       .update         = gtk_ui_progress__update,
+       .finish         = gtk_ui_progress__finish,
 };
 
-void perf_gtk__init_progress(void)
+void gtk_ui_progress__init(void)
 {
-       progress_fns = &gtk_progress_fns;
+       ui_progress__ops = &gtk_ui_progress__ops;
 }
index 6c2dd2e423f3a6a160bcbd879b71c6134ef9d460..1d57676f82124d82e18d032e349e879e09a060e8 100644 (file)
@@ -8,7 +8,7 @@ int perf_gtk__init(void)
 {
        perf_error__register(&perf_gtk_eops);
        perf_gtk__init_helpline();
-       perf_gtk__init_progress();
+       gtk_ui_progress__init();
        perf_gtk__init_hpp();
 
        return gtk_init_check(NULL, NULL) ? 0 : -1;
index 3ec695607a4d074f844f4922805d52556b2ec645..d753821b6e0bf68b6943efea6e992ec0d5e465df 100644 (file)
@@ -1,26 +1,26 @@
 #include "../cache.h"
 #include "progress.h"
 
-static void nop_progress_update(u64 curr __maybe_unused,
-                               u64 total __maybe_unused,
-                               const char *title __maybe_unused)
+static void null_progress__update(u64 curr __maybe_unused,
+                                 u64 total __maybe_unused,
+                                 const char *title __maybe_unused)
 {
 }
 
-static struct ui_progress default_progress_fns =
+static struct ui_progress_ops null_progress__ops =
 {
-       .update         = nop_progress_update,
+       .update = null_progress__update,
 };
 
-struct ui_progress *progress_fns = &default_progress_fns;
+struct ui_progress_ops *ui_progress__ops = &null_progress__ops;
 
 void ui_progress__update(u64 curr, u64 total, const char *title)
 {
-       return progress_fns->update(curr, total, title);
+       return ui_progress__ops->update(curr, total, title);
 }
 
 void ui_progress__finish(void)
 {
-       if (progress_fns->finish)
-               progress_fns->finish();
+       if (ui_progress__ops->finish)
+               ui_progress__ops->finish();
 }
index 257cc224f9cff6d29acc81c0db9d315ed4b2b39a..d41bde5908a66a28301f529407cba12cb0d51ab7 100644 (file)
@@ -3,14 +3,12 @@
 
 #include <../types.h>
 
-struct ui_progress {
+struct ui_progress_ops {
        void (*update)(u64, u64, const char *);
        void (*finish)(void);
 };
 
-extern struct ui_progress *progress_fns;
-
-void ui_progress__init(void);
+extern struct ui_progress_ops *ui_progress__ops;
 
 void ui_progress__update(u64 curr, u64 total, const char *title);
 void ui_progress__finish(void);
index 6c2184d53cbf9a16d378d084984613d19ec99752..0fcc5a1f525a636aee2c7caa29bd2fcaafb6e549 100644 (file)
@@ -2,6 +2,7 @@
 #include "../progress.h"
 #include "../libslang.h"
 #include "../ui.h"
+#include "tui.h"
 #include "../browser.h"
 
 static void tui_progress__update(u64 curr, u64 total, const char *title)
@@ -31,12 +32,12 @@ static void tui_progress__update(u64 curr, u64 total, const char *title)
        pthread_mutex_unlock(&ui__lock);
 }
 
-static struct ui_progress tui_progress_fns =
+static struct ui_progress_ops tui_progress__ops =
 {
        .update         = tui_progress__update,
 };
 
-void ui_progress__init(void)
+void tui_progress__init(void)
 {
-       progress_fns = &tui_progress_fns;
+       ui_progress__ops = &tui_progress__ops;
 }
index b9401482d110bad0f5d39946c04b881cd9b779d9..2f612562978cdc13c7e89b6dbddd24c9f928d626 100644 (file)
@@ -9,6 +9,7 @@
 #include "../util.h"
 #include "../libslang.h"
 #include "../keysyms.h"
+#include "tui.h"
 
 static volatile int ui__need_resize;
 
@@ -119,7 +120,7 @@ int ui__init(void)
 
        ui_helpline__init();
        ui_browser__init();
-       ui_progress__init();
+       tui_progress__init();
 
        signal(SIGSEGV, ui__signal);
        signal(SIGFPE, ui__signal);
diff --git a/tools/perf/ui/tui/tui.h b/tools/perf/ui/tui/tui.h
new file mode 100644 (file)
index 0000000..18961c7
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef _PERF_TUI_H_
+#define _PERF_TUI_H_ 1
+
+void tui_progress__init(void);
+
+#endif /* _PERF_TUI_H_ */