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

Tony Jones tonyj at suse.de
Thu Sep 10 20:15:01 EDT 2015


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.

# 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





More information about the lttng-dev mailing list