X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=liblttng-ust%2Flttng-context-ip.c;h=fb9229543194d91b6df66a36e447fa4bb59fb314;hb=HEAD;hp=d7a65905d8328e3caf98ab35abc7d2d4e123acb2;hpb=0466ac28c41336fd6d373cc8b0b26ef132225b9f;p=lttng-ust.git diff --git a/liblttng-ust/lttng-context-ip.c b/liblttng-ust/lttng-context-ip.c deleted file mode 100644 index d7a65905..00000000 --- a/liblttng-ust/lttng-context-ip.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - * SPDX-License-Identifier: LGPL-2.1-only - * - * Copyright (C) 2009-2012 Mathieu Desnoyers - * - * LTTng UST Instruction Pointer Context. - */ - -#define _LGPL_SOURCE -#include -#include -#include -#include -#include -#include - -#include "context-internal.h" - -static -size_t ip_get_size(struct lttng_ust_ctx_field *field, size_t offset) -{ - size_t size = 0; - - size += lib_ring_buffer_align(offset, lttng_alignof(void *)); - size += sizeof(void *); - return size; -} - -static -void ip_record(struct lttng_ust_ctx_field *field, - struct lttng_ust_lib_ring_buffer_ctx *ctx, - struct lttng_channel *chan) -{ - void *ip; - - ip = ctx->ip; - lib_ring_buffer_align_ctx(ctx, lttng_alignof(ip)); - chan->ops->event_write(ctx, &ip, sizeof(ip)); -} - -int lttng_add_ip_to_ctx(struct lttng_ust_ctx **ctx) -{ - struct lttng_ust_ctx_field *field; - struct lttng_ust_type_common *type; - int ret; - - type = lttng_ust_create_type_integer(sizeof(void *) * CHAR_BIT, - lttng_alignof(void *) * CHAR_BIT, - lttng_is_signed_type(void *), - BYTE_ORDER, 16); - if (!type) - return -ENOMEM; - field = lttng_append_context(ctx); - if (!field) { - ret = -ENOMEM; - goto error_context; - } - if (lttng_find_context(*ctx, "ip")) { - ret = -EEXIST; - goto error_find_context; - } - field->event_field->name = strdup("ip"); - if (!field->event_field->name) { - ret = -ENOMEM; - goto error_name; - } - field->event_field->type = type; - field->get_size = ip_get_size; - field->record = ip_record; - lttng_context_update(*ctx); - return 0; - -error_name: -error_find_context: - lttng_remove_context_field(ctx, field); -error_context: - lttng_ust_destroy_type(type); - return ret; -}