Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf tools: Do not attempt to run perf-read-vdso32 if it wasn't built

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@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1414061124-26830-17-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Adrian Hunter and committed by
Arnaldo Carvalho de Melo
46b1fa85 f6832e17

+16 -2
+6 -2
tools/perf/config/Makefile
··· 627 627 ifeq (${IS_64_BIT}, 1) 628 628 ifndef NO_PERF_READ_VDSO32 629 629 $(call feature_check,compile-32) 630 - ifneq ($(feature-compile-32), 1) 630 + ifeq ($(feature-compile-32), 1) 631 + CFLAGS += -DHAVE_PERF_READ_VDSO32 632 + else 631 633 NO_PERF_READ_VDSO32 := 1 632 634 endif 633 635 endif ··· 638 636 endif 639 637 ifndef NO_PERF_READ_VDSOX32 640 638 $(call feature_check,compile-x32) 641 - ifneq ($(feature-compile-x32), 1) 639 + ifeq ($(feature-compile-x32), 1) 640 + CFLAGS += -DHAVE_PERF_READ_VDSOX32 641 + else 642 642 NO_PERF_READ_VDSOX32 := 1 643 643 endif 644 644 endif
+10
tools/perf/util/vdso.c
··· 255 255 enum dso_type dso_type; 256 256 257 257 dso_type = machine__thread_dso_type(machine, thread); 258 + 259 + #ifndef HAVE_PERF_READ_VDSO32 260 + if (dso_type == DSO__TYPE_32BIT) 261 + return 0; 262 + #endif 263 + #ifndef HAVE_PERF_READ_VDSOX32 264 + if (dso_type == DSO__TYPE_X32BIT) 265 + return 0; 266 + #endif 267 + 258 268 switch (dso_type) { 259 269 case DSO__TYPE_32BIT: 260 270 *dso = vdso__findnew_compat(machine, &vdso_info->vdso32);