diff options
author | Steven Rostedt <srostedt@redhat.com> | 2010-04-20 10:47:33 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2010-05-14 09:33:49 -0400 |
commit | 8f0820183056ad26dabc0202115848a92f1143fc (patch) | |
tree | c9e1cb9d41e37d5075704efbde3c97121820e0c5 /include | |
parent | 23e117fa44429cc054cb27d5621d64e4ced91e52 (diff) | |
download | linux-8f0820183056ad26dabc0202115848a92f1143fc.tar.gz linux-8f0820183056ad26dabc0202115848a92f1143fc.tar.bz2 linux-8f0820183056ad26dabc0202115848a92f1143fc.zip |
tracing: Create class struct for events
This patch creates a ftrace_event_class struct that event structs point to.
This class struct will be made to hold information to modify the
events. Currently the class struct only holds the events system name.
This patch slightly increases the size, but this change lays the ground work
of other changes to make the footprint of tracepoints smaller.
With 82 standard tracepoints, and 618 system call tracepoints
(two tracepoints per syscall: enter and exit):
text data bss dec hex filename
4913961 1088356 861512 6863829 68bbd5 vmlinux.orig
4914025 1088868 861512 6864405 68be15 vmlinux.class
This patch also cleans up some stale comments in ftrace.h.
v2: Fixed missing semi-colon in macro.
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Acked-by: Masami Hiramatsu <mhiramat@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/ftrace_event.h | 6 | ||||
-rw-r--r-- | include/linux/syscalls.h | 6 | ||||
-rw-r--r-- | include/trace/ftrace.h | 44 |
3 files changed, 28 insertions, 28 deletions
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 39e71b0a3bfd..496eea898ee4 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h @@ -113,10 +113,14 @@ void tracing_record_cmdline(struct task_struct *tsk); struct event_filter; +struct ftrace_event_class { + char *system; +}; + struct ftrace_event_call { struct list_head list; + struct ftrace_event_class *class; char *name; - char *system; struct dentry *dir; struct trace_event *event; int enabled; diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 057929b0a651..ac5791df2506 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -134,6 +134,8 @@ struct perf_event_attr; #define __SC_STR_TDECL5(t, a, ...) #t, __SC_STR_TDECL4(__VA_ARGS__) #define __SC_STR_TDECL6(t, a, ...) #t, __SC_STR_TDECL5(__VA_ARGS__) +extern struct ftrace_event_class event_class_syscalls; + #define SYSCALL_TRACE_ENTER_EVENT(sname) \ static const struct syscall_metadata __syscall_meta_##sname; \ static struct ftrace_event_call \ @@ -146,7 +148,7 @@ struct perf_event_attr; __attribute__((section("_ftrace_events"))) \ event_enter_##sname = { \ .name = "sys_enter"#sname, \ - .system = "syscalls", \ + .class = &event_class_syscalls, \ .event = &enter_syscall_print_##sname, \ .raw_init = init_syscall_trace, \ .define_fields = syscall_enter_define_fields, \ @@ -168,7 +170,7 @@ struct perf_event_attr; __attribute__((section("_ftrace_events"))) \ event_exit_##sname = { \ .name = "sys_exit"#sname, \ - .system = "syscalls", \ + .class = &event_class_syscalls, \ .event = &exit_syscall_print_##sname, \ .raw_init = init_syscall_trace, \ .define_fields = syscall_exit_define_fields, \ diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index 75dd7787fb37..7dcdfd824aab 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h @@ -62,7 +62,10 @@ struct trace_entry ent; \ tstruct \ char __data[0]; \ - }; + }; \ + \ + static struct ftrace_event_class event_class_##name; + #undef DEFINE_EVENT #define DEFINE_EVENT(template, name, proto, args) \ static struct ftrace_event_call \ @@ -430,22 +433,6 @@ perf_trace_disable_##name(struct ftrace_event_call *unused) \ * * Override the macros in <trace/trace_events.h> to include the following: * - * static void ftrace_event_<call>(proto) - * { - * event_trace_printk(_RET_IP_, "<call>: " <fmt>); - * } - * - * static int ftrace_reg_event_<call>(struct ftrace_event_call *unused) - * { - * return register_trace_<call>(ftrace_event_<call>); - * } - * - * static void ftrace_unreg_event_<call>(struct ftrace_event_call *unused) - * { - * unregister_trace_<call>(ftrace_event_<call>); - * } - * - * * For those macros defined with TRACE_EVENT: * * static struct ftrace_event_call event_<call>; @@ -497,17 +484,21 @@ perf_trace_disable_##name(struct ftrace_event_call *unused) \ * * static const char print_fmt_<call>[] = <TP_printk>; * + * static struct ftrace_event_class __used event_class_<template> = { + * .system = "<system>", + * }; + * * static struct ftrace_event_call __used * __attribute__((__aligned__(4))) * __attribute__((section("_ftrace_events"))) event_<call> = { * .name = "<call>", - * .system = "<system>", + * .class = event_class_<template>, * .raw_init = trace_event_raw_init, - * .regfunc = ftrace_reg_event_<call>, - * .unregfunc = ftrace_unreg_event_<call>, + * .regfunc = ftrace_raw_reg_event_<call>, + * .unregfunc = ftrace_raw_unreg_event_<call>, * .print_fmt = print_fmt_<call>, * .define_fields = ftrace_define_fields_<call>, - * } + * }; * */ @@ -627,7 +618,10 @@ static struct trace_event ftrace_event_type_##call = { \ #undef DECLARE_EVENT_CLASS #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ -static const char print_fmt_##call[] = print; +static const char print_fmt_##call[] = print; \ +static struct ftrace_event_class __used event_class_##call = { \ + .system = __stringify(TRACE_SYSTEM) \ +}; #undef DEFINE_EVENT #define DEFINE_EVENT(template, call, proto, args) \ @@ -636,7 +630,7 @@ static struct ftrace_event_call __used \ __attribute__((__aligned__(4))) \ __attribute__((section("_ftrace_events"))) event_##call = { \ .name = #call, \ - .system = __stringify(TRACE_SYSTEM), \ + .class = &event_class_##template, \ .event = &ftrace_event_type_##call, \ .raw_init = trace_event_raw_init, \ .regfunc = ftrace_raw_reg_event_##call, \ @@ -644,7 +638,7 @@ __attribute__((section("_ftrace_events"))) event_##call = { \ .print_fmt = print_fmt_##template, \ .define_fields = ftrace_define_fields_##template, \ _TRACE_PERF_INIT(call) \ -} +}; #undef DEFINE_EVENT_PRINT #define DEFINE_EVENT_PRINT(template, call, proto, args, print) \ @@ -655,7 +649,7 @@ static struct ftrace_event_call __used \ __attribute__((__aligned__(4))) \ __attribute__((section("_ftrace_events"))) event_##call = { \ .name = #call, \ - .system = __stringify(TRACE_SYSTEM), \ + .class = &event_class_##template, \ .event = &ftrace_event_type_##call, \ .raw_init = trace_event_raw_init, \ .regfunc = ftrace_raw_reg_event_##call, \ |