Fix: add missing UST perf counter support check
[lttng-tools.git] / src / bin / lttng-sessiond / trace-ust.c
index a3e25aa8adfed1532b95ffb22b67849f21e282fb..4f06f1b06d149635080e99edc616978cca3ae7ba 100644 (file)
@@ -470,7 +470,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");
This page took 0.023457 seconds and 4 git commands to generate.