X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=ltt-ring-buffer-client.h;h=c70c62b3c59c5dde47c59b93f325019c0ee7e835;hb=ad1c05e136eba463795ba592e5f6c27542643e16;hp=a262da105a6eec1dc9bfb6611d0fcc406cb4f2e0;hpb=baf2099544522f85e52c830b13aa45601ff15204;p=lttng-modules.git diff --git a/ltt-ring-buffer-client.h b/ltt-ring-buffer-client.h index a262da10..c70c62b3 100644 --- a/ltt-ring-buffer-client.h +++ b/ltt-ring-buffer-client.h @@ -216,6 +216,26 @@ void ltt_channel_destroy(struct channel *chan) kfree(chan_priv); } +static +struct lib_ring_buffer *ltt_buffer_read_open(struct channel *chan) +{ + struct lib_ring_buffer *buf; + int cpu; + + for_each_channel_cpu(cpu, chan->chan) { + buf = channel_get_ring_buffer(&config_config, chan, cpu); + if (!lib_ring_buffer_open_read(buf)) + return buf; + } + return NULL; +} + +static +struct lib_ring_buffer *ltt_buffer_read_close(struct lib_ring_buffer *buf) +{ + lib_ring_buffer_release_read(buf); +} + static void ltt_relay_remove_dirs(struct ltt_trace *trace) { debugfs_remove(trace->dentry.trace_root); @@ -249,6 +269,8 @@ static struct ltt_transport ltt_relay_transport = { .remove_dirs = ltt_relay_remove_dirs, .create_channel = ltt_channel_create, .destroy_channel = ltt_channel_destroy, + .buffer_read_open = ltt_buffer_read_open, + .buffer_read_close = ltt_buffer_read_close, }, };