}
static inline
-size_t ctx_get_aligned_size(size_t offset, struct lttng_ctx *ctx,
+size_t ctx_get_aligned_size(size_t offset, struct lttng_ust_ctx *ctx,
size_t ctx_len)
{
size_t orig_offset = offset;
}
static inline
-void ctx_get_struct_size(struct lttng_ctx *ctx, size_t *ctx_len,
+void ctx_get_struct_size(struct lttng_ust_ctx *ctx, size_t *ctx_len,
enum app_ctx_mode mode)
{
int i;
}
for (i = 0; i < ctx->nr_fields; i++) {
if (mode == APP_CTX_ENABLED) {
- offset += ctx->fields[i].get_size(&ctx->fields[i], offset);
+ offset += ctx->fields[i]->get_size(ctx->fields[i], offset);
} else {
- if (lttng_context_is_app(ctx->fields[i].event_field.name)) {
+ if (lttng_context_is_app(ctx->fields[i]->event_field->name)) {
/*
* Before UST 2.8, we cannot use the
* application context, because we
* concurrently with application context
* register/unregister.
*/
- offset += lttng_ust_dummy_get_size(&ctx->fields[i], offset);
+ offset += lttng_ust_dummy_get_size(ctx->fields[i], offset);
} else {
- offset += ctx->fields[i].get_size(&ctx->fields[i], offset);
+ offset += ctx->fields[i]->get_size(ctx->fields[i], offset);
}
}
}
static inline
void ctx_record(struct lttng_ust_lib_ring_buffer_ctx *bufctx,
struct lttng_channel *chan,
- struct lttng_ctx *ctx,
+ struct lttng_ust_ctx *ctx,
enum app_ctx_mode mode)
{
int i;
lib_ring_buffer_align_ctx(bufctx, ctx->largest_align);
for (i = 0; i < ctx->nr_fields; i++) {
if (mode == APP_CTX_ENABLED) {
- ctx->fields[i].record(&ctx->fields[i], bufctx, chan);
+ ctx->fields[i]->record(ctx->fields[i], bufctx, chan);
} else {
- if (lttng_context_is_app(ctx->fields[i].event_field.name)) {
+ if (lttng_context_is_app(ctx->fields[i]->event_field->name)) {
/*
* Before UST 2.8, we cannot use the
* application context, because we
* concurrently with application context
* register/unregister.
*/
- lttng_ust_dummy_record(&ctx->fields[i], bufctx, chan);
+ lttng_ust_dummy_record(ctx->fields[i], bufctx, chan);
} else {
- ctx->fields[i].record(&ctx->fields[i], bufctx, chan);
+ ctx->fields[i]->record(ctx->fields[i], bufctx, chan);
}
}
}
.name = "relay-" RING_BUFFER_MODE_TEMPLATE_STRING "-mmap",
.ops = {
.struct_size = sizeof(struct lttng_ust_channel_ops),
- .channel_create = _channel_create,
- .channel_destroy = lttng_channel_destroy,
+ .priv = __LTTNG_COMPOUND_LITERAL(struct lttng_ust_channel_ops_private, {
+ .pub = <tng_relay_transport.ops,
+ .channel_create = _channel_create,
+ .channel_destroy = lttng_channel_destroy,
+ .packet_avail_size = NULL, /* Would be racy anyway */
+ .is_finalized = lttng_is_finalized,
+ .is_disabled = lttng_is_disabled,
+ .flush_buffer = lttng_flush_buffer,
+ }),
.event_reserve = lttng_event_reserve,
.event_commit = lttng_event_commit,
.event_write = lttng_event_write,
- .packet_avail_size = NULL, /* Would be racy anyway */
- .is_finalized = lttng_is_finalized,
- .is_disabled = lttng_is_disabled,
- .flush_buffer = lttng_flush_buffer,
.event_strcpy = lttng_event_strcpy,
},
.client_config = &client_config,