X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=lib%2Fringbuffer%2Ffrontend_types.h;h=fe208b676e0f035f8bd4b9794ca94f79f24ca8dd;hb=b64bc438d1c9bbcf241c598ca9f0e00d5770d784;hp=d269c00a685221086448b249724326f6acc5b81f;hpb=f3bc08c50e1b302bceea699027d889fd6d9af525;p=lttng-modules.git diff --git a/lib/ringbuffer/frontend_types.h b/lib/ringbuffer/frontend_types.h index d269c00a..fe208b67 100644 --- a/lib/ringbuffer/frontend_types.h +++ b/lib/ringbuffer/frontend_types.h @@ -16,9 +16,10 @@ * Dual LGPL v2.1/GPL v2 license. */ +#include #include "../../wrapper/ringbuffer/config.h" #include "../../wrapper/ringbuffer/backend_types.h" -#include "../../wrapper/prio_heap.h" /* For per-CPU read-side iterator */ +#include "../../lib/prio_heap/lttng_prio_heap.h" /* For per-CPU read-side iterator */ /* * A switch is done during tracing or as a final flush after tracing (so it @@ -29,7 +30,7 @@ enum switch_mode { SWITCH_ACTIVE, SWITCH_FLUSH }; /* channel-level read-side iterator */ struct channel_iter { /* Prio heap of buffers. Lowest timestamps at the top. */ - struct ptr_heap heap; /* Heap of struct lib_ring_buffer ptrs */ + struct lttng_ptr_heap heap; /* Heap of struct lib_ring_buffer ptrs */ struct list_head empty_head; /* Empty buffers linked-list head */ int read_open; /* Opened for reading ? */ u64 last_qs; /* Last quiescent state timestamp */ @@ -61,8 +62,10 @@ struct channel { int cpu_hp_enable:1; /* Enable CPU hotplug notif. */ int hp_iter_enable:1; /* Enable hp iter notif. */ wait_queue_head_t read_wait; /* reader wait queue */ + wait_queue_head_t hp_wait; /* CPU hotplug wait queue */ + int finalized; /* Has channel been finalized */ struct channel_iter iter; /* Channel read-side iterator */ - atomic_long_t read_ref; /* Reader reference count */ + struct kref ref; /* Reference count */ }; /* Per-subbuffer commit counters used on the hot path */ @@ -138,6 +141,12 @@ struct lib_ring_buffer { int read_timer_enabled:1; /* Protected by ring_buffer_nohz_lock */ }; +static inline +void *channel_get_private(struct channel *chan) +{ + return chan->backend.priv; +} + /* * Issue warnings and disable channels upon internal error. * Can receive struct lib_ring_buffer or struct lib_ring_buffer_backend