Remove event id parameter from event_reserve callback
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 28 Apr 2021 19:30:04 +0000 (15:30 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 29 Apr 2021 14:33:51 +0000 (10:33 -0400)
This can be fetched from the event recorder.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I85a4ef493d67c1c374e7f3076569c2c2c2109953

include/lttng/events.h
include/lttng/tracepoint-event-impl.h
src/lttng-event-notifier-notification.c
src/lttng-events.c
src/lttng-ring-buffer-client.h
src/lttng-ring-buffer-event-notifier-client.h
src/lttng-ring-buffer-metadata-client.h
src/probes/lttng-kprobes.c
src/probes/lttng-kretprobes.c
src/probes/lttng-uprobes.c

index 613b9c49d7fc5e6cd23eaffc2b04beddaed1d27a..8c200bdd49787ee7b5960f1bff741eea1413d838 100644 (file)
@@ -562,8 +562,7 @@ struct lttng_channel_ops {
        struct lib_ring_buffer *(*buffer_read_open)(struct channel *chan);
        int (*buffer_has_read_closed_stream)(struct channel *chan);
        void (*buffer_read_close)(struct lib_ring_buffer *buf);
-       int (*event_reserve)(struct lib_ring_buffer_ctx *ctx,
-                            uint32_t event_id);
+       int (*event_reserve)(struct lib_ring_buffer_ctx *ctx);
        void (*event_commit)(struct lib_ring_buffer_ctx *ctx);
        void (*event_write)(struct lib_ring_buffer_ctx *ctx, const void *src,
                            size_t len);
index dbb92b8535485b9805705736d3ab0a00668508d7..23c053fcc944283a664746e9481b86b7bde8e1e2 100644 (file)
@@ -1094,7 +1094,7 @@ static void __event_probe__##_name(_data_proto)                                           \
                __event_align = __event_get_align__##_name(_locvar_args);               \
                lib_ring_buffer_ctx_init(&__ctx, __event_recorder, __event_len,         \
                                         __event_align, &__lttng_probe_ctx);            \
-               __ret = __chan->ops->event_reserve(&__ctx, __event_recorder->priv->id); \
+               __ret = __chan->ops->event_reserve(&__ctx);                             \
                if (__ret < 0)                                                          \
                        goto __post;                                                    \
                _fields                                                                 \
index e5bd172a6417e514dada2f4f57de32e45ec6de4b..99ca8a292e72207563b3c3ae3b27d0f057c7316c 100644 (file)
@@ -402,7 +402,7 @@ void notification_send(struct lttng_event_notifier_notification *notif,
 
        lib_ring_buffer_ctx_init(&ctx, event_notifier_group->chan, reserve_size,
                        lttng_alignof(kernel_notif), NULL);
-       ret = event_notifier_group->ops->event_reserve(&ctx, 0);
+       ret = event_notifier_group->ops->event_reserve(&ctx);
        if (ret < 0) {
                record_error(event_notifier);
                return;
index 4c266466953a7ed0706092b42d8a9d87ca2a0659..30b514a8414007eb49446a7570c733d69d450d52 100644 (file)
@@ -2886,7 +2886,7 @@ int lttng_metadata_output_channel(struct lttng_metadata_stream *stream,
        /*
         * If reservation failed, return an error to the caller.
         */
-       ret = stream->transport->ops.event_reserve(&ctx, 0);
+       ret = stream->transport->ops.event_reserve(&ctx);
        if (ret != 0) {
                printk(KERN_WARNING "LTTng: Metadata event reservation failed\n");
                stream->coherent = false;
index ff404368edc6fac5ae6b48fddf0658f53a9bd842..9ac2cfe9d348d057e7b30199cb1072766c69bd8d 100644 (file)
@@ -13,6 +13,7 @@
 #include <wrapper/vmalloc.h>   /* for wrapper_vmalloc_sync_mappings() */
 #include <wrapper/trace-clock.h>
 #include <lttng/events.h>
+#include <lttng/events-internal.h>
 #include <lttng/tracer.h>
 #include <ringbuffer/frontend_types.h>
 
@@ -604,17 +605,18 @@ void lttng_buffer_read_close(struct lib_ring_buffer *buf)
 }
 
 static
-int lttng_event_reserve(struct lib_ring_buffer_ctx *ctx,
-                     uint32_t event_id)
+int lttng_event_reserve(struct lib_ring_buffer_ctx *ctx)
 {
        struct lttng_kernel_event_recorder *event_recorder = ctx->client_priv;
        struct lttng_channel *lttng_chan = event_recorder->chan;
        struct lttng_client_ctx client_ctx;
        int ret, cpu;
+       uint32_t event_id;
 
        cpu = lib_ring_buffer_get_cpu(&client_config);
        if (unlikely(cpu < 0))
                return -EPERM;
+       event_id = event_recorder->priv->id;
        memset(&ctx->priv, 0, sizeof(ctx->priv));
        ctx->priv.chan = lttng_chan->chan;
        ctx->priv.reserve_cpu = cpu;
index 993c96da3699048ab58fe2989fea93d00737aeed..a1c8cb323187b75ba2c3c8def9457786630d9f6e 100644 (file)
@@ -301,7 +301,7 @@ void lttng_write_event_notifier_header(const struct lib_ring_buffer_config *conf
 }
 
 static
-int lttng_event_reserve(struct lib_ring_buffer_ctx *ctx, uint32_t event_id)
+int lttng_event_reserve(struct lib_ring_buffer_ctx *ctx)
 {
        struct channel *chan = ctx->client_priv;
        int ret;
index 7e418001f85fb51fadb2a31c5a38dec4f703a29e..16e80c0700de8a1e859a61edce72868f08be9e5c 100644 (file)
@@ -300,7 +300,7 @@ void lttng_buffer_read_close(struct lib_ring_buffer *buf)
 }
 
 static
-int lttng_event_reserve(struct lib_ring_buffer_ctx *ctx, uint32_t event_id)
+int lttng_event_reserve(struct lib_ring_buffer_ctx *ctx)
 {
        struct channel *chan = ctx->client_priv;
        int ret;
index 39de7d3d3e1e1d6bdb53a780036a56909dedeb81..e3fa493f8a93f7170afd65f2637dd95d25a38578 100644 (file)
@@ -65,7 +65,7 @@ int lttng_kprobes_event_handler_pre(struct kprobe *p, struct pt_regs *regs)
 
                lib_ring_buffer_ctx_init(&ctx, event_recorder, sizeof(data),
                                         lttng_alignof(data), &lttng_probe_ctx);
-               ret = chan->ops->event_reserve(&ctx, event_recorder->priv->id);
+               ret = chan->ops->event_reserve(&ctx);
                if (ret < 0)
                        return 0;
                lib_ring_buffer_align_ctx(&ctx, lttng_alignof(data));
index 03561703dcbc3d3e66c8b80803d9ac11f491f28d..2b5e91a2fadc1d110784c2955926ff1dfe3653ec 100644 (file)
@@ -83,7 +83,7 @@ int _lttng_kretprobes_handler(struct kretprobe_instance *krpi,
 
                lib_ring_buffer_ctx_init(&ctx, event_recorder, sizeof(payload),
                                         lttng_alignof(payload), &lttng_probe_ctx);
-               ret = chan->ops->event_reserve(&ctx, event_recorder->priv->id);
+               ret = chan->ops->event_reserve(&ctx);
                if (ret < 0)
                        return 0;
                lib_ring_buffer_align_ctx(&ctx, lttng_alignof(payload));
index 20865889bd17084b7bcc72396f27a672ccb22b16..f679dd764cf73178ffff628b9689519fafaae16d 100644 (file)
@@ -71,7 +71,7 @@ int lttng_uprobes_event_handler_pre(struct uprobe_consumer *uc, struct pt_regs *
                lib_ring_buffer_ctx_init(&ctx, event_recorder,
                        sizeof(payload), lttng_alignof(payload), &lttng_probe_ctx);
 
-               ret = chan->ops->event_reserve(&ctx, event_recorder->priv->id);
+               ret = chan->ops->event_reserve(&ctx);
                if (ret < 0)
                        return 0;
 
This page took 0.032851 seconds and 4 git commands to generate.