From: Mathieu Desnoyers Date: Thu, 23 May 2019 16:56:57 +0000 (-0400) Subject: Fix: initialize syscall table when kernel tracer is lazily initialized X-Git-Tag: v2.9.13~16 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=740656beaad64985f60f9d59876f90dc42784e8b;p=lttng-tools.git Fix: initialize syscall table when kernel tracer is lazily initialized 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 Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index f0765f07c..936a8df9d 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -2765,6 +2765,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: @@ -5980,14 +5986,6 @@ int main(int argc, char **argv) /* Setup kernel tracer */ if (!opt_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 */