Fix: initialize syscall table when kernel tracer is lazily initialized
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 23 May 2019 16:56:57 +0000 (12:56 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 5 Sep 2019 18:14:26 +0000 (14:14 -0400)
How to reproduce:

start lttng-sessiond while lttng-modules are not installed, then install
lttng-modules. Then issue "lttng list --syscall -k". It will show an
empty syscall list because the system call list has not been
initialized.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/main.c

index 577936a89ff2d8f1e09aa68c14a4052f8581efe0..d559306cb323a7578d62058063777d2a07466d21 100644 (file)
@@ -2652,6 +2652,12 @@ static int init_kernel_tracer(void)
        }
 
        DBG("Kernel tracer fd %d", kernel_tracer_fd);
+
+       ret = syscall_init_table();
+       if (ret < 0) {
+               ERR("Unable to populate syscall table. Syscall tracing won't "
+                       "work for this session daemon.");
+       }
        return 0;
 
 error_version:
@@ -5771,14 +5777,6 @@ int main(int argc, char **argv)
                /* Setup kernel tracer */
                if (!config.no_kernel) {
                        init_kernel_tracer();
-                       if (kernel_tracer_fd >= 0) {
-                               ret = syscall_init_table();
-                               if (ret < 0) {
-                                       ERR("Unable to populate syscall table. "
-                                               "Syscall tracing won't work "
-                                               "for this session daemon.");
-                               }
-                       }
                }
 
                /* Set ulimit for open files */
This page took 0.028302 seconds and 4 git commands to generate.