Write context fields into trace
[lttng-modules.git] / probes / lttng-context-pid.c
index 669e593fa1d50152362d191955118266f585b458..adb14c3604a72ead0ca08e414cc1b374ff604bb4 100644 (file)
 #include "../wrapper/vmalloc.h"
 #include "../ltt-tracer.h"
 
+static
+size_t pid_get_size(size_t offset)
+{
+       size_t size = 0;
+
+       size += lib_ring_buffer_align(offset, ltt_alignof(pid_t));
+       size += sizeof(pid_t);
+       return size;
+}
+
 static
 void pid_record(struct lttng_ctx_field *field,
                struct lib_ring_buffer_ctx *ctx,
@@ -43,7 +53,8 @@ int lttng_add_pid_to_ctx(struct lttng_ctx **ctx)
        field->type.u.basic.integer.reverse_byte_order = 0;
        field->type.u.basic.integer.base = 10;
        field->type.u.basic.integer.encoding = lttng_encode_none;
-       field->callback = pid_record;
+       field->get_size = pid_get_size;
+       field->record = pid_record;
        wrapper_vmalloc_sync_all();
        return 0;
 }
This page took 0.023686 seconds and 4 git commands to generate.