]> git.baikalelectronics.ru Git - kernel.git/commit
tools lib traceevent: Fix time stamp rounding issue
authorChaos.Chen <rainboy1215@gmail.com>
Tue, 9 Feb 2016 20:40:14 +0000 (15:40 -0500)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 3 Mar 2016 14:10:37 +0000 (11:10 -0300)
commit4100a879f5797cc2c7255a2efbcb7568156b4df1
tree81200b0f539f94c8f71efe192cb6e41176d20743
parent7fb5d2de94daf0d2f8ad07f6f3a8f11dd57657d7
tools lib traceevent: Fix time stamp rounding issue

When rounding to microseconds, if the timestamp subsecond is between
.999999500 and .999999999, it is rounded to .1000000, when it should
instead increment the second counter due to the overflow.

For example, if the timestamp is 1234.999999501 instead of seeing:

  1235.000000

we see:

  1234.1000000

Signed-off-by: Chaos.Chen <rainboy1215@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Link: http://lkml.kernel.org/r/20160209204236.824426460@goodmis.org
[ fixed incrementing "secs" instead of decrementing it ]
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/lib/traceevent/event-parse.c