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>
This page took 0.031453 seconds and 4 git commands to generate.