* [PATCH] perf probe: Remove build error of builtin-probe.c
@ 2010-01-16 12:31 Hitoshi Mitake
2010-01-17 6:59 ` [tip:perf/core] perf probe: Fix " tip-bot for Hitoshi Mitake
0 siblings, 1 reply; 2+ messages in thread
From: Hitoshi Mitake @ 2010-01-16 12:31 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Hitoshi Mitake, Peter Zijlstra, Paul Mackerras,
Frederic Weisbecker, Masami Hiramatsu
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>
---
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 1d3a99e..34f2acb 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,
return 0;
}
-static int opt_show_lines(const struct option *opt __used,
- const char *str, int unset __used)
-{
- if (str)
- parse_line_range_desc(str, &session.line_range);
- INIT_LIST_HEAD(&session.line_range.line_list);
- session.show_lines = true;
- return 0;
-}
/* Currently just checking function name from symbol map */
static void evaluate_probe_point(struct probe_point *pp)
{
@@ -148,6 +139,16 @@ static int open_vmlinux(void)
pr_debug("Try to open %s\n", session.kmap->dso->long_name);
return open(session.kmap->dso->long_name, O_RDONLY);
}
+
+static int opt_show_lines(const struct option *opt __used,
+ const char *str, int unset __used)
+{
+ if (str)
+ parse_line_range_desc(str, &session.line_range);
+ INIT_LIST_HEAD(&session.line_range.line_list);
+ session.show_lines = true;
+ return 0;
+}
#endif
static const char * const probe_usage[] = {
--
1.6.5.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [tip:perf/core] perf probe: Fix build error of builtin-probe.c
2010-01-16 12:31 [PATCH] perf probe: Remove build error of builtin-probe.c Hitoshi Mitake
@ 2010-01-17 6:59 ` tip-bot for Hitoshi Mitake
0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Hitoshi Mitake @ 2010-01-17 6:59 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, paulus, hpa, mingo, a.p.zijlstra, efault, mitake,
fweisbec, tglx, mhiramat, mingo
Commit-ID: 0eda7385db1f30271ade830a231006938a76fb53
Gitweb: http://git.kernel.org/tip/0eda7385db1f30271ade830a231006938a76fb53
Author: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
AuthorDate: Sat, 16 Jan 2010 21:31:16 +0900
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Sun, 17 Jan 2010 07:55:19 +0100
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>
---
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 1d3a99e..34f2acb 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,
return 0;
}
-static int opt_show_lines(const struct option *opt __used,
- const char *str, int unset __used)
-{
- if (str)
- parse_line_range_desc(str, &session.line_range);
- INIT_LIST_HEAD(&session.line_range.line_list);
- session.show_lines = true;
- return 0;
-}
/* Currently just checking function name from symbol map */
static void evaluate_probe_point(struct probe_point *pp)
{
@@ -148,6 +139,16 @@ static int open_vmlinux(void)
pr_debug("Try to open %s\n", session.kmap->dso->long_name);
return open(session.kmap->dso->long_name, O_RDONLY);
}
+
+static int opt_show_lines(const struct option *opt __used,
+ const char *str, int unset __used)
+{
+ if (str)
+ parse_line_range_desc(str, &session.line_range);
+ INIT_LIST_HEAD(&session.line_range.line_list);
+ session.show_lines = true;
+ return 0;
+}
#endif
static const char * const probe_usage[] = {
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-01-17 7:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-16 12:31 [PATCH] perf probe: Remove build error of builtin-probe.c Hitoshi Mitake
2010-01-17 6:59 ` [tip:perf/core] perf probe: Fix " tip-bot for Hitoshi Mitake
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox