diff options
author | Namhyung Kim <namhyung.kim@lge.com> | 2012-09-28 05:32:00 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-10-02 16:56:01 -0400 |
commit | 95485b1cda827e4db7102ad5fde1791087a0f4c5 (patch) | |
tree | 63ea6df23c175b2780c491092b0bcf9bd7dd4746 /tools/perf/builtin-record.c | |
parent | 29a0fc9b2b6084e7a8810481df62a0fa496d8957 (diff) |
perf tools: Convert to LIBUNWIND_SUPPORT
For building perf without libunwind, we can set NO_LIBUNWIND=1 as a
argument of make. It then defines NO_LIBUNWIND_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.
Also change NO_PERF_REGS macro to HAVE_PERF_REGS for the same reason.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1348824728-14025-5-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-record.c')
-rw-r--r-- | tools/perf/builtin-record.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index f14cb5fdb91f..8c029fe2e22c 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c | |||
@@ -33,11 +33,11 @@ | |||
33 | 33 | ||
34 | #define CALLCHAIN_HELP "do call-graph (stack chain/backtrace) recording: " | 34 | #define CALLCHAIN_HELP "do call-graph (stack chain/backtrace) recording: " |
35 | 35 | ||
36 | #ifdef NO_LIBUNWIND_SUPPORT | 36 | #ifdef LIBUNWIND_SUPPORT |
37 | static char callchain_help[] = CALLCHAIN_HELP "[fp]"; | ||
38 | #else | ||
39 | static unsigned long default_stack_dump_size = 8192; | 37 | static unsigned long default_stack_dump_size = 8192; |
40 | static char callchain_help[] = CALLCHAIN_HELP "[fp] dwarf"; | 38 | static char callchain_help[] = CALLCHAIN_HELP "[fp] dwarf"; |
39 | #else | ||
40 | static char callchain_help[] = CALLCHAIN_HELP "[fp]"; | ||
41 | #endif | 41 | #endif |
42 | 42 | ||
43 | enum write_mode_t { | 43 | enum write_mode_t { |
@@ -800,7 +800,7 @@ error: | |||
800 | return ret; | 800 | return ret; |
801 | } | 801 | } |
802 | 802 | ||
803 | #ifndef NO_LIBUNWIND_SUPPORT | 803 | #ifdef LIBUNWIND_SUPPORT |
804 | static int get_stack_size(char *str, unsigned long *_size) | 804 | static int get_stack_size(char *str, unsigned long *_size) |
805 | { | 805 | { |
806 | char *endptr; | 806 | char *endptr; |
@@ -826,7 +826,7 @@ static int get_stack_size(char *str, unsigned long *_size) | |||
826 | max_size, str); | 826 | max_size, str); |
827 | return -1; | 827 | return -1; |
828 | } | 828 | } |
829 | #endif /* !NO_LIBUNWIND_SUPPORT */ | 829 | #endif /* LIBUNWIND_SUPPORT */ |
830 | 830 | ||
831 | static int | 831 | static int |
832 | parse_callchain_opt(const struct option *opt __maybe_unused, const char *arg, | 832 | parse_callchain_opt(const struct option *opt __maybe_unused, const char *arg, |
@@ -865,7 +865,7 @@ parse_callchain_opt(const struct option *opt __maybe_unused, const char *arg, | |||
865 | "needed for -g fp\n"); | 865 | "needed for -g fp\n"); |
866 | break; | 866 | break; |
867 | 867 | ||
868 | #ifndef NO_LIBUNWIND_SUPPORT | 868 | #ifdef LIBUNWIND_SUPPORT |
869 | /* Dwarf style */ | 869 | /* Dwarf style */ |
870 | } else if (!strncmp(name, "dwarf", sizeof("dwarf"))) { | 870 | } else if (!strncmp(name, "dwarf", sizeof("dwarf"))) { |
871 | ret = 0; | 871 | ret = 0; |
@@ -883,7 +883,7 @@ parse_callchain_opt(const struct option *opt __maybe_unused, const char *arg, | |||
883 | if (!ret) | 883 | if (!ret) |
884 | pr_debug("callchain: stack dump size %d\n", | 884 | pr_debug("callchain: stack dump size %d\n", |
885 | rec->opts.stack_dump_size); | 885 | rec->opts.stack_dump_size); |
886 | #endif /* !NO_LIBUNWIND_SUPPORT */ | 886 | #endif /* LIBUNWIND_SUPPORT */ |
887 | } else { | 887 | } else { |
888 | pr_err("callchain: Unknown -g option " | 888 | pr_err("callchain: Unknown -g option " |
889 | "value: %s\n", arg); | 889 | "value: %s\n", arg); |