Fix vpid/vppid/vtid contexts handling of sched_switch vs exit NULL nsproxy
[lttng-modules.git] / lttng-context-vtid.c
index c428911ef98aff76bdb822dc72e494febcf41b64..264bbb3011da08760bbb85697de1bf64f1f6f048 100644 (file)
@@ -32,7 +32,13 @@ void vtid_record(struct lttng_ctx_field *field,
 {
        pid_t vtid;
 
-       vtid = task_pid_vnr(current);
+       /*
+        * nsproxy can be NULL when scheduled out of exit.
+        */
+       if (!current->nsproxy)
+               vtid = 0;
+       else
+               vtid = task_pid_vnr(current);
        lib_ring_buffer_align_ctx(ctx, ltt_alignof(vtid));
        chan->ops->event_write(ctx, &vtid, sizeof(vtid));
 }
This page took 0.022235 seconds and 4 git commands to generate.