Skip to content

Commit

Permalink
perf(runtime): save perf output
Browse files Browse the repository at this point in the history
  • Loading branch information
symbiont-stevan-andjelkovic committed Oct 25, 2021
1 parent e341ea2 commit b9a0c85
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/runtime-prototype/benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ for policy in /sys/devices/system/cpu/cpufreq/policy*; do
done

# Compile workloads.
cabal configure "${BENCHMARK_WORKLOAD1}" \
--disable-profiling \
--ghc-options='-O2 -threaded -rtsopts -with-rtsopts=-N'
cabal configure "${BENCHMARK_WORKLOAD2}" \
cabal configure \
--disable-profiling \
--ghc-options='-O2 -threaded -rtsopts -with-rtsopts=-N'

Expand All @@ -56,10 +53,10 @@ for i in $(seq ${BENCHMARK_NUMBER_OF_RUNS}); do
echo "Running benchmark run ${i}"
perf stat -e cache-misses,branch-misses,dTLB-load-misses,iTLB-load-misses \
cabal run -O2 "${BENCHMARK_WORKLOAD1}" \
>> /tmp/${BENCHMARK_WORKLOAD1}.txt
&>> /tmp/${BENCHMARK_WORKLOAD1}.txt
perf stat -e cache-misses,branch-misses,dTLB-load-misses,iTLB-load-misses \
cabal run -O2 "${BENCHMARK_WORKLOAD2}" \
>> /tmp/${BENCHMARK_WORKLOAD2}.txt
&>> /tmp/${BENCHMARK_WORKLOAD2}.txt

# XXX: Can't get the below to work, ${BENCHMARK_WORKLOAD} env var doesn't
# get interpolated correctly into the string?
Expand Down Expand Up @@ -105,6 +102,8 @@ EOF
# to setup the permissions for using `perf`. Also note that on some systems,
# e.g. Ubuntu, `/usr/bin/perf` is not the actual binary but rather a bash script
# that calls the binary. Note that the steps in the admin guide needs to be
# performed on the binary and not the shell script.
# performed on the binary and not the shell script. Since Linux 5.8 there's a
# special capability for capturing perf data called `cap_perfmon`, if you are on
# a older version you need `cap_sys_admin` instead.
#
# For more see: https://brendangregg.com/perf.html

0 comments on commit b9a0c85

Please sign in to comment.