Skip to content

ftrace: printk formatted recording

Steven Rostedt lkml 1 version Applied

Status from this message: applied all 3 patches to tip/tracing/ftrace - thanks Steve.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest2 patches 9 repliesApplied

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/2ftrace: new continue entry - separate out from trace_entrykernel/trace/trace.c kernel/trace/trace.h kernel/trace/trace_mmiotrace.c+160 -1360 replies
2/2ftrace: printk formatting infrastructureinclude/linux/ftrace.h kernel/trace/trace.c kernel/trace/trace.h +1 more+272 -338 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchRandy Dunlap
1/2
2/2A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/2] ftrace: printk formatted recording

I previously sent out a patch to add printk formatted recording to the ftrace buffers. Andrew Morton suggested to get rid of my hacked trace_cont structure and do it properly with one structure at the top and two other structures to handle the difference between the fields and the continuation entry.

That is to have a top entry:

struct trace_entry {
	char type;
	union {
		struct trace_field field;
		struct trace_cont  cont;
	};
};

instead of having a separate trace_cont that was outside the trace_entry and would be typecasted when used. This would be a source of bugs with later modifications of the ftrace code if a developer did not relize the connection between trace_entry and trace_cont. Using this proper method keeps the two tighly coupled for new developers to see.

Unfortunatly, doing it the proper way caused a large code change since now all the users of trace_entry (and there are many) must now dereference the field item.

The first patch just does the struct update and changes all the users to do the dereferencing properly.

The second patch in this series adds the user of the trace_cont, which is the ftrace_printk.

Note: I can no longer use the unspecified array size buf[] because gcc complains about:

struct trace_cont {
	buf[];
};

I now use buf[sizeof(struct trace_field)] which I think is a better solution anyways.

-- Steve