aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2017-02-21 08:39:18 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2017-02-21 08:39:18 +0000
commit07876219967d30fba0351b98744b74ecd3351c7b (patch)
tree3b395c5fe103e7b39b19dc47a139de2ec47c119a
parentf051fce7b858d4f3681af170e0c8dba95d601bfa (diff)
spec2xxx-config: Add --perf-bin and --perf-buildid-dir options
--perf-bin option is, mostly, to note perf version used to record the samples. It is also useful for picking a non-default perf on TX1s and TK1s, where default perf binary doesn't work. --perf-buildid-dir allows to specify destination for perf's buildid cache. Developers would want to use "global" cache in their homedirs, while automation is better off using per-run "local" caches to avoid issues from parallel runs. Change-Id: I6131bcc54475b14e94343cc88f6f923c2ce17453
-rw-r--r--cpu2006.cfg2
-rwxr-xr-xspec2xxx-config30
2 files changed, 30 insertions, 2 deletions
diff --git a/cpu2006.cfg b/cpu2006.cfg
index 30d1d23..5d00fcc 100644
--- a/cpu2006.cfg
+++ b/cpu2006.cfg
@@ -21,7 +21,7 @@ submit = (ulimit -s unlimited; taskset -c $BIND setarch @SETARCH@ -R $command)
# will run on @BIND@. Perf is picking up stdout and stderr from runspec,
# and outputs perf.data contents into stdout. To avoid this we close FDs
# 1 and 2 with "exec ... 1>&- 2>&-".
-@PROFILER_PERF@monitor_specrun_wrapper = taskset -c @HELPER_CPU@ sh -c "exec perf record -q -N @PERF_CALLGRAPH@ @PERF_CPU@ @PERF_EVENTS@ -- $command 1>&- 2>&-"; mkdir -p $[top]/result/perf.$lognum.data/; cp perf.data $[top]/result/perf.$lognum.data/$benchmark.data
+@PROFILER_PERF@monitor_specrun_wrapper = mkdir -p $[top]/result/perf.$lognum.data/; taskset -c @HELPER_CPU@ sh -c "exec @PERF_RECORD@ -q @PERF_CALLGRAPH@ @PERF_CPU@ @PERF_EVENTS@ -- $command 1>&- 2>&-"; cp perf.data $[top]/result/perf.$lognum.data/$benchmark.data
################################################################
# Benchmark noise handling (via number of iterations)
diff --git a/spec2xxx-config b/spec2xxx-config
index d4fae23..ba35c5e 100755
--- a/spec2xxx-config
+++ b/spec2xxx-config
@@ -10,13 +10,16 @@ config="default"
helper_cpu="$(($bind_cpu-1))"
mcpu=""
mfpu=""
+# Use explicit path to perf to have a record of the version
+perf_bin="/usr/lib/linux-tools/$(uname -r)/perf"
+perf_buildid_dir="global"
perf_events=""
profiler="none"
save_temps=false
sysinfo_program="default"
toolchain="gnu"
-OPTS="`getopt -o ve: -l bind:,build:,ccflags:,ccprefix:,config:,event:,helpercpu:,mcpu:,mfpu:,profiler:,save-temps,sysinfo:,toolchain: -- "$@"`"
+OPTS="`getopt -o ve: -l bind:,build:,ccflags:,ccprefix:,config:,event:,helpercpu:,mcpu:,mfpu:,perf-bin:,perf-buildid-dir:,profiler:,save-temps,sysinfo:,toolchain: -- "$@"`"
while test $# -gt 1; do
case $1 in
--bind) bind_cpu="$2"; shift ;;
@@ -28,6 +31,8 @@ while test $# -gt 1; do
--helpercpu) helper_cpu="$2"; shift ;;
--mcpu) mcpu="$2"; shift ;;
--mfpu) mfpu="$2"; shift ;;
+ --perf-bin) perf_bin="$2"; shift ;;
+ --perf-buildid-dir) perf_buildid_dir="$2"; shift ;;
--profiler) profiler="$2"; shift ;;
--save-temps) save_temps=true ;;
--sysinfo) sysinfo_program="$2"; shift ;;
@@ -240,6 +245,28 @@ else
sysinfo_program=""
fi
+case "$perf_buildid_dir" in
+ "none")
+ # Do not use buildid cache (might be necessary for SPEC "rate" runs).
+ perf_record="$perf_bin record --no-buildid-cache"
+ ;;
+ "global")
+ # Use default ~/.debug buildid cache (useful for basic non-parallel
+ # runs).
+ perf_record="$perf_bin record"
+ ;;
+ "local")
+ # Use install-local buildid cache (useful for normal "speed" runs, and
+ # might be necessary for running several SPEC installs in parallel).
+ perf_buildid_dir='$[top]/result/perf.$lognum.data/.debug'
+ perf_record="$perf_bin --buildid-dir $perf_buildid_dir record"
+ ;;
+ *)
+ # Use custom buildid cache.
+ perf_record="$perf_bin --buildid-dir $perf_buildid_dir record"
+ ;;
+esac
+
case "$profiler" in
"none")
profiler_none=""
@@ -315,6 +342,7 @@ cat $cfg_tmpl | sed \
-e "s#@PERF_CPU@#$perf_cpu#g" \
-e "s#@BIND@#$bind_cpu#g" \
-e "s#@PERF_EVENTS@#$perf_events#g" \
+ -e "s#@PERF_RECORD@#$perf_record#g" \
-e "s/@PROFILER_NONE@/$profiler_none/g" \
-e "s/@PROFILER_PERF@/$profiler_perf/g" \
-e "s/@SAVE_TEMPS@/$save_temps_mark/g" \