Skip to contentSkip to conversation

tracing: delete ->show_format()

PATCH In review Lai Jiangshan 1 participant 2 messages Dec 15, 2009 – Jan 13, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 10/10 tracing: delete ->show_format()

->show_format() is not used now.
remove ->show_format() and corresponding codes.

---
 include/linux/ftrace_event.h  |    2
 include/linux/syscalls.h      |    2
 include/trace/ftrace.h        |  133 +-----------------------------------------
 include/trace/syscall.h       |    4 -
 kernel/trace/trace_events.c   |   31 ---------
 kernel/trace/trace_export.c   |   73 -----------------------
 kernel/trace/trace_kprobe.c   |   78 ------------------------
 kernel/trace/trace_syscalls.c |   66 --------------------
 8 files changed, 6 insertions(+), 383 deletions(-)
include/linux/ftrace_event.h +0 -2
index 58db567..e44f9a3 100644
@@ -122,8 +122,6 @@ 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 *);
 	int			(*define_fields)(struct ftrace_event_call *);
 	struct list_head	fields;
 	int			filter_active;
include/linux/syscalls.h +0 -2
index bee1d41..6b5985b 100644
@@ -145,7 +145,6 @@ struct perf_event_attr;
 		.system                 = "syscalls",			\
 		.event                  = &enter_syscall_print_##sname,	\
 		.raw_init		= init_syscall_trace,		\
-		.show_format		= syscall_enter_format,		\
 		.define_fields		= syscall_enter_define_fields,	\
 		.regfunc		= reg_event_syscall_enter,	\
 		.unregfunc		= unreg_event_syscall_enter,	\
@@ -167,7 +166,6 @@ struct perf_event_attr;
 		.system                 = "syscalls",			\
 		.event                  = &exit_syscall_print_##sname,	\
 		.raw_init		= init_syscall_trace,		\
-		.show_format		= syscall_exit_format,		\
 		.define_fields		= syscall_exit_define_fields,	\
 		.regfunc		= reg_event_syscall_exit,	\
 		.unregfunc		= unreg_event_syscall_exit,	\
include/trace/ftrace.h +6 -127

163 lines not on this page · raw message

include/trace/syscall.h +0 -4
index 961fda3..8cd4102 100644
@@ -34,10 +34,6 @@ struct syscall_metadata {
 extern unsigned long arch_syscall_addr(int nr);
 extern int init_syscall_trace(struct ftrace_event_call *call);
 
-extern int syscall_enter_format(struct ftrace_event_call *call,
-				struct trace_seq *s);
-extern int syscall_exit_format(struct ftrace_event_call *call,
-				struct trace_seq *s);
 extern int syscall_enter_define_fields(struct ftrace_event_call *call);
 extern int syscall_exit_define_fields(struct ftrace_event_call *call);
 extern int reg_event_syscall_enter(struct ftrace_event_call *call);
kernel/trace/trace_events.c +0 -31
index d12e75c..4474661 100644
@@ -519,33 +519,6 @@ out:
 	return ret;
 }
 
-extern char *__bad_type_size(void);
-
-#undef FIELD
-#define FIELD(type, name)						\
-	sizeof(type) != sizeof(field.name) ? __bad_type_size() :	\
-	#type, "common_" #name, offsetof(typeof(field), name),		\
-		sizeof(field.name), is_signed_type(type)
-
-static int trace_write_header(struct trace_seq *s)
-{
-	struct trace_entry field;
-
-	/* struct trace_entry */
-	return trace_seq_printf(s,
-			"\tfield:%s %s;\toffset:%zu;\tsize:%zu;\tsigned:%u;\n"
-			"\tfield:%s %s;\toffset:%zu;\tsize:%zu;\tsigned:%u;\n"
-			"\tfield:%s %s;\toffset:%zu;\tsize:%zu;\tsigned:%u;\n"
-			"\tfield:%s %s;\toffset:%zu;\tsize:%zu;\tsigned:%u;\n"
-			"\tfield:%s %s;\toffset:%zu;\tsize:%zu;\tsigned:%u;\n"
-			"\n",
-			FIELD(unsigned short, type),
-			FIELD(unsigned char, flags),
-			FIELD(unsigned char, preempt_count),
-			FIELD(int, pid),
-			FIELD(int, lock_depth));
-}
-
 static ssize_t
 event_format_read(struct file *filp, char __user *ubuf, size_t cnt,
 		  loff_t *ppos)
@@ -977,10 +950,6 @@ event_create_dir(struct ftrace_event_call *call, struct dentry *d_events,
 				  filter);
 	}
 
-	/* A trace may not want to export its format */
-	if (!call->show_format)
-		return 0;
-
 	trace_create_file("format", 0444, call->dir, call,
 			  format);
 
kernel/trace/trace_export.c +0 -73

85 lines not on this page · raw message

kernel/trace/trace_kprobe.c +0 -78

94 lines not on this page · raw message

kernel/trace/trace_syscalls.c +0 -66

78 lines not on this page · raw message

#1 lore raw

[tip:tracing/core] tracing: Remove show_format and related macros from TRACE_EVENT

Commit-ID:  0fa0edaf32b9a78b9854f1da98d4511a501089b0
Gitweb:     http://git.kernel.org/tip/0fa0edaf32b9a78b9854f1da98d4511a501089b0
Author:     Lai Jiangshan <[email protected]>
AuthorDate: Tue, 15 Dec 2009 15:39:57 +0800
Committer:  Steven Rostedt <[email protected]>
CommitDate: Wed, 6 Jan 2010 12:08:46 -0500

tracing: Remove show_format and related macros from TRACE_EVENT

The previous patches added the use of print_fmt string and changes the trace_define_field() function to also create the fields and format output for the event format files.

text data bss dec hex filename
5857201 1355780 9336808 16549789 fc879d vmlinux
5884589 1351684 9337896 16574169 fce6d9 vmlinux-orig

The above shows the size of the vmlinux after this patch set compared to the vmlinux-orig which is before the patch set.

This saves us 27k on text, 1k on bss and adds just 4k of data.

The total savings of 24k in size.

LKML-Reference: <[email protected]>

---
 include/linux/ftrace_event.h  |    2 -
 include/linux/syscalls.h      |    2 -
 include/trace/ftrace.h        |  133 ++---------------------------------------
 include/trace/syscall.h       |    4 -
 kernel/trace/trace_events.c   |   12 ----
 kernel/trace/trace_export.c   |   73 ----------------------
 kernel/trace/trace_kprobe.c   |   78 ------------------------
 kernel/trace/trace_syscalls.c |   66 --------------------
 8 files changed, 6 insertions(+), 364 deletions(-)
include/linux/ftrace_event.h +0 -2
index bd23d8e..84a5629 100644
@@ -123,8 +123,6 @@ 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 *);
 	int			(*define_fields)(struct ftrace_event_call *);
 	struct list_head	fields;
 	int			filter_active;
include/linux/syscalls.h +0 -2
index ed353d2..7b21969 100644
@@ -144,7 +144,6 @@ struct perf_event_attr;
 		.system                 = "syscalls",			\
 		.event                  = &enter_syscall_print_##sname,	\
 		.raw_init		= init_syscall_trace,		\
-		.show_format		= syscall_enter_format,		\
 		.define_fields		= syscall_enter_define_fields,	\
 		.regfunc		= reg_event_syscall_enter,	\
 		.unregfunc		= unreg_event_syscall_enter,	\
@@ -166,7 +165,6 @@ struct perf_event_attr;
 		.system                 = "syscalls",			\
 		.event                  = &exit_syscall_print_##sname,	\
 		.raw_init		= init_syscall_trace,		\
-		.show_format		= syscall_exit_format,		\
 		.define_fields		= syscall_exit_define_fields,	\
 		.regfunc		= reg_event_syscall_exit,	\
 		.unregfunc		= unreg_event_syscall_exit,	\
include/trace/ftrace.h +6 -127

163 lines not on this page · raw message

include/trace/syscall.h +0 -4
index 961fda3..8cd4102 100644
@@ -34,10 +34,6 @@ struct syscall_metadata {
 extern unsigned long arch_syscall_addr(int nr);
 extern int init_syscall_trace(struct ftrace_event_call *call);
 
-extern int syscall_enter_format(struct ftrace_event_call *call,
-				struct trace_seq *s);
-extern int syscall_exit_format(struct ftrace_event_call *call,
-				struct trace_seq *s);
 extern int syscall_enter_define_fields(struct ftrace_event_call *call);
 extern int syscall_exit_define_fields(struct ftrace_event_call *call);
 extern int reg_event_syscall_enter(struct ftrace_event_call *call);
kernel/trace/trace_events.c +0 -12
index 250ec86..c2a3077 100644
@@ -520,14 +520,6 @@ out:
 	return ret;
 }
 
-extern char *__bad_type_size(void);
-
-#undef FIELD
-#define FIELD(type, name)						\
-	sizeof(type) != sizeof(field.name) ? __bad_type_size() :	\
-	#type, "common_" #name, offsetof(typeof(field), name),		\
-		sizeof(field.name), is_signed_type(type)
-
 static ssize_t
 event_format_read(struct file *filp, char __user *ubuf, size_t cnt,
 		  loff_t *ppos)
@@ -965,10 +957,6 @@ event_create_dir(struct ftrace_event_call *call, struct dentry *d_events,
 				  filter);
 	}
 
-	/* A trace may not want to export its format */
-	if (!call->show_format)
-		return 0;
-
 	trace_create_file("format", 0444, call->dir, call,
 			  format);
 
kernel/trace/trace_export.c +0 -73

85 lines not on this page · raw message

kernel/trace/trace_kprobe.c +0 -78

94 lines not on this page · raw message

kernel/trace/trace_syscalls.c +0 -66

78 lines not on this page · raw message