<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Trying a reply as the ML seems to have had an issue.<br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Matthew Khouzam<br>
<b>Sent:</b> Tuesday, July 2, 2019 10:26:05 AM<br>
<b>To:</b> Jonathan Rajotte-Julien; Zvi Vered<br>
<b>Cc:</b> lttng-dev<br>
<b>Subject:</b> Re: [lttng-dev] Log semaphore, mutex in CTF</font>
<div> </div>
</div>
<style type="text/css" style="display:none">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p style="margin-top:0; margin-bottom:0">Please correct me if I'm wrong, I'm waaay out of my comfort zone here...</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">So I am assuming you are doing kernel tracing. If it's userspace tracing, you need to wrap the library yourself. I don't know how recommendable it is, you may incur some performance impact.<br>
</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">In Linux, mutexes/semaphores are atomic and not logged, unless there is contention on the resource. You can see this as a "sys_futex" so look up "utex" and you should be good.</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">Also, if you keep your trace in CTF, certain trace viewers can show your contention between threads[1].</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">Br,</p>
<p style="margin-top:0; margin-bottom:0">Matthew<br>
</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">[1] <a href="https://wiki.eclipse.org/Trace_Compass/News/NewIn23" class="x_OWAAutoLink" id="LPlnk365599">
https://wiki.eclipse.org/Trace_Compass/News/NewIn23</a><br>
</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> lttng-dev <lttng-dev-bounces@lists.lttng.org> on behalf of Jonathan Rajotte-Julien <jonathan.rajotte-julien@efficios.com><br>
<b>Sent:</b> Tuesday, July 2, 2019 10:15:17 AM<br>
<b>To:</b> Zvi Vered<br>
<b>Cc:</b> lttng-dev<br>
<b>Subject:</b> Re: [lttng-dev] Log semaphore, mutex in CTF</font>
<div> </div>
</div>
<div class="x_BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="x_PlainText">HI Zvika,<br>
<br>
It all depends on what exactly you traced. Did you trace some userspace<br>
application? Did you trace the kernel?<br>
<br>
A trace is as good as its tracepoints. You can use lttng list to get the<br>
available tracepoints for each tracing domain:<br>
<br>
>From "lttng-list" man page:<br>
<br>
  With one or more of the --kernel, --userspace, --jul, --log4j, and --python<br>
  domain options, the command lists the available event sources of the selected<br>
  domain on the system. The JUL, log4j, and Python domains list the names of their<br>
  available loggers. The --syscall option can be used alongside the --kernel<br>
  option to get a list of traceable Linux system calls. The --fields option can be<br>
  used to show the fields of the listed event sources.<br>
<br>
AFAIK, lttng-modules does not instrument locking primitive.<br>
<br>
lttng-ust does provides overwrite library for pthread_mutex_lock,<br>
pthread_mutex_trylock and pthread_mutex_unlock. You will need to LD_PRELOAD (application start) it.<br>
<br>
<a href="https://protect2.fireeye.com/url?k=d4352e55-88e124c9-d4356ece-8631fc8bdea5-87f781b0b8299b36&q=1&u=https%3A%2F%2Fgithub.com%2Flttng%2Flttng-ust%2Ftree%2F9d4d2a639afc19a1bd705ea560782917ac892596%2Fliblttng-ust-libc-wrapper">https://protect2.fireeye.com/url?k=d4352e55-88e124c9-d4356ece-8631fc8bdea5-87f781b0b8299b36&q=1&u=https%3A%2F%2Fgithub.com%2Flttng%2Flttng-ust%2Ftree%2F9d4d2a639afc19a1bd705ea560782917ac892596%2Fliblttng-ust-libc-wrapper</a><br>
<br>
Cheers.<br>
<br>
On Mon, Jul 01, 2019 at 07:49:16AM +0300, Zvi Vered wrote:<br>
> Hello,<br>
> <br>
> I converted CTF files created by ltt-ng to text file using babeltrace.<br>
> <br>
> Can you please tell how semaphore, mutex are logged in this text file ?<br>
> <br>
> I did not find the terms "sema" or "mutex".<br>
> <br>
> Thank you,<br>
> Zvika<br>
<br>
> _______________________________________________<br>
> lttng-dev mailing list<br>
> lttng-dev@lists.lttng.org<br>
> <a href="https://protect2.fireeye.com/url?k=ef7159f6-b3a5536a-ef71196d-8631fc8bdea5-094f48839611091d&q=1&u=https%3A%2F%2Flists.lttng.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Flttng-dev">
https://protect2.fireeye.com/url?k=ef7159f6-b3a5536a-ef71196d-8631fc8bdea5-094f48839611091d&q=1&u=https%3A%2F%2Flists.lttng.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Flttng-dev</a><br>
<br>
<br>
-- <br>
Jonathan Rajotte-Julien<br>
EfficiOS<br>
_______________________________________________<br>
lttng-dev mailing list<br>
lttng-dev@lists.lttng.org<br>
<a href="https://protect2.fireeye.com/url?k=9cb6213c-c0622ba0-9cb661a7-8631fc8bdea5-60f0dcbb0316005d&q=1&u=https%3A%2F%2Flists.lttng.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Flttng-dev">https://protect2.fireeye.com/url?k=9cb6213c-c0622ba0-9cb661a7-8631fc8bdea5-60f0dcbb0316005d&q=1&u=https%3A%2F%2Flists.lttng.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Flttng-dev</a><br>
</div>
</span></font></div>
</div>
</body>
</html>