[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190923142428.GC16544@kernel.org>
Date: Mon, 23 Sep 2019 11:24:28 -0300
From: Arnaldo Carvalho de Melo <arnaldo.melo@...il.com>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
Linux Trace Devel <linux-trace-devel@...r.kernel.org>,
Jiri Olsa <jolsa@...hat.com>,
Tzvetomir Stoyanov <tstoyanov@...are.com>
Subject: Re: [PATCH] tools/lib/traceevent: Round up in tep_print_event() time
precision
Em Thu, Sep 19, 2019 at 04:51:19PM -0400, Steven Rostedt escreveu:
>
> From: "Steven Rostedt (VMware)" <rostedt@...dmis.org>
>
>
> When testing the output of the old trace-cmd compared to the one that uses
> the updated tep_print_event() logic, it was different in that the time stamp
> precision in the old format would round up to the nearest precision, where
> as the new logic truncates. Bring back the old method of rounding up.
Thanks, applied.
- Arnaldo
> Signed-off-by: Steven Rostedt (VMware) <rostedt@...dmis.org>
> ---
> tools/lib/traceevent/event-parse.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
> index bb22238debfe..eb84fbb49e4d 100644
> --- a/tools/lib/traceevent/event-parse.c
> +++ b/tools/lib/traceevent/event-parse.c
> @@ -5517,8 +5517,10 @@ static void print_event_time(struct tep_handle *tep, struct trace_seq *s,
> if (divstr && isdigit(*(divstr + 1)))
> div = atoi(divstr + 1);
> time = record->ts;
> - if (div)
> + if (div) {
> + time += div / 2;
> time /= div;
> + }
> pr = prec;
> while (pr--)
> p10 *= 10;
> --
> 2.20.1
--
- Arnaldo
Powered by blists - more mailing lists