<div dir="ltr">Jonathan, sorry, I've copied wrong output, original command was with perf:thread:cpu-cycles:<div><br></div><div>> lttng add-context -u -t vpid -t perf:thread:cpu-cycles -t perf:thread:instructions -t perf:thread:cache-misses</div>
<div>Session auto-20140724-091524 created.</div><div>Traces will be written in /export/home/eiva/lttng-traces/auto-20140724-091524</div><div>UST context vpid added to all channels</div><div>Error: perf:thread:cpu-cycles: UST invalid context</div>
<div>Error: perf:thread:instructions: UST invalid context</div><div>Error: perf:thread:cache-misses: UST invalid context</div><div>Warning: Some command(s) went wrong</div><div>UST event eiva_test:* created in channel channel0</div>
<div><br>> lttng --version</div><div>lttng (LTTng Trace Control) 2.5.0 - Fumisterie</div><div><br></div><div>Later I've tried cpu-cycles separately and then accidentally switched to perf:cpu. Now everything started to work, but nothing changed since then. Though didn't check if we still get zeroes on another machine.</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jul 24, 2014 at 7:01 PM, Jonathan Rajotte-Julien <span dir="ltr"><<a href="mailto:jonathan.rajotte-julien@ericsson.com" target="_blank">jonathan.rajotte-julien@ericsson.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi!<br>
<div class=""><br>
> Hi!<br>
><br>
> I use lttng-2.5.0 (tools, modules, …) and linux-3.8.13. When I try to add context for performance counters I get the following error:<br>
><br>
>> lttng add-context -u -t perf:cpu:cpu-cycles<br>
> Error: perf:cpu:cpu-cycles: UST invalid context<br>
> Warning: Some command(s) went wrong<br>
<br>
</div>Well i think we will both agree that the help page does not help very much.(Should fix that)<br>
<br>
If we go deep down into the code we get the supported context for UST domain. :)<br>
<br>
Ust domain support 6 type of context:<br>
LTTNG_EVENT_CONTEXT_VTID<br>
LTTNG_EVENT_CONTEXT_VPID<br>
LTTNG_UST_CONTEXT_VPID<br>
LTTNG_EVENT_CONTEXT_PTHREAD_ID<br>
LTTNG_EVENT_CONTEXT_PROCNAME<br>
LTTNG_EVENT_CONTEXT_IP<br>
LTTNG_EVENT_CONTEXT_PERF_THREAD_COUNTER<br>
<br>
Well this does help a little ... If we dig a little deeper and search around we get more info and see that an enum from "./lttng-tools/include/lttng/event.h" lttng_event_context_t maps to another one in the lttng-tool side ( context_type in add_context.c)<br>

<br>
*Important Part*<br>
So if we decrypt the macros and functions in add-context.c, we get that the following contexts are supported for UST:<br>
<br>
vpid<br>
vtid<br>
pthread_id<br>
procname<br>
ip<br>
<br>
perf:thread:cpu-cycles<br>
perf:thread:cycles<br>
perf:thread:stalled-cycles-frontend<br>
perf:thread:idle-cycles-frontend<br>
perf:thread:stalled-cycles-backend<br>
perf:thread:idle-cycles-backend<br>
perf:thread:instructions<br>
perf:thread:cache-references<br>
perf:thread:cache-misses<br>
perf:thread:branch-instructions<br>
perf:thread:branches<br>
perf:thread:branch-misses<br>
perf:thread:bus-cycles<br>
<br>
perf:thread:L1-dcache<br>
perf:thread:L1-icache<br>
perf:thread:LLC<br>
perf:thread:dTLB<br>
perf:thread:iTLB-loads<br>
perf:thread:iTLB-load-misses<br>
perf:thread:branch-loads<br>
perf:thread:branch-load-misses<br>
<br>
perf:thread:cpu-clock<br>
perf:thread:task-clock<br>
perf:thread:page-fault<br>
perf:thread:faults<br>
perf:thread:major-faults<br>
perf:thread:minor-faults<br>
perf:thread:context-switches<br>
perf:thread:cs<br>
perf:thread:cpu-migrations<br>
perf:thread:migrations<br>
perf:thread:alignment-faults<br>
perf:thread:emulation-faults<br>
<br>
**(TL;DR : perf:cpu:cpu-cycles is not in the list)**<br>
<br>
If you want perf:cpu:cpu-cycles you will need a kernel tracing domain.<br>
<br>
Even if it make sense that a ust tracing session cannot touch hardware stuff it won’t hurt to be more explicit about it. :).<br>
<div class=""><br>
><br>
> We have another machine with 2.5.0 (modules are not installed though) and adding perf:cpu:cpu-cycles works fine, but it is always zero in results.<br>
<br>
</div>As for this, I cannot explain why lttng-tool does not complain on adding the context.<br>
You can open a bug here <a href="http://bugs.lttng.org/projects/lttng-tools" target="_blank">http://bugs.lttng.org/projects/lttng-tools</a> (you will need to create an account and sign in)<br>
<br>
Cheers,<br>
Jonathan<br>
<span class="HOEnZb"><font color="#888888"><br>
><br>
> --<br>
> Cheers,<br>
> Evgeniy<br>
><br>
><br>
> _______________________________________________<br>
> lttng-dev mailing list<br>
> <a href="mailto:lttng-dev@lists.lttng.org">lttng-dev@lists.lttng.org</a><br>
> <a href="http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev" target="_blank">http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev</a><br>
><br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>Cheers,<br>Evgeniy
</div>