Fix: reintroduce lazy kernel modules load, fix empty syscall list
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 23 May 2019 19:11:50 +0000 (15:11 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 5 Sep 2019 20:39:16 +0000 (16:39 -0400)
commit32e10baa3513a50f5dca51193cd9c834a2e0c39a
treed8e09ff6262df84bb1d0eea76f6b9a77d89e2aa6
parent7a84a58a4e9e2ccdca5a263d51e7a307a016c6f4
Fix: reintroduce lazy kernel modules load, fix empty syscall list

Up and including to lttng 2.10, if the lttng-modules are not available
when the session daemon starts, an attempt is made to load them each
time a command attempts to interact with the kernel domain.

2.11-rc introduces a change in behavior which removes this lazy
initialization. This is an issue for distribution packaging (e.g.
Ubuntu) where there is no strong dependency between lttng-tools and
lttng-modules (because either are optional). So we can be unlucky and
find ourselves in a situation where the modules are not available when
the session daemon is launched at installation, but only afterwards.

Re-introduce the lazy kernel module load behavior, since this is
expected by users.

Also, fix an issue with empty syscall list in those lazy initialization
scenario by moving invocation of syscall_init_table() from main() to
init_kernel_tracer().

While we are there, cleanup the following in session daemon:

- move kernel_tracer_fd from globals.c to kernel.c. It becomes a static
  variable,
- move module_proc_lttng from main.c to kernel.c,
- move init_kernel_tracer() from main.c to kernel.c,
- introduce kernel.c:cleanup_kernel_tracer(), invoke it from program
  cleanup,
- introduce kernel_tracer_is_initialized() to check the state of
  kernel tracer initialization,
- adapt kernel.c functions to use the static kernel_tracer_fd rather
  than expect it as parameter,
- update syscall_init_table, invoked from kernel.c, to pass the
  kernel_tracer_fd as parameter.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/client.c
src/bin/lttng-sessiond/cmd.c
src/bin/lttng-sessiond/globals.c
src/bin/lttng-sessiond/kernel.c
src/bin/lttng-sessiond/kernel.h
src/bin/lttng-sessiond/lttng-sessiond.h
src/bin/lttng-sessiond/lttng-syscall.c
src/bin/lttng-sessiond/lttng-syscall.h
src/bin/lttng-sessiond/main.c
src/bin/lttng-sessiond/notification-thread-events.c
This page took 0.027359 seconds and 4 git commands to generate.