linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] tracing: fix uptime overflow problem
@ 2014-06-28 11:09 Xie XiuQi
  2014-06-28 11:10 ` [PATCH 1/2] " Xie XiuQi
  2014-06-28 11:10 ` [PATCH 2/2] tracing: update Documentation/trace/ftrace.txt for uptime Xie XiuQi
  0 siblings, 2 replies; 14+ messages in thread
From: Xie XiuQi @ 2014-06-28 11:09 UTC (permalink / raw)
  To: linux-kernel; +Cc: rostedt, mingo, tony.luck, fweisbec, m.chehab

The "uptime" tracer added in:
    commit 8aacf017b065a805d27467843490c976835eb4a5
    tracing: Add "uptime" trace clock that uses jiffies
has wraparound problems when the system has been up more
than 1 hour 11 minutes and 34 seconds. It converts jiffies
to nanoseconds using:
        (u64)jiffies_to_usecs(jiffy) * 1000ULL
but since jiffies_to_usecs() only returns a 32-bit value, it
truncates at 2^32 microseconds.  An additional problem on 32-bit
systems is that the argument is "unsigned long", so fixing the
return value only helps until 2^32 jiffies (49.7 days on a HZ=1000
system).

Tony provide full featured jiffies_to_nsecs() function, but
can't resolve another problem that jiffies_lock is not safe
in NMI context.

Now we use the lockless function __current_kernel_time() and
getboottime() to calculate the uptime.

The former discussion is here:
http://lkml.org/lkml/2014/4/8/525

Additional, I changed trace_clock_jiffies to trace_clock_uptime,
in order to better describe its function and updated the document.

Xie XiuQi (2):
  tracing: fix uptime overflow problem
  tracing: update Documentation/trace/ftrace.txt for uptime

 Documentation/trace/ftrace.txt |  3 +--
 include/linux/trace_clock.h    |  2 +-
 kernel/trace/trace.c           |  2 +-
 kernel/trace/trace_clock.c     | 15 +++++++++++----
 4 files changed, 14 insertions(+), 8 deletions(-)

-- 
2.0.0


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2014-07-18 18:54 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-28 11:09 [PATCH 0/2] tracing: fix uptime overflow problem Xie XiuQi
2014-06-28 11:10 ` [PATCH 1/2] " Xie XiuQi
2014-06-30 15:10   ` Steven Rostedt
2014-06-30 18:17     ` [PATCH] tracing: Fix wraparound problems in "uptime" tracer Tony Luck
2014-06-30 18:40       ` Steven Rostedt
2014-06-30 20:31         ` [PATCH-v2] " Tony Luck
2014-07-17 23:02           ` Tony Luck
2014-07-18  2:08             ` Steven Rostedt
2014-07-18 17:05               ` Tony Luck
2014-07-18 17:36                 ` Steven Rostedt
2014-07-18 18:43                   ` [PATCH] " Tony Luck
2014-07-18 18:47                     ` Steven Rostedt
2014-07-18 18:54                       ` Tony Luck
2014-06-28 11:10 ` [PATCH 2/2] tracing: update Documentation/trace/ftrace.txt for uptime Xie XiuQi

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).