- if (caa_unlikely(!cached_vtid))
- cached_vtid = gettid();
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(cached_vtid));
- chan->ops->event_write(ctx, &cached_vtid, sizeof(cached_vtid));
+ pid_t vtid = wrapper_getvtid();
+
+ lib_ring_buffer_align_ctx(ctx, lttng_alignof(vtid));
+ chan->ops->event_write(ctx, &vtid, sizeof(vtid));
+}
+
+static
+void vtid_get_value(struct lttng_ctx_field *field,
+ struct lttng_ctx_value *value)
+{
+ value->u.s64 = wrapper_getvtid();