lkml.org 
[lkml]   [2016]   [Oct]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/3] perf tools: Introduce timestamp_in_usec()
On Mon, Oct 24, 2016 at 11:02:45AM +0900, Namhyung Kim wrote:

SNIP

> +
> if (nanosecs)
> printf("%5lu.%09llu: ", secs, nsecs);
> else
> - printf("%5lu.%06lu: ", secs, usecs);
> + printf("%12s: ", timestamp_in_usec(buf, sz,
> + sample->time));
> }
> }
>
> diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
> index 85c56800f17a..aa3e778989ce 100644
> --- a/tools/perf/util/util.c
> +++ b/tools/perf/util/util.c
> @@ -433,6 +433,15 @@ int parse_nsec_time(const char *str, u64 *ptime)
> return 0;
> }
>
> +char *timestamp_in_usec(char *buf, size_t sz, u64 timestamp)
> +{

good idea.. 2 things:
- I've spot several other places by looking for NSEC_PER_USEC
but haven't checked deeply they could be also users for this function

- timestamp_usec__scnprint might fir better

thanks,
jirka

\
 
 \ /
  Last update: 2016-10-24 18:46    [W:0.126 / U:0.748 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site