projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Clean-up: remove unused _trace_abi field from the CTF2 trace class visitor
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
ust-consumer.cpp
diff --git
a/src/bin/lttng-sessiond/ust-consumer.cpp
b/src/bin/lttng-sessiond/ust-consumer.cpp
index 3a16733293d5ed7fab083cb873c1ba3089a64ec7..ef61cfc7e0f00271e5babb82b2c0f7e19118d0de 100644
(file)
--- a/
src/bin/lttng-sessiond/ust-consumer.cpp
+++ b/
src/bin/lttng-sessiond/ust-consumer.cpp
@@
-25,6
+25,8
@@
#include "session.hpp"
#include "lttng-sessiond.hpp"
#include "session.hpp"
#include "lttng-sessiond.hpp"
+namespace lsu = lttng::sessiond::ust;
+
/*
* Send a single channel to the consumer using command ASK_CHANNEL_CREATION.
*
/*
* Send a single channel to the consumer using command ASK_CHANNEL_CREATION.
*
@@
-34,7
+36,7
@@
static int ask_channel_creation(struct ust_app_session *ua_sess,
struct ust_app_channel *ua_chan,
struct consumer_output *consumer,
struct consumer_socket *socket,
struct ust_app_channel *ua_chan,
struct consumer_output *consumer,
struct consumer_socket *socket,
-
ust_
registry_session *registry,
+
lsu::
registry_session *registry,
struct lttng_trace_chunk *trace_chunk)
{
int ret, output;
struct lttng_trace_chunk *trace_chunk)
{
int ret, output;
@@
-42,7
+44,6
@@
static int ask_channel_creation(struct ust_app_session *ua_sess,
uint64_t key, chan_reg_key;
char *pathname = NULL;
struct lttcomm_consumer_msg msg;
uint64_t key, chan_reg_key;
char *pathname = NULL;
struct lttcomm_consumer_msg msg;
- struct ust_registry_channel *ust_reg_chan;
char shm_path[PATH_MAX] = "";
char root_shm_path[PATH_MAX] = "";
bool is_local_trace;
char shm_path[PATH_MAX] = "";
char root_shm_path[PATH_MAX] = "";
bool is_local_trace;
@@
-105,9
+106,13
@@
static int ask_channel_creation(struct ust_app_session *ua_sess,
* those buffer files.
*/
} else {
* those buffer files.
*/
} else {
- ust_reg_chan = ust_registry_channel_find(registry, chan_reg_key);
- LTTNG_ASSERT(ust_reg_chan);
- chan_id = ust_reg_chan->chan_id;
+ {
+ auto locked_registry = registry->lock();
+ auto& ust_reg_chan = registry->channel(chan_reg_key);
+
+ chan_id = ust_reg_chan.id;
+ }
+
if (ua_sess->shm_path[0]) {
strncpy(shm_path, ua_sess->shm_path, sizeof(shm_path));
shm_path[sizeof(shm_path) - 1] = '\0';
if (ua_sess->shm_path[0]) {
strncpy(shm_path, ua_sess->shm_path, sizeof(shm_path));
shm_path[sizeof(shm_path) - 1] = '\0';
@@
-145,7
+150,7
@@
static int ask_channel_creation(struct ust_app_session *ua_sess,
ua_chan->name,
consumer->net_seq_index,
ua_chan->key,
ua_chan->name,
consumer->net_seq_index,
ua_chan->key,
- registry->
_
uuid,
+ registry->uuid,
chan_id,
ua_chan->tracefile_size,
ua_chan->tracefile_count,
chan_id,
ua_chan->tracefile_size,
ua_chan->tracefile_count,
@@
-196,7
+201,7
@@
int ust_consumer_ask_channel(struct ust_app_session *ua_sess,
struct ust_app_channel *ua_chan,
struct consumer_output *consumer,
struct consumer_socket *socket,
struct ust_app_channel *ua_chan,
struct consumer_output *consumer,
struct consumer_socket *socket,
-
ust_
registry_session *registry,
+
lsu::
registry_session *registry,
struct lttng_trace_chunk * trace_chunk)
{
int ret;
struct lttng_trace_chunk * trace_chunk)
{
int ret;
@@
-445,7
+450,7
@@
int ust_consumer_metadata_request(struct consumer_socket *socket)
ssize_t ret_push;
struct lttcomm_metadata_request_msg request;
struct buffer_reg_uid *reg_uid;
ssize_t ret_push;
struct lttcomm_metadata_request_msg request;
struct buffer_reg_uid *reg_uid;
-
ust_
registry_session *ust_reg;
+
lsu::
registry_session *ust_reg;
struct lttcomm_consumer_msg msg;
LTTNG_ASSERT(socket);
struct lttcomm_consumer_msg msg;
LTTNG_ASSERT(socket);
@@
-493,9
+498,10
@@
int ust_consumer_metadata_request(struct consumer_socket *socket)
}
LTTNG_ASSERT(ust_reg);
}
LTTNG_ASSERT(ust_reg);
- pthread_mutex_lock(&ust_reg->_lock);
- ret_push = ust_app_push_metadata(ust_reg, socket, 1);
- pthread_mutex_unlock(&ust_reg->_lock);
+ {
+ auto locked_ust_reg = ust_reg->lock();
+ ret_push = ust_app_push_metadata(locked_ust_reg, socket, 1);
+ }
if (ret_push == -EPIPE) {
DBG("Application or relay closed while pushing metadata");
} else if (ret_push < 0) {
if (ret_push == -EPIPE) {
DBG("Application or relay closed while pushing metadata");
} else if (ret_push < 0) {
This page took
0.025818 seconds
and
4
git commands to generate.