static int save_kernel_events(struct config_writer *writer, struct ltt_kernel_channel *kchan)
{
int ret;
- struct ltt_kernel_event *event;
ret = config_writer_open_element(writer, config_element_events);
if (ret) {
goto end;
}
- cds_list_for_each_entry (event, &kchan->events_list.head, list) {
+ for (auto *event :
+ lttng::urcu::list_iteration_adapter<ltt_kernel_event, <t_kernel_event::list>(
+ kchan->events_list.head)) {
ret = save_kernel_event(writer, event);
if (ret != LTTNG_OK) {
goto end;
static int save_kernel_contexts(struct config_writer *writer, struct ltt_kernel_channel *kchan)
{
int ret;
- struct ltt_kernel_context *ctx;
if (cds_list_empty(&kchan->ctx_list)) {
ret = LTTNG_OK;
goto end;
}
- cds_list_for_each_entry (ctx, &kchan->ctx_list, list) {
+ for (auto *ctx :
+ lttng::urcu::list_iteration_adapter<ltt_kernel_context, <t_kernel_context::list>(
+ kchan->ctx_list)) {
ret = save_kernel_context(writer, &ctx->ctx);
if (ret != LTTNG_OK) {
goto end;
static int save_ust_context(struct config_writer *writer, struct cds_list_head *ctx_list)
{
int ret;
- struct ltt_ust_context *ctx;
LTTNG_ASSERT(writer);
LTTNG_ASSERT(ctx_list);
goto end;
}
- cds_list_for_each_entry (ctx, ctx_list, list) {
+ for (auto *ctx :
+ lttng::urcu::list_iteration_adapter<ltt_ust_context, <t_ust_context::list>(
+ *ctx_list)) {
ret = config_writer_open_element(writer, config_element_context);
if (ret) {
ret = LTTNG_ERR_SAVE_IO_FAIL;
static int save_kernel_session(struct config_writer *writer, const ltt_session::locked_ref& session)
{
int ret;
- struct ltt_kernel_channel *kchan;
LTTNG_ASSERT(writer);
goto end;
}
- cds_list_for_each_entry (kchan, &session->kernel_session->channel_list.head, list) {
+ for (auto *kchan :
+ lttng::urcu::list_iteration_adapter<ltt_kernel_channel, <t_kernel_channel::list>(
+ session->kernel_session->channel_list.head)) {
ret = save_kernel_channel(writer, kchan);
if (ret != LTTNG_OK) {
goto end;
}
} else {
struct ltt_session_list *list = session_get_list();
- struct ltt_session *raw_session_ptr;
- cds_list_for_each_entry (raw_session_ptr, &list->head, list) {
+ for (auto raw_session_ptr :
+ lttng::urcu::list_iteration_adapter<ltt_session, <t_session::list>(
+ list->head)) {
auto session = [raw_session_ptr]() {
session_get(raw_session_ptr);
raw_session_ptr->lock();