]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit - kernel/trace/trace.c
ftrace: Provide trace clock monotonic raw
authorDrew Richardson <drew.richardson@arm.com>
Fri, 8 May 2015 14:30:39 +0000 (07:30 -0700)
committerSteven Rostedt <rostedt@goodmis.org>
Tue, 12 May 2015 19:58:58 +0000 (15:58 -0400)
commitaabfa5f28f717d3e53102ab088e9cc903741221a
tree3eadb2084239528063aa54219d93de7823784094
parent7e255d346c12888f7cce4b89a03a5fe5e9196ab1
ftrace: Provide trace clock monotonic raw

Expose the NMI safe accessor to the monotonic raw clock to the
tracer. The mono clock was added with commit
1b3e5c0936046e7e023149ddc8946d21c2ea20eb. The advantage of the
monotonic raw clock is that it will advance more constantly than the
monotonic clock.

Imagine someone is trying to optimize a particular program to reduce
instructions executed for a given workload while minimizing the effect
on runtime. Also suppose that NTP is running and potentially making
larger adjustments to the monotonic clock. If NTP is adjusting the
monotonic clock to advance more rapidly, the program will appear to
use fewer instructions per second but run longer than if the monotonic
raw clock had been used. The total number of instructions observed
would be the same regardless of the clock source used, but how it's
attributed to time would be affected.

Conversely if NTP is adjusting the monotonic clock to advance more
slowly, the program will appear to use more instructions per second
but run more quickly. Of course there are many sources that can cause
jitter in performance measurements on modern processors, but let's
remove NTP from the list.

The monotonic raw clock can also be useful for tracing early boot,
e.g. when debugging issues with NTP.

Link: http://lkml.kernel.org/r/20150508143037.GB1276@dreric01-Precision-T1650
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: John Stultz <john.stultz@linaro.org>
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Drew Richardson <drew.richardson@arm.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/trace.c