X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Fkernel-ctl%2Fkernel-ctl.c;h=5f25adf02dc269debabcbdad5d04729ec0d46eb3;hb=41ef8f6305f01c9e31e8be48db625788ef01e758;hp=047d40a34d80ea611ff940a78efdb26ebf9127bd;hpb=1ab8c2ad460ea71dd6d1580d6b69fb0cf68ce9ad;p=lttng-tools.git diff --git a/src/common/kernel-ctl/kernel-ctl.c b/src/common/kernel-ctl/kernel-ctl.c index 047d40a34..5f25adf02 100644 --- a/src/common/kernel-ctl/kernel-ctl.c +++ b/src/common/kernel-ctl/kernel-ctl.c @@ -22,9 +22,11 @@ #include #include #include +#include #include #include #include +#include #include "kernel-ctl.h" #include "kernel-ioctl.h" @@ -238,6 +240,39 @@ int kernctl_session_regenerate_statedump(int fd) return LTTNG_IOCTL_CHECK(fd, LTTNG_KERNEL_SESSION_STATEDUMP); } +int kernctl_session_set_name(int fd, const char *name) +{ + int ret; + struct lttng_kernel_session_name session_name; + + ret = lttng_strncpy(session_name.name, name, sizeof(session_name.name)); + if (ret) { + goto end; + } + + ret = LTTNG_IOCTL_CHECK( + fd, LTTNG_KERNEL_SESSION_SET_NAME, &session_name); +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, @@ -418,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) {