Hi!

> Hi!
> 
> 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:
> 
>> lttng add-context -u -t perf:cpu:cpu-cycles
> Error: perf:cpu:cpu-cycles: UST invalid context
> Warning: Some command(s) went wrong

Well i think we will both agree that the help page does not help very 
much.(Should fix that)

If we go deep down into the code we get the supported context for UST domain. :)

Ust domain support 6 type of context:
LTTNG_EVENT_CONTEXT_VTID
LTTNG_EVENT_CONTEXT_VPID
LTTNG_UST_CONTEXT_VPID
LTTNG_EVENT_CONTEXT_PTHREAD_ID
LTTNG_EVENT_CONTEXT_PROCNAME
LTTNG_EVENT_CONTEXT_IP
LTTNG_EVENT_CONTEXT_PERF_THREAD_COUNTER

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)

*Important Part*
So if we decrypt the macros and functions in add-context.c, we get that the 
following contexts are supported for UST:

vpid
vtid
pthread_id
procname
ip

perf:thread:cpu-cycles
perf:thread:cycles
perf:thread:stalled-cycles-frontend
perf:thread:idle-cycles-frontend
perf:thread:stalled-cycles-backend
perf:thread:idle-cycles-backend
perf:thread:instructions
perf:thread:cache-references
perf:thread:cache-misses
perf:thread:branch-instructions
perf:thread:branches
perf:thread:branch-misses
perf:thread:bus-cycles
    
perf:thread:L1-dcache
perf:thread:L1-icache
perf:thread:LLC
perf:thread:dTLB
perf:thread:iTLB-loads
perf:thread:iTLB-load-misses                                                    
                                                                                
           
perf:thread:branch-loads
perf:thread:branch-load-misses
        
perf:thread:cpu-clock
perf:thread:task-clock
perf:thread:page-fault
perf:thread:faults
perf:thread:major-faults
perf:thread:minor-faults
perf:thread:context-switches
perf:thread:cs
perf:thread:cpu-migrations
perf:thread:migrations
perf:thread:alignment-faults
perf:thread:emulation-faults

**(TL;DR : perf:cpu:cpu-cycles is not in the list)**

If you want perf:cpu:cpu-cycles you will need a kernel tracing domain.

Even if it make sense that a ust tracing session cannot touch hardware stuff it 
won’t hurt to be more explicit about it. :).

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

As for this, I cannot explain why lttng-tool does not complain on adding the 
context.
You can open a bug here http://bugs.lttng.org/projects/lttng-tools (you will 
need to create an account and sign in)

Cheers,
Jonathan

> 
> -- 
> Cheers,
> Evgeniy
> 
> 
> _______________________________________________
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
> 


_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

Reply via email to