aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/sort.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/sort.c')
-rw-r--r--tools/perf/util/sort.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index f9a38a1dd4d1..83eb3fa6f941 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -6,12 +6,14 @@
6#include <linux/time64.h> 6#include <linux/time64.h>
7#include "sort.h" 7#include "sort.h"
8#include "hist.h" 8#include "hist.h"
9#include "cacheline.h"
9#include "comm.h" 10#include "comm.h"
10#include "map.h" 11#include "map.h"
11#include "symbol.h" 12#include "symbol.h"
12#include "thread.h" 13#include "thread.h"
13#include "evsel.h" 14#include "evsel.h"
14#include "evlist.h" 15#include "evlist.h"
16#include "srcline.h"
15#include "strlist.h" 17#include "strlist.h"
16#include "strbuf.h" 18#include "strbuf.h"
17#include <traceevent/event-parse.h> 19#include <traceevent/event-parse.h>
@@ -668,17 +670,11 @@ sort__time_cmp(struct hist_entry *left, struct hist_entry *right)
668static int hist_entry__time_snprintf(struct hist_entry *he, char *bf, 670static int hist_entry__time_snprintf(struct hist_entry *he, char *bf,
669 size_t size, unsigned int width) 671 size_t size, unsigned int width)
670{ 672{
671 unsigned long secs;
672 unsigned long long nsecs;
673 char he_time[32]; 673 char he_time[32];
674 674
675 nsecs = he->time;
676 secs = nsecs / NSEC_PER_SEC;
677 nsecs -= secs * NSEC_PER_SEC;
678
679 if (symbol_conf.nanosecs) 675 if (symbol_conf.nanosecs)
680 snprintf(he_time, sizeof he_time, "%5lu.%09llu: ", 676 timestamp__scnprintf_nsec(he->time, he_time,
681 secs, nsecs); 677 sizeof(he_time));
682 else 678 else
683 timestamp__scnprintf_usec(he->time, he_time, 679 timestamp__scnprintf_usec(he->time, he_time,
684 sizeof(he_time)); 680 sizeof(he_time));