From: "Steven Rostedt (Google)" <rostedt@xxxxxxxxxxx> With the new TAI clock, the clock source can use all 64 bits for the time stamp. The TIME_STAMP event only saves 59 bits of the clock, it is expected that the 5 MSBs will be extracted from the buffer page 64 bit timestamp. Link: https://lore.kernel.org/all/20220427153339.16c33f75@xxxxxxxxxxxxxxxxxx/ Signed-off-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx> --- src/kbuffer-parse.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/kbuffer-parse.c b/src/kbuffer-parse.c index 74999501f5bf..d174e7276df2 100644 --- a/src/kbuffer-parse.c +++ b/src/kbuffer-parse.c @@ -14,6 +14,9 @@ #define COMMIT_MASK ((1 << 27) - 1) +/* Absolute time stamps do not have the 5 MSB, take from the real time stamp */ +#define TS_MSB (0xf8ULL << 56) + enum { KBUFFER_FL_HOST_BIG_ENDIAN = (1<<0), KBUFFER_FL_BIG_ENDIAN = (1<<1), @@ -347,7 +350,7 @@ static unsigned int translate_data(struct kbuffer *kbuf, void *data, void **rptr, unsigned long long *delta, int *length) { - unsigned long long extend; + unsigned long long extend, msb = 0; unsigned int type_len_ts; unsigned int type_len; @@ -362,13 +365,15 @@ translate_data(struct kbuffer *kbuf, void *data, void **rptr, *length = read_4(kbuf, data); break; - case KBUFFER_TYPE_TIME_EXTEND: case KBUFFER_TYPE_TIME_STAMP: + msb = kbuf->timestamp & TS_MSB; + /* fall through */ + case KBUFFER_TYPE_TIME_EXTEND: extend = read_4(kbuf, data); data += 4; extend <<= TS_SHIFT; extend += *delta; - *delta = extend; + *delta = extend | msb; *length = 0; break; -- 2.35.1