aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/Makefile3
-rw-r--r--tools/perf/ui/ui.h28
-rw-r--r--tools/perf/util/cache.h39
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
422LIB_OBJS += $(OUTPUT)util/vdso.o 422LIB_OBJS += $(OUTPUT)util/vdso.o
423LIB_OBJS += $(OUTPUT)util/stat.o 423LIB_OBJS += $(OUTPUT)util/stat.o
424 424
425LIB_OBJS += $(OUTPUT)ui/setup.o
425LIB_OBJS += $(OUTPUT)ui/helpline.o 426LIB_OBJS += $(OUTPUT)ui/helpline.o
426LIB_OBJS += $(OUTPUT)ui/progress.o 427LIB_OBJS += $(OUTPUT)ui/progress.o
427LIB_OBJS += $(OUTPUT)ui/hist.o 428LIB_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
7extern pthread_mutex_t ui__lock; 8extern pthread_mutex_t ui__lock;
8 9
10extern int use_browser;
11
12void setup_browser(bool fallback_to_pager);
13void exit_browser(bool wait_for_ok);
14
15#ifdef NEWT_SUPPORT
16int ui__init(void);
17void ui__exit(bool wait_for_ok);
18#else
19static inline int ui__init(void)
20{
21 return -1;
22}
23static inline void ui__exit(bool wait_for_ok __maybe_unused) {}
24#endif
25
26#ifdef GTK2_SUPPORT
27int perf_gtk__init(void);
28void perf_gtk__exit(bool wait_for_ok);
29#else
30static inline int perf_gtk__init(void)
31{
32 return -1;
33}
34static inline void perf_gtk__exit(bool wait_for_ok __maybe_unused) {}
35#endif
36
9void ui__refresh_dimensions(bool force); 37void 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;
31extern int pager_in_use(void); 32extern int pager_in_use(void);
32extern int pager_use_color; 33extern int pager_use_color;
33 34
34extern int use_browser;
35
36#if defined(NEWT_SUPPORT) || defined(GTK2_SUPPORT)
37void setup_browser(bool fallback_to_pager);
38void exit_browser(bool wait_for_ok);
39
40#ifdef NEWT_SUPPORT
41int ui__init(void);
42void ui__exit(bool wait_for_ok);
43#else
44static inline int ui__init(void)
45{
46 return -1;
47}
48static inline void ui__exit(bool wait_for_ok __maybe_unused) {}
49#endif
50
51#ifdef GTK2_SUPPORT
52int perf_gtk__init(void);
53void perf_gtk__exit(bool wait_for_ok);
54#else
55static inline int perf_gtk__init(void)
56{
57 return -1;
58}
59static inline void perf_gtk__exit(bool wait_for_ok __maybe_unused) {}
60#endif
61
62#else /* NEWT_SUPPORT || GTK2_SUPPORT */
63
64static inline void setup_browser(bool fallback_to_pager)
65{
66 if (fallback_to_pager)
67 setup_pager();
68}
69static inline void exit_browser(bool wait_for_ok __maybe_unused) {}
70#endif /* NEWT_SUPPORT || GTK2_SUPPORT */
71
72char *alias_lookup(const char *alias); 35char *alias_lookup(const char *alias);
73int split_cmdline(char *cmdline, const char ***argv); 36int split_cmdline(char *cmdline, const char ***argv);
74 37