diff options
-rw-r--r-- | tools/perf/Makefile | 3 | ||||
-rw-r--r-- | tools/perf/ui/ui.h | 28 | ||||
-rw-r--r-- | tools/perf/util/cache.h | 39 |
3 files changed, 30 insertions, 40 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile index 5a9075ea218e..a7c6aa8d4a8b 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile | |||
@@ -422,6 +422,7 @@ LIB_OBJS += $(OUTPUT)util/intlist.o | |||
422 | LIB_OBJS += $(OUTPUT)util/vdso.o | 422 | LIB_OBJS += $(OUTPUT)util/vdso.o |
423 | LIB_OBJS += $(OUTPUT)util/stat.o | 423 | LIB_OBJS += $(OUTPUT)util/stat.o |
424 | 424 | ||
425 | LIB_OBJS += $(OUTPUT)ui/setup.o | ||
425 | LIB_OBJS += $(OUTPUT)ui/helpline.o | 426 | LIB_OBJS += $(OUTPUT)ui/helpline.o |
426 | LIB_OBJS += $(OUTPUT)ui/progress.o | 427 | LIB_OBJS += $(OUTPUT)ui/progress.o |
427 | LIB_OBJS += $(OUTPUT)ui/hist.o | 428 | LIB_OBJS += $(OUTPUT)ui/hist.o |
@@ -612,7 +613,6 @@ ifndef NO_NEWT | |||
612 | BASIC_CFLAGS += -I/usr/include/slang | 613 | BASIC_CFLAGS += -I/usr/include/slang |
613 | BASIC_CFLAGS += -DNEWT_SUPPORT | 614 | BASIC_CFLAGS += -DNEWT_SUPPORT |
614 | EXTLIBS += -lnewt -lslang | 615 | EXTLIBS += -lnewt -lslang |
615 | LIB_OBJS += $(OUTPUT)ui/setup.o | ||
616 | LIB_OBJS += $(OUTPUT)ui/browser.o | 616 | LIB_OBJS += $(OUTPUT)ui/browser.o |
617 | LIB_OBJS += $(OUTPUT)ui/browsers/annotate.o | 617 | LIB_OBJS += $(OUTPUT)ui/browsers/annotate.o |
618 | LIB_OBJS += $(OUTPUT)ui/browsers/hists.o | 618 | LIB_OBJS += $(OUTPUT)ui/browsers/hists.o |
@@ -651,7 +651,6 @@ ifndef NO_GTK2 | |||
651 | LIB_OBJS += $(OUTPUT)ui/gtk/progress.o | 651 | LIB_OBJS += $(OUTPUT)ui/gtk/progress.o |
652 | # Make sure that it'd be included only once. | 652 | # Make sure that it'd be included only once. |
653 | ifeq ($(findstring -DNEWT_SUPPORT,$(BASIC_CFLAGS)),) | 653 | ifeq ($(findstring -DNEWT_SUPPORT,$(BASIC_CFLAGS)),) |
654 | LIB_OBJS += $(OUTPUT)ui/setup.o | ||
655 | LIB_OBJS += $(OUTPUT)ui/util.o | 654 | LIB_OBJS += $(OUTPUT)ui/util.o |
656 | endif | 655 | endif |
657 | endif | 656 | endif |
diff --git a/tools/perf/ui/ui.h b/tools/perf/ui/ui.h index 7b67045479f6..d86359c99907 100644 --- a/tools/perf/ui/ui.h +++ b/tools/perf/ui/ui.h | |||
@@ -3,9 +3,37 @@ | |||
3 | 3 | ||
4 | #include <pthread.h> | 4 | #include <pthread.h> |
5 | #include <stdbool.h> | 5 | #include <stdbool.h> |
6 | #include <linux/compiler.h> | ||
6 | 7 | ||
7 | extern pthread_mutex_t ui__lock; | 8 | extern pthread_mutex_t ui__lock; |
8 | 9 | ||
10 | extern int use_browser; | ||
11 | |||
12 | void setup_browser(bool fallback_to_pager); | ||
13 | void exit_browser(bool wait_for_ok); | ||
14 | |||
15 | #ifdef NEWT_SUPPORT | ||
16 | int ui__init(void); | ||
17 | void ui__exit(bool wait_for_ok); | ||
18 | #else | ||
19 | static inline int ui__init(void) | ||
20 | { | ||
21 | return -1; | ||
22 | } | ||
23 | static inline void ui__exit(bool wait_for_ok __maybe_unused) {} | ||
24 | #endif | ||
25 | |||
26 | #ifdef GTK2_SUPPORT | ||
27 | int perf_gtk__init(void); | ||
28 | void perf_gtk__exit(bool wait_for_ok); | ||
29 | #else | ||
30 | static inline int perf_gtk__init(void) | ||
31 | { | ||
32 | return -1; | ||
33 | } | ||
34 | static inline void perf_gtk__exit(bool wait_for_ok __maybe_unused) {} | ||
35 | #endif | ||
36 | |||
9 | void ui__refresh_dimensions(bool force); | 37 | void ui__refresh_dimensions(bool force); |
10 | 38 | ||
11 | #endif /* _PERF_UI_H_ */ | 39 | #endif /* _PERF_UI_H_ */ |
diff --git a/tools/perf/util/cache.h b/tools/perf/util/cache.h index 2bd51370ad28..26e367239873 100644 --- a/tools/perf/util/cache.h +++ b/tools/perf/util/cache.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include "util.h" | 5 | #include "util.h" |
6 | #include "strbuf.h" | 6 | #include "strbuf.h" |
7 | #include "../perf.h" | 7 | #include "../perf.h" |
8 | #include "../ui/ui.h" | ||
8 | 9 | ||
9 | #define CMD_EXEC_PATH "--exec-path" | 10 | #define CMD_EXEC_PATH "--exec-path" |
10 | #define CMD_PERF_DIR "--perf-dir=" | 11 | #define CMD_PERF_DIR "--perf-dir=" |
@@ -31,44 +32,6 @@ extern const char *pager_program; | |||
31 | extern int pager_in_use(void); | 32 | extern int pager_in_use(void); |
32 | extern int pager_use_color; | 33 | extern int pager_use_color; |
33 | 34 | ||
34 | extern int use_browser; | ||
35 | |||
36 | #if defined(NEWT_SUPPORT) || defined(GTK2_SUPPORT) | ||
37 | void setup_browser(bool fallback_to_pager); | ||
38 | void exit_browser(bool wait_for_ok); | ||
39 | |||
40 | #ifdef NEWT_SUPPORT | ||
41 | int ui__init(void); | ||
42 | void ui__exit(bool wait_for_ok); | ||
43 | #else | ||
44 | static inline int ui__init(void) | ||
45 | { | ||
46 | return -1; | ||
47 | } | ||
48 | static inline void ui__exit(bool wait_for_ok __maybe_unused) {} | ||
49 | #endif | ||
50 | |||
51 | #ifdef GTK2_SUPPORT | ||
52 | int perf_gtk__init(void); | ||
53 | void perf_gtk__exit(bool wait_for_ok); | ||
54 | #else | ||
55 | static inline int perf_gtk__init(void) | ||
56 | { | ||
57 | return -1; | ||
58 | } | ||
59 | static inline void perf_gtk__exit(bool wait_for_ok __maybe_unused) {} | ||
60 | #endif | ||
61 | |||
62 | #else /* NEWT_SUPPORT || GTK2_SUPPORT */ | ||
63 | |||
64 | static inline void setup_browser(bool fallback_to_pager) | ||
65 | { | ||
66 | if (fallback_to_pager) | ||
67 | setup_pager(); | ||
68 | } | ||
69 | static inline void exit_browser(bool wait_for_ok __maybe_unused) {} | ||
70 | #endif /* NEWT_SUPPORT || GTK2_SUPPORT */ | ||
71 | |||
72 | char *alias_lookup(const char *alias); | 35 | char *alias_lookup(const char *alias); |
73 | int split_cmdline(char *cmdline, const char ***argv); | 36 | int split_cmdline(char *cmdline, const char ***argv); |
74 | 37 | ||