Skip to content

Commit 92af4dc

Browse files
KAGA-KOKOIngo Molnar
authored andcommitted
tracing: Unify the "boot" and "mono" tracing clocks
Unify the "boot" and "mono" tracing clocks and document the new behaviour. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: John Stultz <john.stultz@linaro.org> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Kevin Easton <kevin@guarana.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mark Salyzyn <salyzyn@android.com> Cc: Michael Kerrisk <mtk.manpages@gmail.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Petr Mladek <pmladek@suse.com> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/20180301165150.489635255@linutronix.de Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 127bfa5 commit 92af4dc

File tree

3 files changed

+4
-18
lines changed

3 files changed

+4
-18
lines changed

Documentation/trace/ftrace.txt

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -449,17 +449,9 @@ of ftrace. Here is a list of some of the key files:
449449
which is montonic but is not subject to any rate adjustments
450450
and ticks at the same rate as the hardware clocksource.
451451

452-
boot: This is the boot clock (CLOCK_BOOTTIME) and is based on the
453-
fast monotonic clock, but also accounts for time spent in
454-
suspend. Since the clock access is designed for use in
455-
tracing in the suspend path, some side effects are possible
456-
if clock is accessed after the suspend time is accounted before
457-
the fast mono clock is updated. In this case, the clock update
458-
appears to happen slightly sooner than it normally would have.
459-
Also on 32-bit systems, it's possible that the 64-bit boot offset
460-
sees a partial update. These effects are rare and post
461-
processing should be able to handle them. See comments in the
462-
ktime_get_boot_fast_ns() function for more information.
452+
boot: Same as mono. Used to be a separate clock which accounted
453+
for the time spent in suspend while CLOCK_MONOTONIC did
454+
not.
463455

464456
To set a clock, simply echo the clock name into this file.
465457

include/linux/timekeeping.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,6 @@ extern u64 ktime_get_mono_fast_ns(void);
113113
extern u64 ktime_get_raw_fast_ns(void);
114114
extern u64 ktime_get_real_fast_ns(void);
115115

116-
/* Clock BOOTTIME compatibility wrappers */
117-
static inline u64 ktime_get_boot_fast_ns(void)
118-
{
119-
return ktime_get_mono_fast_ns();
120-
}
121-
122116
/*
123117
* timespec64 interfaces utilizing the ktime based ones
124118
*/

kernel/trace/trace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1164,7 +1164,7 @@ static struct {
11641164
{ trace_clock, "perf", 1 },
11651165
{ ktime_get_mono_fast_ns, "mono", 1 },
11661166
{ ktime_get_raw_fast_ns, "mono_raw", 1 },
1167-
{ ktime_get_boot_fast_ns, "boot", 1 },
1167+
{ ktime_get_mono_fast_ns, "boot", 1 },
11681168
ARCH_TRACE_CLOCKS
11691169
};
11701170

0 commit comments

Comments
 (0)