[lttng-dev] LTTng buffer mode

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Sat Feb 20 13:17:03 EST 2016


Hi,

LTTng implements per-cpu buffers to eliminate false-sharing between
CPUs. Babeltrace and Trace Compass implement iterators that allow
doing the merge of those per-cpu buffers into a single stream on
the fly. Users of Babeltrace and Trace Compass should not have to
worry about doing this merge.

Since LTTng is inherently multi-buffers, we also use this buffer
merging scheme to deal with tracefile rotation, multi-channel, and
combining traces gathered from various processes/user IDs/kernel vs
userspace.

So my question here is: why you say it is much more difficult for
you to deal with those multiple buffers ? Since there are already
libraries in Babeltrace that do that for you, I would expect this
to be a non-issue.

Although it would be technically possible to implement a ring
buffer shared across CPUs, it would be inefficient, and we would
need a good justification for adding this complexity to the
tracers.

Thanks,

Mathieu


----- On Feb 19, 2016, at 4:00 AM, Jeffrey Chen cpthk at hotmail.com wrote:

> Thanks.
> If we make changes to LTTng to add this feature, would it violate the LTTng
> design principle in any way? Thanks.
> 
> 
> ________________________________________
> From: Philippe Proulx <eeppeliteloop at gmail.com>
> Sent: Tuesday, February 16, 2016 5:02 PM
> To: Jeffrey Chen
> Cc: lttng-dev at lists.lttng.org
> Subject: Re: [lttng-dev] LTTng buffer mode
> 
> No you cannot.
> 
> There's no hidden global buffering scheme option for user space tracing.
> 
> From the LTTng documentation:
> 
>> In the user space tracing domain, two buffering schemes are available
>> when creating a channel:
>>
>> Per-PID buffering: keep one ring buffer per process.
>> Per-UID buffering: keep one ring buffer for all processes of a single user.
> 
> and:
> 
>> The Linux kernel tracing domain only has one available buffering scheme
>> which is to use a single ring buffer for the whole system.
> 
> Phil
> 
> On Tue, Feb 16, 2016 at 7:55 PM, Jeffrey Chen <cpthk at hotmail.com> wrote:
>> Hi LTTng community:
>>
>>
>> I have a question about LTTng buffer mode. According to documentation, LTTng
>> supports 2 buffer modes, per-pid, and per-uid. Is there any mode to have a
>> global buffer that does not have separate buffers? The reason I asked is
>> because, LTTng writes different buffer traces to different directory/file.
>> It is much more difficult for us to post-process separate directories. We
>> would like to have all traces write into one single buffer and
>> directory/file, so it is easier to do post-processing. Thanks.
>>
>>
>>
>> _______________________________________________
>> lttng-dev mailing list
>> lttng-dev at lists.lttng.org
>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>>
> 
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com



More information about the lttng-dev mailing list