aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2013-03-28 10:34:10 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-04-01 11:23:21 -0400
commit6692c262df4f087b1f0d3a57b31ef4cee9b1c6cb (patch)
tree8f82d20add63ab3ea90eb256ee312d8c3c5e2cbf /tools
parenta403253634141137e9a0585a6044e7c059c92f1b (diff)
perf tools: Remove dependency on libnewt
Now that the map browser shares the input routine with the hists browser, there is no need for using any libnewt routine, so remove all traces except for honouring NO_NEWT=1 on the makefile command line as an indication that TUI support is not needed, in fact it just sets NO_SLANG=1. 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: Namhyung Kim <namhyung@gmail.com> 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-wae5o7xca9m52bj1re28jc5j@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/Makefile20
-rw-r--r--tools/perf/builtin-report.c6
-rw-r--r--tools/perf/config/feature-tests.mak12
-rw-r--r--tools/perf/ui/browser.c9
-rw-r--r--tools/perf/ui/browser.h1
-rw-r--r--tools/perf/ui/browsers/annotate.c1
-rw-r--r--tools/perf/ui/browsers/hists.c1
-rw-r--r--tools/perf/ui/browsers/scripts.c1
-rw-r--r--tools/perf/ui/tui/setup.c21
-rw-r--r--tools/perf/ui/ui.h2
-rw-r--r--tools/perf/util/annotate.h2
-rw-r--r--tools/perf/util/hist.h2
12 files changed, 43 insertions, 35 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 8b4c9529e22a..b0f164b133d9 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -35,7 +35,9 @@ include config/utilities.mak
35# 35#
36# Define WERROR=0 to disable treating any warnings as errors. 36# Define WERROR=0 to disable treating any warnings as errors.
37# 37#
38# Define NO_NEWT if you do not want TUI support. 38# Define NO_NEWT if you do not want TUI support. (deprecated)
39#
40# Define NO_SLANG if you do not want TUI support.
39# 41#
40# Define NO_GTK2 if you do not want GTK+ GUI support. 42# Define NO_GTK2 if you do not want GTK+ GUI support.
41# 43#
@@ -104,6 +106,10 @@ ifdef PARSER_DEBUG
104 PARSER_DEBUG_CFLAGS := -DPARSER_DEBUG 106 PARSER_DEBUG_CFLAGS := -DPARSER_DEBUG
105endif 107endif
106 108
109ifdef NO_NEWT
110 NO_SLANG=1
111endif
112
107CFLAGS = -fno-omit-frame-pointer -ggdb3 -funwind-tables -Wall -Wextra -std=gnu99 $(CFLAGS_WERROR) $(CFLAGS_OPTIMIZE) $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) $(PARSER_DEBUG_CFLAGS) 113CFLAGS = -fno-omit-frame-pointer -ggdb3 -funwind-tables -Wall -Wextra -std=gnu99 $(CFLAGS_WERROR) $(CFLAGS_OPTIMIZE) $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) $(PARSER_DEBUG_CFLAGS)
108EXTLIBS = -lpthread -lrt -lelf -lm 114EXTLIBS = -lpthread -lrt -lelf -lm
109ALL_CFLAGS = $(CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE 115ALL_CFLAGS = $(CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
@@ -680,15 +686,15 @@ ifndef NO_LIBAUDIT
680 endif 686 endif
681endif 687endif
682 688
683ifndef NO_NEWT 689ifndef NO_SLANG
684 FLAGS_NEWT=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -lnewt 690 FLAGS_SLANG=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -I/usr/include/slang -lslang
685 ifneq ($(call try-cc,$(SOURCE_NEWT),$(FLAGS_NEWT),libnewt),y) 691 ifneq ($(call try-cc,$(SOURCE_SLANG),$(FLAGS_SLANG),libslang),y)
686 msg := $(warning newt not found, disables TUI support. Please install newt-devel or libnewt-dev); 692 msg := $(warning slang not found, disables TUI support. Please install slang-devel or libslang-dev);
687 else 693 else
688 # Fedora has /usr/include/slang/slang.h, but ubuntu /usr/include/slang.h 694 # Fedora has /usr/include/slang/slang.h, but ubuntu /usr/include/slang.h
689 BASIC_CFLAGS += -I/usr/include/slang 695 BASIC_CFLAGS += -I/usr/include/slang
690 BASIC_CFLAGS += -DNEWT_SUPPORT 696 BASIC_CFLAGS += -DSLANG_SUPPORT
691 EXTLIBS += -lnewt -lslang 697 EXTLIBS += -lslang
692 LIB_OBJS += $(OUTPUT)ui/browser.o 698 LIB_OBJS += $(OUTPUT)ui/browser.o
693 LIB_OBJS += $(OUTPUT)ui/browsers/annotate.o 699 LIB_OBJS += $(OUTPUT)ui/browsers/annotate.o
694 LIB_OBJS += $(OUTPUT)ui/browsers/hists.o 700 LIB_OBJS += $(OUTPUT)ui/browsers/hists.o
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index a20550c9cd68..bd0ca81eeaca 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -111,7 +111,7 @@ static int perf_report__add_mem_hist_entry(struct perf_tool *tool,
111 return -ENOMEM; 111 return -ENOMEM;
112 112
113 /* 113 /*
114 * In the newt browser, we are doing integrated annotation, 114 * In the TUI browser, we are doing integrated annotation,
115 * so we don't allocate the extra space needed because the stdio 115 * so we don't allocate the extra space needed because the stdio
116 * code will not use it. 116 * code will not use it.
117 */ 117 */
@@ -263,7 +263,7 @@ static int perf_evsel__add_hist_entry(struct perf_evsel *evsel,
263 return err; 263 return err;
264 } 264 }
265 /* 265 /*
266 * Only in the newt browser we are doing integrated annotation, 266 * Only in the TUI browser we are doing integrated annotation,
267 * so we don't allocated the extra space needed because the stdio 267 * so we don't allocated the extra space needed because the stdio
268 * code will not use it. 268 * code will not use it.
269 */ 269 */
@@ -877,7 +877,7 @@ repeat:
877 usage_with_options(report_usage, options); 877 usage_with_options(report_usage, options);
878 878
879 /* 879 /*
880 * Only in the newt browser we are doing integrated annotation, 880 * Only in the TUI browser we are doing integrated annotation,
881 * so don't allocate extra space that won't be used in the stdio 881 * so don't allocate extra space that won't be used in the stdio
882 * implementation. 882 * implementation.
883 */ 883 */
diff --git a/tools/perf/config/feature-tests.mak b/tools/perf/config/feature-tests.mak
index b4eabb44e381..708fb8e9822a 100644
--- a/tools/perf/config/feature-tests.mak
+++ b/tools/perf/config/feature-tests.mak
@@ -61,15 +61,13 @@ int main(void)
61} 61}
62endef 62endef
63 63
64ifndef NO_NEWT 64ifndef NO_SLANG
65define SOURCE_NEWT 65define SOURCE_SLANG
66#include <newt.h> 66#include <slang.h>
67 67
68int main(void) 68int main(void)
69{ 69{
70 newtInit(); 70 return SLsmg_init_smg();
71 newtCls();
72 return newtFinished();
73} 71}
74endef 72endef
75endif 73endif
@@ -235,4 +233,4 @@ int main(void)
235 numa_available(); 233 numa_available();
236 return 0; 234 return 0;
237} 235}
238endef \ No newline at end of file 236endef
diff --git a/tools/perf/ui/browser.c b/tools/perf/ui/browser.c
index 809ea4632a34..bbc782e364b0 100644
--- a/tools/perf/ui/browser.c
+++ b/tools/perf/ui/browser.c
@@ -2,7 +2,6 @@
2#include "../cache.h" 2#include "../cache.h"
3#include "../../perf.h" 3#include "../../perf.h"
4#include "libslang.h" 4#include "libslang.h"
5#include <newt.h>
6#include "ui.h" 5#include "ui.h"
7#include "util.h" 6#include "util.h"
8#include <linux/compiler.h> 7#include <linux/compiler.h>
@@ -234,7 +233,7 @@ void ui_browser__reset_index(struct ui_browser *browser)
234void __ui_browser__show_title(struct ui_browser *browser, const char *title) 233void __ui_browser__show_title(struct ui_browser *browser, const char *title)
235{ 234{
236 SLsmg_gotorc(0, 0); 235 SLsmg_gotorc(0, 0);
237 ui_browser__set_color(browser, NEWT_COLORSET_ROOT); 236 ui_browser__set_color(browser, HE_COLORSET_ROOT);
238 slsmg_write_nstring(title, browser->width + 1); 237 slsmg_write_nstring(title, browser->width + 1);
239} 238}
240 239
@@ -514,6 +513,12 @@ static struct ui_browser_colorset {
514 .bg = "default", 513 .bg = "default",
515 }, 514 },
516 { 515 {
516 .colorset = HE_COLORSET_ROOT,
517 .name = "root",
518 .fg = "white",
519 .bg = "blue",
520 },
521 {
517 .name = NULL, 522 .name = NULL,
518 } 523 }
519}; 524};
diff --git a/tools/perf/ui/browser.h b/tools/perf/ui/browser.h
index af70314605e5..404ff66a3e36 100644
--- a/tools/perf/ui/browser.h
+++ b/tools/perf/ui/browser.h
@@ -11,6 +11,7 @@
11#define HE_COLORSET_SELECTED 53 11#define HE_COLORSET_SELECTED 53
12#define HE_COLORSET_CODE 54 12#define HE_COLORSET_CODE 54
13#define HE_COLORSET_ADDR 55 13#define HE_COLORSET_ADDR 55
14#define HE_COLORSET_ROOT 56
14 15
15struct ui_browser { 16struct ui_browser {
16 u64 index, top_idx; 17 u64 index, top_idx;
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c
index f56247a03a22..cc64d3f7fc36 100644
--- a/tools/perf/ui/browsers/annotate.c
+++ b/tools/perf/ui/browsers/annotate.c
@@ -10,7 +10,6 @@
10#include "../../util/symbol.h" 10#include "../../util/symbol.h"
11#include "../../util/evsel.h" 11#include "../../util/evsel.h"
12#include <pthread.h> 12#include <pthread.h>
13#include <newt.h>
14 13
15struct browser_disasm_line { 14struct browser_disasm_line {
16 struct rb_node rb_node; 15 struct rb_node rb_node;
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index a5843fd6ab51..d88a2d0acb6d 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -2,7 +2,6 @@
2#include "../libslang.h" 2#include "../libslang.h"
3#include <stdlib.h> 3#include <stdlib.h>
4#include <string.h> 4#include <string.h>
5#include <newt.h>
6#include <linux/rbtree.h> 5#include <linux/rbtree.h>
7 6
8#include "../../util/evsel.h" 7#include "../../util/evsel.h"
diff --git a/tools/perf/ui/browsers/scripts.c b/tools/perf/ui/browsers/scripts.c
index cbbd44b0d93e..12f009e61e94 100644
--- a/tools/perf/ui/browsers/scripts.c
+++ b/tools/perf/ui/browsers/scripts.c
@@ -1,5 +1,4 @@
1#include <elf.h> 1#include <elf.h>
2#include <newt.h>
3#include <inttypes.h> 2#include <inttypes.h>
4#include <sys/ttydefaults.h> 3#include <sys/ttydefaults.h>
5#include <string.h> 4#include <string.h>
diff --git a/tools/perf/ui/tui/setup.c b/tools/perf/ui/tui/setup.c
index 81efa192e86c..b9401482d110 100644
--- a/tools/perf/ui/tui/setup.c
+++ b/tools/perf/ui/tui/setup.c
@@ -1,4 +1,3 @@
1#include <newt.h>
2#include <signal.h> 1#include <signal.h>
3#include <stdbool.h> 2#include <stdbool.h>
4 3
@@ -88,13 +87,6 @@ int ui__getch(int delay_secs)
88 return SLkp_getkey(); 87 return SLkp_getkey();
89} 88}
90 89
91static void newt_suspend(void *d __maybe_unused)
92{
93 newtSuspend();
94 raise(SIGTSTP);
95 newtResume();
96}
97
98static void ui__signal(int sig) 90static void ui__signal(int sig)
99{ 91{
100 ui__exit(false); 92 ui__exit(false);
@@ -106,7 +98,17 @@ int ui__init(void)
106{ 98{
107 int err; 99 int err;
108 100
109 newtInit(); 101 SLutf8_enable(-1);
102 SLtt_get_terminfo();
103 SLtt_get_screen_size();
104
105 err = SLsmg_init_smg();
106 if (err < 0)
107 goto out;
108 err = SLang_init_tty(0, 0, 0);
109 if (err < 0)
110 goto out;
111
110 err = SLkp_init(); 112 err = SLkp_init();
111 if (err < 0) { 113 if (err < 0) {
112 pr_err("TUI initialization failed.\n"); 114 pr_err("TUI initialization failed.\n");
@@ -115,7 +117,6 @@ int ui__init(void)
115 117
116 SLkp_define_keysym((char *)"^(kB)", SL_KEY_UNTAB); 118 SLkp_define_keysym((char *)"^(kB)", SL_KEY_UNTAB);
117 119
118 newtSetSuspendCallback(newt_suspend, NULL);
119 ui_helpline__init(); 120 ui_helpline__init();
120 ui_browser__init(); 121 ui_browser__init();
121 ui_progress__init(); 122 ui_progress__init();
diff --git a/tools/perf/ui/ui.h b/tools/perf/ui/ui.h
index d86359c99907..70cb0d4eb8aa 100644
--- a/tools/perf/ui/ui.h
+++ b/tools/perf/ui/ui.h
@@ -12,7 +12,7 @@ extern int use_browser;
12void setup_browser(bool fallback_to_pager); 12void setup_browser(bool fallback_to_pager);
13void exit_browser(bool wait_for_ok); 13void exit_browser(bool wait_for_ok);
14 14
15#ifdef NEWT_SUPPORT 15#ifdef SLANG_SUPPORT
16int ui__init(void); 16int ui__init(void);
17void ui__exit(bool wait_for_ok); 17void ui__exit(bool wait_for_ok);
18#else 18#else
diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h
index 6f3c16f01ab4..af755156d278 100644
--- a/tools/perf/util/annotate.h
+++ b/tools/perf/util/annotate.h
@@ -150,7 +150,7 @@ int symbol__tty_annotate(struct symbol *sym, struct map *map,
150 struct perf_evsel *evsel, bool print_lines, 150 struct perf_evsel *evsel, bool print_lines,
151 bool full_paths, int min_pcnt, int max_lines); 151 bool full_paths, int min_pcnt, int max_lines);
152 152
153#ifdef NEWT_SUPPORT 153#ifdef SLANG_SUPPORT
154int symbol__tui_annotate(struct symbol *sym, struct map *map, 154int symbol__tui_annotate(struct symbol *sym, struct map *map,
155 struct perf_evsel *evsel, 155 struct perf_evsel *evsel,
156 struct hist_browser_timer *hbt); 156 struct hist_browser_timer *hbt);
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
index fd6313416476..14c2fe20aa62 100644
--- a/tools/perf/util/hist.h
+++ b/tools/perf/util/hist.h
@@ -192,7 +192,7 @@ struct hist_browser_timer {
192 int refresh; 192 int refresh;
193}; 193};
194 194
195#ifdef NEWT_SUPPORT 195#ifdef SLANG_SUPPORT
196#include "../ui/keysyms.h" 196#include "../ui/keysyms.h"
197int hist_entry__tui_annotate(struct hist_entry *he, struct perf_evsel *evsel, 197int hist_entry__tui_annotate(struct hist_entry *he, struct perf_evsel *evsel,
198 struct hist_browser_timer *hbt); 198 struct hist_browser_timer *hbt);