Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
* [lttng-dev] make a trace_event in a module (driver)
@ 2013-11-25 19:22 Thibault, Daniel
  2013-11-26 17:32 ` Klaus Dannecker
  0 siblings, 1 reply; 6+ messages in thread
From: Thibault, Daniel @ 2013-11-25 19:22 UTC (permalink / raw)


> Date: Mon, 25 Nov 2013 12:00:14 -0500
> From: J?r?mie Galarneau <jeremie.galarneau@efficios.com>

>>    Aha!  There is one crucial mistake in the ibm.com document: he installs the packages in the wrong order.  lttng-tools must be installed AFTER lttng-modules and lttng-ust.  lttng-modules can be installed before, during or after lttng-ust, but userspace-rcu must be installed before lttng-ust.
>>    The problem is that the configure of lttng-tools detects the presence or absence of lttng-modules and also detects the presence or absence of lttng-ust, and adjusts to both.  By installing lttng-tools before lttng-modules, you've built an lttng-tools set that CANNOT be used to trace the kernel.
>>
>>    So, try again from scratch, making sure to install lttng-tools last.
>
> lttng-tools checks for kernel modules at run time, not at configure time. You can safely install lttng-modules after lttng-tools and still use kernel tracing.
>
> Regards,
> J?r?mie

   Dang, you're right.  The build of lttng-tools reacts to the presence or absence of lttng-ust, but is indifferent to the presence or absence of lttng-modules.  (Only liblttng-ctl.a is different, probably some internal timestamps or some such)

> klaus at ubuntu:~$ sudo lttng -vvv start
> DEBUG2 [2854/2854]: Config file path found: /home/klaus (in get_session_name() at utils.c:57)
> DEBUG1 [2854/2854]: Session name found: auto-20131124-091639 (in get_session_name() at utils.c:58)
> DEBUG1 [2854/2854]: Starting tracing for session auto-20131124-091639 (in start_tracing() at commands/start.c:81)
> DEBUG1 [2854/2854]: LSM cmd type : 16 (in send_session_msg() at lttng-ctl.c:131)
> 'ctrl c'
> klaus at ubuntu:~$

   Let's try to identify the module responsible.  First, make sure lttng-sessiond is NOT running.  Then, do this in one shell:

$ sudo -H lttng-sessiond -vvv

   It should fail after loading one of the modules.

   You can also try:

$ sudo -H lttng-sessiond -vvv --no-kernel

   In which case you should be able to do any lttng command except those involving the kernel.  For example, 'lttng list -u'.

Daniel U. Thibault
Protection des syst?mes et contremesures (PSC) | Systems Protection & Countermeasures (SPC)
Cyber s?curit? pour les missions essentielles (CME) | Mission Critical Cyber Security (MCCS)
R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) | Defence R&D Canada - Valcartier (DRDC Valcartier)
2459 route de la Bravoure
Qu?bec QC  G3J 1X5
CANADA
Vox : (418) 844-4000 x4245
Fax : (418) 844-4538
NAC : 918V QSDJ <http://www.travelgis.com/map.asp?addr=918V%20QSDJ>
Gouvernement du Canada | Government of Canada
<http://www.valcartier.drdc-rddc.gc.ca/>



^ permalink raw reply	[flat|nested] 6+ messages in thread
* [lttng-dev] make a trace_event in a module (driver)
@ 2013-11-25 15:53 Thibault, Daniel
  2013-11-25 17:00 ` Jérémie Galarneau
  0 siblings, 1 reply; 6+ messages in thread
From: Thibault, Daniel @ 2013-11-25 15:53 UTC (permalink / raw)


> Date: Sun, 24 Nov 2013 19:26:05 +0100
> From: Klaus Dannecker <klaus.dannecker@gmx.de>
>
> > Interesting. Would you mind running "lttng start" in verbose mode and 
> > provide the output?
> > lttng -vvv start
> klaus at ubuntu:~$ sudo lttng -vvv start
> DEBUG2 [2854/2854]: Config file path found: /home/klaus (in get_session_name() at utils.c:57)
> DEBUG1 [2854/2854]: Session name found: auto-20131124-091639 (in get_session_name() at utils.c:58)
> DEBUG1 [2854/2854]: Starting tracing for session auto-20131124-091639 (in start_tracing() at commands/start.c:81)
> DEBUG1 [2854/2854]: LSM cmd type : 16 (in send_session_msg() at lttng-ctl.c:131)
> 'ctrl c'
> klaus at ubuntu:~$

Definitely looks like a module loading problem.

> > lttng-modules does not define an "uninstall" make target. I guess 
> > you'll have to delete the modules manually under /lib/modules/$(uname 
> > -r)/extra /lib/modules/$(uname -r)/extra/lib /lib/modules/$(uname 
> > -r)/extra/probes
> >
> > I'm wondering if it could be a conflict with your distribution's 
> > lttng-modules-dkms package... Could you verify that it is not 
> > installed?
>
> now i make two experiments:
> first:
> install ubuntu 12.04 in vmware
> $ git clone git://git.lttng.org/lttng-tools.git
> $ git clone git://git.lttng.org/lttng-modules.git
> $ git clone git://git.lttng.org/lttng-ust.git
> $ git clone git://git.lttng.org/userspace-rcu.git
> compile and install all like:
> https://www.ibm.com/developerworks/community/blogs/fe313521-2e95-46f2-817d-44a4f27eba32/entry/howto_tracing_with_lttng?lang=en
> now i have the same problem.

   Aha!  There is one crucial mistake in the ibm.com document: he installs the packages in the wrong order.  lttng-tools must be installed AFTER lttng-modules and lttng-ust.  lttng-modules can be installed before, during or after lttng-ust, but userspace-rcu must be installed before lttng-ust.
   The problem is that the configure of lttng-tools detects the presence or absence of lttng-modules and also detects the presence or absence of lttng-ust, and adjusts to both.  By installing lttng-tools before lttng-modules, you've built an lttng-tools set that CANNOT be used to trace the kernel.

   So, try again from scratch, making sure to install lttng-tools last.

> second:
> install ubuntu 12.04 in vmware
> sudo apt-get install lttng-tools
>...
> Building only for 3.8.0-29-generic
> Building initial module for 3.8.0-29-generic
> Error! Bad return status for module build on kernel: 3.8.0-29-generic (i686)
> Consult /var/lib/dkms/lttng-modules/2.0.2/build/make.log for more information.
> Setting up lttng-tools (2.0.1-0ubuntu1) ...
> /usr/sbin/addgroup
> lttng-sessiond start/running, process 5515
> Processing triggers for libc-bin ...
> ldconfig deferred processing now taking place
> klaus at ubuntu:~$

   The Ubuntu lttng 2.0.1 install will very likely run into trouble against kernel 3.8 because of the new module signing requirements.

> $ git clone git://git.lttng.org/lttng-modules.git
> compile and install lttng_modules
>
> now works lttng start, stop and destroy!
>
> Klaus

Daniel U. Thibault
Protection des syst?mes et contremesures (PSC) | Systems Protection & Countermeasures (SPC)
Cyber s?curit? pour les missions essentielles (CME) | Mission Critical Cyber Security (MCCS)
R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) | Defence R&D Canada - Valcartier (DRDC Valcartier)
2459 route de la Bravoure
Qu?bec QC  G3J 1X5
CANADA
Vox : (418) 844-4000 x4245
Fax : (418) 844-4538
NAC : 918V QSDJ <http://www.travelgis.com/map.asp?addr=918V%20QSDJ>
Gouvernement du Canada | Government of Canada
<http://www.valcartier.drdc-rddc.gc.ca/>



^ permalink raw reply	[flat|nested] 6+ messages in thread
* [lttng-dev] make a trace_event in a module (driver)
@ 2013-11-21 14:23 Thibault, Daniel
  0 siblings, 0 replies; 6+ messages in thread
From: Thibault, Daniel @ 2013-11-21 14:23 UTC (permalink / raw)


> Date: Thu, 21 Nov 2013 10:48:59 +0100
> From: Klaus Dannecker <klaus.dannecker@gmx.de>
>
> now i have ubuntu 13.10 installed  in a vmware.
> but i have the same error!
>
>$ sudo make modules_install
> make -C /lib/modules/3.11.0-12-generic/build 
> M=/home/klaus/lttng_src/lttng-modules modules_install
> make[1]: Entering directory `/usr/src/linux-headers-3.11.0-12-generic'
>   INSTALL /home/klaus/lttng_src/lttng-modules/lib/lttng-lib-ring-buffer.ko
> Can't read private key
> ....
> lsmod | grep lttng
> -> no module found

   This seems to be a problem with Ubuntu 13, which now requires kernel modules to be signed (or is this a kernel 3.8.5 feature/requirement?).  It is surprisingly hard to find a simple workaround on the Web (I gave up after a while).  Some threads seem to indicate the error can be ignored, so it may just be a matter of making sure the 'make modules_install' doesn't give up at that point.  Another possibility may be to install the kernel's "Linux Kernel Archives Verification Key" GPG key (see e.g. http://alien.slackbook.org/dokuwiki/doku.php?id=linux:kernelbuilding): 'gpg --keyserver wwwkeys.pgp.net --recv-keys 0x517D0F0E'

Daniel U. Thibault
Protection des syst?mes et contremesures (PSC) | Systems Protection & Countermeasures (SPC)
Cyber s?curit? pour les missions essentielles (CME) | Mission Critical Cyber Security (MCCS)
R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) | Defence R&D Canada - Valcartier (DRDC Valcartier)
2459 route de la Bravoure
Qu?bec QC  G3J 1X5
CANADA
Vox : (418) 844-4000 x4245
Fax : (418) 844-4538
NAC : 918V QSDJ <http://www.travelgis.com/map.asp?addr=918V%20QSDJ>
Gouvernement du Canada | Government of Canada
<http://www.valcartier.drdc-rddc.gc.ca/>



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-11-26 17:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-25 19:22 [lttng-dev] make a trace_event in a module (driver) Thibault, Daniel
2013-11-26 17:32 ` Klaus Dannecker
  -- strict thread matches above, loose matches on Subject: below --
2013-11-25 15:53 Thibault, Daniel
2013-11-25 17:00 ` Jérémie Galarneau
2013-11-25 18:14   ` Klaus Dannecker
2013-11-21 14:23 Thibault, Daniel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox