projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove fcntl wrapper
[lttng-tools.git]
/
src
/
common
/
kernel-consumer
/
kernel-consumer.cpp
diff --git
a/src/common/kernel-consumer/kernel-consumer.cpp
b/src/common/kernel-consumer/kernel-consumer.cpp
index 3b42438d8826a1d2e246cf2c403a92107f699d79..7e8de03f6b1380ca46eaf31c02ce5682b5f20e81 100644
(file)
--- a/
src/common/kernel-consumer/kernel-consumer.cpp
+++ b/
src/common/kernel-consumer/kernel-consumer.cpp
@@
-13,7
+13,6
@@
#include <common/buffer-view.hpp>
#include <common/common.hpp>
#include <common/compat/endian.hpp>
#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/consumer/consumer-stream.hpp>
#include <common/consumer/consumer-timer.hpp>
#include <common/consumer/consumer.hpp>
@@
-25,9
+24,11
@@
#include <common/relayd/relayd.hpp>
#include <common/sessiond-comm/relayd.hpp>
#include <common/sessiond-comm/sessiond-comm.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 <common/utils.hpp>
#include <bin/lttng-consumerd/health-consumerd.hpp>
+#include <fcntl.h>
#include <inttypes.h>
#include <poll.h>
#include <pthread.h>
#include <inttypes.h>
#include <poll.h>
#include <pthread.h>
@@
-151,7
+152,7
@@
static int lttng_kconsumer_snapshot_channel(struct lttng_consumer_channel *chann
/* Prevent channel modifications while we perform the snapshot.*/
pthread_mutex_lock(&channel->lock);
/* 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) {
/* Splice is not supported yet for channel snapshot. */
if (channel->output != CONSUMER_CHANNEL_MMAP) {
@@
-328,7
+329,6
@@
error_close_stream_output:
end_unlock:
pthread_mutex_unlock(&stream->lock);
end:
end_unlock:
pthread_mutex_unlock(&stream->lock);
end:
- rcu_read_unlock();
pthread_mutex_unlock(&channel->lock);
return ret;
}
pthread_mutex_unlock(&channel->lock);
return ret;
}
@@
-354,7
+354,7
@@
static int lttng_kconsumer_snapshot_metadata(struct lttng_consumer_channel *meta
DBG("Kernel consumer snapshot metadata with key %" PRIu64 " at path %s", key, path);
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 = metadata_channel->metadata_stream;
LTTNG_ASSERT(metadata_stream);
@@
-415,7
+415,6
@@
error_snapshot:
metadata_stream->read_subbuffer_ops.unlock(metadata_stream);
consumer_stream_destroy(metadata_stream, nullptr);
metadata_channel->metadata_stream = nullptr;
metadata_stream->read_subbuffer_ops.unlock(metadata_stream);
consumer_stream_destroy(metadata_stream, nullptr);
metadata_channel->metadata_stream = nullptr;
- rcu_read_unlock();
return ret;
}
return ret;
}
@@
-455,7
+454,7
@@
int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
health_code_update();
/* relayd needs RCU read-side protection */
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:
switch (msg.cmd_type) {
case LTTNG_CONSUMER_ADD_RELAYD_SOCKET:
@@
-783,7
+782,12
@@
int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
health_code_update();
health_code_update();
- ret_pipe_write = lttng_pipe_write(stream_pipe, &new_stream, sizeof(new_stream));
+ ret_pipe_write =
+ lttng_pipe_write(stream_pipe, &new_stream, sizeof(new_stream)); /* NOLINT
+ sizeof
+ used on a
+ pointer.
+ */
if (ret_pipe_write < 0) {
ERR("Consumer write %s stream to pipe %d",
new_stream->metadata_flag ? "metadata" : "data",
if (ret_pipe_write < 0) {
ERR("Consumer write %s stream to pipe %d",
new_stream->metadata_flag ? "metadata" : "data",
@@
-867,7
+871,6
@@
int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
}
case LTTNG_CONSUMER_UPDATE_STREAM:
{
}
case LTTNG_CONSUMER_UPDATE_STREAM:
{
- rcu_read_unlock();
return -ENOSYS;
}
case LTTNG_CONSUMER_DESTROY_RELAYD:
return -ENOSYS;
}
case LTTNG_CONSUMER_DESTROY_RELAYD:
@@
-1383,7
+1386,6
@@
end_msg_sessiond:
end:
health_code_update();
end:
health_code_update();
- rcu_read_unlock();
return ret_func;
}
return ret_func;
}
This page took
0.025765 seconds
and
4
git commands to generate.