Skip to contentSkip to conversation

perf bench sched-messaging: Use USEC_PER_MSEC

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:  af15e67e8f8572072167bfb193ceabff04f4b21e
Gitweb:     http://git.kernel.org/tip/af15e67e8f8572072167bfb193ceabff04f4b21e
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Mon, 8 Aug 2016 15:04:23 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Tue, 23 Aug 2016 15:37:33 -0300

perf bench sched-messaging: Use USEC_PER_MSEC

---
 tools/perf/bench/sched-messaging.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
tools/perf/bench/sched-messaging.c +3 -2
index bfaf950..6a111e7 100644
@@ -29,6 +29,7 @@
 #include <poll.h>
 #include <limits.h>
 #include <err.h>
+#include <linux/time64.h>
 
 #define DATASIZE 100
 
@@ -312,11 +313,11 @@ int bench_sched_messaging(int argc, const char **argv,
 		       thread_mode ? "threads" : "processes");
 		printf(" %14s: %lu.%03lu [sec]\n", "Total time",
 		       diff.tv_sec,
-		       (unsigned long) (diff.tv_usec/1000));
+		       (unsigned long) (diff.tv_usec / USEC_PER_MSEC));
 		break;
 	case BENCH_FORMAT_SIMPLE:
 		printf("%lu.%03lu\n", diff.tv_sec,
-		       (unsigned long) (diff.tv_usec/1000));
+		       (unsigned long) (diff.tv_usec / USEC_PER_MSEC));
 		break;
 	default:
 		/* reaching here is something disaster */