@@ -125,6 +125,7 @@ list_comparisons () {
125print_help () {
125print_help () {
126 echo "Usage: $0 "
126 echo "Usage: $0 "
127 echo " [--benchmarks <"bench1 bench2 ..." | help>]"
127 echo " [--benchmarks <"bench1 bench2 ..." | help>]"
128+ echo " [--fields <"field1 field2 ..." | help>]"
128 echo " [--graphs]"
129 echo " [--graphs]"
129 echo " [--no-measure]"
130 echo " [--no-measure]"
130 echo " [--append]"
131 echo " [--append]"
@@ -136,6 +137,7 @@ print_help () {
136 echo " -- <gauge options or benchmarks>"
137 echo " -- <gauge options or benchmarks>"
138 echo "--benchmarks: benchmarks to run, use 'help' for list of benchmarks"
139 echo "--benchmarks: benchmarks to run, use 'help' for list of benchmarks"
140+ echo "--fields: measurement fields to report, use 'help' for a list"
139 echo "--graphs: Generate graphical reports"
141 echo "--graphs: Generate graphical reports"
140 echo "--no-measure: Don't run benchmarks, run reports from previous results"
142 echo "--no-measure: Don't run benchmarks, run reports from previous results"
141 echo "--append: Don't overwrite previous results, append for comparison"
143 echo "--append: Don't overwrite previous results, append for comparison"
@@ -394,7 +396,7 @@ run_reports() {
395 echo "Generating reports for ${i}..."
397 echo "Generating reports for ${i}..."
396 $prog $(test "$GRAPH" = 1 && echo "--graphs") \
398 $prog $(test "$GRAPH" = 1 && echo "--graphs") \
397− --benchmark $i
399+ --benchmark $i --fields "$FIELDS"
@@ -403,6 +405,9 @@ run_reports() {
403#-----------------------------------------------------------------------------
405#-----------------------------------------------------------------------------
405DEFAULT_BENCHMARKS="$all_grp"
407DEFAULT_BENCHMARKS="$all_grp"
408+DEFAULT_FIELDS="allocated bytescopied cputime"
409+ALL_FIELDS="$FIELDS time cycles utime stime minflt majflt nvcsw nivcsw"
410+FIELDS=$DEFAULT_FIELDS
@@ -438,6 +443,7 @@ do
438 -h|--help|help) print_help ;;
443 -h|--help|help) print_help ;;
439 # options with arguments
444 # options with arguments
440 --benchmarks) shift; BENCHMARKS=$1; shift ;;
445 --benchmarks) shift; BENCHMARKS=$1; shift ;;
446+ --fields) shift; FIELDS=$1; shift ;;
441 --base) shift; BASE=$1; shift ;;
447 --base) shift; BASE=$1; shift ;;
442 --candidate) shift; CANDIDATE=$1; shift ;;
448 --candidate) shift; CANDIDATE=$1; shift ;;
443 --cabal-build-flags) shift; CABAL_BUILD_FLAGS=$1; shift ;;
449 --cabal-build-flags) shift; CABAL_BUILD_FLAGS=$1; shift ;;
@@ -476,10 +482,10 @@ only_real_benchmarks () {
479−has_benchmark () {
485+has_item () {
480− for i in $BENCHMARKS_ORIG
486+ for i in $1
482− if test "$i" = "$1"
488+ if test "$i" = "$2"
484 echo "$i"
490 echo "$i"
@@ -488,7 +494,7 @@ has_benchmark () {
490BENCHMARKS_ORIG=$BENCHMARKS
496BENCHMARKS_ORIG=$BENCHMARKS
491−if test "$(has_benchmark help)" = "help"
497+if test "$(has_item "$BENCHMARKS_ORIG" help)" = "help"
493 list_bench_groups
499 list_bench_groups
494 list_comparisons
500 list_comparisons
@@ -496,6 +502,13 @@ then
505+if test "$(has_item "$FIELDS" help)" = "help"
507+ echo "Supported fields: $ALL_FIELDS"
508+ echo "Default fields: $DEFAULT_FIELDS"
499if test "$LONG" -ne 0
512if test "$LONG" -ne 0
501 if test -n "$BENCHMARKS"
514 if test -n "$BENCHMARKS"
@@ -559,7 +572,7 @@ fi
559COMPARISON_REPORTS=""
572COMPARISON_REPORTS=""
560for i in $COMPARISONS
573for i in $COMPARISONS
562− if test "$(has_benchmark $i)" = $i
575+ if test "$(has_item "$BENCHMARKS_ORIG" $i)" = $i
564 COMPARISON_REPORTS="$COMPARISON_REPORTS $i"
577 COMPARISON_REPORTS="$COMPARISON_REPORTS $i"
565 mkdir -p "charts/$i"
578 mkdir -p "charts/$i"