Hi Benjamin,

On Wed, Jan 08, 2020 at 01:07:20PM +0100, Salvatore Bonaccorso wrote:
> Hi Benjamin,
> 
> On Wed, Jan 08, 2020 at 09:24:30AM +0900, Benjamin Poirier wrote:
> [...]
> > Looks like the modules are built before lttng-sessiond is started:
> >     Setting up lttng-modules-dkms (2.11.0-2) ...
> >     Loading new lttng-modules-2.11.0 DKMS files...
> >     Building for 5.4.0-2-amd64
> >     Building initial module for 5.4.0-2-amd64
> >     Done.
> > 
> >     lttng-lib-ring-buffer.ko:
> >     Running module version sanity check.
> >      - Original module
> >        - No original module exists within this kernel
> >      - Installation
> >        - Installing to /lib/modules/5.4.0-2-amd64/updates/dkms/
> > 
> >     [...]
> > 
> >     depmod...
> > 
> >     DKMS: install completed.
> >     Setting up linux-headers-5.4.0-2-amd64 (5.4.8-1) ...
> >     /etc/kernel/header_postinst.d/dkms:
> >     dkms: running auto installation service for kernel 5.4.0-2-amd64:.
> >     Setting up sudo (1.8.29-1) ...
> >     Setting up babeltrace (1.5.7-2) ...
> >     Setting up liburcu6:amd64 (0.11.1-2) ...
> >     Setting up linux-headers-amd64 (5.4.8-1) ...
> >     Setting up liblttng-ctl0:amd64 (2.11.0-3) ...
> >     Setting up lttng-tools (2.11.0-3) ...
> > 
> > Still, it doesn't work.
> > 
> > > Simply restarting the sessiond should fix this.
> > 
> > I tried restarting lttng-sessiond or rebooting the machine but it was no
> > help, lttng-sessiond always reports:
> >     Error: Failed to load kmod library resources
> >     Warning: No kernel tracer available
> > 
> > A quick look into the code shows that is:
> > src/bin/lttng-sessiond/modprobe.c
> >     kmod_set_log_fn(*ctx, log_kmod, NULL);
> >     ret = kmod_load_resources(*ctx);
> >     if (ret < 0) {
> >             ERR("Failed to load kmod library resources");
> >             goto error;
> >     }
> > 
> > I didn't dig into libkmod, but I noticed (using opensnoop.bt) the
> > following:
> >     8071   lttng-sessiond      2   0 
> > /lib/modules/5.4.0-2-amd64/modules.dep.bin
> >     8071   lttng-sessiond      2   0 
> > /lib/modules/5.4.0-2-amd64/modules.alias.bin
> >     8071   lttng-sessiond      2   0 
> > /lib/modules/5.4.0-2-amd64/modules.symbols.bin
> >     8071   lttng-sessiond      2   0 
> > /lib/modules/5.4.0-2-amd64/modules.builtin.alias.bin
> > 
> > On another machine which I haven't yet updated and where lttng still
> > works, I see:
> >     193519 lttng-sessiond      2   0 
> > /lib/modules/5.4.0-1-amd64/modules.dep.bin
> >     193519 lttng-sessiond      2   0 
> > /lib/modules/5.4.0-1-amd64/modules.alias.bin
> >     193519 lttng-sessiond      2   0 
> > /lib/modules/5.4.0-1-amd64/modules.symbols.bin
> >     193519 lttng-sessiond      2   0 
> > /lib/modules/5.4.0-1-amd64/modules.builtin.bin
> > 
> > Not sure if /lib/modules/5.4.0-2-amd64/modules.builtin.alias.bin is
> > relevant but it's an empty file...
> > 
> > After downgrading libkmod2 from
> >     Version: 26+20191223-1
> > to
> >     Version: 26-3
> > the issue with lttng is no longer apparent:
> >     root@vsid:/tmp# lttng list --kernel
> >     Kernel events:
> >     -------------
> >           asoc_snd_soc_bias_level_start (loglevel: TRACE_EMERG (0)) (type: 
> > tracepoint)
> >           asoc_snd_soc_bias_level_done (loglevel: TRACE_EMERG (0)) (type: 
> > tracepoint)
> >           asoc_snd_soc_dapm_start (loglevel: TRACE_EMERG (0)) (type: 
> > tracepoint)
> >     [...] 
> > 
> 
> Should we track this in a separate bug from #948257?

So here is what I think is part of what is going on (unless there is
something broken in my analysis):

Since 898490c010b5 ("moduleparam: Save information about built-in
modules in separate file")[1] which is in 5.2-rc1, there is a new
modules.builtin.modinfo provided.

 [1]: <https://git.kernel.org/linus/898490c010b5d2e499e03b7e815fc214209ac583>

This one is installed in the -unsigned binary packages but not copied
over into the signing template, so the signed linux image packages do
not contain it.

Now with kmod/26+20191223-1 we have 60084cf1cb24 ("libkmod: Add parser
for modules.builtin.modinfo")[2] adding the parser and [3] and [4]
using that.

 [2]: 
<https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git/commit/?id=60084cf1cb24dc3a257976c0d539a4c3ffda5db5>
 [3]: 
<https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git/commit/?id=73eed2aba3cbe18bbda40f18f7bc32e8de1ec81f>
 [4]: 
<https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git/commit/?id=b866b2165ae6cf18fb26b635f4a7ee57c0334731>

Salvatore

Reply via email to