diff options
author | Namhyung Kim <namhyung.kim@lge.com> | 2012-04-30 00:55:08 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-05-02 15:17:34 -0400 |
commit | 281ef544a8476f750b9f378593c42b3e8a0b8788 (patch) | |
tree | 685e23ed105380b167a36ccac54130c42aaf38c9 /tools/perf/util | |
parent | 28e62b90d95a4ed8ae2ba93879003665051581a6 (diff) |
perf ui: Add gtk2 support into setup_browser()
Now setup_browser can handle gtk2 front-end so split the TUI code to
ui/tui/setup.c in order to remove dependency.
To this end, make ui__init/exit global symbols and take an argument.
Also split gtk code to ui/gtk/setup.c.
Signed-off-by: Namhyung Kim <namhyung.kim@lge.com>
Acked-by: Pekka Enberg <penberg@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1335761711-31403-5-git-send-email-namhyung.kim@lge.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util')
-rw-r--r-- | tools/perf/util/cache.h | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/tools/perf/util/cache.h b/tools/perf/util/cache.h index 3428b777396d..761d4e998101 100644 --- a/tools/perf/util/cache.h +++ b/tools/perf/util/cache.h | |||
@@ -33,7 +33,7 @@ extern int pager_use_color; | |||
33 | 33 | ||
34 | extern int use_browser; | 34 | extern int use_browser; |
35 | 35 | ||
36 | #ifdef NO_NEWT_SUPPORT | 36 | #if defined(NO_NEWT_SUPPORT) && defined(NO_GTK2_SUPPORT) |
37 | static inline void setup_browser(bool fallback_to_pager) | 37 | static inline void setup_browser(bool fallback_to_pager) |
38 | { | 38 | { |
39 | if (fallback_to_pager) | 39 | if (fallback_to_pager) |
@@ -43,19 +43,32 @@ static inline void exit_browser(bool wait_for_ok __used) {} | |||
43 | #else | 43 | #else |
44 | void setup_browser(bool fallback_to_pager); | 44 | void setup_browser(bool fallback_to_pager); |
45 | void exit_browser(bool wait_for_ok); | 45 | void exit_browser(bool wait_for_ok); |
46 | |||
47 | #ifdef NO_NEWT_SUPPORT | ||
48 | static inline int ui__init(bool fallback_to_pager) | ||
49 | { | ||
50 | if (fallback_to_pager) | ||
51 | setup_pager(); | ||
52 | return 0; | ||
53 | } | ||
54 | static inline void ui__exit(bool wait_for_ok __used) {} | ||
55 | #else | ||
56 | int ui__init(bool fallback_to_pager); | ||
57 | void ui__exit(bool wait_for_ok); | ||
46 | #endif | 58 | #endif |
47 | 59 | ||
48 | #ifdef NO_GTK2_SUPPORT | 60 | #ifdef NO_GTK2_SUPPORT |
49 | static inline void perf_gtk__setup_browser(bool fallback_to_pager) | 61 | static inline void perf_gtk__init(bool fallback_to_pager) |
50 | { | 62 | { |
51 | if (fallback_to_pager) | 63 | if (fallback_to_pager) |
52 | setup_pager(); | 64 | setup_pager(); |
53 | } | 65 | } |
54 | static inline void perf_gtk__exit_browser(bool wait_for_ok __used) {} | 66 | static inline void perf_gtk__exit(bool wait_for_ok __used) {} |
55 | #else | 67 | #else |
56 | void perf_gtk__setup_browser(bool fallback_to_pager); | 68 | void perf_gtk__init(bool fallback_to_pager); |
57 | void perf_gtk__exit_browser(bool wait_for_ok); | 69 | void perf_gtk__exit(bool wait_for_ok); |
58 | #endif | 70 | #endif |
71 | #endif /* NO_NEWT_SUPPORT && NO_GTK2_SUPPORT */ | ||
59 | 72 | ||
60 | char *alias_lookup(const char *alias); | 73 | char *alias_lookup(const char *alias); |
61 | int split_cmdline(char *cmdline, const char ***argv); | 74 | int split_cmdline(char *cmdline, const char ***argv); |