Report whether performance counters are supported by UST on the
architecture as soon as the user try to enable a perf counter context.
Fixes #851
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
utype = LTTNG_UST_CONTEXT_IP;
break;
case LTTNG_EVENT_CONTEXT_PERF_THREAD_COUNTER:
- utype = LTTNG_UST_CONTEXT_PERF_THREAD_COUNTER;
+ if (!ustctl_has_perf_counters()) {
+ utype = -1;
+ WARN("Perf counters not implemented in UST");
+ } else {
+ utype = LTTNG_UST_CONTEXT_PERF_THREAD_COUNTER;
+ }
break;
default:
ERR("Invalid UST context");