X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=lib%2Fringbuffer%2Fbackend_types.h;h=c443b644d1a3fab23c313aa65b28822479baf5b9;hb=68045fadc564005c6a103595e373e04e7b61244a;hp=1577c812bb93c1df71cb5f736d8c1de6c8a933f6;hpb=dd5a0db3ea07c46bee3c1814ef7326736f38a06e;p=lttng-modules.git diff --git a/lib/ringbuffer/backend_types.h b/lib/ringbuffer/backend_types.h index 1577c812..c443b644 100644 --- a/lib/ringbuffer/backend_types.h +++ b/lib/ringbuffer/backend_types.h @@ -1,34 +1,23 @@ -#ifndef _LIB_RING_BUFFER_BACKEND_TYPES_H -#define _LIB_RING_BUFFER_BACKEND_TYPES_H - -/* +/* SPDX-License-Identifier: (GPL-2.0 OR LGPL-2.1) + * * lib/ringbuffer/backend_types.h * * Ring buffer backend (types). * * 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 */ +#ifndef _LIB_RING_BUFFER_BACKEND_TYPES_H +#define _LIB_RING_BUFFER_BACKEND_TYPES_H + #include #include +#include +#include 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 { @@ -44,6 +33,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. */ @@ -55,6 +54,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. @@ -85,7 +86,11 @@ struct channel_backend { void *priv; /* Client-specific information */ void *priv_ops; /* Client-specific ops pointer */ void (*release_priv_ops)(void *priv_ops); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) + struct lttng_cpuhp_node cpuhp_prepare; /* CPU hotplug prepare */ +#else struct notifier_block cpu_hp_notifier; /* CPU hotplug notifier */ +#endif /* * We need to copy config because the module containing the * source config can vanish before the last reference to this