Refactoring: syscall tracing: config compat
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 5 Nov 2021 18:40:18 +0000 (14:40 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 5 Nov 2021 18:40:18 +0000 (14:40 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I023a7fc9e1c03dee3e3c9421b141b03d3b353777

src/lttng-syscalls.c

index af81267138c2b27569bac38ea7c7a14376b72545..316055f2370cff7a8f9ff591627b2a70af644c3c 100644 (file)
@@ -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 */
This page took 0.026798 seconds and 4 git commands to generate.