Fix: sessiond ust-app session teardown race
[lttng-tools.git] / src / bin / lttng-sessiond / trace-ust.c
index 999f0dfc21e75f4e988476be894adcff3e33f4bc..5f41bd764308a812806f623bdfb2ed24c09b838d 100644 (file)
@@ -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");
This page took 0.026321 seconds and 4 git commands to generate.