[lttng-dev] Reading CTF trace from time T

Salman Rafiq salman.rafiq at esk.fraunhofer.de
Wed Jul 18 09:27:58 EDT 2012


Hello All,

I am tracing a user application using lttng kernel tracer, i.e.,

Start lttng kernel trace
./application
Stop lttng kernel trace

Before I was reading kernel CTF trace using babeltrace API's from beginning of trace, e.g.,
struct  bt_iter_pos  begin_pos
struct bt_ctf_iter *iterator

begin_pos.type = BT_SEEK_BEGIN
iterator = create_iterator(context,  &begin_pos, NULL)
.. and then read events start from that iterator postion.

Recently, I have been trying to seek trace using timestamp from when the application started to application end.
I would like to know if I am doing it right. Would the method below enough to achieve this? Or I am missing something here :-S

begin_pos.type = BT_SEEK_TIME
end_pos.type = BT_SEEK_TIME

begin_pos.u.seek_time = timestamp1 (for now manually taken from CTF kernel trace when application started)
end_pos.u.seek_time = timestamp2 (for now manually taken from CTF kernel trace when application ended)

iterator = create_iterator(context,  &begin_pos, &end_pos);
and then with reading events at iterator position until end_pos.


I am using babeltrace package version "1.0.0-pre4".
Any help related to achieving this functionality will be highly appreciated.

Best Regards,
Salman


--
Salman Rafiq
Industrial Communication
Fraunhofer-Einrichtung für Systeme der Kommunikationstechnik ESK

Hansastraße 32 | 80686 München
Telefon, Fax:  +49 89 547088-356 | +49 89 547088-66-356
E-Mail:   salman.rafiq at esk.fraunhofer.de<http://www.esk.fraunhofer.de/>

Internet:
http://www.esk.fraunhofer.de<http://www.esk.fraunhofer.de/>
http://www.facebook.com/FraunhoferESK
http://www.twitter.com/FraunhoferESK

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20120718/5136aafe/attachment-0001.html>


More information about the lttng-dev mailing list