Add likely/unlikely annotations on channel sample handling path
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 21 Dec 2017 16:03:33 +0000 (11:03 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 3 Apr 2018 16:12:28 +0000 (12:12 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/notification-thread-events.c

index 254aa5396e5d30c102e771545773645ad766311c..87939f0660e4ed88164b34a2e711ecd25bb6e97c 100644 (file)
@@ -2404,7 +2404,7 @@ int handle_notification_thread_channel_sample(
                        &latest_sample.key,
                        &iter);
        node = cds_lfht_iter_get_node(&iter);
-       if (!node) {
+       if (caa_unlikely(!node)) {
                /*
                 * Not an error since the consumer can push a sample to the pipe
                 * and the rest of the session daemon could notify us of the
@@ -2433,7 +2433,7 @@ int handle_notification_thread_channel_sample(
                        &latest_sample.key,
                        &iter);
        node = cds_lfht_iter_get_node(&iter);
-       if (node) {
+       if (caa_likely(node)) {
                struct channel_state_sample *stored_sample;
 
                /* Update the sample stored. */
@@ -2472,7 +2472,7 @@ int handle_notification_thread_channel_sample(
                        &latest_sample.key,
                        &iter);
        node = cds_lfht_iter_get_node(&iter);
-       if (!node) {
+       if (caa_likely(!node)) {
                goto end_unlock;
        }
 
@@ -2535,7 +2535,7 @@ int handle_notification_thread_channel_sample(
                                channel_info->session_info->uid,
                                channel_info->session_info->gid);
                lttng_evaluation_destroy(evaluation);
-               if (ret) {
+               if (caa_unlikely(ret)) {
                        goto end_unlock;
                }
        }
This page took 0.026973 seconds and 4 git commands to generate.