X-Git-Url: http://git.lttng.org/?p=lttng-ust.git;a=blobdiff_plain;f=liblttng-ust-ctl%2Fustctl.c;h=8e2e8f1b8b4eabf7e617a585198d5dc296db2ee1;hp=7b41b992fc03dc511554bb52e5fc350ac435e8cf;hb=f45930b75b297a5f80fe14ef2550b196ca750b4a;hpb=d0cba1f1d68f4aa7d611d4ba1c4c57f736f3c846 diff --git a/liblttng-ust-ctl/ustctl.c b/liblttng-ust-ctl/ustctl.c index 7b41b992..8e2e8f1b 100644 --- a/liblttng-ust-ctl/ustctl.c +++ b/liblttng-ust-ctl/ustctl.c @@ -1501,6 +1501,25 @@ int ustctl_snapshot(struct ustctl_consumer_stream *stream) &buf->prod_snapshot, consumer_chan->chan->handle); } +/* + * Get a snapshot of the current ring buffer producer and consumer positions + * even if the consumed and produced positions are contained within the same + * subbuffer. + */ +int ustctl_snapshot_sample_positions(struct ustctl_consumer_stream *stream) +{ + struct lttng_ust_lib_ring_buffer *buf; + struct ustctl_consumer_channel *consumer_chan; + + if (!stream) + return -EINVAL; + buf = stream->buf; + consumer_chan = stream->chan; + return lib_ring_buffer_snapshot_sample_positions(buf, + &buf->cons_snapshot, &buf->prod_snapshot, + consumer_chan->chan->handle); +} + /* Get the consumer position (iteration start) */ int ustctl_snapshot_get_consumed(struct ustctl_consumer_stream *stream, unsigned long *pos)