<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><div><br data-mce-bogus="1"></div><div><span id="zwchr" data-marker="__DIVIDER__">----- On Jan 21, 2019, at 12:14 PM, Yonghong Yan <yanyh15@gmail.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 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 data-mce-bogus="1"></div><div>(e.g. lttng enable-event {-u,-k} --filter '$ctx.cpu_id == 2').<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>It is not possible to add it as context to the streams, because its information would<br data-mce-bogus="1"></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 data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>You just need to use babeltrace to convert to text, and while doing so, it prints a<br data-mce-bogus="1"></div><div>"cpu_id = N" context based on the packet_context cpu_id field for each event.<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>Thanks,</div><div><br data-mce-bogus="1"></div><div>Mathieu<br data-mce-bogus="1"></div></div><div><br data-mce-bogus="1"></div><div data-marker="__SIG_POST__">-- <br></div><div>Mathieu Desnoyers<br>EfficiOS Inc.<br>http://www.efficios.com</div></div></body></html>