X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=libringbuffer%2Fbackend_types.h;h=3432ef078c25071be7ba6dcb216bc0afb44c23ae;hb=fb31eb73d8a4a6d9784ed5c335b7fa3b9684108c;hp=81e67119847a119b2ad140e71aefa0a648ef5bfa;hpb=2253b139ffb6a4eca7291b60083cc5206a6e128d;p=lttng-ust.git diff --git a/libringbuffer/backend_types.h b/libringbuffer/backend_types.h index 81e67119..3432ef07 100644 --- a/libringbuffer/backend_types.h +++ b/libringbuffer/backend_types.h @@ -1,17 +1,30 @@ -#ifndef _LINUX_RING_BUFFER_BACKEND_TYPES_H -#define _LINUX_RING_BUFFER_BACKEND_TYPES_H +#ifndef _LTTNG_RING_BUFFER_BACKEND_TYPES_H +#define _LTTNG_RING_BUFFER_BACKEND_TYPES_H /* * linux/ringbuffer/backend_types.h * - * Copyright (C) 2008-2010 - Mathieu Desnoyers - * * Ring buffer backend (types). * - * Dual LGPL v2.1/GPL v2 license. + * 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 */ #include +#include #include "shm_internal.h" #include "vatomic.h" @@ -30,6 +43,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. */ @@ -46,6 +69,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. @@ -84,4 +109,4 @@ struct channel_backend { struct lttng_ust_lib_ring_buffer_shmp buf[]; }; -#endif /* _LINUX_RING_BUFFER_BACKEND_TYPES_H */ +#endif /* _LTTNG_RING_BUFFER_BACKEND_TYPES_H */