Web lists-archives.com

[PATCH] perf tool: Fix build failure when NO_AUXTRACE=1




Perf tool fails with following build failure when AUXTRACE is
not set:

  $ make NO_AUXTRACE=1
  builtin-script.c: In function 'perf_script__process_auxtrace_info':
  util/auxtrace.h:608:44: error: called object is not a function or function pointer
   #define perf_event__process_auxtrace_info  0
                                              ^

Fix it by guarding function under HAVE_AUXTRACE_SUPPORT.

Fixes: 47e5a26a916b ("perf script: Fix --per-event-dump for auxtrace synth evsels")
Signed-off-by: Ravi Bangoria <ravi.bangoria@xxxxxxxxxxxxxxxxxx>
---
 tools/perf/builtin-script.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index ad6404dcf91c..9b43bda45a41 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -2848,6 +2848,7 @@ int process_cpu_map_event(struct perf_tool *tool __maybe_unused,
 	return set_maps(script);
 }
 
+#ifdef HAVE_AUXTRACE_SUPPORT
 static int perf_script__process_auxtrace_info(struct perf_tool *tool,
 					      union perf_event *event,
 					      struct perf_session *session)
@@ -2862,6 +2863,9 @@ static int perf_script__process_auxtrace_info(struct perf_tool *tool,
 
 	return ret;
 }
+#else
+#define perf_script__process_auxtrace_info 0
+#endif
 
 int cmd_script(int argc, const char **argv)
 {
-- 
2.13.6