DECLARE_BITMAP(sc_compat_exit, NR_compat_syscalls);
};
-static
-int lttng_syscalls_create_matching_event_notifiers(struct lttng_event_enabler_common *event_enabler);
-
static void syscall_entry_event_unknown(struct hlist_head *unknown_action_list_head,
struct pt_regs *regs, long id)
{
}
static
-int lttng_syscalls_populate_events(struct lttng_event_enabler_common *syscall_event_enabler)
+void lttng_syscall_event_enabler_create_matching_events(struct lttng_event_enabler_common *event_enabler)
{
- struct lttng_event_recorder_enabler *event_recorder_enabler;
- struct lttng_kernel_channel_buffer *chan;
- int ret;
-
- if (syscall_event_enabler->enabler_type != LTTNG_EVENT_ENABLER_TYPE_RECORDER)
- return 0;
- event_recorder_enabler = container_of(syscall_event_enabler, struct lttng_event_recorder_enabler, parent);
- chan = event_recorder_enabler->chan;
-
- lttng_syscall_event_enabler_create_matching_syscall_table_events(&event_recorder_enabler->parent, sc_table.table, sc_table.len, SC_TYPE_ENTRY);
- lttng_syscall_event_enabler_create_matching_syscall_table_events(&event_recorder_enabler->parent, sc_exit_table.table, sc_exit_table.len, SC_TYPE_EXIT);
- create_unknown_syscall_event(syscall_event_enabler, SC_TYPE_ENTRY);
- create_unknown_syscall_event(syscall_event_enabler, SC_TYPE_EXIT);
+ enum lttng_kernel_abi_syscall_entryexit entryexit = event_enabler->event_param.u.syscall.entryexit;
- lttng_syscall_event_enabler_create_matching_syscall_table_events(&event_recorder_enabler->parent, compat_sc_table.table, compat_sc_table.len, SC_TYPE_COMPAT_ENTRY);
- lttng_syscall_event_enabler_create_matching_syscall_table_events(&event_recorder_enabler->parent, compat_sc_exit_table.table, compat_sc_exit_table.len, SC_TYPE_COMPAT_EXIT);
- create_unknown_syscall_event(syscall_event_enabler, SC_TYPE_COMPAT_ENTRY);
- create_unknown_syscall_event(syscall_event_enabler, SC_TYPE_COMPAT_EXIT);
+ if (entryexit == LTTNG_KERNEL_ABI_SYSCALL_ENTRY || entryexit == LTTNG_KERNEL_ABI_SYSCALL_ENTRYEXIT) {
+ lttng_syscall_event_enabler_create_matching_syscall_table_events(event_enabler,
+ sc_table.table, sc_table.len, SC_TYPE_ENTRY);
+ lttng_syscall_event_enabler_create_matching_syscall_table_events(event_enabler,
+ compat_sc_table.table, compat_sc_table.len, SC_TYPE_COMPAT_ENTRY);
+ create_unknown_syscall_event(event_enabler, SC_TYPE_ENTRY);
+ create_unknown_syscall_event(event_enabler, SC_TYPE_COMPAT_ENTRY);
+ }
- return ret;
+ if (entryexit == LTTNG_KERNEL_ABI_SYSCALL_EXIT || entryexit == LTTNG_KERNEL_ABI_SYSCALL_ENTRYEXIT) {
+ lttng_syscall_event_enabler_create_matching_syscall_table_events(event_enabler,
+ sc_exit_table.table, sc_exit_table.len, SC_TYPE_EXIT);
+ lttng_syscall_event_enabler_create_matching_syscall_table_events(event_enabler,
+ compat_sc_exit_table.table, compat_sc_exit_table.len, SC_TYPE_COMPAT_EXIT);
+ create_unknown_syscall_event(event_enabler, SC_TYPE_EXIT);
+ create_unknown_syscall_event(event_enabler, SC_TYPE_COMPAT_EXIT);
+ }
}
/*
return -ENOMEM;
}
- ret = lttng_syscalls_populate_events(syscall_event_enabler);
- if (ret)
- return ret;
-
- ret = lttng_syscalls_create_matching_event_notifiers(syscall_event_enabler);
- if (ret)
- return ret;
+ lttng_syscall_event_enabler_create_matching_events(syscall_event_enabler);
if (!syscall_table->sys_enter_registered) {
ret = lttng_wrapper_tracepoint_probe_register("sys_enter",
return ret;
}
-static
-int lttng_syscalls_create_matching_event_notifiers(struct lttng_event_enabler_common *event_enabler)
-{
- int ret;
- enum lttng_kernel_abi_syscall_entryexit entryexit =
- event_enabler->event_param.u.syscall.entryexit;
- struct lttng_event_notifier_enabler *event_notifier_enabler;
-
- if (event_enabler->enabler_type != LTTNG_EVENT_ENABLER_TYPE_NOTIFIER)
- return 0;
- event_notifier_enabler = container_of(event_enabler, struct lttng_event_notifier_enabler, parent);
-
- if (entryexit == LTTNG_KERNEL_ABI_SYSCALL_ENTRY || entryexit == LTTNG_KERNEL_ABI_SYSCALL_ENTRYEXIT) {
- lttng_syscall_event_enabler_create_matching_syscall_table_events(&event_notifier_enabler->parent,
- sc_table.table, sc_table.len, SC_TYPE_ENTRY);
- lttng_syscall_event_enabler_create_matching_syscall_table_events(&event_notifier_enabler->parent,
- compat_sc_table.table, compat_sc_table.len, SC_TYPE_COMPAT_ENTRY);
- create_unknown_syscall_event(event_enabler, SC_TYPE_ENTRY);
- create_unknown_syscall_event(event_enabler, SC_TYPE_COMPAT_ENTRY);
- }
-
- if (entryexit == LTTNG_KERNEL_ABI_SYSCALL_EXIT || entryexit == LTTNG_KERNEL_ABI_SYSCALL_ENTRYEXIT) {
- lttng_syscall_event_enabler_create_matching_syscall_table_events(&event_notifier_enabler->parent,
- sc_exit_table.table, sc_exit_table.len, SC_TYPE_EXIT);
- lttng_syscall_event_enabler_create_matching_syscall_table_events(&event_notifier_enabler->parent,
- compat_sc_exit_table.table, compat_sc_exit_table.len, SC_TYPE_COMPAT_EXIT);
- create_unknown_syscall_event(event_enabler, SC_TYPE_EXIT);
- create_unknown_syscall_event(event_enabler, SC_TYPE_COMPAT_EXIT);
- }
- return ret;
-}
-
int lttng_syscalls_unregister_syscall_table(struct lttng_kernel_syscall_table *syscall_table)
{
int ret;