[PATCH] D72198: tools/timeit.sh: be flexible while parsing perf-stat output

Yuanfang Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 3 23:39:01 PST 2020


ychen created this revision.
ychen added a reviewer: jmolloy.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

There are some minor changes on the perf-stat output that needs to be
accommodated so we parse the time data correctly.


Repository:
  rT test-suite

https://reviews.llvm.org/D72198

Files:
  tools/timeit.sh


Index: tools/timeit.sh
===================================================================
--- tools/timeit.sh
+++ tools/timeit.sh
@@ -46,6 +46,6 @@
 fi
 
 echo exit $EXITCODE > $REPORT
-awk -F' ' '{if ($2 == "task-clock") print "user",$1/1000; else if($2 =="seconds") print "real",$1;}' $PERFSTAT >> $REPORT
+awk -F' ' '{if ($2 ~ /^task-clock/ || $3 ~ /^task-clock/) print "user",$1/1000; else if($2 == "seconds" && $4 == "elapsed") print "real",$1;}' $PERFSTAT >> $REPORT
 
 exit $EXITCODE


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72198.236167.patch
Type: text/x-patch
Size: 492 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200104/efd95378/attachment.bin>


More information about the llvm-commits mailing list