Skip to contentSkip to conversation

perf bench mem: Use USEC_PER_SEC

tip:perf/core tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Aug 24, 2016 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  f2b91be731a6c1aff9333c1ce3fece7a311f1e0d
Gitweb:     http://git.kernel.org/tip/f2b91be731a6c1aff9333c1ce3fece7a311f1e0d
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Mon, 8 Aug 2016 14:59:21 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Tue, 23 Aug 2016 15:37:33 -0300

perf bench mem: Use USEC_PER_SEC

Following kernel practices, using linux/time64.h

---
 tools/perf/bench/mem-functions.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/perf/bench/mem-functions.c +2 -1
index 2b54d0f..c684910 100644
@@ -21,6 +21,7 @@
 #include <string.h>
 #include <sys/time.h>
 #include <errno.h>
+#include <linux/time64.h>
 
 #define K 1024
 
@@ -89,7 +90,7 @@ static u64 get_cycles(void)
 
 static double timeval2double(struct timeval *ts)
 {
-	return (double)ts->tv_sec + (double)ts->tv_usec / (double)1000000;
+	return (double)ts->tv_sec + (double)ts->tv_usec / (double)USEC_PER_SEC;
 }
 
 #define print_bps(x) do {						\