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 new-gen-rank|old-gen-rank max|avg logfile" | 10 echo "Usage: $0 RANK SORT [LOGFILE]" |
| 11 echo "" |
| 12 echo "Arguments:" |
| 13 echo " RANK: old-gen-rank | new-gen-rank" |
| 14 echo " SORT: max | avg" |
| 15 echo " LOGFILE: the file to process. will default to /dev/stdin" |
11 exit 1 | 16 exit 1 |
12 } | 17 } |
13 | 18 |
14 if [ $# -ne 3 ]; then | 19 if [[ $# -lt 2 || $# -gt 3 ]]; then |
15 print_usage_and_die | 20 print_usage_and_die |
16 fi | 21 fi |
17 | 22 |
18 case $1 in | 23 case $1 in |
19 new-gen-rank|old-gen-rank) | 24 new-gen-rank|old-gen-rank) |
20 OP=$1 | 25 OP=$1 |
21 ;; | 26 ;; |
22 *) | 27 *) |
23 print_usage_and_die | 28 print_usage_and_die |
24 esac | 29 esac |
25 | 30 |
26 case $2 in | 31 case $2 in |
27 max|avg) | 32 max|avg) |
28 RANK_MODE=$2 | 33 RANK_MODE=$2 |
29 ;; | 34 ;; |
30 *) | 35 *) |
31 print_usage_and_die | 36 print_usage_and_die |
32 esac | 37 esac |
33 | 38 |
34 LOGFILE=$3 | 39 if [ $# -eq 3 ]; then |
| 40 LOGFILE=$3 |
| 41 else |
| 42 LOGFILE=/dev/stdin |
| 43 fi |
35 | 44 |
36 GENERAL_INTERESTING_KEYS="\ | 45 GENERAL_INTERESTING_KEYS="\ |
37 pause \ | 46 pause \ |
38 " | 47 " |
39 | 48 |
40 INTERESTING_NEW_GEN_KEYS="\ | 49 INTERESTING_NEW_GEN_KEYS="\ |
41 ${GENERAL_INTERESTING_KEYS} \ | 50 ${GENERAL_INTERESTING_KEYS} \ |
42 scavenge \ | 51 scavenge \ |
43 weak \ | 52 weak \ |
44 roots \ | 53 roots \ |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 | 97 |
89 case $OP in | 98 case $OP in |
90 new-gen-rank) | 99 new-gen-rank) |
91 cat $LOGFILE | grep "gc=s" \ | 100 cat $LOGFILE | grep "gc=s" \ |
92 | $BASE_DIR/eval_gc_nvp.py \ | 101 | $BASE_DIR/eval_gc_nvp.py \ |
93 --no-histogram \ | 102 --no-histogram \ |
94 --rank $RANK_MODE \ | 103 --rank $RANK_MODE \ |
95 ${INTERESTING_NEW_GEN_KEYS} | 104 ${INTERESTING_NEW_GEN_KEYS} |
96 ;; | 105 ;; |
97 old-gen-rank) | 106 old-gen-rank) |
98 cat $LOGFILE | grep "gc=ms" | grep "reduce_memory=0" | grep -v "steps=0" \ | 107 cat $LOGFILE | grep "gc=ms" \ |
99 | $BASE_DIR/eval_gc_nvp.py \ | 108 | $BASE_DIR/eval_gc_nvp.py \ |
100 --no-histogram \ | 109 --no-histogram \ |
101 --rank $RANK_MODE \ | 110 --rank $RANK_MODE \ |
102 ${INTERESTING_OLD_GEN_KEYS} | 111 ${INTERESTING_OLD_GEN_KEYS} |
103 ;; | 112 ;; |
104 *) | 113 *) |
105 ;; | 114 ;; |
106 esac | 115 esac |
107 | 116 |
OLD | NEW |