linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tzvetomir Stoyanov <tstoyanov@vmware.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Linux Trace Devel <linux-trace-devel@vger.kernel.org>
Subject: Re: [PATCH 5/5] tools/lib/traceevent: Round up in tep_print_event() time precision
Date: Fri, 20 Sep 2019 15:18:37 +0000	[thread overview]
Message-ID: <CACqStoch-exxzRUd1TCfDSPV1ojw4+QV-y=Z0jWLQPRk1cHohw@mail.gmail.com> (raw)
In-Reply-To: <20190918020530.974032887@goodmis.org>

On Wed, Sep 18, 2019 at 5:03 AM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> From: "Steven Rostedt (VMware)" <rostedt@goodmis.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.
>
> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
> ---
>  lib/traceevent/event-parse.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/lib/traceevent/event-parse.c b/lib/traceevent/event-parse.c
> index d1085aab9c43..7fbbbccab78a 100644
> --- a/lib/traceevent/event-parse.c
> +++ b/lib/traceevent/event-parse.c
> @@ -5527,8 +5527,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
>
>

Looks good to me.
Reviewed-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>

-- 
Tzvetomir (Ceco) Stoyanov
VMware Open Source Technology Center

      reply	other threads:[~2019-09-20 15:18 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-18  2:03 [PATCH 0/5] trace-cmd: Update for the new trace_print_event() logic Steven Rostedt
2019-09-18  2:03 ` [PATCH 1/5] trace-cmd: Move extract trace_clock into trace-input.c Steven Rostedt
2019-09-20 14:55   ` Tzvetomir Stoyanov
2019-09-20 15:02     ` Steven Rostedt
2019-09-20 15:10     ` [PATCH 1/5 v2] " Steven Rostedt
2019-09-20 16:08       ` Tzvetomir Stoyanov
2019-09-20 16:11         ` Steven Rostedt
2019-09-18  2:03 ` [PATCH 2/5] trace-cmd: Separate out time diff code in trace_show_data() Steven Rostedt
2019-09-20 15:08   ` Tzvetomir Stoyanov
2019-09-18  2:03 ` [PATCH 3/5] trace-cmd: Add check for trace_clock using usecs into tracecmd_parse_trace_clock() Steven Rostedt
2019-09-20 15:10   ` Tzvetomir Stoyanov
2019-09-18  2:03 ` [PATCH 4/5] libtraceevent, perf tools: Changes in tep_print_event_* APIs Steven Rostedt
2019-09-19 22:50   ` Steven Rostedt
2019-09-19 22:53     ` [PATCH 4/5 v2] " Steven Rostedt
2019-09-20 16:06     ` [PATCH 4/5] " Tzvetomir Stoyanov
2019-09-19 22:52   ` Steven Rostedt
2019-09-18  2:03 ` [PATCH 5/5] tools/lib/traceevent: Round up in tep_print_event() time precision Steven Rostedt
2019-09-20 15:18   ` Tzvetomir Stoyanov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACqStoch-exxzRUd1TCfDSPV1ojw4+QV-y=Z0jWLQPRk1cHohw@mail.gmail.com' \
    --to=tstoyanov@vmware.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).