From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mathieu Desnoyers Subject: Re: LTTng buffer mode Date: Fri, 26 Feb 2016 18:07:05 +0000 (UTC) Message-ID: <1263166217.9071.1456510025603.JavaMail.zimbra__37301.7413694926$1456510096$gmane$org@efficios.com> References: <829984174.3472.1455992223842.JavaMail.zimbra@efficios.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1195619572==" Return-path: Received: from mail.efficios.com ([78.47.125.74]) by ltt.polymtl.ca with esmtp (Exim 4.80) (envelope-from ) id 1aZMnL-0006j8-Kp for lttng-dev@lists.lttng.org; Fri, 26 Feb 2016 13:07:18 -0500 In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lttng-dev-bounces@lists.lttng.org To: syed zaidi Cc: lttng-dev List-Id: lttng-dev@lists.lttng.org --===============1195619572== Content-Type: multipart/alternative; boundary="----=_Part_9070_1269716780.1456510025602" ------=_Part_9070_1269716780.1456510025602 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit ----- On Feb 26, 2016, at 4:12 AM, syed zaidi wrote: > Hi Mathieu, > I have few questions related to the questions above and please forgive me for my > ignorance in advance. > 1. When LTTng creates the buffers lets say per uid, the files that show up in > LTTng folder, are those files that LTTng has stopped writing in? What I mean > is, are those files still being written to or they are safe to be moved. They are still being written to. > 2. If I want to collect traces lets say every 5 mins for the last 5 mins while > LTTng keeps running. What is the best approach? Do I just run BabelTrace on the > folder and remove all files from the folder to create space for next files and > keep repeating? I would not use Babeltrace on the target, but rather just move the CTF files. You could swap between two sessions to do that: lttng supports multiple concurrent sessions. Create and start a new session before you stop, destroy, and move away the old session, every 5 minutes... > 3. I understand that I should delete the corresponding .idx file for each log > file that I remove, what about metadata file? Do I remove it or leave it as is? You need to leave it as is. > 4. The trace file produced by Babeltrace, does it guarantee that the file has > traces from all the users and the core till the time stamp of the last line?' > For example if the last line of the trace file looks like this > 23:00:00.912089772,...,... > Does that mean that the trace file has all the traces until that time? It depends on your tracing mode (discard vs snapshot buffers). In discard mode (default if you don't use the --snapshot option on lttng create), Babeltrace will print on stderr whenever it encounters discarded events. Best regards, Mathieu > Thanks > Ammar > On Sat, Feb 20, 2016 at 10:17 AM, Mathieu Desnoyers < > mathieu.desnoyers@efficios.com > wrote: >> 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@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@gmail.com > >> > Sent: Tuesday, February 16, 2016 5:02 PM >> > To: Jeffrey Chen >> > Cc: lttng-dev@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@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@lists.lttng.org >> >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >> > _______________________________________________ >> > lttng-dev mailing list >> > lttng-dev@lists.lttng.org >> > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev >> -- >> Mathieu Desnoyers >> EfficiOS Inc. >> http://www.efficios.com >> _______________________________________________ >> lttng-dev mailing list >> lttng-dev@lists.lttng.org >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com ------=_Part_9070_1269716780.1456510025602 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
----- On Feb 26, 2016, at 4:12 AM, syed zaidi <zaidi1039@gmail.com&g= t; wrote:
Hi Mathieu,=
I have few questions related to the questions above and please for= give me for my ignorance in advance.
1. When LTTng creates the bu= ffers lets say per uid, the files that show up in LTTng folder, are those f= iles that LTTng has stopped writing in? What I mean is, are those files sti= ll being written to or they are safe to be moved.
<= div>
They are still being written to.


2. If I want to collec= t traces lets say every 5 mins for the last 5 mins while LTTng keeps runnin= g. What is the best approach? Do I just run BabelTrace on the folder and re= move all files from the folder to create space for next files and keep repe= ating?  

I would not use B= abeltrace on the target, but rather just move the CTF files.

You could swap bet= ween two sessions to do that: lttng supports multiple
concurrent sessions. Create and start a new session before yo= u stop,
destroy, and move away the old s= ession, every 5 minutes...


3. I understand that I should delete the corres= ponding .idx file for each log file that I remove, what about metadata file= ? Do I remove it or leave it as is?

=
You need to leave it as is.


4. The trace file produced by Babeltrace,= does it guarantee that the file has traces from all the users and the core= till the time stamp of the last line?'
For example if the last l= ine of the trace file looks like this
23:00:00.912089772,...,...<= /div>
Does that mean that the trace file has all the traces until that = time?
It depends on your tracing mode (discard= vs snapshot buffers). In discard
mode (default if you don't = use the --snapshot option on lttng create),
<= div>Babeltrace will print on stderr whenever it encounters discarded events= .

Be= st regards,

Mathieu


Thanks
Ammar

On Sat, Feb 20, 2016 at 10:17 AM, Mathie= u Desnoyers <mathieu.desnoyers@efficios.com> wr= ote:
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@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@gmail.com>
> Sent: Tuesday, February 16, 2016 5:02 PM
> To: Jeffrey Chen
> Cc: ltt= ng-dev@lists.lttng.org
> Subject: Re: [lttng-dev] LTTng buffer mode
>
> No you cannot.
>
> There's no hidden global buffering scheme option for user space tracin= g.
>
> From the LTTng documentation:
>
>> In the user space tracing domain, two buffering schemes are availa= ble
>> 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 sin= gle user.
>
> and:
>
>> The Linux kernel tracing domain only has one available buffering s= cheme
>> 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@hotmail.com> wrote:
>> Hi LTTng community:
>>
>>
>> I have a question about LTTng buffer mode. According to documentat= ion, LTTng
>> supports 2 buffer modes, per-pid, and per-uid. Is there any mode t= o have a
>> global buffer that does not have separate buffers? The reason I as= ked is
>> because, LTTng writes different buffer traces to different directo= ry/file.
>> It is much more difficult for us to post-process separate director= ies. 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
>> ltt= ng-dev@lists.lttng.org
>> http://lists.lttng.org/cgi-bin/mai= lman/listinfo/lttng-dev
>>
>
> _______________________________________________
> lttng-dev mailing list
> lttng-d= ev@lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman= /listinfo/lttng-dev

--
Mathieu Desnoyers
EfficiOS Inc.
ht= tp://www.efficios.com

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
=


--
Mathieu Desnoyers
EfficiOS= Inc.
http://www.efficios.com
------=_Part_9070_1269716780.1456510025602-- --===============1195619572== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ lttng-dev mailing list lttng-dev@lists.lttng.org http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev --===============1195619572==--