X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=lttng-context-vppid.c;h=f01b02068d67fa8ef1bdfc8e1a278f93b27cf618;hb=7b745a9662e0552f2715391147bc994ad17ae29c;hp=4abf784613afebf844f9be3ed92946519dbff31f;hpb=44252f0fd51fd4bf28926dcef525355bceb08c5f;p=lttng-modules.git diff --git a/lttng-context-vppid.c b/lttng-context-vppid.c index 4abf7846..f01b0206 100644 --- a/lttng-context-vppid.c +++ b/lttng-context-vppid.c @@ -31,10 +31,18 @@ void vppid_record(struct lttng_ctx_field *field, struct lib_ring_buffer_ctx *ctx, struct ltt_channel *chan) { + struct task_struct *parent; pid_t vppid; + /* + * nsproxy can be NULL when scheduled out of exit. + */ rcu_read_lock(); - vppid = task_tgid_vnr(current->real_parent); + parent = rcu_dereference(current->real_parent); + if (!parent->nsproxy) + vppid = 0; + else + vppid = task_tgid_vnr(parent); rcu_read_unlock(); lib_ring_buffer_align_ctx(ctx, ltt_alignof(vppid)); chan->ops->event_write(ctx, &vppid, sizeof(vppid));