2022-04-14 21:22:09

by Kurt Kanzenbach

[permalink] [raw]
Subject: [PATCH v2 3/3] tracing: Add documentation for trace clock tai

Add documentation for newly introduced trace clock "tai".
This clock corresponds to CLOCK_TAI.

Signed-off-by: Kurt Kanzenbach <[email protected]>
---
Documentation/trace/ftrace.rst | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/Documentation/trace/ftrace.rst b/Documentation/trace/ftrace.rst
index 45b8c56af67a..b37dc19e4d40 100644
--- a/Documentation/trace/ftrace.rst
+++ b/Documentation/trace/ftrace.rst
@@ -517,6 +517,18 @@ of ftrace. Here is a list of some of the key files:
processing should be able to handle them. See comments in the
ktime_get_boot_fast_ns() function for more information.

+ tai:
+ This is the tai clock (CLOCK_TAI) and is derived from the wall-
+ clock time. However, this clock does not experience
+ discontinuities and backwards jumps caused by NTP inserting leap
+ seconds. Since the clock access is designed for use in tracing,
+ side effects are possible. The clock access may yield wrong
+ readouts in case the internal TAI offset is updated e.g., caused
+ by setting the system time or using adjtimex() with an offset.
+ These effects are rare and post processing should be able to
+ handle them. See comments in the ktime_get_tai_fast_ns()
+ function for more information.
+
To set a clock, simply echo the clock name into this file::

# echo global > trace_clock
--
2.30.2


2022-04-15 11:58:28

by Kurt Kanzenbach

[permalink] [raw]
Subject: Re: [PATCH v2 3/3] tracing: Add documentation for trace clock tai

On Thu Apr 14 2022, Bagas Sanjaya wrote:
> On 4/14/22 16:18, Kurt Kanzenbach wrote:
>> + tai:
>> + This is the tai clock (CLOCK_TAI) and is derived from the wall-
>> + clock time. However, this clock does not experience
>> + discontinuities and backwards jumps caused by NTP inserting leap
>> + seconds. Since the clock access is designed for use in tracing,
>> + side effects are possible. The clock access may yield wrong
>> + readouts in case the internal TAI offset is updated e.g., caused
>> + by setting the system time or using adjtimex() with an offset.
>> + These effects are rare and post processing should be able to
>> + handle them. See comments in the ktime_get_tai_fast_ns()
>> + function for more information.
>> +
>
> In what file are the ktime_get_tai_fast_ns() comments?

In kernel/time/timekeeping.c. That function is introduced in patch #1
and has kernel doc comments. Similar to ktime_get_boot_fast_ns().

Thanks,
Kurt


Attachments:
signature.asc (877.00 B)

2022-04-16 00:20:57

by Bagas Sanjaya

[permalink] [raw]
Subject: Re: [PATCH v2 3/3] tracing: Add documentation for trace clock tai

On 4/14/22 16:18, Kurt Kanzenbach wrote:
> + tai:
> + This is the tai clock (CLOCK_TAI) and is derived from the wall-
> + clock time. However, this clock does not experience
> + discontinuities and backwards jumps caused by NTP inserting leap
> + seconds. Since the clock access is designed for use in tracing,
> + side effects are possible. The clock access may yield wrong
> + readouts in case the internal TAI offset is updated e.g., caused
> + by setting the system time or using adjtimex() with an offset.
> + These effects are rare and post processing should be able to
> + handle them. See comments in the ktime_get_tai_fast_ns()
> + function for more information.
> +

In what file are the ktime_get_tai_fast_ns() comments?

--
An old man doll... just what I always wanted! - Clara