X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;ds=sidebyside;f=src%2Fcommon%2Fconsumer%2Fconsumer-timer.cpp;h=70094ef4f98e30c5da46e9c8b087e3bd5dfdd7da;hb=refs%2Fheads%2Fmaster;hp=2ae7f0f73d1b2fdaffe59ed6b21b3814b78e8c22;hpb=9fed015cbc40e9323cca8f22702eb17ba1d9c2f2;p=lttng-tools.git diff --git a/src/common/consumer/consumer-timer.cpp b/src/common/consumer/consumer-timer.cpp index 2ae7f0f73..c4c45e8a1 100644 --- a/src/common/consumer/consumer-timer.cpp +++ b/src/common/consumer/consumer-timer.cpp @@ -284,7 +284,7 @@ static void live_timer(struct lttng_consumer_local_data *ctx, siginfo_t *si) DBG("Live timer for channel %" PRIu64, channel->key); { - lttng::urcu::read_lock_guard read_lock; + const lttng::urcu::read_lock_guard read_lock; cds_lfht_for_each_entry_duplicate(ht->ht, ht->hash_fct(&channel->key, lttng_ht_seed), ht->match_fct, @@ -576,7 +576,7 @@ static int sample_channel_positions(struct lttng_consumer_channel *channel, *_total_consumed = 0; - lttng::urcu::read_lock_guard read_lock; + const lttng::urcu::read_lock_guard read_lock; cds_lfht_for_each_entry_duplicate(ht->ht, ht->hash_fct(&channel->key, lttng_ht_seed), @@ -644,7 +644,7 @@ end: void sample_and_send_channel_buffer_stats(struct lttng_consumer_channel *channel) { int ret; - int channel_monitor_pipe = consumer_timer_thread_get_channel_monitor_pipe(); + const int channel_monitor_pipe = consumer_timer_thread_get_channel_monitor_pipe(); struct lttcomm_consumer_channel_monitor_msg msg = { .key = channel->key, .session_id = channel->session_id, @@ -687,7 +687,8 @@ void sample_and_send_channel_buffer_stats(struct lttng_consumer_channel *channel msg.highest = highest; msg.lowest = lowest; - msg.consumed_since_last_sample = total_consumed - channel->last_consumed_size_sample_sent; + msg.consumed_since_last_sample = + total_consumed - channel->consumed_size_as_of_last_sample_sent; /* * Writes performed here are assumed to be atomic which is only @@ -712,7 +713,7 @@ void sample_and_send_channel_buffer_stats(struct lttng_consumer_channel *channel channel->key, msg.highest, msg.lowest); - channel->last_consumed_size_sample_sent = msg.consumed_since_last_sample; + channel->consumed_size_as_of_last_sample_sent = total_consumed; } }