Fix: previous channel total is not updated
[lttng-tools.git] / src / bin / lttng-sessiond / notification-thread-events.c
index 254aa5396e5d30c102e771545773645ad766311c..df801be59d77f1b50561cae48705177277f133cb 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. */
@@ -2444,6 +2444,7 @@ int handle_notification_thread_channel_sample(
                                sizeof(previous_sample));
                stored_sample->highest_usage = latest_sample.highest_usage;
                stored_sample->lowest_usage = latest_sample.lowest_usage;
+               stored_sample->channel_total_consumed = latest_sample.channel_total_consumed;
                previous_sample_available = true;
        } else {
                /*
@@ -2472,7 +2473,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 +2536,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.02502 seconds and 5 git commands to generate.