Performance: cache the backend pages pointer in context
[lttng-ust.git] / liblttng-ust / lttng-ring-buffer-client.h
index e5640b2ea0e4e7096e8729e975f75141b0892692..c5867dc1b697f2434a5bf17e74a98de85878661c 100644 (file)
@@ -717,6 +717,14 @@ int lttng_event_reserve(struct lttng_ust_lib_ring_buffer_ctx *ctx,
        ret = lib_ring_buffer_reserve(&client_config, ctx);
        if (ret)
                goto put;
+       if (caa_likely(ctx->ctx_len
+                       >= sizeof(struct lttng_ust_lib_ring_buffer_ctx))) {
+               if (lib_ring_buffer_backend_get_pages(&client_config, ctx,
+                               &ctx->backend_pages)) {
+                       ret = -EPERM;
+                       goto put;
+               }
+       }
        lttng_write_event_header(&client_config, ctx, event_id);
        return 0;
 put:
This page took 0.023987 seconds and 4 git commands to generate.