diff options
author | Evelina Dumitrescu <evelinad@google.com> | 2016-09-20 00:35:47 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-02-01 18:13:45 -0800 |
commit | 058aae85dcfb12049ef90137915ec7e981288569 (patch) | |
tree | 87b3a32b13c392939d66fa93105896f5df0736a6 /user_activity_benchmarks/collect_pprof_data.sh | |
parent | 215fd6f8720cd3f6c691e256e59fcdef4a8ac17b (diff) | |
download | toolchain-utils-058aae85dcfb12049ef90137915ec7e981288569.tar.gz |
user_activity: Added tools for the benchmark profile collection.
The scripts run the Telemetry benchmarks, collects their perf profiles, use
local_cwp to do the profile symbolization and collect the hot
functions and callchains with pprof.
BUG=None
TEST=None
Change-Id: I2170e53d95924f1a3ba134bd62b1eead9e7a3077
Reviewed-on: https://chrome-internal-review.googlesource.com/288517
Reviewed-by: Luis Lozano <llozano@chromium.org>
Reviewed-by: Evelina Dumitrescu <evelinad@google.com>
Commit-Queue: Evelina Dumitrescu <evelinad@google.com>
Tested-by: Evelina Dumitrescu <evelinad@google.com>
Reviewed-on: https://chromium-review.googlesource.com/435923
Commit-Ready: Luis Lozano <llozano@chromium.org>
Tested-by: Luis Lozano <llozano@chromium.org>
Diffstat (limited to 'user_activity_benchmarks/collect_pprof_data.sh')
-rwxr-xr-x | user_activity_benchmarks/collect_pprof_data.sh | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/user_activity_benchmarks/collect_pprof_data.sh b/user_activity_benchmarks/collect_pprof_data.sh new file mode 100755 index 00000000..5b89f185 --- /dev/null +++ b/user_activity_benchmarks/collect_pprof_data.sh @@ -0,0 +1,41 @@ +#!/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. +# Collects the pprof tree and top outputs. +# All the local_cwp symbolized profiles are taken from the +# local_cwp_results_path. +# The pprof top output is stored in the pprof_top_results_path and the pprof +# tree output is stored in the pprof_tree_results_path. + +set -e + +if [ "$#" -ne 3 ]; then + echo "USAGE: collect_pprof_data.sh local_cwp_results_path " \ + "pprof_top_results_path pprof_tree_results_path" + exit 1 +fi + +readonly LOCAL_CWP_RESULTS_PATH=$1 +readonly PPROF_TOP_RESULTS_PATH=$2 +readonly PPROF_TREE_RESULTS_PATH=$3 +readonly SYMBOLIZED_PROFILES=`ls $LOCAL_CWP_RESULTS_PATH` + +for symbolized_profile in "${SYMBOLIZED_PROFILES[@]}" +do + pprof --top "$LOCAL_CWP_RESULTS_PATH/${symbolized_profile}" > \ + "$PPROF_TOP_RESULTS_PATH/${symbolized_profile}.pprof" + if [ $? -ne 0 ]; then + echo "Failed to extract the pprof top output for the $symbolized_profile." + continue + fi + + pprof --tree "$LOCAL_CWP_RESULTS_PATH/${symbolized_profile}" > \ + "$PPROF_TREE_RESULTS_PATH/${symbolized_profile}.pprof" + if [ $? -ne 0 ]; then + echo "Failed to extract the pprof tree output for the " \ + "$symbolized_profile." + continue + fi +done |