{
enum lttng_error_code ret_code;
int ret;
- struct ltt_kernel_event *event;
struct ltt_kernel_channel *kchan;
assert(reply_payload);
}
/* Kernel channels */
- 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)) {
struct lttng_event *tmp_event = lttng_event_create();
if (!tmp_event) {
int start_kernel_session(struct ltt_kernel_session *ksess)
{
int ret;
- struct ltt_kernel_channel *kchan;
/* Open kernel metadata */
if (ksess->metadata == nullptr && ksess->output_traces) {
}
/* For each channel */
- cds_list_for_each_entry (kchan, &ksess->channel_list.head, list) {
+ for (auto kchan :
+ lttng::urcu::list_iteration_adapter<ltt_kernel_channel, <t_kernel_channel::list>(
+ ksess->channel_list.head)) {
if (kchan->stream_count == 0) {
ret = kernel_open_channel_stream(kchan);
if (ret < 0) {
int stop_kernel_session(struct ltt_kernel_session *ksess)
{
- struct ltt_kernel_channel *kchan;
bool error_occurred = false;
int ret;
}
/* Flush all buffers after stopping */
- cds_list_for_each_entry (kchan, &ksess->channel_list.head, list) {
+ for (auto kchan :
+ lttng::urcu::list_iteration_adapter<ltt_kernel_channel, <t_kernel_channel::list>(
+ ksess->channel_list.head)) {
ret = kernel_flush_buffer(kchan);
if (ret < 0) {
ERR("Kernel flush buffer error");
case LTTNG_DOMAIN_KERNEL:
{
/* Kernel channels */
- struct ltt_kernel_channel *kchan;
if (session->kernel_session != nullptr) {
- 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)) {
uint64_t discarded_events, lost_packets;
struct lttng_channel_extended *extended;
{
int ret;
unsigned int i = 0;
- struct ltt_session *raw_session_ptr;
struct ltt_session_list *list = session_get_list();
struct lttng_session_extended *extended = (typeof(extended)) (&sessions[session_count]);
* Iterate over session list and append data after the control struct in
* the buffer.
*/
- 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();
uint64_t tot_size = 0;
if (session->kernel_session) {
- struct ltt_kernel_channel *chan;
- const struct ltt_kernel_session *ksess = session->kernel_session;
+ struct ltt_kernel_session *ksess = session->kernel_session;
- cds_list_for_each_entry (chan, &ksess->channel_list.head, list) {
+ for (auto chan : lttng::urcu::list_iteration_adapter<ltt_kernel_channel,
+ <t_kernel_channel::list>(
+ ksess->channel_list.head)) {
if (cur_nr_packets >= chan->channel->attr.num_subbuf) {
/*
* Don't take channel into account if we