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 18:09:43 +0000 (14:09 -0400)
commit7d268848fe44e591c53c8dfce796c6503c4539e8
tree3ced769429c6a399708534e8744598e8467a6baa
parentfb180e6e4855acd6eff826ac6253b58d5d3e6da4
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.025576 seconds and 4 git commands to generate.