struct channel_backend *chanb = &bufb->chan->backend;
const struct lib_ring_buffer_config *config = chanb->config;
size_t index;
- ssize_t pagecpy, orig_len;
+ ssize_t pagecpy;
struct lib_ring_buffer_backend_pages *rpages;
unsigned long sb_bindex, id;
- orig_len = len;
offset &= chanb->buf_size - 1;
index = (offset & (chanb->subbuf_size - 1)) >> PAGE_SHIFT;
if (unlikely(!len))
const struct lib_ring_buffer_config *config = chanb->config;
struct channel *chan = container_of(chanb, struct channel, backend);
void *priv = chanb->priv;
- unsigned int num_subbuf;
size_t subbuf_header_size;
u64 tsc;
int ret;
goto free_commit;
}
- num_subbuf = chan->backend.num_subbuf;
init_waitqueue_head(&buf->read_wait);
raw_spin_lock_init(&buf->raw_tick_nohz_spinlock);
.ops = &ring_buffer_pipe_buf_ops,
.spd_release = lib_ring_buffer_page_release,
};
- unsigned long consumed_old, consumed_idx, roffset;
+ unsigned long consumed_old, roffset;
unsigned long bytes_avail;
/*
WARN_ON(atomic_long_read(&buf->active_readers) != 1);
consumed_old = lib_ring_buffer_get_consumed(config, buf);
consumed_old += *ppos;
- consumed_idx = subbuf_index(consumed_old, chan);
/*
* Adjust read len, if longer than what is available.
.name = "lttng_metadata",
};
struct ltt_event *event;
- int ret;
/*
* We tolerate no failure path after event creation. It will stay
*/
event = ltt_event_create(channel, &metadata_params, NULL);
if (!event) {
- ret = -EINVAL;
goto create_error;
}
return;
enum channel_type channel_type)
{
struct ltt_session *session = session_file->private_data;
- const struct file_operations *fops;
+ const struct file_operations *fops = NULL;
const char *transport_name;
struct ltt_channel *chan;
struct file *chan_file;
ret = chan_fd;
goto fd_error;
}
+ switch (channel_type) {
+ case PER_CPU_CHANNEL:
+ fops = <tng_channel_fops;
+ break;
+ case METADATA_CHANNEL:
+ fops = <tng_metadata_fops;
+ break;
+ }
+
chan_file = anon_inode_getfile("[lttng_channel]",
- <tng_channel_fops,
+ fops,
NULL, O_RDWR);
if (IS_ERR(chan_file)) {
ret = PTR_ERR(chan_file);
} else {
return -EINVAL;
}
- fops = <tng_channel_fops;
break;
case METADATA_CHANNEL:
if (chan_param.output == LTTNG_KERNEL_SPLICE)
transport_name = "relay-metadata-mmap";
else
return -EINVAL;
- fops = <tng_metadata_fops;
break;
default:
transport_name = "<unknown>";