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-31 15:07:54 +00:00
|
|
|
echo "Usage: $0 [OPTIONS]"
|
2016-03-21 15:07:58 +00:00
|
|
|
echo ""
|
2016-03-31 15:07:54 +00:00
|
|
|
echo "OPTIONS"
|
|
|
|
echo " -r|--rank new-gen-rank|old-gen-rank GC mode to profile"
|
|
|
|
echo " (default: old-gen-rank)"
|
|
|
|
echo " -s|--sort avg|max sorting mode (default: max)"
|
|
|
|
echo " -t|--top-level include top-level categories"
|
|
|
|
echo " -c|--csv provide csv output"
|
|
|
|
echo " -f|--file FILE profile input in a file"
|
|
|
|
echo " (default: stdin)"
|
2016-04-08 12:04:54 +00:00
|
|
|
echo " -p|--percentiles comma separated percentiles"
|
2015-11-18 15:46:36 +00:00
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
2016-03-31 15:07:54 +00:00
|
|
|
OP=old-gen-rank
|
|
|
|
RANK_MODE=max
|
|
|
|
TOP_LEVEL=no
|
|
|
|
CSV=""
|
|
|
|
LOGFILE=/dev/stdin
|
2016-04-08 12:04:54 +00:00
|
|
|
PERCENTILES=""
|
2015-11-18 15:46:36 +00:00
|
|
|
|
2016-03-31 15:07:54 +00:00
|
|
|
while [[ $# -ge 1 ]]
|
|
|
|
do
|
|
|
|
key="$1"
|
|
|
|
case $key in
|
|
|
|
-r|--rank)
|
|
|
|
case $2 in
|
|
|
|
new-gen-rank|old-gen-rank)
|
|
|
|
OP="$2"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
print_usage_and_die
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
-s|--sort)
|
|
|
|
case $2 in
|
|
|
|
max|avg)
|
|
|
|
RANK_MODE=$2
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
print_usage_and_die
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
-t|--top-level)
|
|
|
|
TOP_LEVEL=yes
|
|
|
|
;;
|
|
|
|
-c|--csv)
|
|
|
|
CSV=" --csv "
|
|
|
|
;;
|
|
|
|
-f|--file)
|
|
|
|
LOGFILE=$2
|
|
|
|
shift
|
|
|
|
;;
|
2016-04-08 12:15:04 +00:00
|
|
|
-p|--percentiles)
|
2016-04-08 12:04:54 +00:00
|
|
|
PERCENTILES="--percentiles=$2"
|
|
|
|
shift
|
|
|
|
;;
|
2016-03-31 15:07:54 +00:00
|
|
|
*)
|
|
|
|
break
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
2015-11-18 15:46:36 +00:00
|
|
|
|
2016-03-31 15:07:54 +00:00
|
|
|
if [[ $# -ne 0 ]]; then
|
|
|
|
echo "Unknown option(s): $@"
|
|
|
|
echo ""
|
|
|
|
print_usage_and_die
|
2016-03-21 15:07:58 +00:00
|
|
|
fi
|
2015-11-18 15:46:36 +00:00
|
|
|
|
|
|
|
INTERESTING_NEW_GEN_KEYS="\
|
|
|
|
scavenge \
|
|
|
|
weak \
|
|
|
|
roots \
|
|
|
|
old_new \
|
|
|
|
code \
|
|
|
|
semispace \
|
|
|
|
object_groups \
|
|
|
|
"
|
|
|
|
|
|
|
|
INTERESTING_OLD_GEN_KEYS="\
|
2015-12-11 11:25:45 +00:00
|
|
|
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 \
|
|
|
|
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.to_evacuated \
|
|
|
|
evacuate.update_pointers.to_new \
|
|
|
|
evacuate.update_pointers.weak \
|
2016-03-29 10:15:49 +00:00
|
|
|
external.mc_prologue \
|
|
|
|
external.mc_epilogue \
|
|
|
|
external.mc_incremental_prologue \
|
|
|
|
external.mc_incremental_epilogue \
|
|
|
|
external.weak_global_handles \
|
2015-12-11 11:25:45 +00:00
|
|
|
mark.finish_incremental \
|
|
|
|
mark.prepare_code_flush \
|
|
|
|
mark.roots \
|
|
|
|
mark.weak_closure \
|
2016-03-29 14:51:28 +00:00
|
|
|
mark.weak_closure.ephemeral \
|
|
|
|
mark.weak_closure.weak_handles \
|
|
|
|
mark.weak_closure.weak_roots \
|
|
|
|
mark.weak_closure.harmony \
|
2015-12-11 11:25:45 +00:00
|
|
|
sweep.code \
|
|
|
|
sweep.map \
|
|
|
|
sweep.old \
|
2015-11-18 15:46:36 +00:00
|
|
|
"
|
|
|
|
|
2016-03-31 15:07:54 +00:00
|
|
|
if [[ "$TOP_LEVEL" = "yes" ]]; then
|
|
|
|
INTERESTING_OLD_GEN_KEYS="\
|
|
|
|
${INTERESTING_OLD_GEN_KEYS} \
|
|
|
|
clear \
|
|
|
|
evacuate \
|
|
|
|
finish \
|
|
|
|
incremental_finalize \
|
|
|
|
mark \
|
|
|
|
pause
|
|
|
|
sweep \
|
|
|
|
"
|
|
|
|
INTERESTING_NEW_GEN_KEYS="\
|
|
|
|
${INTERESTING_NEW_GEN_KEYS} \
|
|
|
|
"
|
|
|
|
fi
|
|
|
|
|
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 \
|
2016-03-31 15:07:54 +00:00
|
|
|
$CSV \
|
2016-04-08 12:04:54 +00:00
|
|
|
$PERCENTILES \
|
2015-11-18 15:46:36 +00:00
|
|
|
${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 \
|
2016-03-31 15:07:54 +00:00
|
|
|
$CSV \
|
2016-04-08 12:04:54 +00:00
|
|
|
$PERCENTILES \
|
2015-11-18 15:46:36 +00:00
|
|
|
${INTERESTING_OLD_GEN_KEYS}
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|