build: Check and set perf --log-fd option

Linux perf tool version 3.2 introduced a new option "--log-fd" defaults
to 0, which leads to error "Failed opening logfd: Illegal argument" when
executing perf tests.

Set logfd to stderr to let perf test work.

Issue #1538
This commit is contained in:
Haitao Li 2012-01-16 19:20:07 +08:00
parent 293678847b
commit ef0775fec8
2 changed files with 15 additions and 1 deletions

10
configure vendored
View File

@ -363,6 +363,16 @@ then
err "either clang or gcc is required"
fi
if [ ! -z "$CFG_PERF" ]
then
HAVE_PERF_LOGFD=`$CFG_PERF stat --log-fd 2>&1 | grep 'unknown option'`
if [ -z "$HAVE_PERF_LOGFD" ];
then
CFG_PERF_WITH_LOGFD=1
putvar CFG_PERF_WITH_LOGFD
fi
fi
step_msg "making directories"
for i in \

View File

@ -58,7 +58,11 @@ ifneq ($(findstring linux,$(CFG_OSTYPE)),)
CFG_LDENV := LD_LIBRARY_PATH
CFG_DEF_SUFFIX := .linux.def
ifdef CFG_PERF
CFG_PERF_TOOL := $(CFG_PERF) stat -r 3
ifneq ($(CFG_PERF_WITH_LOGFD),)
CFG_PERF_TOOL := $(CFG_PERF) stat -r 3 --log-fd 2
else
CFG_PERF_TOOL := $(CFG_PERF) stat -r 3
endif
else
ifdef CFG_VALGRIND
CFG_PERF_TOOL :=\