This can be fetched from the event recorder.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I85a4ef493d67c1c374e7f3076569c2c2c2109953
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);
__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 \
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;
/*
* 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;
#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>
}
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;
}
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;
}
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;
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));
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));
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;