[lttng-dev] add cpu_id context to the channel

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Mon Jan 21 14:06:21 EST 2019


----- On Jan 21, 2019, at 12:14 PM, Yonghong Yan <yanyh15 at gmail.com> wrote: 

> 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.

The cpu_id context only exists for the purpose of lttng-ust and lttng-modules filtering. 
(e.g. lttng enable-event {-u,-k} --filter '$ctx.cpu_id == 2'). 

It is not possible to add it as context to the streams, because its information would 
be completely redundant with the fact that all the data is written into per-cpu buffers, 
and the cpu_id field is available within each packet context (which is right after each 
packet header). 

You just need to use babeltrace to convert to text, and while doing so, it prints a 
"cpu_id = N" context based on the packet_context cpu_id field for each event. 

Thanks, 

Mathieu 

-- 
Mathieu Desnoyers 
EfficiOS Inc. 
http://www.efficios.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.lttng.org/pipermail/lttng-dev/attachments/20190121/8c8c3bfa/attachment.html>


More information about the lttng-dev mailing list