int ret;
mutex_lock(&sessions_mutex);
- session->active = 0;
+ ACCESS_ONCE(session->active) = 0;
list_for_each_entry(event, &session->events, list) {
ret = _ltt_event_unregister(event);
WARN_ON(ret);
ret = -EBUSY;
goto end;
}
- session->active = 1;
+ ACCESS_ONCE(session->active) = 1;
synchronize_trace(); /* Wait for in-flight events to complete */
end:
mutex_unlock(&sessions_mutex);
ret = -EBUSY;
goto end;
}
- session->active = 0;
+ ACCESS_ONCE(session->active) = 0;
synchronize_trace(); /* Wait for in-flight events to complete */
end:
mutex_unlock(&sessions_mutex);
\
if (0) \
(void) __dynamic_len_idx; /* don't warn if unused */ \
+ if (!ACCESS_ONCE(__chan->session->active)) \
+ return; \
__event_len = __event_get_size__##_name(__dynamic_len, _args); \
__event_align = __event_get_align__##_name(_args); \
lib_ring_buffer_ctx_init(&ctx, __chan->chan, NULL, __event_len, \