Skip to contentSkip to conversation

perf probe: Fix build failure

PATCH In review Li Zefan 2 participants 5 messages Jan 14, 2010 perf events

lore
Share & tools
lore

Li Zefan

author
#0 lore raw

PATCH 1/1 perf probe: Fix build failure

builtin-probe.c:121: error: 'opt_show_lines' defined but not used

---
 tools/perf/builtin-probe.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
tools/perf/builtin-probe.c +3 -0
index 1d3a99e..9be8063 100644
@@ -118,6 +118,7 @@ static int opt_del_probe_event(const struct option *opt __used,
 	return 0;
 }
 
+#ifndef NO_LIBDWARF
 static int opt_show_lines(const struct option *opt __used,
 			  const char *str, int unset __used)
 {
@@ -127,6 +128,8 @@ static int opt_show_lines(const struct option *opt __used,
 	session.show_lines = true;
 	return 0;
 }
+#endif
+
 /* Currently just checking function name from symbol map */
 static void evaluate_probe_point(struct probe_point *pp)
 {
Signature · 1 line
1.6.3
#1 lore raw

Hi,

Thank you, the patch code looks good to me.

Quoted 1 line · Li Zefan

builtin-probe.c:121: error: 'opt_show_lines' defined but not used

Please add some comment for explanation, like:

This build error occurs when compiling perf-tools without dwarf support (no libdwarf).

Quoted 27 lines
---
 tools/perf/builtin-probe.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
tools/perf/builtin-probe.c +3 -0
index 1d3a99e..9be8063 100644
@@ -118,6 +118,7 @@ static int opt_del_probe_event(const struct option *opt __used,
 	return 0;
 }
 
+#ifndef NO_LIBDWARF
 static int opt_show_lines(const struct option *opt __used,
 			  const char *str, int unset __used)
 {
@@ -127,6 +128,8 @@ static int opt_show_lines(const struct option *opt __used,
 	session.show_lines = true;
 	return 0;
 }
+#endif
+
 /* Currently just checking function name from symbol map */
 static void evaluate_probe_point(struct probe_point *pp)
 {
Signature · 7 lines
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America), Inc.
Software Solutions Division

e-mail: [email protected]
author
#2 lore raw
Quoted 4 lines · Masami Hiramatsu

Hi,

Thank you, the patch code looks good to me.

Quoted 8 lines
Quoted 1 line · Li Zefan

builtin-probe.c:121: error: 'opt_show_lines' defined but not used

Please add some comment for explanation, like:

This build error occurs when compiling perf-tools without dwarf support (no libdwarf).

But as simple as this patch, the code itself has explained the cause of this compile error.

#3 lore raw
Quoted 8 lines · Li Zefan
Quoted 7 lines · Masami Hiramatsu

Hi,

Thank you, the patch code looks good to me.

Quoted 1 line · Li Zefan

builtin-probe.c:121: error: 'opt_show_lines' defined but not used

Quoted 8 lines
Quoted 5 lines

Please add some comment for explanation, like:

This build error occurs when compiling perf-tools without dwarf support (no libdwarf).

But as simple as this patch, the code itself has explained the cause of this compile error.

If someone looks git-log afterwords, below message seems too short.
---
perf probe: Fix build failure

builtin-probe.c:121: error: 'opt_show_lines' defined but not used
---
Especially, if there is libdwarf, we will not see above error. So IMHO, at least we'd better add a comment about how the error occurs.

Thank you,

Signature · 7 lines
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America), Inc.
Software Solutions Division

e-mail: [email protected]
author Acked-by Masami Hiramatsu
#4 lore raw
Quoted 14 lines
Quoted 8 lines
Quoted 6 lines
Quoted 1 line

builtin-probe.c:121: error: 'opt_show_lines' defined but not used

Please add some comment for explanation, like:

This build error occurs when compiling perf-tools without dwarf support (no libdwarf).

But as simple as this patch, the code itself has explained the cause of this compile error.

If someone looks git-log afterwords, below message seems too short.
---
perf probe: Fix build failure

Quoted 5 lines

builtin-probe.c:121: error: 'opt_show_lines' defined but not used
---
Especially, if there is libdwarf, we will not see above error. So IMHO, at least we'd better add a comment about how the error occurs.

Fair enough, here's the updated patch, and I guess I can add you acked-by.

=============

From: Li Zefan <[email protected]>
Subject: [PATCH] perf probe: Fix build failure

When compiling perf-tools without dwarf support, I ran into this:

builtin-probe.c:121: error: 'opt_show_lines' defined but not used

---
 tools/perf/builtin-probe.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
tools/perf/builtin-probe.c +3 -0
index 1d3a99e..9be8063 100644
@@ -118,6 +118,7 @@ static int opt_del_probe_event(const struct option *opt __used,
 	return 0;
 }
 
+#ifndef NO_LIBDWARF
 static int opt_show_lines(const struct option *opt __used,
 			  const char *str, int unset __used)
 {
@@ -127,6 +128,8 @@ static int opt_show_lines(const struct option *opt __used,
 	session.show_lines = true;
 	return 0;
 }
+#endif
+
 /* Currently just checking function name from symbol map */
 static void evaluate_probe_point(struct probe_point *pp)
 {
Signature · 1 line
1.6.3