[lttng-dev] [RFC lttng-tools] Do not list or allow unsupported perf events

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Sun Sep 13 11:54:38 EDT 2015


CCing Jeremie.

----- On Sep 10, 2015, at 8:15 PM, Tony Jones tonyj at suse.de wrote:

> On 09/10/2015 12:21 PM, Tony Jones wrote:
> 
>> +static int is_event_supported(const struct ctx_opts *ctx)
>> +{
>> +	int fd;
>> +	struct perf_event_attr attr = {
>> +		.type = ctx->u.perf.type,
>> +		.config = ctx->u.perf.config,
>> +		.disabled = 1
>> +	};
>> +
>> +	if (ctx->ctx_type == CONTEXT_PERF_CPU_COUNTER ||
>> +	    ctx->ctx_type == CONTEXT_PERF_THREAD_COUNTER) {
> 
> obviously CONTEXT_PERF_THREAD_COUNTER is UST.  Regardless, there are  some
> obvious usability issues (below).  I need to look at the code some more.

OK, keep us posted. It would be nice if we can list more specifically
which counters are supported on the machine.

Thanks,

Mathieu

> 
> # lttng add-context -u -t perf:thread:alignment-faults
> UST context perf:thread:alignment-faults added to all channels
> 
> (invalid, better error needed, also sometimes -k -t perf:thread:* succeeds which
> seems broken)
> # lttng add-context -k -t perf:thread:alignment-faults
> Error: perf:thread:alignment-faults: Add kernel context failed
> Warning: Some command(s) went wrong

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com



More information about the lttng-dev mailing list