X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=libringbuffer%2Fbackend_types.h;h=f821c27fdd0684695866148da84a6e1fd8599e62;hb=c0c0989ab70574e09b2f7e8b48c2da6af664a849;hp=a53fb322ec109bb2fc5c9cc275e5f0118dd67bf5;hpb=e92f3e285939848f248af08f11a39a04a7fcf852;p=lttng-ust.git diff --git a/libringbuffer/backend_types.h b/libringbuffer/backend_types.h index a53fb322..f821c27f 100644 --- a/libringbuffer/backend_types.h +++ b/libringbuffer/backend_types.h @@ -1,29 +1,16 @@ -#ifndef _LTTNG_RING_BUFFER_BACKEND_TYPES_H -#define _LTTNG_RING_BUFFER_BACKEND_TYPES_H - /* - * linux/ringbuffer/backend_types.h - * - * Ring buffer backend (types). + * SPDX-License-Identifier: LGPL-2.1-only * * Copyright (C) 2008-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 backend (types). */ +#ifndef _LTTNG_RING_BUFFER_BACKEND_TYPES_H +#define _LTTNG_RING_BUFFER_BACKEND_TYPES_H + #include +#include #include "shm_internal.h" #include "vatomic.h" @@ -42,6 +29,16 @@ struct lttng_ust_lib_ring_buffer_backend_subbuffer { unsigned long id; /* backend subbuffer identifier */ }; +struct lttng_ust_lib_ring_buffer_backend_counts { + /* + * Counter specific to the sub-buffer location within the ring buffer. + * The actual sequence number of the packet within the entire ring + * buffer can be derived from the formula nr_subbuffers * seq_cnt + + * subbuf_idx. + */ + uint64_t seq_cnt; /* packet sequence number */ +}; + /* * Forward declaration of frontend-specific channel and ring_buffer. */ @@ -58,6 +55,8 @@ struct lttng_ust_lib_ring_buffer_backend { DECLARE_SHMP(struct lttng_ust_lib_ring_buffer_backend_subbuffer, buf_wsb); /* ring_buffer_backend_subbuffer for reader */ struct lttng_ust_lib_ring_buffer_backend_subbuffer buf_rsb; + /* Array of lib_ring_buffer_backend_counts for the packet counter */ + DECLARE_SHMP(struct lttng_ust_lib_ring_buffer_backend_counts, buf_cnt); /* * Pointer array of backend pages, for whole buffer. * Indexed by ring_buffer_backend_subbuffer identifier (id) index.