Skip to contentSkip to conversation

How to display a ktime value as trace timestamp in trace output?

DISCUSSION David Howells 2 participants 2 messages Jan 31, 2024 – Feb 29, 2024 Tracing

lore
Share & tools
lore
#0 lore raw

Hi Steven,

I have a tracepoint in AF_RXRPC that displays information about a timeout I'm going to set. I have the timeout in a ktime_t as an absolute time. Is there a way to display this in the trace output such that it looks like a trace timestamp and can be (roughly) correlated with the displayed timestamps?

I tried subtracting ktime_get_read() - ktime_get_boottime() from it and displaying the result, but it looked about one and a bit seconds out from the trace timestamp.

Thanks,
David

maintainer
#1 lore raw
Quoted 1 line · On Wed, 31 Jan 2024 14:47:31 +0000 David Howells <[email protected]> wrote:

Hi Steven,

Hi David,

Sorry, I just noticed this email as it was buried in other unread emails :-p

Quoted 5 lines

I have a tracepoint in AF_RXRPC that displays information about a timeout I'm going to set. I have the timeout in a ktime_t as an absolute time. Is there a way to display this in the trace output such that it looks like a trace timestamp and can be (roughly) correlated with the displayed timestamps?

Have you tried the other clocks?

	{ ktime_get_mono_fast_ns,	"mono",		1 },
	{ ktime_get_raw_fast_ns,	"mono_raw",	1 },
	{ ktime_get_boot_fast_ns,	"boot",		1 },

The above are the functions used for the tracing timestamps.

-- Steve

Quoted 5 lines

I tried subtracting ktime_get_read() - ktime_get_boottime() from it and displaying the result, but it looked about one and a bit seconds out from the trace timestamp.