goto error;
return put_u64(si, arg);
}
+ case LTTNG_RING_BUFFER_GET_CURRENT_TIMESTAMP:
+ {
+ uint64_t ts;
+
+ if (!lttng_chan->ops)
+ goto error;
+ ret = lttng_chan->ops->current_timestamp(config, buf, &ts);
+ if (ret < 0)
+ goto error;
+ return put_u64(ts, arg);
+ }
default:
return lib_ring_buffer_file_operations.unlocked_ioctl(filp,
cmd, arg);
goto error;
return put_u64(si, arg);
}
+ case LTTNG_RING_BUFFER_GET_CURRENT_TIMESTAMP:
+ {
+ uint64_t ts;
+
+ if (!lttng_chan->ops)
+ goto error;
+ ret = lttng_chan->ops->current_timestamp(config, buf, &ts);
+ if (ret < 0)
+ goto error;
+ return put_u64(ts, arg);
+ }
default:
return lib_ring_buffer_file_operations.compat_ioctl(filp,
cmd, arg);
#define LTTNG_RING_BUFFER_GET_PACKET_SIZE _IOR(0xF6, 0x24, uint64_t)
/* returns the stream id */
#define LTTNG_RING_BUFFER_GET_STREAM_ID _IOR(0xF6, 0x25, uint64_t)
+/* returns the current timestamp */
+#define LTTNG_RING_BUFFER_GET_CURRENT_TIMESTAMP _IOR(0xF6, 0x26, uint64_t)
#ifdef CONFIG_COMPAT
/* returns the timestamp begin of the current sub-buffer */
/* returns the stream id */
#define LTTNG_RING_BUFFER_COMPAT_GET_STREAM_ID \
LTTNG_RING_BUFFER_GET_STREAM_ID
+/* returns the current timestamp */
+#define LTTNG_RING_BUFFER_COMPAT_GET_CURRENT_TIMESTAMP \
+ LTTNG_RING_BUFFER_GET_CURRENT_TIMESTAMP
#endif /* CONFIG_COMPAT */
#endif /* _LTTNG_ABI_H */
int (*stream_id) (const struct lib_ring_buffer_config *config,
struct lib_ring_buffer *bufb,
uint64_t *stream_id);
+ int (*current_timestamp) (const struct lib_ring_buffer_config *config,
+ struct lib_ring_buffer *bufb,
+ uint64_t *ts);
};
struct lttng_transport {
return 0;
}
+static int client_current_timestamp(const struct lib_ring_buffer_config *config,
+ struct lib_ring_buffer *bufb,
+ uint64_t *ts)
+{
+ *ts = config->cb.ring_buffer_clock_read(bufb->backend.chan);
+
+ return 0;
+}
+
static const struct lib_ring_buffer_config client_config = {
.cb.ring_buffer_clock_read = client_ring_buffer_clock_read,
.cb.record_header_size = client_record_header_size,
lttng_chan->ops->content_size = client_content_size;
lttng_chan->ops->packet_size = client_packet_size;
lttng_chan->ops->stream_id = client_stream_id;
+ lttng_chan->ops->current_timestamp = client_current_timestamp;
return channel_create(&client_config, name, lttng_chan, buf_addr,
subbuf_size, num_subbuf, switch_timer_interval,
return -ENOSYS;
}
+static int client_current_timestamp(const struct lib_ring_buffer_config *config,
+ struct lib_ring_buffer *bufb,
+ uint64_t *ts)
+{
+ return -ENOSYS;
+}
+
static int client_content_size(const struct lib_ring_buffer_config *config,
struct lib_ring_buffer *bufb,
uint64_t *content_size)
lttng_chan->ops->content_size = client_content_size;
lttng_chan->ops->packet_size = client_packet_size;
lttng_chan->ops->stream_id = client_stream_id;
+ lttng_chan->ops->current_timestamp = client_current_timestamp;
return channel_create(&client_config, name, lttng_chan, buf_addr,
subbuf_size, num_subbuf, switch_timer_interval,