[lttng-dev] Fw: Error is thrown when continously using babeltrace

Venkata Kantimahanthi venkata.kantimahanthi at tcs.com
Tue Feb 24 04:37:42 EST 2015


I have reproduced the issue with babeltrace -v option . 

Thanks & Regards
Venkata Ranganadh Kantimahanthi

----- Forwarded by Venkata Kantimahanthi/HYD/TCS on 02/24/2015 03:02 PM 

From:   Venkata Kantimahanthi <venkata.kantimahanthi at tcs.com>
To:     lttng-dev at lists.lttng.org
Date:   02/18/2015 02:29 PM
Subject:        [lttng-dev] Error is thrown when  continously using 


We are using babeltrace 1.2.4 and LTTng Trace Control 2.5.3.  Continously 
giving babeltrace is throwing this error.  I am actually getting this 
while reading a snapshot session . I have given continously babeltrace and 
path to read the traces . Then I am getting this error. 

[error] Unexpected end of packet. Either the trace data stream is 
corrupted or metadata description does not match data layout. 
[error] Reading event failed. 
Error printing trace. 
As you said previously "The corrupted stream probably can't be handled by 
Babeltrace anymore at that point." 

Please see the  below code snippet how we are using the lttng calls to 
handle our requirement 
creation of session: 
           lttng create s1 --snapshot -o /pramfs/telog 
           lttng enable-channel ch1 -u --buffers-uid --subbuf-size 4096 
--num-subbuf 16 
           # Enable default events 
           lttng enable-event -u -c ch1 --loglevel TRACE_INFO '*' 

After succesful creation of the session we are able to read the traces 
using babeltrace successfully. But we have written a wrappers for using 
lttng API calls in such a way to meet our requirement which is reading 
only traces inside the buffer at that instant by writing into a file by 
removing previously created snapshots. 

lttng_sessions[0].path contains /pramfs/telog 
myrm is a function pointer which cleans the directory and returns 770 
permissions to that particular snapshot path. 

        if (ted_ss_reboot == SS_RB_CONF) { 
                /* Only read snapshot from last reboot once */ 
                ted_ss_reboot = SS_RB_DONE; 
                extra = FCORRELATE; 
        } else { 
                /* Remove all previous snapshots from output folder 
                 * This way filesystem will not be flooded by snapshots 
                 * taken every time user reads the log. OBS, All dirs 
                 * path will be deleted. 
                if (nftw(lttng_sessions[0].path, myrm, FOPEN_MAX, 
FTW_DEPTH) < 0) { 
                        ERR("Failed to clean path, %s", 
                        goto send_rsp; 

         * Take a snapshot of lttng buffers  for a given session 
        /* Create a output handle */ 
        if ((lttng_out = lttng_snapshot_output_create()) == NULL) { 
                ERR("lttng_snapshot_output_create failed"); 
                ret = -1; 
                goto send_rsp; 

        /* Take a snapshot, output path used is same as configured for the 
session */ 
        ret = lttng_snapshot_record(lttng_sessions[0].name, lttng_out, 0); 

        if (ret < 0) { 
                ERR("lttng_snapshot_record failed, ses:%s, %s", 
                    lttng_sessions[0].name, lttng_strerror(ret)); 
                ret = -1; 
                goto send_rsp; 


         * snapshot folder created by root lttng-sessiond and all its 
         * subfolders have permissions set to 770, meaning non-privileged 
         * user cant read/write from/to that folder. A regular user should 

         * be able to read traces generated by root sessiond. 
         * Changing permissions to this file tree. 
        nftw(lttng_sessions[0].path, mychmod, FOPEN_MAX, FTW_DEPTH);

babeltrace --clock-date  --clock-force-correlate /pramfs/telog 
which was giving the logs which we were expecting but if we keep this 
process repeatedly above mentioned error was coming. I am sharing the log 
file (there te log read is the wrapper call for above process which I 
mentioned).Please tell if any other logs were required. 

Thanks & Regards
Venkata Ranganadh Kantimahanthi
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you
lttng-dev mailing list
lttng-dev at lists.lttng.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20150224/017e1cec/attachment-0001.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: lttng_logs.txt.txt
URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20150224/017e1cec/attachment-0002.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: babeltrace-output.txt
URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20150224/017e1cec/attachment-0003.txt>

More information about the lttng-dev mailing list