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
diff --git a/tools/timeit.sh b/tools/timeit.sh
index d148792..e1bbcea 100644
--- a/tools/timeit.sh
+++ b/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