OLD | NEW |
1 #! /bin/sh | 1 #! /bin/sh |
2 # | 2 # |
3 # Copyright 2016 the V8 project authors. All rights reserved. | 3 # Copyright 2016 the V8 project authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 # | 6 # |
7 | 7 |
8 ########## Global variable definitions | 8 ########## Global variable definitions |
9 | 9 |
10 # Ensure that <your CPU clock> / $SAMPLE_EVERY_N_CYCLES < $MAXIMUM_SAMPLE_RATE. | 10 # Ensure that <your CPU clock> / $SAMPLE_EVERY_N_CYCLES < $MAXIMUM_SAMPLE_RATE. |
(...skipping 27 matching lines...) Expand all Loading... |
38 echo "Setting appropriate maximum sample rate..." | 38 echo "Setting appropriate maximum sample rate..." |
39 echo $MAXIMUM_SAMPLE_RATE | sudo tee $SAMPLE_RATE_CONFIG_FILE | 39 echo $MAXIMUM_SAMPLE_RATE | sudo tee $SAMPLE_RATE_CONFIG_FILE |
40 fi | 40 fi |
41 | 41 |
42 ACTUAL_KERNEL_MAP_RESTRICTION=$(cat $KERNEL_MAP_CONFIG_FILE) | 42 ACTUAL_KERNEL_MAP_RESTRICTION=$(cat $KERNEL_MAP_CONFIG_FILE) |
43 if [ "$ACTUAL_KERNEL_MAP_RESTRICTION" -ne "0" ] ; then | 43 if [ "$ACTUAL_KERNEL_MAP_RESTRICTION" -ne "0" ] ; then |
44 echo "Disabling kernel address map restriction..." | 44 echo "Disabling kernel address map restriction..." |
45 echo 0 | sudo tee $KERNEL_MAP_CONFIG_FILE | 45 echo 0 | sudo tee $KERNEL_MAP_CONFIG_FILE |
46 fi | 46 fi |
47 | 47 |
| 48 # Extract the command being perfed, so that we can prepend arguments to the |
| 49 # arguments that the user supplied. |
| 50 COMMAND=$1 |
| 51 shift 1 |
| 52 |
48 echo "Running..." | 53 echo "Running..." |
49 perf record -R \ | 54 perf record -R \ |
50 -e $EVENT_TYPE \ | 55 -e $EVENT_TYPE \ |
51 -c $SAMPLE_EVERY_N_CYCLES \ | 56 -c $SAMPLE_EVERY_N_CYCLES \ |
52 --call-graph $CALL_GRAPH_METHOD \ | 57 --call-graph $CALL_GRAPH_METHOD \ |
53 -i $@ --perf_basic_prof | 58 -i "$COMMAND" --perf_basic_prof "$@" |
OLD | NEW |