Make goals configurable with CONFIG_LTTNG
[lttng-modules.git] / lttng-context-pid.c
index 25cbcbb299d70f6cee9107c959c98aa4595f8f12..5ad92c14e10ab923deb2c1cebe9240ad9c423c04 100644 (file)
@@ -50,6 +50,14 @@ 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,
+               struct lttng_probe_ctx *lttng_probe_ctx,
+               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 +79,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.026623 seconds and 4 git commands to generate.