* @extra_reader_sb: need extra subbuffer for reader
*/
static
-int lib_ring_buffer_backend_allocate(const struct lib_ring_buffer_config *config,
- struct lib_ring_buffer_backend *bufb,
+int lib_ring_buffer_backend_allocate(const struct lttng_kernel_ring_buffer_config *config,
+ struct lttng_kernel_ring_buffer_backend *bufb,
size_t size, size_t num_subbuf,
int extra_reader_sb)
{
for (i = 0; i < num_subbuf_alloc; i++) {
bufb->array[i] =
lttng_kvzalloc_node(ALIGN(
- sizeof(struct lib_ring_buffer_backend_pages) +
- sizeof(struct lib_ring_buffer_backend_page)
+ sizeof(struct lttng_kernel_ring_buffer_backend_pages) +
+ sizeof(struct lttng_kernel_ring_buffer_backend_page)
* num_pages_per_subbuf,
1 << INTERNODE_CACHE_SHIFT),
GFP_KERNEL | __GFP_NOWARN,
/* Allocate write-side subbuffer table */
bufb->buf_wsb = lttng_kvzalloc_node(ALIGN(
- sizeof(struct lib_ring_buffer_backend_subbuffer)
+ sizeof(struct lttng_kernel_ring_buffer_backend_subbuffer)
* num_subbuf,
1 << INTERNODE_CACHE_SHIFT),
GFP_KERNEL | __GFP_NOWARN,
/* Allocate subbuffer packet counter table */
bufb->buf_cnt = lttng_kvzalloc_node(ALIGN(
- sizeof(struct lib_ring_buffer_backend_counts)
+ sizeof(struct lttng_kernel_ring_buffer_backend_counts)
* num_subbuf,
1 << INTERNODE_CACHE_SHIFT),
GFP_KERNEL | __GFP_NOWARN,
return -ENOMEM;
}
-int lib_ring_buffer_backend_create(struct lib_ring_buffer_backend *bufb,
+int lib_ring_buffer_backend_create(struct lttng_kernel_ring_buffer_backend *bufb,
struct channel_backend *chanb, int cpu)
{
- const struct lib_ring_buffer_config *config = &chanb->config;
+ const struct lttng_kernel_ring_buffer_config *config = &chanb->config;
- bufb->chan = container_of(chanb, struct channel, backend);
+ bufb->chan = container_of(chanb, struct lttng_kernel_ring_buffer_channel, backend);
bufb->cpu = cpu;
return lib_ring_buffer_backend_allocate(config, bufb, chanb->buf_size,
chanb->extra_reader_sb);
}
-void lib_ring_buffer_backend_free(struct lib_ring_buffer_backend *bufb)
+void lib_ring_buffer_backend_free(struct lttng_kernel_ring_buffer_backend *bufb)
{
struct channel_backend *chanb = &bufb->chan->backend;
unsigned long i, j, num_subbuf_alloc;
bufb->allocated = 0;
}
-void lib_ring_buffer_backend_reset(struct lib_ring_buffer_backend *bufb)
+void lib_ring_buffer_backend_reset(struct lttng_kernel_ring_buffer_backend *bufb)
{
struct channel_backend *chanb = &bufb->chan->backend;
- const struct lib_ring_buffer_config *config = &chanb->config;
+ const struct lttng_kernel_ring_buffer_config *config = &chanb->config;
unsigned long num_subbuf_alloc;
unsigned int i;
*/
void channel_backend_reset(struct channel_backend *chanb)
{
- struct channel *chan = container_of(chanb, struct channel, backend);
- const struct lib_ring_buffer_config *config = &chanb->config;
+ struct lttng_kernel_ring_buffer_channel *chan = container_of(chanb, struct lttng_kernel_ring_buffer_channel, backend);
+ const struct lttng_kernel_ring_buffer_config *config = &chanb->config;
/*
* Don't reset buf_size, subbuf_size, subbuf_size_order,
chanb->start_tsc = config->cb.ring_buffer_clock_read(chan);
}
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0))
/*
* No need to implement a "dead" callback to do a buffer switch here,
{
struct channel_backend *chanb = container_of(node,
struct channel_backend, cpuhp_prepare);
- const struct lib_ring_buffer_config *config = &chanb->config;
- struct lib_ring_buffer *buf;
+ const struct lttng_kernel_ring_buffer_config *config = &chanb->config;
+ struct lttng_kernel_ring_buffer *buf;
int ret;
CHAN_WARN_ON(chanb, config->alloc == RING_BUFFER_ALLOC_GLOBAL);
ret = lib_ring_buffer_create(buf, chanb, cpu);
if (ret) {
printk(KERN_ERR
- "ring_buffer_cpu_hp_callback: cpu %d "
+ "LTTng: ring_buffer_cpu_hp_callback: cpu %d "
"buffer creation failed\n", cpu);
return ret;
}
}
EXPORT_SYMBOL_GPL(lttng_cpuhp_rb_backend_prepare);
-#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
+#else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */
#ifdef CONFIG_HOTPLUG_CPU
unsigned int cpu = (unsigned long)hcpu;
struct channel_backend *chanb = container_of(nb, struct channel_backend,
cpu_hp_notifier);
- const struct lib_ring_buffer_config *config = &chanb->config;
- struct lib_ring_buffer *buf;
+ const struct lttng_kernel_ring_buffer_config *config = &chanb->config;
+ struct lttng_kernel_ring_buffer *buf;
int ret;
CHAN_WARN_ON(chanb, config->alloc == RING_BUFFER_ALLOC_GLOBAL);
ret = lib_ring_buffer_create(buf, chanb, cpu);
if (ret) {
printk(KERN_ERR
- "ring_buffer_cpu_hp_callback: cpu %d "
+ "LTTng: ring_buffer_cpu_hp_callback: cpu %d "
"buffer creation failed\n", cpu);
return NOTIFY_BAD;
}
#endif
-#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
+#endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */
/**
* channel_backend_init - initialize a channel backend
*/
int channel_backend_init(struct channel_backend *chanb,
const char *name,
- const struct lib_ring_buffer_config *config,
+ const struct lttng_kernel_ring_buffer_config *config,
void *priv, size_t subbuf_size, size_t num_subbuf)
{
- struct channel *chan = container_of(chanb, struct channel, backend);
+ struct lttng_kernel_ring_buffer_channel *chan = container_of(chanb, struct lttng_kernel_ring_buffer_channel, backend);
unsigned int i;
int ret;
if (config->alloc == RING_BUFFER_ALLOC_PER_CPU) {
/* Allocating the buffer per-cpu structures */
- chanb->buf = alloc_percpu(struct lib_ring_buffer);
+ chanb->buf = alloc_percpu(struct lttng_kernel_ring_buffer);
if (!chanb->buf)
goto free_cpumask;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0))
chanb->cpuhp_prepare.component = LTTNG_RING_BUFFER_BACKEND;
ret = cpuhp_state_add_instance(lttng_rb_hp_prepare,
&chanb->cpuhp_prepare.node);
if (ret)
goto free_bufs;
-#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
+#else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */
{
/*
}
#endif
}
-#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
+#endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */
} else {
- chanb->buf = kzalloc(sizeof(struct lib_ring_buffer), GFP_KERNEL);
+ chanb->buf = kzalloc(sizeof(struct lttng_kernel_ring_buffer), GFP_KERNEL);
if (!chanb->buf)
goto free_cpumask;
ret = lib_ring_buffer_create(chanb->buf, chanb, -1);
free_bufs:
if (config->alloc == RING_BUFFER_ALLOC_PER_CPU) {
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0))
/*
* Teardown of lttng_rb_hp_prepare instance
* on "add" error is handled within cpu hotplug,
* no teardown to do from the caller.
*/
-#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
+#else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */
#ifdef CONFIG_HOTPLUG_CPU
put_online_cpus();
unregister_hotcpu_notifier(&chanb->cpu_hp_notifier);
#endif
-#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
+#endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */
for_each_possible_cpu(i) {
- struct lib_ring_buffer *buf =
+ struct lttng_kernel_ring_buffer *buf =
per_cpu_ptr(chanb->buf, i);
if (!buf->backend.allocated)
*/
void channel_backend_unregister_notifiers(struct channel_backend *chanb)
{
- const struct lib_ring_buffer_config *config = &chanb->config;
+ const struct lttng_kernel_ring_buffer_config *config = &chanb->config;
if (config->alloc == RING_BUFFER_ALLOC_PER_CPU) {
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0))
int ret;
ret = cpuhp_state_remove_instance(lttng_rb_hp_prepare,
&chanb->cpuhp_prepare.node);
WARN_ON(ret);
-#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
+#else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */
unregister_hotcpu_notifier(&chanb->cpu_hp_notifier);
-#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) */
+#endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0)) */
}
}
*/
void channel_backend_free(struct channel_backend *chanb)
{
- const struct lib_ring_buffer_config *config = &chanb->config;
+ const struct lttng_kernel_ring_buffer_config *config = &chanb->config;
unsigned int i;
if (config->alloc == RING_BUFFER_ALLOC_PER_CPU) {
for_each_possible_cpu(i) {
- struct lib_ring_buffer *buf = per_cpu_ptr(chanb->buf, i);
+ struct lttng_kernel_ring_buffer *buf = per_cpu_ptr(chanb->buf, i);
if (!buf->backend.allocated)
continue;
free_cpumask_var(chanb->cpumask);
free_percpu(chanb->buf);
} else {
- struct lib_ring_buffer *buf = chanb->buf;
+ struct lttng_kernel_ring_buffer *buf = chanb->buf;
CHAN_WARN_ON(chanb, !buf->backend.allocated);
lib_ring_buffer_free(buf);
* @len : length to write
* @pagecpy : page size copied so far
*/
-void _lib_ring_buffer_write(struct lib_ring_buffer_backend *bufb, size_t offset,
+void _lib_ring_buffer_write(struct lttng_kernel_ring_buffer_backend *bufb, size_t offset,
const void *src, size_t len, size_t pagecpy)
{
struct channel_backend *chanb = &bufb->chan->backend;
- const struct lib_ring_buffer_config *config = &chanb->config;
+ const struct lttng_kernel_ring_buffer_config *config = &chanb->config;
size_t sbidx, index;
- struct lib_ring_buffer_backend_pages *rpages;
+ struct lttng_kernel_ring_buffer_backend_pages *rpages;
unsigned long sb_bindex, id;
do {
* @len : length to write
* @pagecpy : page size copied so far
*/
-void _lib_ring_buffer_memset(struct lib_ring_buffer_backend *bufb,
+void _lib_ring_buffer_memset(struct lttng_kernel_ring_buffer_backend *bufb,
size_t offset,
int c, size_t len, size_t pagecpy)
{
struct channel_backend *chanb = &bufb->chan->backend;
- const struct lib_ring_buffer_config *config = &chanb->config;
+ const struct lttng_kernel_ring_buffer_config *config = &chanb->config;
size_t sbidx, index;
- struct lib_ring_buffer_backend_pages *rpages;
+ struct lttng_kernel_ring_buffer_backend_pages *rpages;
unsigned long sb_bindex, id;
do {
* @pagecpy : page size copied so far
* @pad : character to use for padding
*/
-void _lib_ring_buffer_strcpy(struct lib_ring_buffer_backend *bufb,
+void _lib_ring_buffer_strcpy(struct lttng_kernel_ring_buffer_backend *bufb,
size_t offset, const char *src, size_t len,
size_t pagecpy, int pad)
{
struct channel_backend *chanb = &bufb->chan->backend;
- const struct lib_ring_buffer_config *config = &chanb->config;
+ const struct lttng_kernel_ring_buffer_config *config = &chanb->config;
size_t sbidx, index;
- struct lib_ring_buffer_backend_pages *rpages;
+ struct lttng_kernel_ring_buffer_backend_pages *rpages;
unsigned long sb_bindex, id;
int src_terminated = 0;
}
EXPORT_SYMBOL_GPL(_lib_ring_buffer_strcpy);
+/**
+ * _lib_ring_buffer_pstrcpy - write to a buffer backend P-string
+ * @bufb : buffer backend
+ * @src : source pointer to copy from
+ * @len : length of data to copy
+ * @pad : character to use for padding
+ *
+ * This function copies up to @len bytes of data from a source pointer
+ * to a Pascal String into the buffer backend. If a terminating '\0'
+ * character is found in @src before @len characters are copied, pad the
+ * buffer with @pad characters (e.g. '\0').
+ *
+ * The length of the pascal strings in the ring buffer is explicit: it
+ * is either the array or sequence length.
+ */
+void _lib_ring_buffer_pstrcpy(struct lttng_kernel_ring_buffer_backend *bufb,
+ size_t offset, const char *src, size_t len, int pad)
+{
+ struct channel_backend *chanb = &bufb->chan->backend;
+ const struct lttng_kernel_ring_buffer_config *config = &chanb->config;
+ size_t sbidx, index, bytes_left_in_page;
+ struct lttng_kernel_ring_buffer_backend_pages *rpages;
+ unsigned long sb_bindex, id;
+ bool src_terminated = false;
+
+ CHAN_WARN_ON(chanb, !len);
+ do {
+ sbidx = offset >> chanb->subbuf_size_order;
+ index = (offset & (chanb->subbuf_size - 1)) >> PAGE_SHIFT;
+
+ /*
+ * Underlying layer should never ask for writes across
+ * subbuffers.
+ */
+ CHAN_WARN_ON(chanb, offset >= chanb->buf_size);
+
+ bytes_left_in_page = min_t(size_t, len, PAGE_SIZE - (offset & ~PAGE_MASK));
+ id = bufb->buf_wsb[sbidx].id;
+ sb_bindex = subbuffer_id_get_index(config, id);
+ rpages = bufb->array[sb_bindex];
+ CHAN_WARN_ON(chanb, config->mode == RING_BUFFER_OVERWRITE
+ && subbuffer_id_is_noref(config, id));
+
+ if (likely(!src_terminated)) {
+ size_t count, to_copy;
+
+ to_copy = bytes_left_in_page;
+ count = lib_ring_buffer_do_strcpy(config,
+ rpages->p[index].virt
+ + (offset & ~PAGE_MASK),
+ src, to_copy);
+ offset += count;
+ /* Padding */
+ if (unlikely(count < to_copy)) {
+ size_t pad_len = to_copy - count;
+
+ /* Next pages will have padding */
+ src_terminated = true;
+ lib_ring_buffer_do_memset(rpages->p[index].virt
+ + (offset & ~PAGE_MASK),
+ pad, pad_len);
+ offset += pad_len;
+ }
+ } else {
+ size_t pad_len;
+
+ pad_len = bytes_left_in_page;
+ lib_ring_buffer_do_memset(rpages->p[index].virt
+ + (offset & ~PAGE_MASK),
+ pad, pad_len);
+ offset += pad_len;
+ }
+ len -= bytes_left_in_page;
+ if (!src_terminated)
+ src += bytes_left_in_page;
+ } while (unlikely(len));
+}
+EXPORT_SYMBOL_GPL(_lib_ring_buffer_pstrcpy);
+
/**
* lib_ring_buffer_copy_from_user_inatomic - write user data to a ring_buffer buffer.
* @bufb : buffer backend
* directly without having the src pointer checked with access_ok()
* previously.
*/
-void _lib_ring_buffer_copy_from_user_inatomic(struct lib_ring_buffer_backend *bufb,
+void _lib_ring_buffer_copy_from_user_inatomic(struct lttng_kernel_ring_buffer_backend *bufb,
size_t offset,
const void __user *src, size_t len,
size_t pagecpy)
{
struct channel_backend *chanb = &bufb->chan->backend;
- const struct lib_ring_buffer_config *config = &chanb->config;
+ const struct lttng_kernel_ring_buffer_config *config = &chanb->config;
size_t sbidx, index;
- struct lib_ring_buffer_backend_pages *rpages;
+ struct lttng_kernel_ring_buffer_backend_pages *rpages;
unsigned long sb_bindex, id;
int ret;
* directly without having the src pointer checked with access_ok()
* previously.
*/
-void _lib_ring_buffer_strcpy_from_user_inatomic(struct lib_ring_buffer_backend *bufb,
+void _lib_ring_buffer_strcpy_from_user_inatomic(struct lttng_kernel_ring_buffer_backend *bufb,
size_t offset, const char __user *src, size_t len,
size_t pagecpy, int pad)
{
struct channel_backend *chanb = &bufb->chan->backend;
- const struct lib_ring_buffer_config *config = &chanb->config;
+ const struct lttng_kernel_ring_buffer_config *config = &chanb->config;
size_t sbidx, index;
- struct lib_ring_buffer_backend_pages *rpages;
+ struct lttng_kernel_ring_buffer_backend_pages *rpages;
unsigned long sb_bindex, id;
int src_terminated = 0;
}
EXPORT_SYMBOL_GPL(_lib_ring_buffer_strcpy_from_user_inatomic);
+/**
+ * _lib_ring_buffer_pstrcpy_from_user_inatomic - write userspace string to a buffer backend P-string
+ * @bufb : buffer backend
+ * @src : source pointer to copy from
+ * @len : length of data to copy
+ * @pad : character to use for padding
+ *
+ * This function copies up to @len bytes of data from a source pointer
+ * to a Pascal String into the buffer backend. If a terminating '\0'
+ * character is found in @src before @len characters are copied, pad the
+ * buffer with @pad characters (e.g. '\0').
+ *
+ * The length of the pascal strings in the ring buffer is explicit: it
+ * is either the array or sequence length.
+ *
+ * This function deals with userspace pointers, it should never be called
+ * directly without having the src pointer checked with access_ok()
+ * previously.
+ */
+void _lib_ring_buffer_pstrcpy_from_user_inatomic(struct lttng_kernel_ring_buffer_backend *bufb,
+ size_t offset, const char __user *src, size_t len, int pad)
+{
+ struct channel_backend *chanb = &bufb->chan->backend;
+ const struct lttng_kernel_ring_buffer_config *config = &chanb->config;
+ size_t sbidx, index, bytes_left_in_page;
+ struct lttng_kernel_ring_buffer_backend_pages *rpages;
+ unsigned long sb_bindex, id;
+ bool src_terminated = false;
+
+ CHAN_WARN_ON(chanb, !len);
+ do {
+ sbidx = offset >> chanb->subbuf_size_order;
+ index = (offset & (chanb->subbuf_size - 1)) >> PAGE_SHIFT;
+
+ /*
+ * Underlying layer should never ask for writes across
+ * subbuffers.
+ */
+ CHAN_WARN_ON(chanb, offset >= chanb->buf_size);
+
+ bytes_left_in_page = min_t(size_t, len, PAGE_SIZE - (offset & ~PAGE_MASK));
+ id = bufb->buf_wsb[sbidx].id;
+ sb_bindex = subbuffer_id_get_index(config, id);
+ rpages = bufb->array[sb_bindex];
+ CHAN_WARN_ON(chanb, config->mode == RING_BUFFER_OVERWRITE
+ && subbuffer_id_is_noref(config, id));
+
+ if (likely(!src_terminated)) {
+ size_t count, to_copy;
+
+ to_copy = bytes_left_in_page;
+ count = lib_ring_buffer_do_strcpy_from_user_inatomic(config,
+ rpages->p[index].virt
+ + (offset & ~PAGE_MASK),
+ src, to_copy);
+ offset += count;
+ /* Padding */
+ if (unlikely(count < to_copy)) {
+ size_t pad_len = to_copy - count;
+
+ /* Next pages will have padding */
+ src_terminated = true;
+ lib_ring_buffer_do_memset(rpages->p[index].virt
+ + (offset & ~PAGE_MASK),
+ pad, pad_len);
+ offset += pad_len;
+ }
+ } else {
+ size_t pad_len;
+
+ pad_len = bytes_left_in_page;
+ lib_ring_buffer_do_memset(rpages->p[index].virt
+ + (offset & ~PAGE_MASK),
+ pad, pad_len);
+ offset += pad_len;
+ }
+ len -= bytes_left_in_page;
+ if (!src_terminated)
+ src += bytes_left_in_page;
+ } while (unlikely(len));
+}
+EXPORT_SYMBOL_GPL(_lib_ring_buffer_pstrcpy_from_user_inatomic);
+
/**
* lib_ring_buffer_read - read data from ring_buffer_buffer.
* @bufb : buffer backend
* Should be protected by get_subbuf/put_subbuf.
* Returns the length copied.
*/
-size_t lib_ring_buffer_read(struct lib_ring_buffer_backend *bufb, size_t offset,
+size_t lib_ring_buffer_read(struct lttng_kernel_ring_buffer_backend *bufb, size_t offset,
void *dest, size_t len)
{
struct channel_backend *chanb = &bufb->chan->backend;
- const struct lib_ring_buffer_config *config = &chanb->config;
+ const struct lttng_kernel_ring_buffer_config *config = &chanb->config;
size_t index, pagecpy, orig_len;
- struct lib_ring_buffer_backend_pages *rpages;
+ struct lttng_kernel_ring_buffer_backend_pages *rpages;
unsigned long sb_bindex, id;
orig_len = len;
* function.
* Returns -EFAULT on error, 0 if ok.
*/
-int __lib_ring_buffer_copy_to_user(struct lib_ring_buffer_backend *bufb,
+int __lib_ring_buffer_copy_to_user(struct lttng_kernel_ring_buffer_backend *bufb,
size_t offset, void __user *dest, size_t len)
{
struct channel_backend *chanb = &bufb->chan->backend;
- const struct lib_ring_buffer_config *config = &chanb->config;
+ const struct lttng_kernel_ring_buffer_config *config = &chanb->config;
size_t index;
ssize_t pagecpy;
- struct lib_ring_buffer_backend_pages *rpages;
+ struct lttng_kernel_ring_buffer_backend_pages *rpages;
unsigned long sb_bindex, id;
offset &= chanb->buf_size - 1;
* Should be protected by get_subbuf/put_subbuf.
* Destination length should be at least 1 to hold '\0'.
*/
-int lib_ring_buffer_read_cstr(struct lib_ring_buffer_backend *bufb, size_t offset,
+int lib_ring_buffer_read_cstr(struct lttng_kernel_ring_buffer_backend *bufb, size_t offset,
void *dest, size_t len)
{
struct channel_backend *chanb = &bufb->chan->backend;
- const struct lib_ring_buffer_config *config = &chanb->config;
+ const struct lttng_kernel_ring_buffer_config *config = &chanb->config;
size_t index;
ssize_t pagecpy, pagelen, strpagelen, orig_offset;
char *str;
- struct lib_ring_buffer_backend_pages *rpages;
+ struct lttng_kernel_ring_buffer_backend_pages *rpages;
unsigned long sb_bindex, id;
offset &= chanb->buf_size - 1;
* Should be protected by get_subbuf/put_subbuf.
* Returns the pointer to the page frame number unsigned long.
*/
-unsigned long *lib_ring_buffer_read_get_pfn(struct lib_ring_buffer_backend *bufb,
+unsigned long *lib_ring_buffer_read_get_pfn(struct lttng_kernel_ring_buffer_backend *bufb,
size_t offset, void ***virt)
{
size_t index;
- struct lib_ring_buffer_backend_pages *rpages;
+ struct lttng_kernel_ring_buffer_backend_pages *rpages;
struct channel_backend *chanb = &bufb->chan->backend;
- const struct lib_ring_buffer_config *config = &chanb->config;
+ const struct lttng_kernel_ring_buffer_config *config = &chanb->config;
unsigned long sb_bindex, id;
offset &= chanb->buf_size - 1;
* from/to this address, as long as the read/write is never bigger than a
* page size.
*/
-void *lib_ring_buffer_read_offset_address(struct lib_ring_buffer_backend *bufb,
+void *lib_ring_buffer_read_offset_address(struct lttng_kernel_ring_buffer_backend *bufb,
size_t offset)
{
size_t index;
- struct lib_ring_buffer_backend_pages *rpages;
+ struct lttng_kernel_ring_buffer_backend_pages *rpages;
struct channel_backend *chanb = &bufb->chan->backend;
- const struct lib_ring_buffer_config *config = &chanb->config;
+ const struct lttng_kernel_ring_buffer_config *config = &chanb->config;
unsigned long sb_bindex, id;
offset &= chanb->buf_size - 1;
* it's always at the beginning of a page, it's safe to write directly to this
* address, as long as the write is never bigger than a page size.
*/
-void *lib_ring_buffer_offset_address(struct lib_ring_buffer_backend *bufb,
+void *lib_ring_buffer_offset_address(struct lttng_kernel_ring_buffer_backend *bufb,
size_t offset)
{
size_t sbidx, index;
- struct lib_ring_buffer_backend_pages *rpages;
+ struct lttng_kernel_ring_buffer_backend_pages *rpages;
struct channel_backend *chanb = &bufb->chan->backend;
- const struct lib_ring_buffer_config *config = &chanb->config;
+ const struct lttng_kernel_ring_buffer_config *config = &chanb->config;
unsigned long sb_bindex, id;
offset &= chanb->buf_size - 1;