[lttng-dev] Separate trace file per app

Thibault, Daniel Daniel.Thibault at drdc-rddc.gc.ca
Tue Dec 3 08:14:32 EST 2013


> Date: Thu, 28 Nov 2013 15:46:31 +0530
> From: Anand Neeli <anand.neeli at gmail.com>
>
>How can i create separate trace-file per app?
>
> As shown below, i have created two trace sessions and filtered based on
> procname.
> Is this the correct way? or is there any other efficient way to do it?
>
>./lttng create app_1_trace
>./lttng enable-event -s app_1_trace -u -a --filter '$ctx.procname =="app_1"'
>./lttng start app_1_trace
> now run app_1    ./app_1
>
>./lttng create app_2_trace
>./lttng enable-event -s app_2_trace -u -a --filter '$ctx.procname =="app_2"'
>./lttng start app_2_trace
> now run app_2     ./app_2

   You could trace the user events per process ID.  Each process will then, during its existence, create its own mini-trace within the trace folder hierarchy.  You can use babeltrace to merge all processes or to extract just one process's trace.  Example:

$ lttng create mysession
$ lttng enable-channel mychannel --userspace --buffers-pid
$ lttng enable-event --channel mychannel --userspace --all
$ lttng start
> now run app_1, app_2

   Filters are nice but are fairly expensive CPU-wise.  With per-process tracing, you can do all the requisite filtering after the fact.

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/>



More information about the lttng-dev mailing list