diff options
author | Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp> | 2010-01-16 07:31:16 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-01-17 01:55:19 -0500 |
commit | 0eda7385db1f30271ade830a231006938a76fb53 (patch) | |
tree | 8b9bf7f38c631907125f7353806be72b14f24978 /tools | |
parent | 69e3f52d1b1a3ed4390bb8a09bb1324265af7fbf (diff) |
perf probe: Fix build error of builtin-probe.c
I got this build error when building tip tree:
| cc1: warnings being treated as errors
| builtin-probe.c:123: error: 'opt_show_lines' defined but not used
This error is caused by:
| #ifndef NO_LIBDWARF
| OPT_CALLBACK('L', "line", NULL,
| "FUNC[:RLN[+NUM|:RLN2]]|SRC:ALN[+NUM|:ALN2]",
| "Show source code lines.", opt_show_lines),
| #endif
My environment defines NO_LIBDWARF, so gcc treated
opt_show_lines() as garbage. So I moved opt_show_lines() into
#ifndef NO_LIBDWARF ... #endif block.
Signed-off-by: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
LKML-Reference: <1263645076-9993-1-git-send-email-mitake@dcl.info.waseda.ac.jp>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/builtin-probe.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c index 1d3a99ea5ce1..34f2acb1cc88 100644 --- a/tools/perf/builtin-probe.c +++ b/tools/perf/builtin-probe.c | |||
@@ -118,15 +118,6 @@ static int opt_del_probe_event(const struct option *opt __used, | |||
118 | return 0; | 118 | return 0; |
119 | } | 119 | } |
120 | 120 | ||
121 | static int opt_show_lines(const struct option *opt __used, | ||
122 | const char *str, int unset __used) | ||
123 | { | ||
124 | if (str) | ||
125 | parse_line_range_desc(str, &session.line_range); | ||
126 | INIT_LIST_HEAD(&session.line_range.line_list); | ||
127 | session.show_lines = true; | ||
128 | return 0; | ||
129 | } | ||
130 | /* Currently just checking function name from symbol map */ | 121 | /* Currently just checking function name from symbol map */ |
131 | static void evaluate_probe_point(struct probe_point *pp) | 122 | static void evaluate_probe_point(struct probe_point *pp) |
132 | { | 123 | { |
@@ -148,6 +139,16 @@ static int open_vmlinux(void) | |||
148 | pr_debug("Try to open %s\n", session.kmap->dso->long_name); | 139 | pr_debug("Try to open %s\n", session.kmap->dso->long_name); |
149 | return open(session.kmap->dso->long_name, O_RDONLY); | 140 | return open(session.kmap->dso->long_name, O_RDONLY); |
150 | } | 141 | } |
142 | |||
143 | static int opt_show_lines(const struct option *opt __used, | ||
144 | const char *str, int unset __used) | ||
145 | { | ||
146 | if (str) | ||
147 | parse_line_range_desc(str, &session.line_range); | ||
148 | INIT_LIST_HEAD(&session.line_range.line_list); | ||
149 | session.show_lines = true; | ||
150 | return 0; | ||
151 | } | ||
151 | #endif | 152 | #endif |
152 | 153 | ||
153 | static const char * const probe_usage[] = { | 154 | static const char * const probe_usage[] = { |