<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:Helvetica;
panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
{font-family:Helvetica;
panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Yes, I agree that majority of the projects will pass this as macros. However, if there is an official solution for this problem from LTTng side, it would be
nice if it could support the function-call way of passing the format string and variable argument list as well.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">mate<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Amit Margalit [mailto:AMITM@il.ibm.com]
<br>
<b>Sent:</b> Monday, December 16, 2013 11:36 PM<br>
<b>To:</b> Máté Ferenczy<br>
<b>Cc:</b> lttng-dev@lists.lttng.org; Mathieu Desnoyers<br>
<b>Subject:</b> RE: [lttng-dev] efficient use of LTTng in legacy codebase<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">You are absolutely right. However, looking at several existing code bases that I am working with (our internal code, and a couple of open-source projects I am adding LTTng
support for), it is clear that the vast majority of existing debug log statements have the following general form:</span>
<br>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">DEBUG_MACRO ( some_args, "lliteral format string", more args )</span>
<br>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">Amit</span> <br>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:navy">Amit Margalit</span>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:olive">IBM XIV
</span><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">- <i>Storage Reinvented</i></span>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">XIV-NAS Development Team</span>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">Tel. 03-689-7774</span>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">Fax. 03-689-7230</span>
<br>
<br>
<br>
<br>
<span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:#5F5F5F">From: </span><span style="font-size:7.5pt;font-family:"Arial","sans-serif"">Máté Ferenczy <<a href="mailto:mate.ferenczy@ericsson.com">mate.ferenczy@ericsson.com</a>></span>
<br>
<span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:#5F5F5F">To: </span><span style="font-size:7.5pt;font-family:"Arial","sans-serif"">Amit Margalit/Israel/IBM@IBMIL</span>
<br>
<span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:#5F5F5F">Cc: </span><span style="font-size:7.5pt;font-family:"Arial","sans-serif"">"<a href="mailto:lttng-dev@lists.lttng.org">lttng-dev@lists.lttng.org</a>" <<a href="mailto:lttng-dev@lists.lttng.org">lttng-dev@lists.lttng.org</a>>,
Mathieu Desnoyers <<a href="mailto:mathieu.desnoyers@efficios.com">mathieu.desnoyers@efficios.com</a>></span>
<br>
<span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:#5F5F5F">Date: </span><span style="font-size:7.5pt;font-family:"Arial","sans-serif"">12/16/2013 03:11 AM</span>
<br>
<span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:#5F5F5F">Subject: </span><span style="font-size:7.5pt;font-family:"Arial","sans-serif"">RE: [lttng-dev] efficient use of LTTng in legacy codebase</span>
<o:p></o:p></p>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="3" width="100%" noshade="" style="color:#A0A0A0" align="center">
</div>
<p class="MsoNormal"><br>
<br>
<br>
<span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#004080">I agree that in the long term it would be nice if the trace reader could perform the formatting.</span>
<br>
<span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#004080"> </span>
<br>
<span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#004080">However, I am not sure how #2 would work if the format strings and argument lists are passed through a couple of function calls before calling the tracepoint API (which is the case
in our code).</span> <br>
<span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#004080"> </span>
<br>
<b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Amit Margalit [</span><a href="mailto:AMITM@il.ibm.com"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">mailto:AMITM@il.ibm.com</span></a><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">]
<b><br>
Sent:</b> Sunday, December 15, 2013 4:56 AM<b><br>
To:</b> Máté Ferenczy<b><br>
Cc:</b> <a href="mailto:lttng-dev@lists.lttng.org">lttng-dev@lists.lttng.org</a>; Mathieu Desnoyers<b><br>
Subject:</b> Re: [lttng-dev] efficient use of LTTng in legacy codebase</span> <br>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">The macro is elegant and solves the problem nicely.</span>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif""><br>
I find that it does not make the biggest issue go away - the entire formatted string gets stored in the trace file multiple times.</span>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif""><br>
The best solution would be:</span> <br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">1. To modify CTF and define a type that indicates a printf-style format string.</span>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">2. To have a LTTng macro that provides this string to the tracer, so that it can record it
<u>only once</u> in the metadata.</span> <br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">3. To have the tracepoint store all the arguments in binary form, possibly with the addition of some identifying value of the format string.</span>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">4. And to have babeltrace (the CTF trace reader) perform the formatting off-line.</span>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif""><br>
I mean - consider a trace message that includes a long format string, with say - 5 integer arguments. Something like:</span>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif""><br>
"Buffer vacancy threshold warning: curr_limit=%d, curr_threshold=%d, channel_num=%d, high_mark=%d, hit_count=%d"</span>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif""><br>
This stores > 105 bytes with <u>every</u> trace line. But the real information here is only 20 bytes (assuming the integers are 32-bits).</span>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif""><br>
Storing the format string once in the metadata will effectively boost performance for a system trying to trace like this.</span>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:navy"><br>
Amit Margalit</span> <span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:olive">
<br>
IBM XIV </span><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">- <i>
Storage Reinvented</i></span> <span style="font-size:10.0pt;font-family:"Arial","sans-serif"">
<br>
XIV-NAS Development Team</span> <span style="font-size:10.0pt;font-family:"Arial","sans-serif"">
<br>
Tel. 03-689-7774</span> <span style="font-size:10.0pt;font-family:"Arial","sans-serif"">
<br>
Fax. 03-689-7230</span> <br>
<br>
<br>
<span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:#5F5F5F"><br>
From: </span><span style="font-size:7.5pt;font-family:"Arial","sans-serif"">Máté Ferenczy <</span><a href="mailto:mate.ferenczy@ericsson.com"><span style="font-size:7.5pt;font-family:"Arial","sans-serif"">mate.ferenczy@ericsson.com</span></a><span style="font-size:7.5pt;font-family:"Arial","sans-serif"">></span>
<span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:#5F5F5F"><br>
To: </span><span style="font-size:7.5pt;font-family:"Arial","sans-serif"">Mathieu Desnoyers <</span><a href="mailto:mathieu.desnoyers@efficios.com"><span style="font-size:7.5pt;font-family:"Arial","sans-serif"">mathieu.desnoyers@efficios.com</span></a><span style="font-size:7.5pt;font-family:"Arial","sans-serif"">></span>
<span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:#5F5F5F"><br>
Cc: </span><span style="font-size:7.5pt;font-family:"Arial","sans-serif"">"</span><a href="mailto:lttng-dev@lists.lttng.org"><span style="font-size:7.5pt;font-family:"Arial","sans-serif"">lttng-dev@lists.lttng.org</span></a><span style="font-size:7.5pt;font-family:"Arial","sans-serif"">"
<</span><a href="mailto:lttng-dev@lists.lttng.org"><span style="font-size:7.5pt;font-family:"Arial","sans-serif"">lttng-dev@lists.lttng.org</span></a><span style="font-size:7.5pt;font-family:"Arial","sans-serif"">></span>
<span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:#5F5F5F"><br>
Date: </span><span style="font-size:7.5pt;font-family:"Arial","sans-serif"">12/12/2013 07:39 PM</span>
<span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:#5F5F5F"><br>
Subject: </span><span style="font-size:7.5pt;font-family:"Arial","sans-serif"">Re: [lttng-dev] efficient use of LTTng in legacy codebase</span>
<o:p></o:p></p>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="3" width="100%" noshade="" style="color:#A0A0A0" align="center">
</div>
<p class="MsoNormal"><br>
<br>
<br>
<span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#004080"><br>
That’s even better, as far as I see we do not even have to touch the liblttng code itself.</span>
<span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#004080"><br>
Will get back with comments if any after testing.</span> <span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#004080">
<br>
</span> <span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#004080"><br>
Thanks so much! <br>
mate</span> <span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#004080">
<br>
</span> <span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#004080"><br>
</span> <b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""><br>
From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Mathieu Desnoyers [</span><a href="mailto:mathieu.desnoyers@efficios.com"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">mailto:mathieu.desnoyers@efficios.com</span></a><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">]
<b><br>
Sent:</b> Thursday, December 12, 2013 4:35 AM<b><br>
To:</b> Máté Ferenczy<b><br>
Cc:</b> </span><a href="mailto:lttng-dev@lists.lttng.org"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">lttng-dev@lists.lttng.org</span></a><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""><br>
Subject:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Re: efficient use of LTTng in legacy codebase</span>
<span style="font-size:10.0pt;font-family:"Calibri","sans-serif""><br>
</span> <span style="font-size:10.0pt;font-family:"Calibri","sans-serif""><br>
Just to speed things up, please have a look at the proposed UST patch. (it's not in mainline yet)</span>
<span style="font-size:10.0pt;font-family:"Calibri","sans-serif""><br>
</span> <span style="font-size:10.0pt;font-family:"Calibri","sans-serif""><br>
This is specifically for a demo program example so far.</span> <span style="font-size:10.0pt;font-family:"Calibri","sans-serif"">
<br>
</span> <span style="font-size:10.0pt;font-family:"Calibri","sans-serif""><br>
Comments are welcome,</span> <span style="font-size:10.0pt;font-family:"Calibri","sans-serif"">
<br>
</span> <span style="font-size:10.0pt;font-family:"Calibri","sans-serif""><br>
Thanks,</span> <span style="font-size:10.0pt;font-family:"Calibri","sans-serif"">
<br>
</span> <span style="font-size:10.0pt;font-family:"Calibri","sans-serif""><br>
Mathieu</span> <span style="font-size:10.0pt;font-family:"Calibri","sans-serif"">
<br>
</span> <span style="font-size:10.0pt;font-family:"Calibri","sans-serif""><br>
</span> <o:p></o:p></p>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="3" width="100%" align="center">
</div>
<p class="MsoNormal"><br>
<b><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif""><br>
From: </span></b><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">"Máté Ferenczy" <</span><a href="mailto:mate.ferenczy@ericsson.com"><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">mate.ferenczy@ericsson.com</span></a><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">><b><br>
To: </b>"Mathieu Desnoyers" <</span><a href="mailto:mathieu.desnoyers@efficios.com"><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">mathieu.desnoyers@efficios.com</span></a><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">><b><br>
Cc: </b></span><a href="mailto:lttng-dev@lists.lttng.org"><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">lttng-dev@lists.lttng.org</span></a><b><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif""><br>
Sent: </span></b><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">Wednesday, December 11, 2013 8:52:30 PM<b><br>
Subject: </b>RE: efficient use of LTTng in legacy codebase</span> <span style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">
<br>
</span> <span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#004080"><br>
It sounds great, I like the idea. Just to make sure I understand your suggestion, are we talking about converting the variable argument list to string in include/lttng/ust-tracepoint-event-write.h?</span>
<span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#004080"><br>
</span> <span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#004080"><br>
For example:</span> <span style="font-size:10.0pt;color:#004080"><br>
#define ctf_format_string(_item, …) \</span> <span style="font-size:10.0pt;color:#004080">
<br>
do { \</span> <span style="font-size:10.0pt;color:#004080">
<br>
char _buf[BUF_MAXLEN]; \</span> <span style="font-size:10.0pt;color:#004080">
<br>
snprintf(buf, sizeof(_buf), __VA_ARGS__); \</span> <span style="font-size:10.0pt;color:#004080">
<br>
_ctf_string(_item, _buf, 0); \</span> <span style="font-size:10.0pt;color:#004080">
<br>
} while(0)</span> <span style="font-size:10.0pt;color:#004080"><br>
</span><span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#004080"><br>
Or do you have some better place to put this logic?</span> <span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#004080">
<br>
</span> <span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#004080"><br>
Thanks,</span> <span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#004080">
<br>
Mate</span> <span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#004080">
<br>
</span> <b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""><br>
From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Mathieu Desnoyers [</span><a href="mailto:mathieu.desnoyers@efficios.com"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">mailto:mathieu.desnoyers@efficios.com</span></a><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">]
<b><br>
Sent:</b> Wednesday, December 11, 2013 4:48 PM<b><br>
To:</b> Máté Ferenczy<b><br>
Cc:</b> </span><a href="mailto:lttng-dev@lists.lttng.org"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">lttng-dev@lists.lttng.org</span></a><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""><br>
Subject:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Re: efficient use of LTTng in legacy codebase</span>
<span style="font-size:10.0pt;font-family:"Calibri","sans-serif""><br>
</span> <o:p></o:p></p>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="3" width="100%" align="center">
</div>
<p class="MsoNormal"><br>
<b><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif""><br>
From: </span></b><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">"Máté Ferenczy" <</span><a href="mailto:mate.ferenczy@ericsson.com" target="_blank"><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">mate.ferenczy@ericsson.com</span></a><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">><b><br>
To: </b>"mathieu desnoyers" <</span><a href="mailto:mathieu.desnoyers@efficios.com" target="_blank"><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">mathieu.desnoyers@efficios.com</span></a><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">><b><br>
Cc: </b></span><a href="mailto:lttng-dev@lists.lttng.org" target="_blank"><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">lttng-dev@lists.lttng.org</span></a><b><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif""><br>
Sent: </span></b><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">Wednesday, December 11, 2013 6:52:22 PM<b><br>
Subject: </b>RE: efficient use of LTTng in legacy codebase</span> <span style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">
<br>
</span> <span style="font-size:10.0pt;font-family:"Calibri","sans-serif""><br>
I found this email thread: </span><a href="https://www.mail-archive.com/lttng-dev@lists.lttng.org/msg02278.html" target="_blank"><span style="font-size:10.0pt;font-family:"Calibri","sans-serif"">https://www.mail-archive.com/lttng-dev@lists.lttng.org/msg02278.html</span></a>
<span style="font-size:10.0pt;font-family:"Calibri","sans-serif""><br>
According to this I could just check caa_unlikely(__tracepoint_##provider##___##name.state). However, Dave claims that this state will stay true even if the tracepoint is disabled. Is there anything else I should check for?</span>
<br>
<br>
I would recommend doing this in the UST probe provider instead. Within the TRACEPOINT_EVENT "TP_FIELD" section, when you declare your string field, you could parse the format string there in the last argument of a ctf_string() (a statement expression). The
format string would be received as parameter by the tracepoint, along with a variable arg list (...). In the probe, it would be turned into a va_list (see stdarg(3)), and the parameters could be decoded into a string there. This has the benefit of moving the
serialization call out-of-line into the probe provider rather than clobbering the tracepoint call site.
<br>
<br>
Thoughts ? <br>
<br>
Thanks, <br>
<br>
Mathieu <br>
<span style="font-size:10.0pt;font-family:"Calibri","sans-serif""><br>
Thanks,</span> <span style="font-size:10.0pt;font-family:"Calibri","sans-serif"">
<br>
Mate</span> <span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#004080">
<br>
</span> <b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""><br>
From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Máté Ferenczy
<b><br>
Sent:</b> Wednesday, December 11, 2013 12:17 PM<b><br>
To:</b> 'mathieu.desnoyers@efficios.com'<b><br>
Cc:</b> 'lttng-dev@lists.lttng.org'<b><br>
Subject:</b> efficient use of LTTng in legacy codebase</span> <span style="font-size:10.0pt;font-family:"Calibri","sans-serif"">
<br>
Hello Mathieu,</span> <span style="font-size:10.0pt;font-family:"Calibri","sans-serif"">
<br>
Our team was asked to support LTTng UST solution in a legacy codebase. The existing codebase is fairly large, and the requirement is that we provide all the existing logs and debugs in the system as LTTng traces.</span>
<span style="font-size:10.0pt;font-family:"Calibri","sans-serif""><br>
The planned solution so far was just to pass everything we have as text (strings) to LTTng. For that we obviously have to convert the printf-like format string and parameter list to a string by calling snprintf before giving the string to the LTTng API. That
would however mean, that these snprintfs are getting called every time even if there is no listener/active trace session for the given trace. In this case, all those unnecessary snprintf calls may end up significantly impacting the performance of our applications.</span>
<span style="font-size:10.0pt;font-family:"Calibri","sans-serif""><br>
In order to work around this, we were thinking that if there was a way to query the LTTng library from our application code whether there is an active tracing session for the given trace level, we could avoid calling those snprintfs in case they are not needed.
Do you think it would be feasible to easily get this data from LTTng lib? If yes, can you provide us some pointers where to look at in order to do those changes ourselves?</span>
<span style="font-size:10.0pt;font-family:"Calibri","sans-serif""><br>
Any suggestions are welcome.</span> <span style="font-size:10.0pt;font-family:"Calibri","sans-serif"">
<br>
Thank you,</span> <span style="font-size:10.0pt;font-family:"Calibri","sans-serif"">
<br>
Mate Ferenczy</span> <br>
<br>
<br>
-- <br>
Mathieu Desnoyers<br>
EfficiOS Inc.<u><span style="color:blue"><br>
</span></u><a href="http://www.efficios.com/" target="_blank">http://www.efficios.com</a>
<br>
<br>
<br>
-- <br>
Mathieu Desnoyers<br>
EfficiOS Inc.<u><span style="color:blue"><br>
</span></u><a href="http://www.efficios.com/">http://www.efficios.com</a><span style="font-size:10.0pt">_______________________________________________<br>
lttng-dev mailing list<u><span style="color:blue"><br>
</span></u></span><a href="mailto:lttng-dev@lists.lttng.org"><span style="font-size:10.0pt">lttng-dev@lists.lttng.org</span></a><u><span style="color:blue"><br>
</span></u><a href="http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev"><span style="font-size:10.0pt">http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev</span></a>
<o:p></o:p></p>
</div>
</body>
</html>