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.

Regards,

Geneviève


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.desnoy...@efficios.com
> <mailto:mathieu.desnoy...@efficios.com>> wrote:
>
>
>     ----- On Jan 21, 2019, at 12:14 PM, Yonghong Yan
>     <yany...@gmail.com <mailto:yany...@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@lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

Reply via email to