<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 10 April 2018 at 10:56, Christoffer Ahlbin <span dir="ltr"><<a href="mailto:Christoffer.Ahlbin@sinch.com" target="_blank">Christoffer.Ahlbin@sinch.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">What is the recommended approach to have an external process notified<br>
that a trace session rotation has completed on the lttng-relayd end?<br>
<br>
I'm trying out the trace rotation functionality available in 2.11<br>
(pre-release) and will be running a trace session inside a Linux<br>
container (userspace tracepoints only), and running lttng-relayd on<br>
the container host. I would then like to have a third process, a<br>
"collector"-like process, that will also be running on the container<br>
host and will have the responsibility of collecting completeted trace<br>
chunks (i.e. rotated chunks) and push them further along into a trace<br>
analysis pipeline.<br>
<br>
So far I've looked at using inotify to watch the lttng-traces/<br>
directory, and the idea would be to infer a trace rotation based on<br>
that the destination directories post rotation are named on the format<br>
"%Y%m%dT%H%M%S%z-%Y%m%dT%H%M%<wbr>S%z-<seqno>". But I'm not entirely<br>
satisifed with that approach. Ideally I would be able to be notified<br>
more explicitly that a rotation completed.<br></blockquote><div><br></div><div>Hi Christopher,<br><br></div><div>There is a notification mechanism available on the target side (sessiond and<br>consumerd) to which I'm adding notifications for ongoing and completed<br>notifications.<br><br></div><div>Unfortunately, those notifications are not forwarded over the network<br></div><div>to the relay daemon. It would be nice to extend the notification<br></div><div>system for that kind of use case.<br><br></div><div>In the short term, monitoring with inotify for new folders with the<br>format you mentioned is pretty much the only mechanism we have if<br></div><div>you can't monitor for notifications on the target.<br><br></div><div>In the current master branch, there is a bug that can cause the<br></div><div>relayd to rename the completed chunk too soon while it is<br></div><div>still being written. In this case, you could fail to read the trace.<br><br></div><div>We are working on a fix at the moment, so the inotify approach<br>should be safe by the time of the release. Did you observe other<br></div><div>problems using inotify?<br></div><div><br></div><div>Thanks!<br></div><div>Jérémie<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
Any thoughts and recommendations are most welcome.<br>
<br>
Thanks<br>
<br>
Christoffer Ahlbin<br>
<br>
______________________________<wbr>_________________<br>
lttng-dev mailing list<br>
<a href="mailto:lttng-dev@lists.lttng.org">lttng-dev@lists.lttng.org</a><br>
<a href="https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev" rel="noreferrer" target="_blank">https://lists.lttng.org/cgi-<wbr>bin/mailman/listinfo/lttng-dev</a><br>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Jérémie Galarneau<br>EfficiOS Inc.<br><a href="http://www.efficios.com" target="_blank">http://www.efficios.com</a></div>
</div></div>