From: Mathieu Desnoyers Date: Mon, 12 Jan 2015 22:14:52 +0000 (-0500) Subject: Fix: add missing UST perf counter support check X-Git-Tag: v2.6.0~16 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=0e9a503d74d0ccbecef5211f09ddcd020488702d;p=lttng-tools.git Fix: add missing UST perf counter support check 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 Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/trace-ust.c b/src/bin/lttng-sessiond/trace-ust.c index 999f0dfc2..5f41bd764 100644 --- a/src/bin/lttng-sessiond/trace-ust.c +++ b/src/bin/lttng-sessiond/trace-ust.c @@ -474,7 +474,12 @@ int trace_ust_context_type_event_to_ust(enum lttng_event_context_type type) 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");