1 #!/bin/bash 2 3 # Copyright 2016 The Chromium OS Authors. All rights reserved. 4 # Use of this source code is governed by a BSD-style license that can be 5 # found in the LICENSE file. 6 # Uses local_cwp to do the profile symbolization. 7 # The profiles that need to be symbolized are placed in the profiles_path. 8 # The results are placed in the local_cwp_results_path. 9 10 set -e 11 12 if [ "$#" -ne 3 ]; then 13 echo "USAGE: symbolize_profiles.sh profiles_path local_cwp_binary_path " \ 14 "local_cwp_results_path" 15 exit 1 16 fi 17 18 readonly PROFILES_PATH=$1 19 readonly LOCAL_CWP_BINARY_PATH=$2 20 readonly LOCAL_CWP_RESULTS_PATH=$3 21 readonly PROFILES=$(ls $PROFILES_PATH) 22 23 for profile in "${PROFILES[@]}" 24 do 25 $LOCAL_CWP_BINARY_PATH --output="$LOCAL_CWP_RESULTS_PATH/${profile}.pb.gz" \ 26 "$PROFILES_PATH/$profile" 27 if [ $? -ne 0 ]; then 28 echo "Failed to symbolize the perf profile output with local_cwp for " \ 29 "$profile." 30 continue 31 fi 32 done 33