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

Previous thread: [git pull] audit fixes by Al Viro on Friday, August 1, 2008 - 12:19 pm. (1 message)

Next thread: [PATCH v2 2/2] ftrace: printk formatting infrastructure by Steven Rostedt on Friday, August 1, 2008 - 12:26 pm. (9 messages)
To: <linux-kernel@...>
Cc: Ingo Molnar <mingo@...>, Peter Zijlstra <peterz@...>, Thomas Gleixner <tglx@...>, Andrew Morton <akpm@...>
Date: Friday, August 1, 2008 - 12:26 pm

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

--

To: Steven Rostedt <rostedt@...>
Cc: <linux-kernel@...>, Peter Zijlstra <peterz@...>, Thomas Gleixner <tglx@...>, Andrew Morton <akpm@...>
Date: Friday, August 15, 2008 - 11:00 am

applied all 3 patches to tip/tracing/ftrace - thanks Steve.

Ingo
--

To: Steven Rostedt <rostedt@...>
Cc: <linux-kernel@...>, Peter Zijlstra <peterz@...>, Thomas Gleixner <tglx@...>, Andrew Morton <akpm@...>
Date: Friday, August 15, 2008 - 11:49 am

From 00968bd78e3346f35dc809f7a7c811a3d88cf07c Mon Sep 17 00:00:00 2001
From: Ingo Molnar <mingo@elte.hu>
Date: Fri, 15 Aug 2008 17:48:02 +0200
Subject: [PATCH] ftrace: build fix
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

fix:

In file included from init/main.c:65:
include/linux/ftrace.h:166: error: expected ‘,' or ‘;' before ‘{' token
make[1]: *** [init/main.o] Error 1
make: *** [init/main.o] Error 2

Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
include/linux/ftrace.h | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index f0d8e48..0d19aab 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -162,7 +162,10 @@ extern void ftrace_dump(void);
static inline void
ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3) { }
static inline int
-ftrace_printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 0)))
+ftrace_printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 0)));
+
+static inline int
+ftrace_printk(const char *fmt, ...)
{
return 0;
}
--

Previous thread: [git pull] audit fixes by Al Viro on Friday, August 1, 2008 - 12:19 pm. (1 message)

Next thread: [PATCH v2 2/2] ftrace: printk formatting infrastructure by Steven Rostedt on Friday, August 1, 2008 - 12:26 pm. (9 messages)