Update symbol name length max size to 256
[lttng-modules.git] / lttng-context-vpid.c
index c99010cf80a60ba71e7a937547cabe1059f661c1..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));
 }
@@ -44,6 +50,10 @@ int lttng_add_vpid_to_ctx(struct lttng_ctx **ctx)
        field = lttng_append_context(ctx);
        if (!field)
                return -ENOMEM;
+       if (lttng_find_context(*ctx, "vpid")) {
+               lttng_remove_context_field(ctx, field);
+               return -EEXIST;
+       }
        field->event_field.name = "vpid";
        field->event_field.type.atype = atype_integer;
        field->event_field.type.u.basic.integer.size = sizeof(pid_t) * CHAR_BIT;
This page took 0.023553 seconds and 4 git commands to generate.