mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/2] ftrace: printk formatted recording
@ 2008-08-01 16:26 Steven Rostedt
  2008-08-01 16:26 ` [PATCH v2 1/2] ftrace: new continue entry - separate out from trace_entry Steven Rostedt
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Steven Rostedt @ 2008-08-01 16:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Peter Zijlstra, Thomas Gleixner, Andrew Morton

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


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

end of thread, other threads:[~2008-08-15 15:49 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-01 16:26 [PATCH v2 0/2] ftrace: printk formatted recording Steven Rostedt
2008-08-01 16:26 ` [PATCH v2 1/2] ftrace: new continue entry - separate out from trace_entry Steven Rostedt
2008-08-01 16:26 ` [PATCH v2 2/2] ftrace: printk formatting infrastructure Steven Rostedt
2008-08-01 16:43   ` Randy Dunlap
2008-08-01 16:53     ` Steven Rostedt
2008-08-01 17:52       ` Randy Dunlap
2008-08-01 18:17         ` [PATCH v2 3/2] ftrace: ftrace_printk doc moved Steven Rostedt
2008-08-01 20:34           ` Randy Dunlap
2008-08-01 20:42             ` Steven Rostedt
2008-08-01 20:45             ` [PATCH v3 " Steven Rostedt
2008-08-01 20:49               ` Randy Dunlap
2008-08-15 15:00 ` [PATCH v2 0/2] ftrace: printk formatted recording Ingo Molnar
2008-08-15 15:49   ` [PATCH] ftrace: build fix Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome