<div dir="ltr">Hey Jonathan,<div><br></div><div>Thanks a lot for help! I think I've found the reason of invalid context messages: I reran root's lttng-sessiond, but didn't check sessions for my user (since I've done 'destroy -a'). Today again I got issue with invalid context and noticed, that there are two pairs of lttng-sessiond and lttng-consumerd: from old version and from new version according dates. Old one is from July 7, which is surprising, since I often do "destroy -a". After killing everything seems to work. Btw, it's Oracle linux 6.5 with linux 3.8.</div>
<div><br></div><div>I'll check that zeros after weekend: I don't have own access to that machine.</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jul 25, 2014 at 1:07 AM, 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"><div class=""><br>
<br>
On 07/24/2014 04:46 PM, Jonathan Rajotte-Julien wrote:<br>
><br>
> Hey Evgeniy,<br>
><br>
><br>
>> Jonathan, sorry, I've copied wrong output, original command was with perf:thread:cpu-cycles:<br>
>><br>
>>> lttng add-context -u -t vpid -t perf:thread:cpu-cycles -t perf:thread:instructions -t perf:thread:cache-misses<br>
>> Session auto-20140724-091524 created.<br>
>> Traces will be written in /export/home/eiva/lttng-traces/auto-20140724-091524<br>
>> UST context vpid added to all channels<br>
>> Error: perf:thread:cpu-cycles: UST invalid context<br>
>> Error: perf:thread:instructions: UST invalid context<br>
>> Error: perf:thread:cache-misses: UST invalid context<br>
>> Warning: Some command(s) went wrong<br>
>> UST event eiva_test:* created in channel channel0<br>
><br>
> Weird, it works on my side (c&p) with latest version witch is 2.5 stable :P.<br>
<br>
</div>I just tested a fresh install from stable ppa (<a href="https://launchpad.net/~lttng/+archive/ubuntu/ppa" target="_blank">https://launchpad.net/~lttng/+archive/ubuntu/ppa</a>).<br>
<br>
and everything seems to work fine. Cycle,cache etc.<br>
<br>
Well, keep us up to date.<br>
<br>
Cheers<br>
Jonathan<br>
<div><div class="h5"><br>
><br>
>><br>
>>> lttng --version<br>
>> lttng (LTTng Trace Control) 2.5.0 - Fumisterie<br>
><br>
> From this output I guess you are working with the lttng package and not the source from git. I don't think packaging is the problem here but let just keep that in mind.<br>
> What dist are you on ?<br>
><br>
> I'm sure you already done it a thousand time but could you just run these and send the output ?<br>
><br>
> First make sure no lttng-sessiond is running then launch:<br>
><br>
> lttng-sessiond -vvv<br>
><br>
> In a separate terminal:<br>
><br>
> lttng destroy -a  // Just in case<br>
> lttng -vvv create test<br>
><br>
> lttng -vvv add-context -u -t vpid -t perf:thread:cpu-cycles -t perf:thread:instructions -t perf:thread:cache-misses<br>
><br>
> If this work, you could test if you get the data or zero.<br>
><br>
> lttng enable-event -u -a -s test<br>
><br>
> lttng start<br>
> // Run the program<br>
><br>
> lttng stop<br>
><br>
> Make sure to send the output from lttng-sessiond -vvv.<br>
><br>
><br>
> Cheers,<br>
> Jonathan<br>
><br>
>><br>
>> 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.<br>

>><br>
>><br>
>> On Thu, Jul 24, 2014 at 7:01 PM, Jonathan Rajotte-Julien <<a href="mailto:jonathan.rajotte-julien@ericsson.com">jonathan.rajotte-julien@ericsson.com</a> <mailto:<a href="mailto:jonathan.rajotte-julien@ericsson.com">jonathan.rajotte-julien@ericsson.com</a>>> wrote:<br>

>><br>
>>     Hi!<br>
>><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>
>>     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>
>><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>
>>     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>
>><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> <mailto:<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>
>><br>
>><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>
</div></div>> <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>
<div class="">><br>
<br>
<br>
_______________________________________________<br>
lttng-dev mailing list<br>
<a href="mailto:lttng-dev@lists.lttng.org">lttng-dev@lists.lttng.org</a><br>
</div><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>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Cheers,<br>Evgeniy
</div>