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