2015-11-18 15:46:36 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# Copyright 2015 the V8 project authors. All rights reserved.
|
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
|
|
|
|
# Convenience Script used to rank GC NVP output.
|
|
|
|
|
|
|
|
print_usage_and_die() {
|
2016-03-21 15:07:58 +00:00
|
|
|
echo "Usage: $0 RANK SORT [LOGFILE]"
|
|
|
|
echo ""
|
|
|
|
echo "Arguments:"
|
|
|
|
echo " RANK: old-gen-rank | new-gen-rank"
|
|
|
|
echo " SORT: max | avg"
|
|
|
|
echo " LOGFILE: the file to process. will default to /dev/stdin"
|
2015-11-18 15:46:36 +00:00
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
2016-03-21 15:07:58 +00:00
|
|
|
if [[ $# -lt 2 || $# -gt 3 ]]; then
|
2015-11-18 15:46:36 +00:00
|
|
|
print_usage_and_die
|
|
|
|
fi
|
|
|
|
|
|
|
|
case $1 in
|
|
|
|
new-gen-rank|old-gen-rank)
|
|
|
|
OP=$1
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
print_usage_and_die
|
|
|
|
esac
|
|
|
|
|
|
|
|
case $2 in
|
|
|
|
max|avg)
|
|
|
|
RANK_MODE=$2
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
print_usage_and_die
|
|
|
|
esac
|
|
|
|
|
2016-03-21 15:07:58 +00:00
|
|
|
if [ $# -eq 3 ]; then
|
|
|
|
LOGFILE=$3
|
|
|
|
else
|
|
|
|
LOGFILE=/dev/stdin
|
|
|
|
fi
|
2015-11-18 15:46:36 +00:00
|
|
|
|
|
|
|
GENERAL_INTERESTING_KEYS="\
|
|
|
|
pause \
|
|
|
|
"
|
|
|
|
|
|
|
|
INTERESTING_NEW_GEN_KEYS="\
|
|
|
|
${GENERAL_INTERESTING_KEYS} \
|
|
|
|
scavenge \
|
|
|
|
weak \
|
|
|
|
roots \
|
|
|
|
old_new \
|
|
|
|
code \
|
|
|
|
semispace \
|
|
|
|
object_groups \
|
|
|
|
"
|
|
|
|
|
|
|
|
INTERESTING_OLD_GEN_KEYS="\
|
|
|
|
${GENERAL_INTERESTING_KEYS} \
|
|
|
|
external \
|
2015-12-11 11:25:45 +00:00
|
|
|
clear \
|
|
|
|
clear.code_flush \
|
|
|
|
clear.dependent_code \
|
|
|
|
clear.global_handles \
|
|
|
|
clear.maps \
|
|
|
|
clear.slots_buffer \
|
|
|
|
clear.store_buffer \
|
|
|
|
clear.string_table \
|
|
|
|
clear.weak_cells \
|
|
|
|
clear.weak_collections \
|
|
|
|
clear.weak_lists \
|
|
|
|
finish \
|
|
|
|
evacuate \
|
|
|
|
evacuate.candidates \
|
|
|
|
evacuate.clean_up \
|
2016-03-17 14:18:14 +00:00
|
|
|
evacuate.copy \
|
2015-12-11 11:25:45 +00:00
|
|
|
evacuate.update_pointers \
|
|
|
|
evacuate.update_pointers.between_evacuated \
|
|
|
|
evacuate.update_pointers.to_evacuated \
|
|
|
|
evacuate.update_pointers.to_new \
|
|
|
|
evacuate.update_pointers.weak \
|
2015-11-18 15:46:36 +00:00
|
|
|
mark \
|
2015-12-11 11:25:45 +00:00
|
|
|
mark.finish_incremental \
|
|
|
|
mark.prepare_code_flush \
|
|
|
|
mark.roots \
|
|
|
|
mark.weak_closure \
|
2015-11-18 15:46:36 +00:00
|
|
|
sweep \
|
2015-12-11 11:25:45 +00:00
|
|
|
sweep.code \
|
|
|
|
sweep.map \
|
|
|
|
sweep.old \
|
|
|
|
incremental_finalize \
|
2015-11-18 15:46:36 +00:00
|
|
|
"
|
|
|
|
|
|
|
|
BASE_DIR=$(dirname $0)
|
|
|
|
|
|
|
|
case $OP in
|
|
|
|
new-gen-rank)
|
|
|
|
cat $LOGFILE | grep "gc=s" \
|
|
|
|
| $BASE_DIR/eval_gc_nvp.py \
|
|
|
|
--no-histogram \
|
|
|
|
--rank $RANK_MODE \
|
|
|
|
${INTERESTING_NEW_GEN_KEYS}
|
|
|
|
;;
|
|
|
|
old-gen-rank)
|
2016-03-21 15:07:58 +00:00
|
|
|
cat $LOGFILE | grep "gc=ms" \
|
2015-11-18 15:46:36 +00:00
|
|
|
| $BASE_DIR/eval_gc_nvp.py \
|
|
|
|
--no-histogram \
|
|
|
|
--rank $RANK_MODE \
|
|
|
|
${INTERESTING_OLD_GEN_KEYS}
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|