[lttng-dev] add cpu_id context to the channel

Genevieve Bastien gbastien at versatic.net
Mon Jan 21 19:46:02 EST 2019

Hi Yonghong,

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,

<stateAttribute type="eventField" value="cpu" />

With LTTng traces, it will automatically be the CPU, obtained as Mathieu
described, no need for an extra field.



On 2019-01-21 4:21 p.m., Yonghong Yan wrote:
> 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. 
> Yonghong
> On Mon, Jan 21, 2019 at 2:06 PM Mathieu Desnoyers
> <mathieu.desnoyers at efficios.com
> <mailto:mathieu.desnoyers at efficios.com>> wrote:
>     ----- On Jan 21, 2019, at 12:14 PM, Yonghong Yan
>     <yanyh15 at gmail.com <mailto: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
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.lttng.org/pipermail/lttng-dev/attachments/20190121/6553c6c6/attachment-0001.html>

More information about the lttng-dev mailing list