<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><div><style><!--
@font-face
{font-family:Helvetica;
panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 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;}
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
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;}
p
{mso-style-priority:99;
margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style></div><div><br></div><div><br></div><div><span id="zwchr" data-marker="__DIVIDER__">----- On Nov 30, 2018, at 12:30 PM, John OSullivan <John.OSullivan@BlackBox.com> wrote:<br></span></div><div data-marker="__QUOTED_TEXT__"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hi Mathieu,</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Thank you for the reply and my apologies for the confusion. Let me try and clarify.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">I understood that the use of the class and instance concepts in the tpl file was to be able to declare a class with as you say a number of fields and then create
instances of that class that provided a way of defining specific variants of that class.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">For example
</span></p>
<p class="MsoNormal"><span style="font-family:"Helvetica","sans-serif";color:black">TRACEPOINT_EVENT_CLASS(<br>
/* Tracepoint provider name */<br>
core_event_trace,<br><br>
/* Tracepoint class name */<br>
core_event_tracepoint_class,<br><br>
/* Input arguments */<br>
TP_ARGS(<br>
int, event_type</span></p>
<p class="MsoNormal"><span style="font-family:"Helvetica","sans-serif";color:black"> int, second_field<br>
int, third_field</span></p>
<p class="MsoNormal"><span style="font-family:"Helvetica","sans-serif";color:black"> int, fourth_field<br>
),<br><br>
/* Output event fields */<br>
TP_FIELDS(<br>
ctf_integer(int, event_type, event_type)<br>
ctf_integer(int, second_field, second_field) </span></p>
<p class="MsoNormal"><span style="font-family:"Helvetica","sans-serif";color:black"> ctf_integer(int, third_field, third_field)<br>
)<br>
)<br><br></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Then we declare an instance</span></p>
<p class="MsoNormal"><span style="font-family:"Helvetica","sans-serif";color:black">TRACEPOINT_EVENT_INSTANCE(<br>
core_event_trace,<br>
core_event_tracepoint_class,<br>
first_event_tracepoint,<br>
TP_ARGS(<br>
int, event_type</span></p>
<p class="MsoNormal"><span style="font-family:"Helvetica","sans-serif";color:black"> Int, first_field<br><br>
)<br>
)</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">And a second one</span></p>
<p class="MsoNormal"><span style="font-family:"Helvetica","sans-serif";color:black">TRACEPOINT_EVENT_INSTANCE(<br>
core_event_trace,<br>
core_event_tracepoint_class,<br>
second_event_tracepoint,<br>
TP_ARGS(<br>
int, event_type</span></p>
<p class="MsoNormal"><span style="font-family:"Helvetica","sans-serif";color:black"> Int, second_field<br><br>
)<br>
)</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">So the two instances do not define all of the fields in the class definition, the first only defines first_field and the second only defines second_field, will
this work or do the field in the instance always have to match the fields in the class?</span></p></div></blockquote><div>I see from the examples above that when you say "field" in your question here, you actually mean "arguments to TP_ARGS".<br></div><div><br data-mce-bogus="1"></div><div>So the answer is that the arguments need to match exactly between the instances and the class they refer to.<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>Thanks,<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>Mathieu<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div class="WordSection1">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"" lang="EN-US">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"" lang="EN-US"> Mathieu Desnoyers [mailto:mathieu.desnoyers@efficios.com]
<br><b>Sent:</b> 30 November 2018 17:13<br><b>To:</b> John O'Sullivan<br><b>Cc:</b> lttng-dev<br><b>Subject:</b> [EXTERNAL] Re: [lttng-dev] Correct way to use the tpl file</span></p>
</div>
</div>
<p class="MsoNormal"> </p>
<div>
<div>
</div>
<div>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif";color:black">----- On Nov 30, 2018, at 11:09 AM, John OSullivan <John.OSullivan@BlackBox.com> wrote:<br><br></span></p>
</div>
<div>
<blockquote style="border:none;border-left:solid #1010FF 1.5pt;padding:0cm 0cm 0cm 4.0pt;margin-left:3.75pt;margin-top:5.0pt;margin-bottom:5.0pt">
<p><span style="font-family:"Helvetica","sans-serif";color:black">Hi,</span></p>
<p><span style="font-family:"Helvetica","sans-serif";color:black">I am looking for some advice on the best way to manage the tracing of some user space events.</span></p>
<p><span style="font-family:"Helvetica","sans-serif";color:black">I have a series of events that are fed to queues, they look something like the following sample</span></p>
<p><span style="font-family:"Helvetica","sans-serif";color:black">EventEnd* event_end_new()<br>
{<br>
EventEnd* event_end = bb_xnew(EventEnd,__func__);<br><br>
if (event_end != NULL)<br>
{<br>
event_end->type = EQ_EVENT_END;<br>
. .. other event specific fields here</span></p>
<p><span style="font-family:"Helvetica","sans-serif";color:black"> ..<br>
}<br>
#ifdef LTTNG_TRACE<br>
tracepoint(core_event_trace, end_event_tracepoint, EQ_EVENT_END);<br>
#endif<br>
return event_end;<br>
}</span></p>
<p><span style="font-family:"Helvetica","sans-serif";color:black">I want to try and trace these so created the following template shown below. My question is, does the class have to have all of the possible members that the different instances will have, as
each unique event is likely to have different members will the class have to have all of these members defines, and if this is the case is it okay for an instance to just implement a subset of the members the class defines?</span></p>
</blockquote>
<div>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif";color:black">I am a bit confused by your use of the word "members" here. A tracepoint class has a provider name,</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif";color:black">a class name, input argument, and output fields.</span></p>
</div>
<div>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif";color:black">The event instance refers to the class by provider and class name, defines its own name, and needs to</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif";color:black">have a compatible input argument prototype (same number of arguments, same types). It will serialize</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif";color:black">the output fields in the exact layout described by the event class.</span></p>
</div>
<div>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif";color:black">I know it does not directly answer your question, but I'm really unsure about what you mean</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif";color:black">by "members".</span></p>
</div>
<div>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif";color:black">Thanks,</span></p>
</div>
<div>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif";color:black">Mathieu</span></p>
</div>
<div>
</div>
<blockquote style="border:none;border-left:solid #1010FF 1.5pt;padding:0cm 0cm 0cm 4.0pt;margin-left:3.75pt;margin-top:5.0pt;margin-bottom:5.0pt">
<p><span style="font-family:"Helvetica","sans-serif";color:black">TRACEPOINT_EVENT_CLASS(<br>
/* Tracepoint provider name */<br>
core_event_trace,<br><br>
/* Tracepoint class name */<br>
core_event_tracepoint_class,<br><br>
/* Input arguments */<br>
TP_ARGS(<br>
int, event_type<br><br>
),<br><br>
/* Output event fields */<br>
TP_FIELDS(<br>
ctf_integer(int, event_type, event_type)<br><br>
)<br>
)<br><br><br><br><br><br>
TRACEPOINT_EVENT_INSTANCE(<br>
core_event_trace,<br>
core_event_tracepoint_class,<br>
end_event_tracepoint,<br>
TP_ARGS(<br>
int, event_type<br><br>
)<br>
)<br><br>
TRACEPOINT_EVENT_INSTANCE(<br>
core_event_trace,<br>
core_event_tracepoint_class,<br>
start_event_tracepoint,<br>
TP_ARGS(<br>
int, event_type<br>
)<br>
)<br><br><br><br>
TRACEPOINT_EVENT_INSTANCE(<br>
core_event_trace,<br>
core_event_tracepoint_class,<br>
foo_event_tracepoint,<br>
TP_ARGS(<br>
int, event_type<br>
)<br>
)</span></p>
<div class="MsoNormal" style="text-align:center" align="center"><span style="font-family:"Helvetica","sans-serif";color:black"><hr width="100%" size="2" align="center"></span></div>
<p class="MsoNormal"><span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:gray"><br>
This email and any files transmitted with it are confidential and are intended for the sole use of the individual to whom they are addressed. Black Box Corporation reserves the right to scan all e-mail traffic for restricted content and to monitor all e-mail
in general. If you are not the intended recipient or you have received this email in error, any use, dissemination or forwarding of this email is strictly prohibited. If you have received this email in error, please notify the sender by replying to this email.<br></span><span style="font-family:"Helvetica","sans-serif";color:black"><br>
_______________________________________________<br>
lttng-dev mailing list<br>
lttng-dev@lists.lttng.org<br>
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev</span></p>
</blockquote>
</div>
<div>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif";color:black">--
</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif";color:black">Mathieu Desnoyers<br>
EfficiOS Inc.<br>
http://www.efficios.com</span></p>
</div>
</div>
</div><br></blockquote></div><div><br></div><div data-marker="__SIG_POST__">-- <br></div><div>Mathieu Desnoyers<br>EfficiOS Inc.<br>http://www.efficios.com</div></div></body></html>