[test-suite] r217239 - Don't remove perf stats after generating report

Yi Kong Yi.Kong at arm.com
Fri Sep 5 03:35:50 PDT 2014


Author: kongyi
Date: Fri Sep  5 05:35:49 2014
New Revision: 217239

URL: http://llvm.org/viewvc/llvm-project?rev=217239&view=rev
Log:
Don't remove perf stats after generating report

It has some interesting data that can be useful, like CPU cycles,
number of branch misses.

Modified:
    test-suite/trunk/tools/timeit.sh

Modified: test-suite/trunk/tools/timeit.sh
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/tools/timeit.sh?rev=217239&r1=217238&r2=217239&view=diff
==============================================================================
--- test-suite/trunk/tools/timeit.sh (original)
+++ test-suite/trunk/tools/timeit.sh Fri Sep  5 05:35:49 2014
@@ -22,10 +22,12 @@ done
 REPORT=/dev/stderr
 INPUT=/dev/stdin
 OUTPUT=/dev/stdout
+PERFSTAT=perfstats
 
 while [[ $1 = -* ]]; do
 	if [ $1 = "--summary" ]; then
 		REPORT=$2
+		PERFSTAT="$REPORT.perfstats"
 	elif [ $1 = "--redirect-input" ]; then
 		INPUT=$2
 	elif [ $1 = "--redirect-output" ]; then
@@ -34,13 +36,11 @@ while [[ $1 = -* ]]; do
 	shift 2
 done
 
-perf stat -o stats $@ < $INPUT > $OUTPUT
+perf stat -o $PERFSTAT $@ < $INPUT > $OUTPUT
 
 EXITCODE=$?
 
 echo exit $EXITCODE > $REPORT
-awk -F' ' '{if ($2 == "task-clock") print "user",$1/1000; else if($2 =="seconds") print "real",$1;}' stats >> $REPORT
-
-rm stats
+awk -F' ' '{if ($2 == "task-clock") print "user",$1/1000; else if($2 =="seconds") print "real",$1;}' $PERFSTAT >> $REPORT
 
 exit $EXITCODE





More information about the llvm-commits mailing list