diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/ftrace_event.h | 5 | ||||
-rw-r--r-- | include/linux/syscalls.h | 14 | ||||
-rw-r--r-- | include/trace/ftrace.h | 11 | ||||
-rw-r--r-- | include/trace/syscall.h | 4 |
4 files changed, 19 insertions, 15 deletions
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index e665ed3..479c3c1 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h @@ -130,6 +130,9 @@ struct ftrace_event_class { #endif int (*reg)(struct ftrace_event_call *event, enum trace_reg type); + int (*define_fields)(struct ftrace_event_call *); + struct list_head *(*get_fields)(struct ftrace_event_call *); + struct list_head fields; }; struct ftrace_event_call { @@ -142,8 +145,6 @@ struct ftrace_event_call { int id; const char *print_fmt; int (*raw_init)(struct ftrace_event_call *); - int (*define_fields)(struct ftrace_event_call *); - struct list_head fields; int filter_active; struct event_filter *filter; void *mod; diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index e3348c4..fd0f1f2 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -122,7 +122,7 @@ extern struct ftrace_event_class event_class_syscall_enter; extern struct ftrace_event_class event_class_syscall_exit; #define SYSCALL_TRACE_ENTER_EVENT(sname) \ - static const struct syscall_metadata __syscall_meta_##sname; \ + static struct syscall_metadata __syscall_meta_##sname; \ static struct ftrace_event_call \ __attribute__((__aligned__(4))) event_enter_##sname; \ static struct trace_event enter_syscall_print_##sname = { \ @@ -136,12 +136,11 @@ extern struct ftrace_event_class event_class_syscall_exit; .class = &event_class_syscall_enter, \ .event = &enter_syscall_print_##sname, \ .raw_init = init_syscall_trace, \ - .define_fields = syscall_enter_define_fields, \ .data = (void *)&__syscall_meta_##sname,\ } #define SYSCALL_TRACE_EXIT_EVENT(sname) \ - static const struct syscall_metadata __syscall_meta_##sname; \ + static struct syscall_metadata __syscall_meta_##sname; \ static struct ftrace_event_call \ __attribute__((__aligned__(4))) event_exit_##sname; \ static struct trace_event exit_syscall_print_##sname = { \ @@ -155,14 +154,13 @@ extern struct ftrace_event_class event_class_syscall_exit; .class = &event_class_syscall_exit, \ .event = &exit_syscall_print_##sname, \ .raw_init = init_syscall_trace, \ - .define_fields = syscall_exit_define_fields, \ .data = (void *)&__syscall_meta_##sname,\ } #define SYSCALL_METADATA(sname, nb) \ SYSCALL_TRACE_ENTER_EVENT(sname); \ SYSCALL_TRACE_EXIT_EVENT(sname); \ - static const struct syscall_metadata __used \ + static struct syscall_metadata __used \ __attribute__((__aligned__(4))) \ __attribute__((section("__syscalls_metadata"))) \ __syscall_meta_##sname = { \ @@ -172,12 +170,14 @@ extern struct ftrace_event_class event_class_syscall_exit; .args = args_##sname, \ .enter_event = &event_enter_##sname, \ .exit_event = &event_exit_##sname, \ + .enter_fields = LIST_HEAD_INIT(__syscall_meta_##sname.enter_fields), \ + .exit_fields = LIST_HEAD_INIT(__syscall_meta_##sname.exit_fields), \ }; #define SYSCALL_DEFINE0(sname) \ SYSCALL_TRACE_ENTER_EVENT(_##sname); \ SYSCALL_TRACE_EXIT_EVENT(_##sname); \ - static const struct syscall_metadata __used \ + static struct syscall_metadata __used \ __attribute__((__aligned__(4))) \ __attribute__((section("__syscalls_metadata"))) \ __syscall_meta__##sname = { \ @@ -185,6 +185,8 @@ extern struct ftrace_event_class event_class_syscall_exit; .nb_args = 0, \ .enter_event = &event_enter__##sname, \ .exit_event = &event_exit__##sname, \ + .enter_fields = LIST_HEAD_INIT(__syscall_meta__##sname.enter_fields), \ + .exit_fields = LIST_HEAD_INIT(__syscall_meta__##sname.exit_fields), \ }; \ asmlinkage long sys_##sname(void) #else diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index 26d1324..c7e3bcd5 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h @@ -430,6 +430,9 @@ static inline notrace int ftrace_get_offsets_##call( \ * * static struct ftrace_event_class __used event_class_<template> = { * .system = "<system>", + * .define_fields = ftrace_define_fields_<call>, + * .fields = LIST_HEAD_INIT(event_class_##call.fields), \ + * .probe = ftrace_raw_event_##call, \ * }; * * static struct ftrace_event_call __used @@ -438,10 +441,8 @@ static inline notrace int ftrace_get_offsets_##call( \ * .name = "<call>", * .class = event_class_<template>, * .raw_init = trace_event_raw_init, - * .regfunc = ftrace_raw_reg_event_<call>, - * .unregfunc = ftrace_raw_unreg_event_<call>, + * .event = &ftrace_event_type_<call>, * .print_fmt = print_fmt_<call>, - * .define_fields = ftrace_define_fields_<call>, * }; * */ @@ -563,6 +564,8 @@ _TRACE_PERF_PROTO(call, PARAMS(proto)); \ static const char print_fmt_##call[] = print; \ static struct ftrace_event_class __used event_class_##call = { \ .system = __stringify(TRACE_SYSTEM), \ + .define_fields = ftrace_define_fields_##call, \ + .fields = LIST_HEAD_INIT(event_class_##call.fields),\ .probe = ftrace_raw_event_##call, \ _TRACE_PERF_INIT(call) \ }; @@ -578,7 +581,6 @@ __attribute__((section("_ftrace_events"))) event_##call = { \ .event = &ftrace_event_type_##call, \ .raw_init = trace_event_raw_init, \ .print_fmt = print_fmt_##template, \ - .define_fields = ftrace_define_fields_##template, \ }; #undef DEFINE_EVENT_PRINT @@ -594,7 +596,6 @@ __attribute__((section("_ftrace_events"))) event_##call = { \ .event = &ftrace_event_type_##call, \ .raw_init = trace_event_raw_init, \ .print_fmt = print_fmt_##call, \ - .define_fields = ftrace_define_fields_##template, \ } #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) diff --git a/include/trace/syscall.h b/include/trace/syscall.h index e5e5f48..3964774 100644 --- a/include/trace/syscall.h +++ b/include/trace/syscall.h @@ -25,6 +25,8 @@ struct syscall_metadata { int nb_args; const char **types; const char **args; + struct list_head enter_fields; + struct list_head exit_fields; struct ftrace_event_call *enter_event; struct ftrace_event_call *exit_event; @@ -34,8 +36,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_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); extern void unreg_event_syscall_enter(struct ftrace_event_call *call); extern int reg_event_syscall_exit(struct ftrace_event_call *call); |