X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=libringbuffer%2Fbackend_types.h;h=83fe04871dd26f0885b8859065b8d14cf277a552;hb=3ff7660f2ce6362de87a48bc45c9a98b9c785472;hp=81e67119847a119b2ad140e71aefa0a648ef5bfa;hpb=3c8964ba54f920c4a33b1e371c4c07ddcdc40383;p=lttng-ust.git diff --git a/libringbuffer/backend_types.h b/libringbuffer/backend_types.h index 81e67119..83fe0487 100644 --- a/libringbuffer/backend_types.h +++ b/libringbuffer/backend_types.h @@ -1,14 +1,26 @@ -#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 @@ -30,6 +42,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 +68,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 +108,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 */