int (*define_fields)(struct ftrace_event_call *);
struct list_head *(*get_fields)(struct ftrace_event_call *);
struct list_head fields;
+ int (*raw_init)(struct ftrace_event_call *);
};
struct ftrace_event_call {
int enabled;
int id;
const char *print_fmt;
- int (*raw_init)(struct ftrace_event_call *);
int filter_active;
struct event_filter *filter;
void *mod;
.name = "sys_enter"#sname, \
.class = &event_class_syscall_enter, \
.event = &enter_syscall_print_##sname, \
- .raw_init = init_syscall_trace, \
.data = (void *)&__syscall_meta_##sname,\
}
.name = "sys_exit"#sname, \
.class = &event_class_syscall_exit, \
.event = &exit_syscall_print_##sname, \
- .raw_init = init_syscall_trace, \
.data = (void *)&__syscall_meta_##sname,\
}
* 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, \
+ * .fields = LIST_HEAD_INIT(event_class_##call.fields),
+ * .raw_init = trace_event_raw_init,
+ * .probe = ftrace_raw_event_##call,
* };
*
* static struct ftrace_event_call __used
* __attribute__((section("_ftrace_events"))) event_<call> = {
* .name = "<call>",
* .class = event_class_<template>,
- * .raw_init = trace_event_raw_init,
* .event = &ftrace_event_type_<call>,
* .print_fmt = print_fmt_<call>,
* };
.system = __stringify(TRACE_SYSTEM), \
.define_fields = ftrace_define_fields_##call, \
.fields = LIST_HEAD_INIT(event_class_##call.fields),\
+ .raw_init = trace_event_raw_init, \
.probe = ftrace_raw_event_##call, \
_TRACE_PERF_INIT(call) \
};
.name = #call, \
.class = &event_class_##template, \
.event = &ftrace_event_type_##call, \
- .raw_init = trace_event_raw_init, \
.print_fmt = print_fmt_##template, \
};
.name = #call, \
.class = &event_class_##template, \
.event = &ftrace_event_type_##call, \
- .raw_init = trace_event_raw_init, \
.print_fmt = print_fmt_##call, \
}
if (!call->name)
return -EINVAL;
- if (call->raw_init) {
- ret = call->raw_init(call);
+ if (call->class->raw_init) {
+ ret = call->class->raw_init(call);
if (ret < 0) {
if (ret != -ENOSYS)
pr_warning("Could not initialize trace "
/* The linker may leave blanks */
if (!call->name)
continue;
- if (call->raw_init) {
- ret = call->raw_init(call);
+ if (call->class->raw_init) {
+ ret = call->class->raw_init(call);
if (ret < 0) {
if (ret != -ENOSYS)
pr_warning("Could not initialize trace "
/* The linker may leave blanks */
if (!call->name)
continue;
- if (call->raw_init) {
- ret = call->raw_init(call);
+ if (call->class->raw_init) {
+ ret = call->class->raw_init(call);
if (ret < 0) {
if (ret != -ENOSYS)
pr_warning("Could not initialize trace "
struct ftrace_event_class event_class_ftrace_##call = { \
.system = __stringify(TRACE_SYSTEM), \
.define_fields = ftrace_define_fields_##call, \
+ .raw_init = ftrace_raw_init_event, \
}; \
\
struct ftrace_event_call __used \
.name = #call, \
.id = type, \
.class = &event_class_ftrace_##call, \
- .raw_init = ftrace_raw_init_event, \
.print_fmt = print, \
}; \
/* Initialize ftrace_event_call */
if (probe_is_return(tp)) {
tp->event.trace = print_kretprobe_event;
- call->raw_init = probe_event_raw_init;
INIT_LIST_HEAD(&call->class->fields);
+ call->class->raw_init = probe_event_raw_init;
call->class->define_fields = kretprobe_event_define_fields;
} else {
- tp->event.trace = print_kprobe_event;
- call->raw_init = probe_event_raw_init;
INIT_LIST_HEAD(&call->class->fields);
+ tp->event.trace = print_kprobe_event;
+ call->class->raw_init = probe_event_raw_init;
call->class->define_fields = kprobe_event_define_fields;
}
if (set_print_fmt(tp) < 0)
.reg = syscall_enter_register,
.define_fields = syscall_enter_define_fields,
.get_fields = syscall_get_enter_fields,
+ .raw_init = init_syscall_trace,
};
struct ftrace_event_class event_class_syscall_exit = {
.reg = syscall_exit_register,
.define_fields = syscall_exit_define_fields,
.get_fields = syscall_get_exit_fields,
+ .raw_init = init_syscall_trace,
};
extern unsigned long __start_syscalls_metadata[];