aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung.kim@lge.com>2012-09-28 05:32:02 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-10-02 17:36:22 -0400
commit1254b51e32649f2d34ec6b070ed36717c5a6b825 (patch)
treefd582d9f1b25e73ebc1e81da46af462451b27f0f /tools/perf/util
parentf315e16850d00ae5b19f11810bc00bf68cf3c24a (diff)
perf tools: Convert to NEWT_SUPPORT
For building perf without libnewt, we can set NO_NEWT=1 as a argument of make. It then defines NO_NEWT_SUPPORT macro for C code to do the proper handling. However it usually used in a negative semantics - e.g. #ifndef - so we saw double negations which can be misleading. Convert it to a positive form to make it more readable. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1348824728-14025-7-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util')
-rw-r--r--tools/perf/util/annotate.h8
-rw-r--r--tools/perf/util/cache.h12
-rw-r--r--tools/perf/util/debug.c2
-rw-r--r--tools/perf/util/debug.h6
-rw-r--r--tools/perf/util/hist.h18
5 files changed, 23 insertions, 23 deletions
diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h
index 9b5b21e7b032..39242dcee8f2 100644
--- a/tools/perf/util/annotate.h
+++ b/tools/perf/util/annotate.h
@@ -138,7 +138,10 @@ int symbol__tty_annotate(struct symbol *sym, struct map *map, int evidx,
138 bool print_lines, bool full_paths, int min_pcnt, 138 bool print_lines, bool full_paths, int min_pcnt,
139 int max_lines); 139 int max_lines);
140 140
141#ifdef NO_NEWT_SUPPORT 141#ifdef NEWT_SUPPORT
142int symbol__tui_annotate(struct symbol *sym, struct map *map, int evidx,
143 void(*timer)(void *arg), void *arg, int delay_secs);
144#else
142static inline int symbol__tui_annotate(struct symbol *sym __maybe_unused, 145static inline int symbol__tui_annotate(struct symbol *sym __maybe_unused,
143 struct map *map __maybe_unused, 146 struct map *map __maybe_unused,
144 int evidx __maybe_unused, 147 int evidx __maybe_unused,
@@ -148,9 +151,6 @@ static inline int symbol__tui_annotate(struct symbol *sym __maybe_unused,
148{ 151{
149 return 0; 152 return 0;
150} 153}
151#else
152int symbol__tui_annotate(struct symbol *sym, struct map *map, int evidx,
153 void(*timer)(void *arg), void *arg, int delay_secs);
154#endif 154#endif
155 155
156extern const char *disassembler_style; 156extern const char *disassembler_style;
diff --git a/tools/perf/util/cache.h b/tools/perf/util/cache.h
index ab1769426541..70f318dc1d9a 100644
--- a/tools/perf/util/cache.h
+++ b/tools/perf/util/cache.h
@@ -33,7 +33,7 @@ extern int pager_use_color;
33 33
34extern int use_browser; 34extern int use_browser;
35 35
36#if defined(NO_NEWT_SUPPORT) && defined(NO_GTK2_SUPPORT) 36#if !defined(NEWT_SUPPORT) && defined(NO_GTK2_SUPPORT)
37static inline void setup_browser(bool fallback_to_pager) 37static inline void setup_browser(bool fallback_to_pager)
38{ 38{
39 if (fallback_to_pager) 39 if (fallback_to_pager)
@@ -44,15 +44,15 @@ static inline void exit_browser(bool wait_for_ok __maybe_unused) {}
44void setup_browser(bool fallback_to_pager); 44void setup_browser(bool fallback_to_pager);
45void exit_browser(bool wait_for_ok); 45void exit_browser(bool wait_for_ok);
46 46
47#ifdef NO_NEWT_SUPPORT 47#ifdef NEWT_SUPPORT
48int ui__init(void);
49void ui__exit(bool wait_for_ok);
50#else
48static inline int ui__init(void) 51static inline int ui__init(void)
49{ 52{
50 return -1; 53 return -1;
51} 54}
52static inline void ui__exit(bool wait_for_ok __maybe_unused) {} 55static inline void ui__exit(bool wait_for_ok __maybe_unused) {}
53#else
54int ui__init(void);
55void ui__exit(bool wait_for_ok);
56#endif 56#endif
57 57
58#ifdef NO_GTK2_SUPPORT 58#ifdef NO_GTK2_SUPPORT
@@ -65,7 +65,7 @@ static inline void perf_gtk__exit(bool wait_for_ok __maybe_unused) {}
65int perf_gtk__init(void); 65int perf_gtk__init(void);
66void perf_gtk__exit(bool wait_for_ok); 66void perf_gtk__exit(bool wait_for_ok);
67#endif 67#endif
68#endif /* NO_NEWT_SUPPORT && NO_GTK2_SUPPORT */ 68#endif /* !NEWT_SUPPORT && NO_GTK2_SUPPORT */
69 69
70char *alias_lookup(const char *alias); 70char *alias_lookup(const char *alias);
71int split_cmdline(char *cmdline, const char ***argv); 71int split_cmdline(char *cmdline, const char ***argv);
diff --git a/tools/perf/util/debug.c b/tools/perf/util/debug.c
index 66eb3828ceb5..0f6ad7037d9c 100644
--- a/tools/perf/util/debug.c
+++ b/tools/perf/util/debug.c
@@ -49,7 +49,7 @@ int dump_printf(const char *fmt, ...)
49 return ret; 49 return ret;
50} 50}
51 51
52#if defined(NO_NEWT_SUPPORT) && defined(NO_GTK2_SUPPORT) 52#if !defined(NEWT_SUPPORT) && defined(NO_GTK2_SUPPORT)
53int ui__warning(const char *format, ...) 53int ui__warning(const char *format, ...)
54{ 54{
55 va_list args; 55 va_list args;
diff --git a/tools/perf/util/debug.h b/tools/perf/util/debug.h
index bb2e7d1007ab..3fe9ade7a2c2 100644
--- a/tools/perf/util/debug.h
+++ b/tools/perf/util/debug.h
@@ -15,7 +15,7 @@ void trace_event(union perf_event *event);
15struct ui_progress; 15struct ui_progress;
16struct perf_error_ops; 16struct perf_error_ops;
17 17
18#if defined(NO_NEWT_SUPPORT) && defined(NO_GTK2_SUPPORT) 18#if !defined(NEWT_SUPPORT) && defined(NO_GTK2_SUPPORT)
19static inline void ui_progress__update(u64 curr __maybe_unused, 19static inline void ui_progress__update(u64 curr __maybe_unused,
20 u64 total __maybe_unused, 20 u64 total __maybe_unused,
21 const char *title __maybe_unused) {} 21 const char *title __maybe_unused) {}
@@ -34,13 +34,13 @@ perf_error__unregister(struct perf_error_ops *eops __maybe_unused)
34 return 0; 34 return 0;
35} 35}
36 36
37#else /* NO_NEWT_SUPPORT && NO_GTK2_SUPPORT */ 37#else /* !NEWT_SUPPORT && NO_GTK2_SUPPORT */
38 38
39#include "../ui/progress.h" 39#include "../ui/progress.h"
40int ui__error(const char *format, ...) __attribute__((format(printf, 1, 2))); 40int ui__error(const char *format, ...) __attribute__((format(printf, 1, 2)));
41#include "../ui/util.h" 41#include "../ui/util.h"
42 42
43#endif /* NO_NEWT_SUPPORT && NO_GTK2_SUPPORT */ 43#endif /* !NEWT_SUPPORT && NO_GTK2_SUPPORT */
44 44
45int ui__warning(const char *format, ...) __attribute__((format(printf, 1, 2))); 45int ui__warning(const char *format, ...) __attribute__((format(printf, 1, 2)));
46int ui__error_paranoid(void); 46int ui__error_paranoid(void);
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
index f011ad4756e8..843638d0287f 100644
--- a/tools/perf/util/hist.h
+++ b/tools/perf/util/hist.h
@@ -154,7 +154,15 @@ int hist_entry__period_snprintf(struct perf_hpp *hpp, struct hist_entry *he,
154 154
155struct perf_evlist; 155struct perf_evlist;
156 156
157#ifdef NO_NEWT_SUPPORT 157#ifdef NEWT_SUPPORT
158#include "../ui/keysyms.h"
159int hist_entry__tui_annotate(struct hist_entry *he, int evidx,
160 void(*timer)(void *arg), void *arg, int delay_secs);
161
162int perf_evlist__tui_browse_hists(struct perf_evlist *evlist, const char *help,
163 void(*timer)(void *arg), void *arg,
164 int refresh);
165#else
158static inline 166static inline
159int perf_evlist__tui_browse_hists(struct perf_evlist *evlist __maybe_unused, 167int perf_evlist__tui_browse_hists(struct perf_evlist *evlist __maybe_unused,
160 const char *help __maybe_unused, 168 const char *help __maybe_unused,
@@ -177,14 +185,6 @@ static inline int hist_entry__tui_annotate(struct hist_entry *self
177} 185}
178#define K_LEFT -1 186#define K_LEFT -1
179#define K_RIGHT -2 187#define K_RIGHT -2
180#else
181#include "../ui/keysyms.h"
182int hist_entry__tui_annotate(struct hist_entry *he, int evidx,
183 void(*timer)(void *arg), void *arg, int delay_secs);
184
185int perf_evlist__tui_browse_hists(struct perf_evlist *evlist, const char *help,
186 void(*timer)(void *arg), void *arg,
187 int refresh);
188#endif 188#endif
189 189
190#ifdef NO_GTK2_SUPPORT 190#ifdef NO_GTK2_SUPPORT