linux/kernel/trace
Tony Luck b8dea936e3 tracing: Fix wraparound problems in "uptime" trace clock
commit 58d4e21e50 upstream.

The "uptime" trace clock added in:

    commit 8aacf017b0
    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).

Avoid these problems by using jiffies_64 as our basis, and
not converting to nanoseconds (we do convert to clock_t because
user facing API must not be dependent on internal kernel
HZ values).

Link: http://lkml.kernel.org/p/99d63c5bfe9b320a3b428d773825a37095bf6a51.1405708254.git.tony.luck@intel.com

Fixes: 8aacf017b0 "tracing: Add "uptime" trace clock that uses jiffies"
Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-31 12:52:55 -07:00
..
Kconfig
Makefile
blktrace.c
ftrace.c tracing: Fix graph tracer with stack tracer on other archs 2014-07-28 08:05:57 -07:00
power-traces.c
ring_buffer.c ring-buffer: Fix polling on trace_pipe 2014-07-28 08:06:02 -07:00
ring_buffer_benchmark.c
rpm-traces.c
trace.c tracing: Fix wraparound problems in "uptime" trace clock 2014-07-31 12:52:55 -07:00
trace.h ring-buffer: Check if buffer exists before polling 2014-07-17 16:21:06 -07:00
trace_branch.c
trace_clock.c tracing: Fix wraparound problems in "uptime" trace clock 2014-07-31 12:52:55 -07:00
trace_entries.h
trace_event_perf.c
trace_events.c tracing: instance_rmdir() leaks ftrace_event_file->filter 2014-07-28 08:05:57 -07:00
trace_events_filter.c
trace_events_filter_test.h
trace_events_trigger.c
trace_export.c
trace_functions.c
trace_functions_graph.c
trace_irqsoff.c
trace_kdb.c
trace_kprobe.c
trace_mmiotrace.c
trace_nop.c
trace_output.c
trace_output.h
trace_printk.c
trace_probe.c
trace_probe.h
trace_sched_switch.c
trace_sched_wakeup.c
trace_selftest.c
trace_selftest_dynamic.c
trace_stack.c
trace_stat.c
trace_stat.h
trace_syscalls.c
trace_uprobe.c