public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 06/10] tracing: add print_fmt field
@ 2009-12-09  7:15 Lai Jiangshan
  2009-12-11  0:25 ` Steven Rostedt
  0 siblings, 1 reply; 5+ messages in thread
From: Lai Jiangshan @ 2009-12-09  7:15 UTC (permalink / raw)
  To: Ingo Molnar, Steven Rostedt, Frederic Weisbecker,
	Masami Hiramatsu, Jason Baron, LKML


Add print_fmt field and the initialization codes.
It will be used for replacing ->show_format().

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
---
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index f883406..58db567 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -120,6 +120,7 @@ struct ftrace_event_call {
 	int			(*regfunc)(struct ftrace_event_call *);
 	void			(*unregfunc)(struct ftrace_event_call *);
 	int			id;
+	const char		*print_fmt;
 	int			(*raw_init)(struct ftrace_event_call *);
 	int			(*show_format)(struct ftrace_event_call *,
 					       struct trace_seq *);
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index 54258a0..eb63c97 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -723,8 +723,20 @@ static struct trace_event ftrace_event_type_##call = {			\
 
 #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
 
+#undef __entry
+#define __entry REC
+
+#undef __print_flags
+#undef __print_symbolic
+#undef __get_dynamic_array
+#undef __get_str
+
+#undef TP_printk
+#define TP_printk(fmt, args...) #fmt ", "  __stringify(args)
+
 #undef DECLARE_EVENT_CLASS
-#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print)
+#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print)	\
+static const char print_fmt_##call[] = print;
 
 #undef DEFINE_EVENT
 #define DEFINE_EVENT(template, call, proto, args)			\
@@ -738,6 +750,7 @@ __attribute__((section("_ftrace_events"))) event_##call = {		\
 	.raw_init		= trace_event_raw_init,			\
 	.regfunc		= ftrace_raw_reg_event_##call,		\
 	.unregfunc		= ftrace_raw_unreg_event_##call,	\
+	.print_fmt		= print_fmt_##template,			\
 	.show_format		= ftrace_format_##template,		\
 	.define_fields		= ftrace_define_fields_##template,	\
 	_TRACE_PROFILE_INIT(call)					\
@@ -746,6 +759,8 @@ __attribute__((section("_ftrace_events"))) event_##call = {		\
 #undef DEFINE_EVENT_PRINT
 #define DEFINE_EVENT_PRINT(template, call, proto, args, print)		\
 									\
+static const char print_fmt_##call[] = print;				\
+									\
 static struct ftrace_event_call __used					\
 __attribute__((__aligned__(4)))						\
 __attribute__((section("_ftrace_events"))) event_##call = {		\
@@ -755,6 +770,7 @@ __attribute__((section("_ftrace_events"))) event_##call = {		\
 	.raw_init		= trace_event_raw_init,			\
 	.regfunc		= ftrace_raw_reg_event_##call,		\
 	.unregfunc		= ftrace_raw_unreg_event_##call,	\
+	.print_fmt		= print_fmt_##call,			\
 	.show_format		= ftrace_format_##call,			\
 	.define_fields		= ftrace_define_fields_##template,	\
 	_TRACE_PROFILE_INIT(call)					\
@@ -838,6 +854,16 @@ __attribute__((section("_ftrace_events"))) event_##call = {		\
 
 #ifdef CONFIG_EVENT_PROFILE
 
+#undef __entry
+#define __entry entry
+
+#undef __get_dynamic_array
+#define __get_dynamic_array(field)	\
+		((void *)__entry + (__entry->__data_loc_##field & 0xffff))
+
+#undef __get_str
+#define __get_str(field) (char *)__get_dynamic_array(field)
+
 #undef __perf_addr
 #define __perf_addr(a) __addr = (a)
 
diff --git a/kernel/trace/trace_export.c b/kernel/trace/trace_export.c
index 9978a4f..95d14b6 100644
--- a/kernel/trace/trace_export.c
+++ b/kernel/trace/trace_export.c
@@ -203,6 +203,9 @@ static int ftrace_raw_init_event(struct ftrace_event_call *call)
 	return 0;
 }
 
+#undef __entry
+#define __entry REC
+
 #undef __field
 #define __field(type, item)
 
@@ -218,6 +221,9 @@ static int ftrace_raw_init_event(struct ftrace_event_call *call)
 #undef __dynamic_array
 #define __dynamic_array(type, item)
 
+#undef F_printk
+#define F_printk(fmt, args...) #fmt ", "  __stringify(args)
+
 #undef FTRACE_ENTRY
 #define FTRACE_ENTRY(call, struct_name, type, tstruct, print)		\
 									\
@@ -228,6 +234,7 @@ __attribute__((section("_ftrace_events"))) event_##call = {		\
 	.id			= type,					\
 	.system			= __stringify(TRACE_SYSTEM),		\
 	.raw_init		= ftrace_raw_init_event,		\
+	.print_fmt		= print,				\
 	.show_format		= ftrace_format_##call,			\
 	.define_fields		= ftrace_define_fields_##call,		\
 };									\



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

* Re: [PATCH 06/10] tracing: add print_fmt field
  2009-12-09  7:15 [PATCH 06/10] tracing: add " Lai Jiangshan
@ 2009-12-11  0:25 ` Steven Rostedt
  2009-12-11  1:17   ` Lai Jiangshan
  0 siblings, 1 reply; 5+ messages in thread
From: Steven Rostedt @ 2009-12-11  0:25 UTC (permalink / raw)
  To: Lai Jiangshan
  Cc: Ingo Molnar, Frederic Weisbecker, Masami Hiramatsu, Jason Baron,
	LKML

On Wed, 2009-12-09 at 15:15 +0800, Lai Jiangshan wrote:
> Add print_fmt field and the initialization codes.
> It will be used for replacing ->show_format().

This change log is very lacking. I don't even know what this patch is
doing. I'm guessing other patches will depend on it. But this patch
alone should have a change log that describes the goal that will happen
to give it rational.

If I'm bisecting the kernel and I come across this change, I want the
change log to explain why this change exists, and not have to spend time
searching the logs for other patches that may depend on this one.


-- Steve

> 
> Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
> ---
> diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
> index f883406..58db567 100644
> --- a/include/linux/ftrace_event.h
> +++ b/include/linux/ftrace_event.h
> @@ -120,6 +120,7 @@ struct ftrace_event_call {
>  	int			(*regfunc)(struct ftrace_event_call *);
>  	void			(*unregfunc)(struct ftrace_event_call *);
>  	int			id;
> +	const char		*print_fmt;
>  	int			(*raw_init)(struct ftrace_event_call *);
>  	int			(*show_format)(struct ftrace_event_call *,
>  					       struct trace_seq *);
> diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
> index 54258a0..eb63c97 100644
> --- a/include/trace/ftrace.h
> +++ b/include/trace/ftrace.h
> @@ -723,8 +723,20 @@ static struct trace_event ftrace_event_type_##call = {			\
>  
>  #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
>  
> +#undef __entry
> +#define __entry REC
> +
> +#undef __print_flags
> +#undef __print_symbolic
> +#undef __get_dynamic_array
> +#undef __get_str
> +
> +#undef TP_printk
> +#define TP_printk(fmt, args...) #fmt ", "  __stringify(args)
> +
>  #undef DECLARE_EVENT_CLASS
> -#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print)
> +#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print)	\
> +static const char print_fmt_##call[] = print;
>  
>  #undef DEFINE_EVENT
>  #define DEFINE_EVENT(template, call, proto, args)			\
> @@ -738,6 +750,7 @@ __attribute__((section("_ftrace_events"))) event_##call = {		\
>  	.raw_init		= trace_event_raw_init,			\
>  	.regfunc		= ftrace_raw_reg_event_##call,		\
>  	.unregfunc		= ftrace_raw_unreg_event_##call,	\
> +	.print_fmt		= print_fmt_##template,			\
>  	.show_format		= ftrace_format_##template,		\
>  	.define_fields		= ftrace_define_fields_##template,	\
>  	_TRACE_PROFILE_INIT(call)					\
> @@ -746,6 +759,8 @@ __attribute__((section("_ftrace_events"))) event_##call = {		\
>  #undef DEFINE_EVENT_PRINT
>  #define DEFINE_EVENT_PRINT(template, call, proto, args, print)		\
>  									\
> +static const char print_fmt_##call[] = print;				\
> +									\
>  static struct ftrace_event_call __used					\
>  __attribute__((__aligned__(4)))						\
>  __attribute__((section("_ftrace_events"))) event_##call = {		\
> @@ -755,6 +770,7 @@ __attribute__((section("_ftrace_events"))) event_##call = {		\
>  	.raw_init		= trace_event_raw_init,			\
>  	.regfunc		= ftrace_raw_reg_event_##call,		\
>  	.unregfunc		= ftrace_raw_unreg_event_##call,	\
> +	.print_fmt		= print_fmt_##call,			\
>  	.show_format		= ftrace_format_##call,			\
>  	.define_fields		= ftrace_define_fields_##template,	\
>  	_TRACE_PROFILE_INIT(call)					\
> @@ -838,6 +854,16 @@ __attribute__((section("_ftrace_events"))) event_##call = {		\
>  
>  #ifdef CONFIG_EVENT_PROFILE
>  
> +#undef __entry
> +#define __entry entry
> +
> +#undef __get_dynamic_array
> +#define __get_dynamic_array(field)	\
> +		((void *)__entry + (__entry->__data_loc_##field & 0xffff))
> +
> +#undef __get_str
> +#define __get_str(field) (char *)__get_dynamic_array(field)
> +
>  #undef __perf_addr
>  #define __perf_addr(a) __addr = (a)
>  
> diff --git a/kernel/trace/trace_export.c b/kernel/trace/trace_export.c
> index 9978a4f..95d14b6 100644
> --- a/kernel/trace/trace_export.c
> +++ b/kernel/trace/trace_export.c
> @@ -203,6 +203,9 @@ static int ftrace_raw_init_event(struct ftrace_event_call *call)
>  	return 0;
>  }
>  
> +#undef __entry
> +#define __entry REC
> +
>  #undef __field
>  #define __field(type, item)
>  
> @@ -218,6 +221,9 @@ static int ftrace_raw_init_event(struct ftrace_event_call *call)
>  #undef __dynamic_array
>  #define __dynamic_array(type, item)
>  
> +#undef F_printk
> +#define F_printk(fmt, args...) #fmt ", "  __stringify(args)
> +
>  #undef FTRACE_ENTRY
>  #define FTRACE_ENTRY(call, struct_name, type, tstruct, print)		\
>  									\
> @@ -228,6 +234,7 @@ __attribute__((section("_ftrace_events"))) event_##call = {		\
>  	.id			= type,					\
>  	.system			= __stringify(TRACE_SYSTEM),		\
>  	.raw_init		= ftrace_raw_init_event,		\
> +	.print_fmt		= print,				\
>  	.show_format		= ftrace_format_##call,			\
>  	.define_fields		= ftrace_define_fields_##call,		\
>  };									\
> 
> 



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

* Re: [PATCH 06/10] tracing: add print_fmt field
  2009-12-11  0:25 ` Steven Rostedt
@ 2009-12-11  1:17   ` Lai Jiangshan
  0 siblings, 0 replies; 5+ messages in thread
From: Lai Jiangshan @ 2009-12-11  1:17 UTC (permalink / raw)
  To: rostedt
  Cc: Ingo Molnar, Frederic Weisbecker, Masami Hiramatsu, Jason Baron,
	LKML

Steven Rostedt wrote:
> On Wed, 2009-12-09 at 15:15 +0800, Lai Jiangshan wrote:
>> Add print_fmt field and the initialization codes.
>> It will be used for replacing ->show_format().
> 
> This change log is very lacking. I don't even know what this patch is
> doing. I'm guessing other patches will depend on it. But this patch
> alone should have a change log that describes the goal that will happen
> to give it rational.
> 
> If I'm bisecting the kernel and I come across this change, I want the
> change log to explain why this change exists, and not have to spend time
> searching the logs for other patches that may depend on this one.
> 
> 

For a format file

# cat events/irq/irq_handler_entry/format
name: irq_handler_entry
ID: 97
format:

A) ======> name, ID, and a string "format:"

        field:unsigned short common_type;       offset:0;       size:2; signed:0;
        field:unsigned char common_flags;       offset:2;       size:1; signed:0;
        field:unsigned char common_preempt_count;       offset:3;       size:1; signed:0;
        field:int common_pid;   offset:4;       size:4; signed:1;
        field:int common_lock_depth;    offset:8;       size:4; signed:1;

        field:int irq;  offset:12;      size:4; signed:1;
        field:__data_loc char[] name;   offset:16;      size:4; signed:1;

B) ========> fields.

print fmt: "irq=%d name=%s", REC->irq, __get_str(name)

C) ========> string "print fmt: " and the print format after it.

How my patches work:
For B)
Ensure all fields are add into struct ftrace_event_call->fields. (patch#4)
Ensure all fields are correct. (patch#5)

For C)
add a print_fmt field (this patch)
init print_fmt carefully (this patch and patch#7 patch#8)

So when we generate format file:
print name
print ID
print string "format:"
use struct ftrace_event_call->fields to print fields
use struct ftrace_event_call->print_fmt to print "print fmt: XXXXXXXXXXX"

Thanks
-- Lai

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

* [PATCH 06/10] tracing: add print_fmt field
@ 2009-12-15  7:39 Lai Jiangshan
  2010-01-13 10:21 ` [tip:tracing/core] tracing: Add " tip-bot for Lai Jiangshan
  0 siblings, 1 reply; 5+ messages in thread
From: Lai Jiangshan @ 2009-12-15  7:39 UTC (permalink / raw)
  To: Ingo Molnar, Steven Rostedt, Frederic Weisbecker,
	Masami Hiramatsu, Jason Baron, LKML


Adds print_fmt field to struct ftrace_event_call
and some initialization code. But this field is not used now,
the next patches will use it and replace the ->show_format().

It is preparing patch for new way of printing format files which
uses defined fields and a defined print_fmt to print formats.

How will the new way works(and how print_fmt will be used)?
print name
print ID
print string "format:"
use struct ftrace_event_call->fields to print fields
use struct ftrace_event_call->print_fmt to print "print fmt: XXXXXXXXXXX"

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
---
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index f883406..58db567 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -120,6 +120,7 @@ struct ftrace_event_call {
 	int			(*regfunc)(struct ftrace_event_call *);
 	void			(*unregfunc)(struct ftrace_event_call *);
 	int			id;
+	const char		*print_fmt;
 	int			(*raw_init)(struct ftrace_event_call *);
 	int			(*show_format)(struct ftrace_event_call *,
 					       struct trace_seq *);
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index 54258a0..eb63c97 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -723,8 +723,20 @@ static struct trace_event ftrace_event_type_##call = {			\
 
 #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
 
+#undef __entry
+#define __entry REC
+
+#undef __print_flags
+#undef __print_symbolic
+#undef __get_dynamic_array
+#undef __get_str
+
+#undef TP_printk
+#define TP_printk(fmt, args...) #fmt ", "  __stringify(args)
+
 #undef DECLARE_EVENT_CLASS
-#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print)
+#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print)	\
+static const char print_fmt_##call[] = print;
 
 #undef DEFINE_EVENT
 #define DEFINE_EVENT(template, call, proto, args)			\
@@ -738,6 +750,7 @@ __attribute__((section("_ftrace_events"))) event_##call = {		\
 	.raw_init		= trace_event_raw_init,			\
 	.regfunc		= ftrace_raw_reg_event_##call,		\
 	.unregfunc		= ftrace_raw_unreg_event_##call,	\
+	.print_fmt		= print_fmt_##template,			\
 	.show_format		= ftrace_format_##template,		\
 	.define_fields		= ftrace_define_fields_##template,	\
 	_TRACE_PROFILE_INIT(call)					\
@@ -746,6 +759,8 @@ __attribute__((section("_ftrace_events"))) event_##call = {		\
 #undef DEFINE_EVENT_PRINT
 #define DEFINE_EVENT_PRINT(template, call, proto, args, print)		\
 									\
+static const char print_fmt_##call[] = print;				\
+									\
 static struct ftrace_event_call __used					\
 __attribute__((__aligned__(4)))						\
 __attribute__((section("_ftrace_events"))) event_##call = {		\
@@ -755,6 +770,7 @@ __attribute__((section("_ftrace_events"))) event_##call = {		\
 	.raw_init		= trace_event_raw_init,			\
 	.regfunc		= ftrace_raw_reg_event_##call,		\
 	.unregfunc		= ftrace_raw_unreg_event_##call,	\
+	.print_fmt		= print_fmt_##call,			\
 	.show_format		= ftrace_format_##call,			\
 	.define_fields		= ftrace_define_fields_##template,	\
 	_TRACE_PROFILE_INIT(call)					\
@@ -838,6 +854,16 @@ __attribute__((section("_ftrace_events"))) event_##call = {		\
 
 #ifdef CONFIG_EVENT_PROFILE
 
+#undef __entry
+#define __entry entry
+
+#undef __get_dynamic_array
+#define __get_dynamic_array(field)	\
+		((void *)__entry + (__entry->__data_loc_##field & 0xffff))
+
+#undef __get_str
+#define __get_str(field) (char *)__get_dynamic_array(field)
+
 #undef __perf_addr
 #define __perf_addr(a) __addr = (a)
 
diff --git a/kernel/trace/trace_export.c b/kernel/trace/trace_export.c
index 9978a4f..95d14b6 100644
--- a/kernel/trace/trace_export.c
+++ b/kernel/trace/trace_export.c
@@ -203,6 +203,9 @@ static int ftrace_raw_init_event(struct ftrace_event_call *call)
 	return 0;
 }
 
+#undef __entry
+#define __entry REC
+
 #undef __field
 #define __field(type, item)
 
@@ -218,6 +221,9 @@ static int ftrace_raw_init_event(struct ftrace_event_call *call)
 #undef __dynamic_array
 #define __dynamic_array(type, item)
 
+#undef F_printk
+#define F_printk(fmt, args...) #fmt ", "  __stringify(args)
+
 #undef FTRACE_ENTRY
 #define FTRACE_ENTRY(call, struct_name, type, tstruct, print)		\
 									\
@@ -228,6 +234,7 @@ __attribute__((section("_ftrace_events"))) event_##call = {		\
 	.id			= type,					\
 	.system			= __stringify(TRACE_SYSTEM),		\
 	.raw_init		= ftrace_raw_init_event,		\
+	.print_fmt		= print,				\
 	.show_format		= ftrace_format_##call,			\
 	.define_fields		= ftrace_define_fields_##call,		\
 };									\






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

* [tip:tracing/core] tracing: Add print_fmt field
  2009-12-15  7:39 [PATCH 06/10] tracing: add print_fmt field Lai Jiangshan
@ 2010-01-13 10:21 ` tip-bot for Lai Jiangshan
  0 siblings, 0 replies; 5+ messages in thread
From: tip-bot for Lai Jiangshan @ 2010-01-13 10:21 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, rostedt, tglx, laijs

Commit-ID:  509e760cd91c831983097ae174cb6c0b8c6c8e6b
Gitweb:     http://git.kernel.org/tip/509e760cd91c831983097ae174cb6c0b8c6c8e6b
Author:     Lai Jiangshan <laijs@cn.fujitsu.com>
AuthorDate: Tue, 15 Dec 2009 15:39:42 +0800
Committer:  Steven Rostedt <rostedt@goodmis.org>
CommitDate: Wed, 6 Jan 2010 11:41:54 -0500

tracing: Add print_fmt field

This is part of a patch set that removes the show_format method
in the ftrace event macros.

The print_fmt field is added to hold the string that shows
the print_fmt in the event format files. This patch only adds
the field but it is currently not used. Later patches will use
this field to enable us to remove the show_format field
and function.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
LKML-Reference: <4B273D3E.2000704@cn.fujitsu.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 include/linux/ftrace_event.h |    1 +
 include/trace/ftrace.h       |   28 +++++++++++++++++++++++++++-
 kernel/trace/trace_export.c  |    7 +++++++
 3 files changed, 35 insertions(+), 1 deletions(-)

diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index 2233c98..bd23d8e 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -121,6 +121,7 @@ struct ftrace_event_call {
 	int			(*regfunc)(struct ftrace_event_call *);
 	void			(*unregfunc)(struct ftrace_event_call *);
 	int			id;
+	const char		*print_fmt;
 	int			(*raw_init)(struct ftrace_event_call *);
 	int			(*show_format)(struct ftrace_event_call *,
 					       struct trace_seq *);
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index c6fe03e..3351d85 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -722,8 +722,20 @@ static struct trace_event ftrace_event_type_##call = {			\
 
 #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
 
+#undef __entry
+#define __entry REC
+
+#undef __print_flags
+#undef __print_symbolic
+#undef __get_dynamic_array
+#undef __get_str
+
+#undef TP_printk
+#define TP_printk(fmt, args...) "\"" fmt "\", "  __stringify(args)
+
 #undef DECLARE_EVENT_CLASS
-#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print)
+#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print)	\
+static const char print_fmt_##call[] = print;
 
 #undef DEFINE_EVENT
 #define DEFINE_EVENT(template, call, proto, args)			\
@@ -737,6 +749,7 @@ __attribute__((section("_ftrace_events"))) event_##call = {		\
 	.raw_init		= trace_event_raw_init,			\
 	.regfunc		= ftrace_raw_reg_event_##call,		\
 	.unregfunc		= ftrace_raw_unreg_event_##call,	\
+	.print_fmt		= print_fmt_##template,			\
 	.show_format		= ftrace_format_##template,		\
 	.define_fields		= ftrace_define_fields_##template,	\
 	_TRACE_PROFILE_INIT(call)					\
@@ -745,6 +758,8 @@ __attribute__((section("_ftrace_events"))) event_##call = {		\
 #undef DEFINE_EVENT_PRINT
 #define DEFINE_EVENT_PRINT(template, call, proto, args, print)		\
 									\
+static const char print_fmt_##call[] = print;				\
+									\
 static struct ftrace_event_call __used					\
 __attribute__((__aligned__(4)))						\
 __attribute__((section("_ftrace_events"))) event_##call = {		\
@@ -754,6 +769,7 @@ __attribute__((section("_ftrace_events"))) event_##call = {		\
 	.raw_init		= trace_event_raw_init,			\
 	.regfunc		= ftrace_raw_reg_event_##call,		\
 	.unregfunc		= ftrace_raw_unreg_event_##call,	\
+	.print_fmt		= print_fmt_##call,			\
 	.show_format		= ftrace_format_##call,			\
 	.define_fields		= ftrace_define_fields_##template,	\
 	_TRACE_PROFILE_INIT(call)					\
@@ -837,6 +853,16 @@ __attribute__((section("_ftrace_events"))) event_##call = {		\
 
 #ifdef CONFIG_EVENT_PROFILE
 
+#undef __entry
+#define __entry entry
+
+#undef __get_dynamic_array
+#define __get_dynamic_array(field)	\
+		((void *)__entry + (__entry->__data_loc_##field & 0xffff))
+
+#undef __get_str
+#define __get_str(field) (char *)__get_dynamic_array(field)
+
 #undef __perf_addr
 #define __perf_addr(a) __addr = (a)
 
diff --git a/kernel/trace/trace_export.c b/kernel/trace/trace_export.c
index 9978a4f..95d14b6 100644
--- a/kernel/trace/trace_export.c
+++ b/kernel/trace/trace_export.c
@@ -203,6 +203,9 @@ static int ftrace_raw_init_event(struct ftrace_event_call *call)
 	return 0;
 }
 
+#undef __entry
+#define __entry REC
+
 #undef __field
 #define __field(type, item)
 
@@ -218,6 +221,9 @@ static int ftrace_raw_init_event(struct ftrace_event_call *call)
 #undef __dynamic_array
 #define __dynamic_array(type, item)
 
+#undef F_printk
+#define F_printk(fmt, args...) #fmt ", "  __stringify(args)
+
 #undef FTRACE_ENTRY
 #define FTRACE_ENTRY(call, struct_name, type, tstruct, print)		\
 									\
@@ -228,6 +234,7 @@ __attribute__((section("_ftrace_events"))) event_##call = {		\
 	.id			= type,					\
 	.system			= __stringify(TRACE_SYSTEM),		\
 	.raw_init		= ftrace_raw_init_event,		\
+	.print_fmt		= print,				\
 	.show_format		= ftrace_format_##call,			\
 	.define_fields		= ftrace_define_fields_##call,		\
 };									\

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

end of thread, other threads:[~2010-01-13 10:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-15  7:39 [PATCH 06/10] tracing: add print_fmt field Lai Jiangshan
2010-01-13 10:21 ` [tip:tracing/core] tracing: Add " tip-bot for Lai Jiangshan
  -- strict thread matches above, loose matches on Subject: below --
2009-12-09  7:15 [PATCH 06/10] tracing: add " Lai Jiangshan
2009-12-11  0:25 ` Steven Rostedt
2009-12-11  1:17   ` Lai Jiangshan

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