Fix: context alignment not properly handled
[lttng-ust.git] / liblttng-ust / lttng-context-vpid.c
index 3ab786f4c8f616243deb751dbcbfc1bd425b4106..b54ada1dd1a0ef953e9025f05f86239237bae582 100644 (file)
@@ -83,6 +83,16 @@ void vpid_record(struct lttng_ctx_field *field,
        chan->ops->event_write(ctx, &pid, sizeof(pid));
 }
 
+static
+void vpid_get_value(struct lttng_ctx_field *field,
+               union lttng_ctx_value *value)
+{
+       pid_t pid;
+
+       pid = wrapper_getpid();
+       value->s64 = pid;
+}
+
 int lttng_add_vpid_to_ctx(struct lttng_ctx **ctx)
 {
        struct lttng_ctx_field *field;
@@ -104,5 +114,7 @@ int lttng_add_vpid_to_ctx(struct lttng_ctx **ctx)
        field->event_field.type.u.basic.integer.encoding = lttng_encode_none;
        field->get_size = vpid_get_size;
        field->record = vpid_record;
+       field->get_value = vpid_get_value;
+       lttng_context_update(*ctx);
        return 0;
 }
This page took 0.023886 seconds and 4 git commands to generate.