OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 # | 2 # |
3 # Copyright 2015 the V8 project authors. All rights reserved. | 3 # Copyright 2015 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 # Convenience Script used to rank GC NVP output. | 7 # Convenience Script used to rank GC NVP output. |
8 | 8 |
9 print_usage_and_die() { | 9 print_usage_and_die() { |
10 echo "Usage: $0 [OPTIONS]" | 10 echo "Usage: $0 [OPTIONS]" |
11 echo "" | 11 echo "" |
12 echo "OPTIONS" | 12 echo "OPTIONS" |
13 echo " -r|--rank new-gen-rank|old-gen-rank GC mode to profile" | 13 echo " -r|--rank new-gen-rank|old-gen-rank GC mode to profile" |
14 echo " (default: old-gen-rank)" | 14 echo " (default: old-gen-rank)" |
15 echo " -s|--sort avg|max sorting mode (default: max)" | 15 echo " -s|--sort avg|max sorting mode (default: max)" |
16 echo " -t|--top-level include top-level categories" | 16 echo " -t|--top-level include top-level categories" |
17 echo " -c|--csv provide csv output" | 17 echo " -c|--csv provide csv output" |
18 echo " -f|--file FILE profile input in a file" | 18 echo " -f|--file FILE profile input in a file" |
19 echo " (default: stdin)" | 19 echo " (default: stdin)" |
| 20 echo " -p|--percentiles comma separated percentiles" |
20 exit 1 | 21 exit 1 |
21 } | 22 } |
22 | 23 |
23 OP=old-gen-rank | 24 OP=old-gen-rank |
24 RANK_MODE=max | 25 RANK_MODE=max |
25 TOP_LEVEL=no | 26 TOP_LEVEL=no |
26 CSV="" | 27 CSV="" |
27 LOGFILE=/dev/stdin | 28 LOGFILE=/dev/stdin |
| 29 PERCENTILES="" |
28 | 30 |
29 while [[ $# -ge 1 ]] | 31 while [[ $# -ge 1 ]] |
30 do | 32 do |
31 key="$1" | 33 key="$1" |
32 case $key in | 34 case $key in |
33 -r|--rank) | 35 -r|--rank) |
34 case $2 in | 36 case $2 in |
35 new-gen-rank|old-gen-rank) | 37 new-gen-rank|old-gen-rank) |
36 OP="$2" | 38 OP="$2" |
37 ;; | 39 ;; |
(...skipping 15 matching lines...) Expand all Loading... |
53 -t|--top-level) | 55 -t|--top-level) |
54 TOP_LEVEL=yes | 56 TOP_LEVEL=yes |
55 ;; | 57 ;; |
56 -c|--csv) | 58 -c|--csv) |
57 CSV=" --csv " | 59 CSV=" --csv " |
58 ;; | 60 ;; |
59 -f|--file) | 61 -f|--file) |
60 LOGFILE=$2 | 62 LOGFILE=$2 |
61 shift | 63 shift |
62 ;; | 64 ;; |
| 65 -f|--percentiles) |
| 66 PERCENTILES="--percentiles=$2" |
| 67 shift |
| 68 ;; |
63 *) | 69 *) |
64 break | 70 break |
65 ;; | 71 ;; |
66 esac | 72 esac |
67 shift | 73 shift |
68 done | 74 done |
69 | 75 |
70 if [[ $# -ne 0 ]]; then | 76 if [[ $# -ne 0 ]]; then |
71 echo "Unknown option(s): $@" | 77 echo "Unknown option(s): $@" |
72 echo "" | 78 echo "" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 | 144 |
139 BASE_DIR=$(dirname $0) | 145 BASE_DIR=$(dirname $0) |
140 | 146 |
141 case $OP in | 147 case $OP in |
142 new-gen-rank) | 148 new-gen-rank) |
143 cat $LOGFILE | grep "gc=s" \ | 149 cat $LOGFILE | grep "gc=s" \ |
144 | $BASE_DIR/eval_gc_nvp.py \ | 150 | $BASE_DIR/eval_gc_nvp.py \ |
145 --no-histogram \ | 151 --no-histogram \ |
146 --rank $RANK_MODE \ | 152 --rank $RANK_MODE \ |
147 $CSV \ | 153 $CSV \ |
| 154 $PERCENTILES \ |
148 ${INTERESTING_NEW_GEN_KEYS} | 155 ${INTERESTING_NEW_GEN_KEYS} |
149 ;; | 156 ;; |
150 old-gen-rank) | 157 old-gen-rank) |
151 cat $LOGFILE | grep "gc=ms" \ | 158 cat $LOGFILE | grep "gc=ms" \ |
152 | $BASE_DIR/eval_gc_nvp.py \ | 159 | $BASE_DIR/eval_gc_nvp.py \ |
153 --no-histogram \ | 160 --no-histogram \ |
154 --rank $RANK_MODE \ | 161 --rank $RANK_MODE \ |
155 $CSV \ | 162 $CSV \ |
| 163 $PERCENTILES \ |
156 ${INTERESTING_OLD_GEN_KEYS} | 164 ${INTERESTING_OLD_GEN_KEYS} |
157 ;; | 165 ;; |
158 *) | 166 *) |
159 ;; | 167 ;; |
160 esac | 168 esac |
OLD | NEW |