X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=lttng-context-vsgid.c;fp=lttng-context-vsgid.c;h=0000000000000000000000000000000000000000;hb=cfa6cc1d0f01c2cfcc1a679abf3a6572d411c309;hp=c6a6ea7c8a30571b94c65ce5680e0f8283e8b680;hpb=cd4486798c2b046ea93b89439cd705e93c40b349;p=lttng-modules.git diff --git a/lttng-context-vsgid.c b/lttng-context-vsgid.c deleted file mode 100644 index c6a6ea7c..00000000 --- a/lttng-context-vsgid.c +++ /dev/null @@ -1,76 +0,0 @@ -/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only) - * - * lttng-context-vsgid.c - * - * LTTng namespaced saved set-group-ID context. - * - * Copyright (C) 2009-2012 Mathieu Desnoyers - * 2019 Michael Jeanson - * - */ - -#include -#include -#include -#include -#include -#include -#include - -static -size_t vsgid_get_size(size_t offset) -{ - size_t size = 0; - - size += lib_ring_buffer_align(offset, lttng_alignof(gid_t)); - size += sizeof(gid_t); - return size; -} - -static -void vsgid_record(struct lttng_ctx_field *field, - struct lib_ring_buffer_ctx *ctx, - struct lttng_channel *chan) -{ - gid_t vsgid; - - vsgid = lttng_current_vsgid(); - lib_ring_buffer_align_ctx(ctx, lttng_alignof(vsgid)); - chan->ops->event_write(ctx, &vsgid, sizeof(vsgid)); -} - -static -void vsgid_get_value(struct lttng_ctx_field *field, - struct lttng_probe_ctx *lttng_probe_ctx, - union lttng_ctx_value *value) -{ - value->s64 = lttng_current_vsgid(); -} - -int lttng_add_vsgid_to_ctx(struct lttng_ctx **ctx) -{ - struct lttng_ctx_field *field; - - field = lttng_append_context(ctx); - if (!field) - return -ENOMEM; - if (lttng_find_context(*ctx, "vsgid")) { - lttng_remove_context_field(ctx, field); - return -EEXIST; - } - field->event_field.name = "vsgid"; - field->event_field.type.atype = atype_integer; - field->event_field.type.u.integer.size = sizeof(gid_t) * CHAR_BIT; - field->event_field.type.u.integer.alignment = lttng_alignof(gid_t) * CHAR_BIT; - field->event_field.type.u.integer.signedness = lttng_is_signed_type(gid_t); - field->event_field.type.u.integer.reverse_byte_order = 0; - field->event_field.type.u.integer.base = 10; - field->event_field.type.u.integer.encoding = lttng_encode_none; - field->get_size = vsgid_get_size; - field->record = vsgid_record; - field->get_value = vsgid_get_value; - lttng_context_update(*ctx); - wrapper_vmalloc_sync_mappings(); - return 0; -} -EXPORT_SYMBOL_GPL(lttng_add_vsgid_to_ctx);