[lttng-dev] Tracking children

Thibault, Daniel Daniel.Thibault at drdc-rddc.gc.ca
Tue Jun 7 14:06:04 UTC 2016


   The new 'tracking' facility of LTTng 2.7 is very interesting.  Comparison with strace is unavoidable.

   Has any thought been given to providing a track option that would mimic strace's -f option?  Specifically, strace -f will trace not only (all threads of) the target process but also all of its child processes (those that are forked/vforked/cloned off) (Note that all of these *functions* go through a single *system call*: clone; presumably Plan 9's rfork does the same).  Given a similar option, say 'track --children', LTTng would automatically add to the session's tracking white list any processes cloned off of tracked processes (execve is not a concern since it preserves the PID).

   Right now, this isn't easily done: one would need to attach a listener to a live trace of the (tracked) clone system calls which would add the cloned off process to the white list.  Because this would be done at the consumer level, there is a risk of losing the first few system calls generated by the children (the delay corresponds to the clone system call events transiting through the LTTng event capture buffer and out through the consumer daemon to the listener, plus the listener's reaction time).

   In a slightly different train of thought, an strace-like wrapper (previously mentioned in GSoC 2013, I think) would be nice: a way to launch a process from a command line or shell script such that it is tracked by LTTng from its very inception.  Something like 'lttng-strace (-k | -u) [-s <SESSION>] [--children] -- <command line>'.  Come to think of it, this could be done by the LTTng track command if it detected the -- option and treated the remainder of its command line as the process-launching command line (this would be antithetical to the --pid and --all options, of course).

   Shall I create a feature request?

   I also take it, reading http://lttng.org/docs/#doc-enabling-disabling-channels, that system call events can now be assigned to multiple channels within a session?

Daniel U. Thibault, M.Sc.²

Informaticien scientifique, CME-PSC, Centre de recherches de Valcartier
Recherche et développement pour la défense Canada / Gouvernement du Canada
daniel.thibault at drdc-rddc.gc.ca / Tél: 418-844-4000x4245 Téléc: 418-844-4538
daniel.thibault at forces.gc.ca / Tél: 418-844-4000x4245 Téléc: 418-844-4538

Computer Scientist, MCCS-SPC, Valcartier Research Centre 
Defence Research and Development Canada / Government of Canada
daniel.thibault at drdc-rddc.gc.ca / Tel: 418-844-4000x4245 Fax: 418-844-4538
daniel.thibault at forces.gc.ca / Tel: 418-844-4000x4245 Fax: 418-844-4538

DRDC is an agency of the Department of National Defence / RDDC est une agence du ministère de la Défense nationale


More information about the lttng-dev mailing list