The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@elte.hu>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH v2 0/2] ftrace: printk formatted recording
Date: Fri, 01 Aug 2008 12:26:39 -0400	[thread overview]
Message-ID: <20080801162639.175407419@goodmis.org> (raw)

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


             reply	other threads:[~2008-08-01 16:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-01 16:26 Steven Rostedt [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080801162639.175407419@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox