From: Mathieu Desnoyers Date: Fri, 5 Nov 2021 18:40:18 +0000 (-0400) Subject: Refactoring: syscall tracing: config compat X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=1ab4126a90a19f9a50935cbcebd1ce9020f3df3b;p=lttng-modules.git Refactoring: syscall tracing: config compat Signed-off-by: Mathieu Desnoyers Change-Id: I023a7fc9e1c03dee3e3c9421b141b03d3b353777 --- diff --git a/src/lttng-syscalls.c b/src/lttng-syscalls.c index af812671..316055f2 100644 --- a/src/lttng-syscalls.c +++ b/src/lttng-syscalls.c @@ -647,6 +647,9 @@ void lttng_syscall_event_enabler_create_matching_events(struct lttng_event_enabl const struct lttng_kernel_event_desc *desc; unsigned int i; + if (!IS_ENABLED(CONFIG_COMPAT) && (type == SC_TYPE_COMPAT_ENTRY || type == SC_TYPE_COMPAT_EXIT)) + return; + /* iterate over all syscall and create event_notifier that match */ for (i = 0; i < table_len; i++) { struct lttng_kernel_event_common_private *event_priv; @@ -702,6 +705,9 @@ void create_unknown_syscall_event(struct lttng_event_enabler_common *event_enabl bool found = false; struct hlist_head *head; + if (!IS_ENABLED(CONFIG_COMPAT) && (type == SC_TYPE_COMPAT_ENTRY || type == SC_TYPE_COMPAT_EXIT)) + return; + /* * Considering that currently system calls can only be enabled on a per * name basis (or wildcard based on a name), unknown syscall events are @@ -767,14 +773,13 @@ int lttng_syscalls_populate_events(struct lttng_event_enabler_common *syscall_ev create_unknown_syscall_event(syscall_event_enabler, SC_TYPE_ENTRY); create_unknown_syscall_event(syscall_event_enabler, SC_TYPE_EXIT); -#ifdef CONFIG_COMPAT lttng_syscall_event_enabler_create_matching_events(&event_recorder_enabler->parent, compat_sc_table.table, compat_sc_table.len, syscall_table->compat_syscall_dispatch, SC_TYPE_COMPAT_ENTRY); lttng_syscall_event_enabler_create_matching_events(&event_recorder_enabler->parent, compat_sc_exit_table.table, compat_sc_exit_table.len, syscall_table->compat_syscall_exit_dispatch, 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); -#endif + return ret; } @@ -799,7 +804,6 @@ int lttng_event_enabler_create_syscall_events_if_missing(struct lttng_event_enab return -ENOMEM; } - #ifdef CONFIG_COMPAT if (!syscall_table->compat_syscall_dispatch) { /* create syscall table mapping compat syscall to events */