X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=lttng-context-pid.c;h=5ad92c14e10ab923deb2c1cebe9240ad9c423c04;hb=79150a4903b5f31695fcd1d9655555ba6dc4bfa4;hp=85427e66bb47e4d6e0f3b4b334f34fed383d7016;hpb=886d51a3d7ed5fa6b41d7f19b3e14ae6c535a44c;p=lttng-modules.git diff --git a/lttng-context-pid.c b/lttng-context-pid.c index 85427e66..5ad92c14 100644 --- a/lttng-context-pid.c +++ b/lttng-context-pid.c @@ -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; @@ -65,12 +73,14 @@ int lttng_add_pid_to_ctx(struct lttng_ctx **ctx) field->event_field.type.atype = atype_integer; field->event_field.type.u.basic.integer.size = sizeof(pid_t) * CHAR_BIT; field->event_field.type.u.basic.integer.alignment = lttng_alignof(pid_t) * CHAR_BIT; - field->event_field.type.u.basic.integer.signedness = is_signed_type(pid_t); + field->event_field.type.u.basic.integer.signedness = lttng_is_signed_type(pid_t); field->event_field.type.u.basic.integer.reverse_byte_order = 0; field->event_field.type.u.basic.integer.base = 10; 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; } @@ -79,3 +89,7 @@ EXPORT_SYMBOL_GPL(lttng_add_pid_to_ctx); MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Mathieu Desnoyers"); MODULE_DESCRIPTION("Linux Trace Toolkit PID Context"); +MODULE_VERSION(__stringify(LTTNG_MODULES_MAJOR_VERSION) "." + __stringify(LTTNG_MODULES_MINOR_VERSION) "." + __stringify(LTTNG_MODULES_PATCHLEVEL_VERSION) + LTTNG_MODULES_EXTRAVERSION);