diff options
Diffstat (limited to 'tools/perf/util/svghelper.c')
-rw-r--r-- | tools/perf/util/svghelper.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/perf/util/svghelper.c b/tools/perf/util/svghelper.c index eec6c1149f44..1cbada2dc6be 100644 --- a/tools/perf/util/svghelper.c +++ b/tools/perf/util/svghelper.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <unistd.h> | 18 | #include <unistd.h> |
19 | #include <string.h> | 19 | #include <string.h> |
20 | #include <linux/bitmap.h> | 20 | #include <linux/bitmap.h> |
21 | #include <linux/time64.h> | ||
21 | 22 | ||
22 | #include "perf.h" | 23 | #include "perf.h" |
23 | #include "svghelper.h" | 24 | #include "svghelper.h" |
@@ -274,14 +275,14 @@ static char *time_to_string(u64 duration) | |||
274 | 275 | ||
275 | text[0] = 0; | 276 | text[0] = 0; |
276 | 277 | ||
277 | if (duration < 1000) /* less than 1 usec */ | 278 | if (duration < NSEC_PER_USEC) /* less than 1 usec */ |
278 | return text; | 279 | return text; |
279 | 280 | ||
280 | if (duration < 1000 * 1000) { /* less than 1 msec */ | 281 | if (duration < NSEC_PER_MSEC) { /* less than 1 msec */ |
281 | sprintf(text, "%.1f us", duration / 1000.0); | 282 | sprintf(text, "%.1f us", duration / (double)NSEC_PER_USEC); |
282 | return text; | 283 | return text; |
283 | } | 284 | } |
284 | sprintf(text, "%.1f ms", duration / 1000.0 / 1000); | 285 | sprintf(text, "%.1f ms", duration / (double)NSEC_PER_MSEC); |
285 | 286 | ||
286 | return text; | 287 | return text; |
287 | } | 288 | } |
@@ -297,7 +298,7 @@ void svg_waiting(int Yslot, int cpu, u64 start, u64 end, const char *backtrace) | |||
297 | 298 | ||
298 | style = "waiting"; | 299 | style = "waiting"; |
299 | 300 | ||
300 | if (end-start > 10 * 1000000) /* 10 msec */ | 301 | if (end-start > 10 * NSEC_PER_MSEC) /* 10 msec */ |
301 | style = "WAITING"; | 302 | style = "WAITING"; |
302 | 303 | ||
303 | text = time_to_string(end-start); | 304 | text = time_to_string(end-start); |