• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
10set -e
11
12if [ "$#" -ne 3 ]; then
13  echo "USAGE: symbolize_profiles.sh profiles_path local_cwp_binary_path " \
14    "local_cwp_results_path"
15  exit 1
16fi
17
18readonly PROFILES_PATH=$1
19readonly LOCAL_CWP_BINARY_PATH=$2
20readonly LOCAL_CWP_RESULTS_PATH=$3
21readonly PROFILES=$(ls $PROFILES_PATH)
22
23for profile in "${PROFILES[@]}"
24do
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
32done
33