Skip to content

Commit a10baf9

Browse files
author
Yuanfang Chen
committed
tools/timeit.sh: be flexible while parsing perf-stat output
Summary: There are some minor changes on the perf-stat output that needs to be accommodated so we parse the time data correctly. Reviewers: jmolloy, kongyi Reviewed by: kongyi Differential Revision: https://reviews.llvm.org/D72198
1 parent 5f13cb8 commit a10baf9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/timeit.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ if [ "$APPEND_STATUS" = "1" ]; then
4646
fi
4747

4848
echo exit $EXITCODE > $REPORT
49-
awk -F' ' '{if ($2 == "task-clock") print "user",$1/1000; else if($2 =="seconds") print "real",$1;}' $PERFSTAT >> $REPORT
49+
awk -F' ' '{if ($2 ~ /^task-clock/ || $3 ~ /^task-clock/) print "user",$1/1000; else if($2 == "seconds" && $4 == "elapsed") print "real",$1;}' $PERFSTAT >> $REPORT
5050

5151
exit $EXITCODE

0 commit comments

Comments
 (0)