[lttng-dev] Changed scheduling when using lttng

Mats Liljegren liljegren.mats2 at gmail.com
Mon May 13 03:29:49 EDT 2013


On Fri, May 10, 2013 at 4:56 PM, Mathieu Desnoyers
<mathieu.desnoyers at efficios.com> wrote:
> * Mats Liljegren (liljegren.mats2 at gmail.com) wrote:
>> >>       --buffers-global     Use shared buffer for the whole system (-k only)
>> >
>> > This option would be clearer as "--buffers-per-cpu" maybe ?
>>
>> This makes me even more confused... The name "buffers-global" is very
>> clear to me. Opposites would be buffers private for a CPU, for a UID,
>> and so on. Is the option "--buffers-global" meant to be an opposite of
>> "--buffers-uid" and "--buffers-pid"? This would seems strange since
>> those two are only for user space tracing while "--buffers-global" is
>> for kernel tracing. By the way, isn't "--buffers-per-cpu" default? Oh
>> well...
>
> Currently, we have:
>
> kernel tracing: --buffers-global (those are per-cpu buffers)
>
> ust tracing: --buffers-pid, --buffers-uid (those are also per-cpu buffers)
>
> We currently don't implement "single buffer" shared across all CPUs.
>
> By the way, the fact that e.g. --buffers-global is only available for
> kernel tracing today does not mean it will never be available for ust in
> future versions.

So for data buffers, you can have them per pid & cpu, per uid and cpu
or only per cpu where the last option is the only option for kernel
tracing. This was then according to my first belief then, it was the
help text of the lttng command that made me believe otherwise.

Then I'd vote for renaming --buffers-global to --buffers-per-cpu,
which apparently is not only default but also the only available
option for kernel tracing. If I've understood things correctly, there
are plans for offering per-cpu buffers when tracing user space as
well, which then would be the reason for keeping the option.

>>
>> But the real confusion lies in the fact that I cannot see the option
>> being used for anything. It sets the file local variable
>> opt_buffers_global, and is used for a sanity check. But I can't see it
>> being used for anything else. Have I missed something here?
>
> David ?
>
> the "lttng" command passes it to liblttng-ctl, which asks lttng-sessiond
> to allocate the buffer. Then, buffer allocation is handled by either
> sessiond or consumerd (depending if kernel or ust tracing), using either
> the lttng-modules ABI or liblttng-ust-ctl. This is where the allocation
> really happens.

Thanks for the info. I'll take a deep dive into the design and see if
I can make a more intelligent modification. When thinking about it, it
might be possible to keep things per-cpu-ish, since I have no need for
inter-cpu support when writing. It is only the flushing that needs to
be done on another CPU. Not sure what that means yet since I haven't
dived into the design yet.

/Mats



More information about the lttng-dev mailing list