X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=libringbuffer%2Ffrontend_api.h;h=fd601ce5ca93589636d6932cc435a3a1c8f1677b;hb=31624f6cf986d7e7761847f66562c97bc773a02c;hp=bc1fd1220ba97c21da824ac326d81d4edf789a8a;hpb=e56bb47c3af00db3bc9e2dea711bef4882e6ef4c;p=lttng-ust.git diff --git a/libringbuffer/frontend_api.h b/libringbuffer/frontend_api.h index bc1fd122..fd601ce5 100644 --- a/libringbuffer/frontend_api.h +++ b/libringbuffer/frontend_api.h @@ -1,39 +1,22 @@ -#ifndef _LTTNG_RING_BUFFER_FRONTEND_API_H -#define _LTTNG_RING_BUFFER_FRONTEND_API_H - /* - * libringbuffer/frontend_api.h + * SPDX-License-Identifier: LGPL-2.1-only * * Copyright (C) 2005-2012 Mathieu Desnoyers * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; only - * version 2.1 of the License. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Ring Buffer Library Synchronization Header (buffer write API). - * - * Author: - * Mathieu Desnoyers - * * See ring_buffer_frontend.c for more information on wait-free * algorithms. * See frontend.h for channel allocation and read-side API. */ -#include "frontend.h" -#include +#ifndef _LTTNG_RING_BUFFER_FRONTEND_API_H +#define _LTTNG_RING_BUFFER_FRONTEND_API_H + +#include + #include +#include "frontend.h" + /** * lib_ring_buffer_get_cpu - Precedes ring buffer reserve/commit. * @@ -88,7 +71,7 @@ int lib_ring_buffer_try_reserve(const struct lttng_ust_lib_ring_buffer_config *c unsigned long *o_begin, unsigned long *o_end, unsigned long *o_old, size_t *before_hdr_pad) { - struct channel *chan = ctx->chan; + struct lttng_ust_lib_ring_buffer_channel *chan = ctx->chan; struct lttng_ust_lib_ring_buffer *buf = ctx->buf; *o_begin = v_read(config, &buf->offset); *o_old = *o_begin; @@ -156,7 +139,7 @@ int lib_ring_buffer_reserve(const struct lttng_ust_lib_ring_buffer_config *confi struct lttng_ust_lib_ring_buffer_ctx *ctx, void *client_ctx) { - struct channel *chan = ctx->chan; + struct lttng_ust_lib_ring_buffer_channel *chan = ctx->chan; struct lttng_ust_shm_handle *handle = ctx->handle; struct lttng_ust_lib_ring_buffer *buf; unsigned long o_begin, o_end, o_old; @@ -248,7 +231,7 @@ static inline void lib_ring_buffer_commit(const struct lttng_ust_lib_ring_buffer_config *config, const struct lttng_ust_lib_ring_buffer_ctx *ctx) { - struct channel *chan = ctx->chan; + struct lttng_ust_lib_ring_buffer_channel *chan = ctx->chan; struct lttng_ust_shm_handle *handle = ctx->handle; struct lttng_ust_lib_ring_buffer *buf = ctx->buf; unsigned long offset_end = ctx->buf_offset; @@ -343,14 +326,14 @@ int lib_ring_buffer_try_discard_reserve(const struct lttng_ust_lib_ring_buffer_c static inline void channel_record_disable(const struct lttng_ust_lib_ring_buffer_config *config, - struct channel *chan) + struct lttng_ust_lib_ring_buffer_channel *chan) { uatomic_inc(&chan->record_disabled); } static inline void channel_record_enable(const struct lttng_ust_lib_ring_buffer_config *config, - struct channel *chan) + struct lttng_ust_lib_ring_buffer_channel *chan) { uatomic_dec(&chan->record_disabled); }