linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ftrace trace_raw_pipe format
@ 2019-12-17 17:44 David Laight
  2019-12-17 22:34 ` Steven Rostedt
  0 siblings, 1 reply; 10+ messages in thread
From: David Laight @ 2019-12-17 17:44 UTC (permalink / raw)
  To: linux-kernel, 'Steven Rostedt'

I'm trying to 'grok' the trace_raw_pipe data that ftrace generates.
I've some 3rd party code that post-processes it, but doesn't like wrapped traces
because (I think) the traces from different cpus start at different times.

I can't seem to find any documentation at all...

I can find the format of the trace entries (I only need the length) from the 'format' files.
There seems to be 4 bytes between the entries that looks like a time difference.
I presume this is the interval before the trace item that follows.
(There is a time-delta of 1 before the first entry.)

The overall file seems to be a series of 4k blocks.
All but the first have a 16 byte header (possibly) described by 'header_page'
that has a timestamp and length (and a sign extended flag).

The first 4k page is confusing me.
The first 8 bytes might be the time the actual trace started.
The next 8 contain a length (short for a wrapped trace).
I've no idea what the next 8 are, they look like count of something.

Given that I've stopped tracing before reading the files I'd
expect the last buffer to be the partial one, not the first.
I'm also pretty sure the partial block contains the last trace data
(it seems to refer to the shell script sleep used to time the trace.)

I did find some old mailing list messages about these files being
corrupt - but that was about the time the splice code was
added to read them out - best part of 10 years ago.

If I can sort the headers for the 4k block (and reorder them??),
then delete entries so the start times match I should be able to
make the post-processing code work.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-01-07 13:49 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-17 17:44 ftrace trace_raw_pipe format David Laight
2019-12-17 22:34 ` Steven Rostedt
2019-12-17 22:43   ` Steven Rostedt
2019-12-17 22:47   ` Steven Rostedt
2019-12-17 23:36   ` Steven Rostedt
2019-12-17 23:54     ` Steven Rostedt
2019-12-18 16:31   ` Sudip Mukherjee
2019-12-18 17:28   ` David Laight
2019-12-18 17:59     ` Steven Rostedt
2020-01-07 13:49     ` David Laight

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).