Migrate tracepoint instrumentation to TP_FIELDS
[lttng-modules.git] / lttng-context-pid.c
index 25cbcbb299d70f6cee9107c959c98aa4595f8f12..3211819d082097596e3802aa5c1620987c1162b7 100644 (file)
@@ -50,6 +50,13 @@ void pid_record(struct lttng_ctx_field *field,
        chan->ops->event_write(ctx, &pid, sizeof(pid));
 }
 
+static
+void pid_get_value(struct lttng_ctx_field *field,
+               union lttng_ctx_value *value)
+{
+       value->s64 = task_tgid_nr(current);
+}
+
 int lttng_add_pid_to_ctx(struct lttng_ctx **ctx)
 {
        struct lttng_ctx_field *field;
@@ -71,6 +78,7 @@ int lttng_add_pid_to_ctx(struct lttng_ctx **ctx)
        field->event_field.type.u.basic.integer.encoding = lttng_encode_none;
        field->get_size = pid_get_size;
        field->record = pid_record;
+       field->get_value = pid_get_value;
        lttng_context_update(*ctx);
        wrapper_vmalloc_sync_all();
        return 0;
This page took 0.022962 seconds and 4 git commands to generate.