diff options
author | David Sharp <dhsharp@google.com> | 2016-05-12 16:23:52 -0700 |
---|---|---|
committer | <chrome-bot@proto-chromeos-trusty.c.chromeos-bot.internal> | 2016-05-12 17:47:21 -0700 |
commit | 12e22fd759418bea20cce8cf996e3d6327c43931 (patch) | |
tree | a9436fcbe9ed39fd778792dfd0e32ead4942acaa /crosperf | |
parent | d1c31b2853e1b7bf47935cffd41ffd4f790d8d9f (diff) | |
download | toolchain-utils-12e22fd759418bea20cce8cf996e3d6327c43931.tar.gz |
crosperf: Add script to measure overhead of some perf commands
BUG=none
TEST=Ran the script
Change-Id: I07d998df4e43e632308c90ea336c228c34b7a2a7
Reviewed-on: https://chrome-internal-review.googlesource.com/258705
Commit-Ready: David Sharp <dhsharp@google.com>
Tested-by: David Sharp <dhsharp@google.com>
Reviewed-by: Luis Lozano <llozano@chromium.org>
Diffstat (limited to 'crosperf')
-rwxr-xr-x | crosperf/experiment_files/telemetry_perf_perf | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/crosperf/experiment_files/telemetry_perf_perf b/crosperf/experiment_files/telemetry_perf_perf new file mode 100755 index 00000000..6e9cc67d --- /dev/null +++ b/crosperf/experiment_files/telemetry_perf_perf @@ -0,0 +1,77 @@ +#!/bin/bash +# Copyright 2016 The Chromium OS Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +# +# Script for generating and running telemetry benchmarkes via crosperf with +# different perf command lines in order to measure the impact of the perf +# commands on performance. Crosperf cannot run the same benchmark multiple +# times, so this script runs crosperf multpilpe times instead. Unfortunately, +# this means you must compare the results yourself. +# +# Perf will run for the entire benchmark run, so results should be interpreted +# in that context. i.e, if this shows a 3% overhead for a particular perf +# command, that overhead would only be seen during the 2 seconds of measurement +# during a Chrome OS Wide Profiling collection. +set -e + +board=xxx #<you-board-here> +remote=xxx #<your-remote-here> +iterations=5 +chromeos_root=~/chromiumos +chrome_src=~/chromium + + +function GenerateExperiment() { + local perf_args="${1:+perf_args: $1}" + local track="$2" # stable, beta, dev + + cat <<_EOF +$perf_args +benchmark: page_cycler.typical_25 { + suite: telemetry_Crosperf +} + +$track { + build: latest-$track +} +_EOF +} + +function RunExperiment() { + local name="$1" + local perf_command="$2" + GenerateExperiment "$perf_command" "stable" > /tmp/crosperf.exp + ./crosperf /tmp/crosperf.exp \ + --name telemetry_perf_perf_${name} \ + --board="${board}" \ + --remote="${remote}" \ + --iterations="${iterations}" \ + --chromeos_root="${chromeos_root}" \ + --chrome_src="${chrome_src}" \ + --rerun=true \ + --use_file_locks=true \ + --locks_dir=/tmp/crosperf.locks +} + +if [ "$board" = "xxx" -o "$remote" = "xxx" ]; then + echo "Please set board and remote at the top of this script before running." + exit -1 +fi + + +# Note that "-a" is automatically inserted in the perf command line. + +# Control: No profiling. +RunExperiment 'control' '' +# This is our baseline standard 'cycles' perf command. +RunExperiment 'cycles.flat' \ + 'record -e cycles -c 1000003' +# Callgraph profiling. +RunExperiment 'cycles.callgraph' \ + 'record -g -e cycles -c 4000037' +# Memory bandwidth profiling. As a perf stat command, we expect imperceptible +# overhead. +RunExperiment 'memory.bandwidth' \ + 'stat -e cycles -e instructions -e uncore_imc/data_reads/ -e uncore_imc/data_writes/ -e cpu/event=0xD0,umask=0x11,name=MEM_UOPS_RETIRED-STLB_MISS_LOADS/ -e cpu/event=0xD0,umask=0x12,name=MEM_UOPS_RETIRED-STLB_MISS_STORES/' + |