[lttng-dev] clarification on limiting the size of the trace file
Thibault, Daniel
Daniel.Thibault at drdc-rddc.gc.ca
Thu May 8 09:28:11 EDT 2014
----------------------------------------------------------------------
Date: Mon, 5 May 2014 16:10:06 +0000
> Your command sets up a single user-space channel named perf which uses a 32-part buffer of total size 32*262144=8388608 (8 MiB).
> The trace is itself limited to 32 chunks of size 262144 each. By default, user-space channels run in discard mode. So in this case LTTng
> should capture about 8 MiB of events to disc, and a further 8 MiB in memory before "giving up" altogether.
>
> When the trace is started the 8 MiB buffer will start filling up, and the consumer daemon will start dumping the events to the trace file.
> Once the trace file saturates at 8 MiB total size, the consumer daemon will stop emptying the buffer. The buffer will then capture
> another 8 MiB of events. Once the buffer is full, LTTng will systematically discard new events as they occur.
>
> It would be an interesting feature if the snapshot command could be used at this point to dump the 8 MiB of otherwise-lost events to another trace file.
My apologies, I misspoke. The discard/overwrite setting of the channel is independent of the trace file size/count settings, in the sense that it only matters when comparing the relative data rates of the trace providers and consumers. In the example above, the on-disc trace file does *not* saturate: rather, once all 32 file chunks have been written, the consumer daemon re-uses chunk 0, then chunk 1, etc. The on-disc trace file in effect becomes a circular buffer itself.
It could be an interesting feature to have a separate option, say 'tracefile-discard', which would have the trace file, when tracefile-size is specified, prevent re-use of its files (or chunks if also specified). This could be used to capture a trace of the boot process events, for instance (which you can already do using snapshot+discard mode). If anyone thinks this may be of use, please submit a feature request on bugs.lttng.org.
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