X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=include%2Flttng%2Fringbuffer-config.h;h=ca52fc71fb02e90776e9d6157c9e100b5682f3fa;hb=refs%2Fheads%2Fstable-2.2;hp=24fb1cc4c35cd9a51d1fcb9fae3733da358abb13;hpb=9501d22f55b3a23f382f631c99b2325d1419b5da;p=lttng-ust.git diff --git a/include/lttng/ringbuffer-config.h b/include/lttng/ringbuffer-config.h index 24fb1cc4..ca52fc71 100644 --- a/include/lttng/ringbuffer-config.h +++ b/include/lttng/ringbuffer-config.h @@ -18,6 +18,14 @@ * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. */ #include @@ -27,12 +35,13 @@ #include #include #include "lttng/align.h" +#include struct lttng_ust_lib_ring_buffer; struct channel; struct lttng_ust_lib_ring_buffer_config; struct lttng_ust_lib_ring_buffer_ctx; -struct lttng_ust_shm_handle *handle; +struct lttng_ust_shm_handle; /* * Ring buffer client callbacks. Only used by slow path, never on fast path. @@ -187,6 +196,10 @@ struct lttng_ust_lib_ring_buffer_config { * Context passed to lib_ring_buffer_reserve(), lib_ring_buffer_commit(), * lib_ring_buffer_try_discard_reserve(), lib_ring_buffer_align_ctx() and * lib_ring_buffer_write(). + * + * IMPORTANT: this structure is part of the ABI between the probe and + * UST. Fields need to be only added at the end, never reordered, never + * removed. */ #define LTTNG_UST_RING_BUFFER_CTX_PADDING 24 struct lttng_ust_lib_ring_buffer_ctx { @@ -228,6 +241,11 @@ struct lttng_ust_lib_ring_buffer_ctx { * @largest_align: largest alignment within data payload types * @cpu: processor id */ +static inline lttng_ust_notrace +void lib_ring_buffer_ctx_init(struct lttng_ust_lib_ring_buffer_ctx *ctx, + struct channel *chan, void *priv, + size_t data_size, int largest_align, + int cpu, struct lttng_ust_shm_handle *handle); static inline void lib_ring_buffer_ctx_init(struct lttng_ust_lib_ring_buffer_ctx *ctx, struct channel *chan, void *priv, @@ -275,6 +293,8 @@ void lib_ring_buffer_ctx_init(struct lttng_ust_lib_ring_buffer_ctx *ctx, * Calculate the offset needed to align the type. * size_of_type must be non-zero. */ +static inline lttng_ust_notrace +unsigned int lib_ring_buffer_align(size_t align_drift, size_t size_of_type); static inline unsigned int lib_ring_buffer_align(size_t align_drift, size_t size_of_type) { @@ -289,6 +309,8 @@ unsigned int lib_ring_buffer_align(size_t align_drift, size_t size_of_type) * Calculate the offset needed to align the type. * size_of_type must be non-zero. */ +static inline lttng_ust_notrace +unsigned int lib_ring_buffer_align(size_t align_drift, size_t size_of_type); static inline unsigned int lib_ring_buffer_align(size_t align_drift, size_t size_of_type) { @@ -301,6 +323,9 @@ unsigned int lib_ring_buffer_align(size_t align_drift, size_t size_of_type) * lib_ring_buffer_align_ctx - Align context offset on "alignment" * @ctx: ring buffer context. */ +static inline lttng_ust_notrace +void lib_ring_buffer_align_ctx(struct lttng_ust_lib_ring_buffer_ctx *ctx, + size_t alignment); static inline void lib_ring_buffer_align_ctx(struct lttng_ust_lib_ring_buffer_ctx *ctx, size_t alignment) @@ -313,6 +338,10 @@ void lib_ring_buffer_align_ctx(struct lttng_ust_lib_ring_buffer_ctx *ctx, * lib_ring_buffer_check_config() returns 0 on success. * Used internally to check for valid configurations at channel creation. */ +static inline lttng_ust_notrace +int lib_ring_buffer_check_config(const struct lttng_ust_lib_ring_buffer_config *config, + unsigned int switch_timer_interval, + unsigned int read_timer_interval); static inline int lib_ring_buffer_check_config(const struct lttng_ust_lib_ring_buffer_config *config, unsigned int switch_timer_interval,