[lttng-dev] Error is thrown when continously using babeltrace
Venkata Kantimahanthi
venkata.kantimahanthi at tcs.com
Wed Feb 18 03:58:25 EST 2015
Hi,
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
under
* path will be deleted.
*/
if (nftw(lttng_sessions[0].path, myrm, FOPEN_MAX,
FTW_DEPTH) < 0) {
ERR("Failed to clean path, %s",
lttng_sessions[0].path);
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;
}
lttng_snapshot_output_destroy(lttng_out);
/*
* 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20150218/5bf2a4b6/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/20150218/5bf2a4b6/attachment-0001.txt>
More information about the lttng-dev
mailing list