X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=lib%2Fringbuffer%2Fbackend_types.h;h=c1d8be18323c2dc5b31003015ae69b1a81b83004;hb=8ec496cfb24b29a54c057a332fc91e761994999e;hp=4578185c3c75d8a1fb307a5e78ddbb1567bbd878;hpb=5a8fd222992df9bbb709836e5bf4ca053dd776c3;p=lttng-modules.git diff --git a/lib/ringbuffer/backend_types.h b/lib/ringbuffer/backend_types.h index 4578185c..c1d8be18 100644 --- a/lib/ringbuffer/backend_types.h +++ b/lib/ringbuffer/backend_types.h @@ -1,14 +1,26 @@ -#ifndef _LINUX_RING_BUFFER_BACKEND_TYPES_H -#define _LINUX_RING_BUFFER_BACKEND_TYPES_H +#ifndef _LIB_RING_BUFFER_BACKEND_TYPES_H +#define _LIB_RING_BUFFER_BACKEND_TYPES_H /* - * linux/ringbuffer/backend_types.h - * - * Copyright (C) 2008-2010 - Mathieu Desnoyers + * lib/ringbuffer/backend_types.h * * 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 @@ -16,7 +28,7 @@ struct lib_ring_buffer_backend_page { void *virt; /* page virtual address (cached) */ - struct page *page; /* pointer to page structure */ + unsigned long pfn; /* page frame number */ }; struct lib_ring_buffer_backend_pages { @@ -32,6 +44,16 @@ struct lib_ring_buffer_backend_subbuffer { unsigned long id; /* backend subbuffer identifier */ }; +struct 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. */ @@ -43,6 +65,8 @@ struct lib_ring_buffer_backend { struct lib_ring_buffer_backend_subbuffer *buf_wsb; /* ring_buffer_backend_subbuffer for reader */ struct lib_ring_buffer_backend_subbuffer buf_rsb; + /* Array of lib_ring_buffer_backend_counts for the packet counter */ + struct lib_ring_buffer_backend_counts *buf_cnt; /* * Pointer array of backend pages, for whole buffer. * Indexed by ring_buffer_backend_subbuffer identifier (id) index. @@ -71,6 +95,8 @@ struct channel_backend { unsigned long num_subbuf; /* Number of sub-buffers for writer */ u64 start_tsc; /* Channel creation TSC value */ void *priv; /* Client-specific information */ + void *priv_ops; /* Client-specific ops pointer */ + void (*release_priv_ops)(void *priv_ops); struct notifier_block cpu_hp_notifier; /* CPU hotplug notifier */ /* * We need to copy config because the module containing the @@ -82,4 +108,4 @@ struct channel_backend { char name[NAME_MAX]; /* Channel name */ }; -#endif /* _LINUX_RING_BUFFER_BACKEND_TYPES_H */ +#endif /* _LIB_RING_BUFFER_BACKEND_TYPES_H */