[PATCH 18/32] perf tools: Do not attempt to run perf-read-vdso32 if it wasn't built

From: Arnaldo Carvalho de Melo
Date: Tue Oct 28 2014 - 09:34:12 EST


From: Adrian Hunter <adrian.hunter@xxxxxxxxx>

popen() causes an error message to print if perf-read-vdso32 does not
run. Avoid that by not trying to run it if it was not built. Ditto
perf-read-vdsox32.

Signed-off-by: Adrian Hunter <adrian.hunter@xxxxxxxxx>
Cc: David Ahern <dsahern@xxxxxxxxx>
Cc: Frederic Weisbecker <fweisbec@xxxxxxxxx>
Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxx>
Cc: Paul Mackerras <paulus@xxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Stephane Eranian <eranian@xxxxxxxxxx>
Link: http://lkml.kernel.org/r/1414061124-26830-17-git-send-email-adrian.hunter@xxxxxxxxx
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
tools/perf/config/Makefile | 8 ++++++--
tools/perf/util/vdso.c | 10 ++++++++++
2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 3ba2382a5236..71264e41fa85 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -627,7 +627,9 @@ endif
ifeq (${IS_64_BIT}, 1)
ifndef NO_PERF_READ_VDSO32
$(call feature_check,compile-32)
- ifneq ($(feature-compile-32), 1)
+ ifeq ($(feature-compile-32), 1)
+ CFLAGS += -DHAVE_PERF_READ_VDSO32
+ else
NO_PERF_READ_VDSO32 := 1
endif
endif
@@ -636,7 +638,9 @@ ifeq (${IS_64_BIT}, 1)
endif
ifndef NO_PERF_READ_VDSOX32
$(call feature_check,compile-x32)
- ifneq ($(feature-compile-x32), 1)
+ ifeq ($(feature-compile-x32), 1)
+ CFLAGS += -DHAVE_PERF_READ_VDSOX32
+ else
NO_PERF_READ_VDSOX32 := 1
endif
endif
diff --git a/tools/perf/util/vdso.c b/tools/perf/util/vdso.c
index 69daef6a17d5..5c7dd796979d 100644
--- a/tools/perf/util/vdso.c
+++ b/tools/perf/util/vdso.c
@@ -255,6 +255,16 @@ static int vdso__dso_findnew_compat(struct machine *machine,
enum dso_type dso_type;

dso_type = machine__thread_dso_type(machine, thread);
+
+#ifndef HAVE_PERF_READ_VDSO32
+ if (dso_type == DSO__TYPE_32BIT)
+ return 0;
+#endif
+#ifndef HAVE_PERF_READ_VDSOX32
+ if (dso_type == DSO__TYPE_X32BIT)
+ return 0;
+#endif
+
switch (dso_type) {
case DSO__TYPE_32BIT:
*dso = vdso__findnew_compat(machine, &vdso_info->vdso32);
--
1.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/