-#ifndef _LINUX_RING_BUFFER_BACKEND_TYPES_H
-#define _LINUX_RING_BUFFER_BACKEND_TYPES_H
-
-/*
- * linux/ringbuffer/backend_types.h
+/* SPDX-License-Identifier: (GPL-2.0 OR LGPL-2.1)
*
- * Copyright (C) 2008-2010 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ * lib/ringbuffer/backend_types.h
*
* Ring buffer backend (types).
*
- * Dual LGPL v2.1/GPL v2 license.
+ * Copyright (C) 2008-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
*/
+#ifndef _LIB_RING_BUFFER_BACKEND_TYPES_H
+#define _LIB_RING_BUFFER_BACKEND_TYPES_H
+
#include <linux/cpumask.h>
#include <linux/types.h>
+#include <lttng-kernel-version.h>
+#include <lttng-cpuhotplug.h>
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 {
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.
*/
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.
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);
+#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 */
- const struct lib_ring_buffer_config *config; /* Ring buffer configuration */
+#endif
+ /*
+ * We need to copy config because the module containing the
+ * source config can vanish before the last reference to this
+ * channel's streams is released.
+ */
+ struct lib_ring_buffer_config config; /* Ring buffer configuration */
cpumask_var_t cpumask; /* Allocated per-cpu buffers cpumask */
char name[NAME_MAX]; /* Channel name */
};
-#endif /* _LINUX_RING_BUFFER_BACKEND_TYPES_H */
+#endif /* _LIB_RING_BUFFER_BACKEND_TYPES_H */