const lsu::registry_session::locked_ref& locked_registry)
{
int ret;
- struct ust_app_stream *stream, *stmp;
LTTNG_ASSERT(ua_chan);
ASSERT_RCU_READ_LOCKED();
DBG3("UST app deleting channel %s", ua_chan->name);
/* Wipe stream */
- cds_list_for_each_entry_safe (stream, stmp, &ua_chan->streams.head, list) {
+ for (auto *stream :
+ lttng::urcu::list_iteration_adapter<ust_app_stream, &ust_app_stream::list>(
+ ua_chan->streams.head)) {
cds_list_del(&stream->list);
delete_ust_app_stream(sock, stream, app);
}
struct ust_app_channel *ua_chan)
{
int ret;
- struct ust_app_stream *stream, *stmp;
LTTNG_ASSERT(app);
LTTNG_ASSERT(ua_sess);
health_code_update();
/* Send all streams to application. */
- cds_list_for_each_entry_safe (stream, stmp, &ua_chan->streams.head, list) {
+ for (auto *stream :
+ lttng::urcu::list_iteration_adapter<ust_app_stream, &ust_app_stream::list>(
+ ua_chan->streams.head)) {
ret = ust_consumer_send_stream_to_ust(app, ua_chan, stream);
if (ret == -EPIPE || ret == -LTTNG_UST_ERR_EXITING) {
ret = -ENOTCONN; /* Caused by app exiting. */
struct ust_app *app)
{
int ret = 0;
- struct ust_app_stream *stream, *stmp;
LTTNG_ASSERT(buf_reg_chan);
LTTNG_ASSERT(ua_chan);
DBG2("UST app setup buffer registry stream");
/* Send all streams to application. */
- cds_list_for_each_entry_safe (stream, stmp, &ua_chan->streams.head, list) {
+ for (auto *stream :
+ lttng::urcu::list_iteration_adapter<ust_app_stream, &ust_app_stream::list>(
+ ua_chan->streams.head)) {
struct buffer_reg_stream *reg_stream;
ret = buffer_reg_stream_create(®_stream);
struct ust_app_channel *ua_chan)
{
int ret;
- struct buffer_reg_stream *reg_stream;
LTTNG_ASSERT(buf_reg_chan);
LTTNG_ASSERT(app);
/* Send all streams to application. */
pthread_mutex_lock(&buf_reg_chan->stream_list_lock);
- cds_list_for_each_entry (reg_stream, &buf_reg_chan->streams, lnode) {
+ for (auto *reg_stream :
+ lttng::urcu::list_iteration_adapter<buffer_reg_stream, &buffer_reg_stream::lnode>(
+ buf_reg_chan->streams)) {
struct ust_app_stream stream = {};
ret = duplicate_stream_object(reg_stream, &stream);
copy_channel_attr_to_ustctl(&ua_sess->metadata_attr, &uchan->attr);
ret = 0;
} else {
- struct ltt_ust_context *uctx = nullptr;
-
/*
* Create channel onto application and synchronize its
* configuration.
}
/* Add contexts. */
- cds_list_for_each_entry (uctx, &uchan->ctx_list, list) {
+ for (auto *uctx :
+ lttng::urcu::list_iteration_adapter<ltt_ust_context, <t_ust_context::list>(
+ uchan->ctx_list)) {
ret = create_ust_app_channel_context(ua_chan, &uctx->ctx, app);
if (ret) {
goto error;
switch (usess->buffer_type) {
case LTTNG_BUFFER_PER_UID:
{
- struct buffer_reg_uid *reg;
-
/* Flush all per UID buffers associated to that session. */
- cds_list_for_each_entry (reg, &usess->buffer_reg_uid_list, lnode) {
+ for (auto *reg :
+ lttng::urcu::list_iteration_adapter<buffer_reg_uid, &buffer_reg_uid::lnode>(
+ usess->buffer_reg_uid_list)) {
const lttng::urcu::read_lock_guard read_lock;
lsu::registry_session *ust_session_reg;
struct consumer_socket *socket;
switch (usess->buffer_type) {
case LTTNG_BUFFER_PER_UID:
{
- struct buffer_reg_uid *reg;
-
/*
* Clear quiescent for all per UID buffers associated to
* that session.
*/
- cds_list_for_each_entry (reg, &usess->buffer_reg_uid_list, lnode) {
+ for (auto *reg :
+ lttng::urcu::list_iteration_adapter<buffer_reg_uid, &buffer_reg_uid::lnode>(
+ usess->buffer_reg_uid_list)) {
struct consumer_socket *socket;
const lttng::urcu::read_lock_guard read_lock;
{
DBG2("UST app ustctl register key received");
ret = -LTTNG_UST_ERR_NOSYS;
- //TODO
+ // TODO
goto error;
}
default:
switch (usess->buffer_type) {
case LTTNG_BUFFER_PER_UID:
{
- struct buffer_reg_uid *reg;
-
const lttng::urcu::read_lock_guard read_lock;
- cds_list_for_each_entry (reg, &usess->buffer_reg_uid_list, lnode) {
+ for (auto *reg :
+ lttng::urcu::list_iteration_adapter<buffer_reg_uid, &buffer_reg_uid::lnode>(
+ usess->buffer_reg_uid_list)) {
struct consumer_socket *socket;
char pathname[PATH_MAX];
size_t consumer_path_offset = 0;
switch (usess->buffer_type) {
case LTTNG_BUFFER_PER_UID:
{
- struct buffer_reg_uid *reg;
-
- cds_list_for_each_entry (reg, &usess->buffer_reg_uid_list, lnode) {
+ for (auto *reg :
+ lttng::urcu::list_iteration_adapter<buffer_reg_uid, &buffer_reg_uid::lnode>(
+ usess->buffer_reg_uid_list)) {
for (auto *buf_reg_chan :
lttng::urcu::lfht_iteration_adapter<buffer_reg_channel,
decltype(buffer_reg_channel::node),
switch (usess->buffer_type) {
case LTTNG_BUFFER_PER_UID:
{
- struct buffer_reg_uid *reg;
-
- cds_list_for_each_entry (reg, &usess->buffer_reg_uid_list, lnode) {
+ for (auto *reg :
+ lttng::urcu::list_iteration_adapter<buffer_reg_uid, &buffer_reg_uid::lnode>(
+ usess->buffer_reg_uid_list)) {
struct consumer_socket *socket;
const lttng::urcu::read_lock_guard read_lock;
switch (usess->buffer_type) {
case LTTNG_BUFFER_PER_UID:
{
- struct buffer_reg_uid *reg;
const lttng::urcu::read_lock_guard read_lock;
- cds_list_for_each_entry (reg, &usess->buffer_reg_uid_list, lnode) {
+ for (auto *reg :
+ lttng::urcu::list_iteration_adapter<buffer_reg_uid, &buffer_reg_uid::lnode>(
+ usess->buffer_reg_uid_list)) {
fmt_ret = asprintf(&pathname_index,
DEFAULT_UST_TRACE_DIR "/" DEFAULT_UST_TRACE_UID_PATH
"/" DEFAULT_INDEX_DIR,