X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fkernel-ctl%2Fkernel-ctl.c;h=5f25adf02dc269debabcbdad5d04729ec0d46eb3;hp=c9c52b528d582d9282112b4d3d62d1a5903e13cd;hb=99930a9d179c900b48dd2bd033abee425775c22a;hpb=8ff4109e3e6089d04c018a10c96c8498f893fdfb diff --git a/src/common/kernel-ctl/kernel-ctl.c b/src/common/kernel-ctl/kernel-ctl.c index c9c52b528..5f25adf02 100644 --- a/src/common/kernel-ctl/kernel-ctl.c +++ b/src/common/kernel-ctl/kernel-ctl.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "kernel-ctl.h" #include "kernel-ioctl.h" @@ -255,6 +256,23 @@ end: return ret; } +int kernctl_session_set_creation_time(int fd, time_t time) +{ + int ret; + struct lttng_kernel_session_creation_time creation_time; + + ret = time_to_iso8601_str(time, creation_time.iso8601, + sizeof(creation_time.iso8601)); + if (ret) { + goto end; + } + + ret = LTTNG_IOCTL_CHECK(fd, LTTNG_KERNEL_SESSION_SET_CREATION_TIME, + &creation_time); +end: + return ret; +} + int kernctl_create_stream(int fd) { return compat_ioctl_no_arg(fd, LTTNG_KERNEL_OLD_STREAM, @@ -435,6 +453,11 @@ int kernctl_buffer_flush_empty(int fd) return LTTNG_IOCTL_CHECK(fd, RING_BUFFER_FLUSH_EMPTY); } +int kernctl_buffer_clear(int fd) +{ + return LTTNG_IOCTL_CHECK(fd, RING_BUFFER_CLEAR); +} + /* returns the version of the metadata. */ int kernctl_get_metadata_version(int fd, uint64_t *version) {