Performance: add missing unlikely in reserve
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 21 Nov 2016 21:08:22 +0000 (16:08 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 21 Nov 2016 21:08:22 +0000 (16:08 -0500)
Add missing branch prediction hints within lttng_event_reserve().

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lttng-ring-buffer-client.h

index c4b7304fdfa6026153e14affbee429cf57ac53c7..63f2b4ca7befa82da0b2fdaf265f1d8f127abe11 100644 (file)
@@ -606,7 +606,7 @@ int lttng_event_reserve(struct lib_ring_buffer_ctx *ctx,
        int ret, cpu;
 
        cpu = lib_ring_buffer_get_cpu(&client_config);
-       if (cpu < 0)
+       if (unlikely(cpu < 0))
                return -EPERM;
        ctx->cpu = cpu;
 
@@ -624,7 +624,7 @@ int lttng_event_reserve(struct lib_ring_buffer_ctx *ctx,
        }
 
        ret = lib_ring_buffer_reserve(&client_config, ctx);
-       if (ret)
+       if (unlikely(ret))
                goto put;
        lib_ring_buffer_backend_get_pages(&client_config, ctx,
                        &ctx->backend_pages);
This page took 0.02691 seconds and 4 git commands to generate.