From: Mathieu Desnoyers Date: Wed, 28 Apr 2021 19:30:04 +0000 (-0400) Subject: Remove event id parameter from event_reserve callback X-Git-Tag: v2.13.0-rc2~65 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=cefd899fc3de0c29491332929cec445e0d459760;p=lttng-modules.git Remove event id parameter from event_reserve callback This can be fetched from the event recorder. Signed-off-by: Mathieu Desnoyers Change-Id: I85a4ef493d67c1c374e7f3076569c2c2c2109953 --- diff --git a/include/lttng/events.h b/include/lttng/events.h index 613b9c49..8c200bdd 100644 --- a/include/lttng/events.h +++ b/include/lttng/events.h @@ -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); diff --git a/include/lttng/tracepoint-event-impl.h b/include/lttng/tracepoint-event-impl.h index dbb92b85..23c053fc 100644 --- a/include/lttng/tracepoint-event-impl.h +++ b/include/lttng/tracepoint-event-impl.h @@ -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 \ diff --git a/src/lttng-event-notifier-notification.c b/src/lttng-event-notifier-notification.c index e5bd172a..99ca8a29 100644 --- a/src/lttng-event-notifier-notification.c +++ b/src/lttng-event-notifier-notification.c @@ -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; diff --git a/src/lttng-events.c b/src/lttng-events.c index 4c266466..30b514a8 100644 --- a/src/lttng-events.c +++ b/src/lttng-events.c @@ -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; diff --git a/src/lttng-ring-buffer-client.h b/src/lttng-ring-buffer-client.h index ff404368..9ac2cfe9 100644 --- a/src/lttng-ring-buffer-client.h +++ b/src/lttng-ring-buffer-client.h @@ -13,6 +13,7 @@ #include /* for wrapper_vmalloc_sync_mappings() */ #include #include +#include #include #include @@ -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; diff --git a/src/lttng-ring-buffer-event-notifier-client.h b/src/lttng-ring-buffer-event-notifier-client.h index 993c96da..a1c8cb32 100644 --- a/src/lttng-ring-buffer-event-notifier-client.h +++ b/src/lttng-ring-buffer-event-notifier-client.h @@ -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; diff --git a/src/lttng-ring-buffer-metadata-client.h b/src/lttng-ring-buffer-metadata-client.h index 7e418001..16e80c07 100644 --- a/src/lttng-ring-buffer-metadata-client.h +++ b/src/lttng-ring-buffer-metadata-client.h @@ -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; diff --git a/src/probes/lttng-kprobes.c b/src/probes/lttng-kprobes.c index 39de7d3d..e3fa493f 100644 --- a/src/probes/lttng-kprobes.c +++ b/src/probes/lttng-kprobes.c @@ -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), <tng_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)); diff --git a/src/probes/lttng-kretprobes.c b/src/probes/lttng-kretprobes.c index 03561703..2b5e91a2 100644 --- a/src/probes/lttng-kretprobes.c +++ b/src/probes/lttng-kretprobes.c @@ -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), <tng_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)); diff --git a/src/probes/lttng-uprobes.c b/src/probes/lttng-uprobes.c index 20865889..f679dd76 100644 --- a/src/probes/lttng-uprobes.c +++ b/src/probes/lttng-uprobes.c @@ -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), <tng_probe_ctx); - ret = chan->ops->event_reserve(&ctx, event_recorder->priv->id); + ret = chan->ops->event_reserve(&ctx); if (ret < 0) return 0;