#include <common/buffer-view.hpp>
#include <common/common.hpp>
#include <common/compat/endian.hpp>
-#include <common/compat/fcntl.hpp>
#include <common/consumer/consumer-stream.hpp>
#include <common/consumer/consumer-timer.hpp>
#include <common/consumer/consumer.hpp>
#include <common/relayd/relayd.hpp>
#include <common/sessiond-comm/relayd.hpp>
#include <common/sessiond-comm/sessiond-comm.hpp>
+#include <common/urcu.hpp>
#include <common/utils.hpp>
#include <bin/lttng-consumerd/health-consumerd.hpp>
+#include <fcntl.h>
#include <inttypes.h>
#include <poll.h>
#include <pthread.h>
/* Prevent channel modifications while we perform the snapshot.*/
pthread_mutex_lock(&channel->lock);
- rcu_read_lock();
+ lttng::urcu::read_lock_guard read_lock;
/* Splice is not supported yet for channel snapshot. */
if (channel->output != CONSUMER_CHANNEL_MMAP) {
end_unlock:
pthread_mutex_unlock(&stream->lock);
end:
- rcu_read_unlock();
pthread_mutex_unlock(&channel->lock);
return ret;
}
DBG("Kernel consumer snapshot metadata with key %" PRIu64 " at path %s", key, path);
- rcu_read_lock();
+ lttng::urcu::read_lock_guard read_lock;
metadata_stream = metadata_channel->metadata_stream;
LTTNG_ASSERT(metadata_stream);
metadata_stream->read_subbuffer_ops.unlock(metadata_stream);
consumer_stream_destroy(metadata_stream, nullptr);
metadata_channel->metadata_stream = nullptr;
- rcu_read_unlock();
return ret;
}
health_code_update();
/* relayd needs RCU read-side protection */
- rcu_read_lock();
+ lttng::urcu::read_lock_guard read_lock;
switch (msg.cmd_type) {
case LTTNG_CONSUMER_ADD_RELAYD_SOCKET:
}
case LTTNG_CONSUMER_UPDATE_STREAM:
{
- rcu_read_unlock();
return -ENOSYS;
}
case LTTNG_CONSUMER_DESTROY_RELAYD:
end:
health_code_update();
- rcu_read_unlock();
return ret_func;
}