@@ -125,6 +125,7 @@ list_comparisons () {
125125print_help () {
126126 echo "Usage: $0 "
127127 echo " [--benchmarks <"bench1 bench2 ..." | help>]"
128+ echo " [--fields <"field1 field2 ..." | help>]"
128129 echo " [--graphs]"
129130 echo " [--no-measure]"
130131 echo " [--append]"
@@ -136,6 +137,7 @@ print_help () {
136137 echo " -- <gauge options or benchmarks>"
137138 echo
138139 echo "--benchmarks: benchmarks to run, use 'help' for list of benchmarks"
140+ echo "--fields: measurement fields to report, use 'help' for a list"
139141 echo "--graphs: Generate graphical reports"
140142 echo "--no-measure: Don't run benchmarks, run reports from previous results"
141143 echo "--append: Don't overwrite previous results, append for comparison"
@@ -394,7 +396,7 @@ run_reports() {
394396 do
395397 echo "Generating reports for ${i}..."
396398 $prog $(test "$GRAPH" = 1 && echo "--graphs") \
397− --benchmark $i
399+ --benchmark $i --fields "$FIELDS"
398400 done
399401}
400402
@@ -403,6 +405,9 @@ run_reports() {
403405#-----------------------------------------------------------------------------
404406
405407DEFAULT_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
406411
407412COMPARE=0
408413BASE=
@@ -438,6 +443,7 @@ do
438443 -h|--help|help) print_help ;;
439444 # options with arguments
440445 --benchmarks) shift; BENCHMARKS=$1; shift ;;
446+ --fields) shift; FIELDS=$1; shift ;;
441447 --base) shift; BASE=$1; shift ;;
442448 --candidate) shift; CANDIDATE=$1; shift ;;
443449 --cabal-build-flags) shift; CABAL_BUILD_FLAGS=$1; shift ;;
@@ -476,10 +482,10 @@ only_real_benchmarks () {
476482 done
477483}
478484
479−has_benchmark () {
480− for i in $BENCHMARKS_ORIG
485+has_item () {
486+ for i in $1
481487 do
482− if test "$i" = "$1"
488+ if test "$i" = "$2"
483489 then
484490 echo "$i"
485491 break
@@ -488,7 +494,7 @@ has_benchmark () {
488494}
489495
490496BENCHMARKS_ORIG=$BENCHMARKS
491−if test "$(has_benchmark help)" = "help"
497+if test "$(has_item "$BENCHMARKS_ORIG" help)" = "help"
492498then
493499 list_bench_groups
494500 list_comparisons
@@ -496,6 +502,13 @@ then
496502 exit
497503fi
498504
505+if test "$(has_item "$FIELDS" help)" = "help"
506+then
507+ echo "Supported fields: $ALL_FIELDS"
508+ echo "Default fields: $DEFAULT_FIELDS"
509+ exit
510+fi
511+
499512if test "$LONG" -ne 0
500513then
501514 if test -n "$BENCHMARKS"
@@ -559,7 +572,7 @@ fi
559572COMPARISON_REPORTS=""
560573for i in $COMPARISONS
561574do
562− if test "$(has_benchmark $i)" = $i
575+ if test "$(has_item "$BENCHMARKS_ORIG" $i)" = $i
563576 then
564577 COMPARISON_REPORTS="$COMPARISON_REPORTS $i"
565578 mkdir -p "charts/$i"