tools: Introduce tools/include/linux/time64.h for *SEC_PER_*SEC macros
[cascardo/linux.git] / tools / perf / util / debug.c
index 8c4212a..c1838b6 100644 (file)
@@ -6,6 +6,7 @@
 #include <stdarg.h>
 #include <stdio.h>
 #include <api/debug.h>
+#include <linux/time64.h>
 
 #include "cache.h"
 #include "color.h"
@@ -14,9 +15,6 @@
 #include "util.h"
 #include "target.h"
 
-#define NSECS_PER_SEC  1000000000ULL
-#define NSECS_PER_USEC 1000ULL
-
 int verbose;
 bool dump_trace = false, quiet = false;
 int debug_ordered_events;
@@ -54,9 +52,9 @@ static int veprintf_time(u64 t, const char *fmt, va_list args)
        int ret = 0;
        u64 secs, usecs, nsecs = t;
 
-       secs   = nsecs / NSECS_PER_SEC;
-       nsecs -= secs  * NSECS_PER_SEC;
-       usecs  = nsecs / NSECS_PER_USEC;
+       secs   = nsecs / NSEC_PER_SEC;
+       nsecs -= secs  * NSEC_PER_SEC;
+       usecs  = nsecs / NSEC_PER_USEC;
 
        ret = fprintf(stderr, "[%13" PRIu64 ".%06" PRIu64 "] ",
                      secs, usecs);