<div dir="ltr"><div dir="ltr"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div dir="ltr"><div>Thank you Genevieve, "cpu" field works. </div><div><br></div><div>Yonghong</div></div></div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Jan 21, 2019 at 7:57 PM Genevieve Bastien <<a href="mailto:gbastien@versatic.net">gbastien@versatic.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF">
<p>Hi Yonghong,</p>
<p>With TraceCompass XML analyses, you can use as state value or
attribute an eventField called 'cpu' to get the CPU id of an
event. For example,<br>
</p>
<p><stateAttribute type="eventField" value="cpu" /></p>
<p>With LTTng traces, it will automatically be the CPU, obtained as
Mathieu described, no need for an extra field.<br>
</p>
<p>Regards,</p>
<p>Geneviève<br>
</p>
<p><br>
</p>
<div class="gmail-m_1715309599997022837moz-cite-prefix">On 2019-01-21 4:21 p.m., Yonghong Yan
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">Thank you. make sense. I am using Trace Compass XML
based approach to display UST trace records. Using CPU id helps
me easier to sort out the event records in trace compass. I will
check out more on trace compass.
<div><br>
</div>
<div>Yonghong<br>
<br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr">On Mon, Jan 21, 2019 at 2:06 PM Mathieu Desnoyers
<<a href="mailto:mathieu.desnoyers@efficios.com" target="_blank">mathieu.desnoyers@efficios.com</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<div style="font-family:arial,helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<div><br>
</div>
<div><span id="gmail-m_1715309599997022837gmail-m_-6511454066164686156zwchr">----- On
Jan 21, 2019, at 12:14 PM, Yonghong Yan <<a href="mailto:yanyh15@gmail.com" target="_blank">yanyh15@gmail.com</a>>
wrote:<br>
</span></div>
<div>
<blockquote style="border-left:2px solid rgb(16,16,255);margin-left:5px;padding-left:5px;color:rgb(0,0,0);font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt">
<div dir="ltr">
<div dir="ltr">I saw there is cpu_id field in
babeltrace list, how can I add it to the context
of UST tracepoint events. lttng add-context --list
does not show that field and I do not see a
similar field for the cpu_id. </div>
</div>
</blockquote>
<div><br>
</div>
<div>The cpu_id context only exists for the purpose of
lttng-ust and lttng-modules filtering.<br>
</div>
<div>(e.g. lttng enable-event {-u,-k} --filter
'$ctx.cpu_id == 2').<br>
</div>
<div><br>
</div>
<div>It is not possible to add it as context to the
streams, because its information would<br>
</div>
<div>be completely redundant with the fact that all the
data is written into per-cpu buffers,</div>
<div>and the cpu_id field is available within each
packet context (which is right after each</div>
<div>packet header).<br>
</div>
<div><br>
</div>
<div>You just need to use babeltrace to convert to text,
and while doing so, it prints a<br>
</div>
<div>"cpu_id = N" context based on the packet_context
cpu_id field for each event.<br>
</div>
<div><br>
</div>
<div>Thanks,</div>
<div><br>
</div>
<div>Mathieu<br>
</div>
</div>
<div><br>
</div>
<div>-- <br>
</div>
<div>Mathieu Desnoyers<br>
EfficiOS Inc.<br>
<a href="http://www.efficios.com" target="_blank">http://www.efficios.com</a></div>
</div>
</div>
</blockquote>
</div>
<br>
<fieldset class="gmail-m_1715309599997022837mimeAttachmentHeader"></fieldset>
<pre class="gmail-m_1715309599997022837moz-quote-pre">_______________________________________________
lttng-dev mailing list
<a class="gmail-m_1715309599997022837moz-txt-link-abbreviated" href="mailto:lttng-dev@lists.lttng.org" target="_blank">lttng-dev@lists.lttng.org</a>
<a class="gmail-m_1715309599997022837moz-txt-link-freetext" href="https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev" target="_blank">https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev</a>
</pre>
</blockquote>
</div>
_______________________________________________<br>
lttng-dev mailing list<br>
<a href="mailto:lttng-dev@lists.lttng.org" target="_blank">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-bin/mailman/listinfo/lttng-dev</a><br>
</blockquote></div></div>