X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=lttng-context-ppid.c;h=aaa334bc0a3fda482c6404781041955d98af6aad;hb=a90917c3f8c4ed79117f1caa333b29a2108084ec;hp=9f647ab1a079eac1066057cebefea2205a7b8ee7;hpb=09fec6b43d11b3e0ece36f9e9e44b9627c1b565d;p=lttng-modules.git diff --git a/lttng-context-ppid.c b/lttng-context-ppid.c index 9f647ab1..aaa334bc 100644 --- a/lttng-context-ppid.c +++ b/lttng-context-ppid.c @@ -11,17 +11,17 @@ #include #include #include -#include "ltt-events.h" +#include "lttng-events.h" #include "wrapper/ringbuffer/frontend_types.h" #include "wrapper/vmalloc.h" -#include "ltt-tracer.h" +#include "lttng-tracer.h" static size_t ppid_get_size(size_t offset) { size_t size = 0; - size += lib_ring_buffer_align(offset, ltt_alignof(pid_t)); + size += lib_ring_buffer_align(offset, lttng_alignof(pid_t)); size += sizeof(pid_t); return size; } @@ -29,14 +29,14 @@ size_t ppid_get_size(size_t offset) static void ppid_record(struct lttng_ctx_field *field, struct lib_ring_buffer_ctx *ctx, - struct ltt_channel *chan) + struct lttng_channel *chan) { pid_t ppid; rcu_read_lock(); ppid = task_tgid_nr(current->real_parent); rcu_read_unlock(); - lib_ring_buffer_align_ctx(ctx, ltt_alignof(ppid)); + lib_ring_buffer_align_ctx(ctx, lttng_alignof(ppid)); chan->ops->event_write(ctx, &ppid, sizeof(ppid)); } @@ -47,10 +47,14 @@ int lttng_add_ppid_to_ctx(struct lttng_ctx **ctx) field = lttng_append_context(ctx); if (!field) return -ENOMEM; + if (lttng_find_context(*ctx, "ppid")) { + lttng_remove_context_field(ctx, field); + return -EEXIST; + } field->event_field.name = "ppid"; 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 = ltt_alignof(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.reverse_byte_order = 0; field->event_field.type.u.basic.integer.base = 10;