Support LTTNG_KERNEL_SESSION_SET_CREATION_NAME of lttng-modules
[lttng-tools.git] / src / common / kernel-ctl / kernel-ctl.c
index a495ca9b705bee48c94d7d32c9b602cbc9a48a7f..8c0025c93caaef56541c99f292ea4168a91de686 100644 (file)
@@ -25,6 +25,7 @@
 #include <errno.h>
 #include <stdarg.h>
 #include <assert.h>
+#include <common/time.h>
 
 #include "kernel-ctl.h"
 #include "kernel-ioctl.h"
@@ -238,6 +239,30 @@ 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)
+{
+       struct lttng_kernel_session_name session_name;
+
+       strncpy(session_name.name, name, LTTNG_KERNEL_SESSION_NAME_LEN);
+
+       return LTTNG_IOCTL_CHECK(fd, LTTNG_KERNEL_SESSION_SET_NAME,
+                       &session_name);
+}
+
+int kernctl_session_set_creation_time(int fd, time_t time)
+{
+       int ret;
+       struct lttng_kernel_session_creation_time creation_time;
+
+       ret = time_t_to_ISO8601(creation_time.iso8601, sizeof(creation_time.iso8601), time);
+       if (ret) {
+               return -1;
+       }
+
+       return LTTNG_IOCTL_CHECK(fd, LTTNG_KERNEL_SESSION_SET_CREATION_TIME,
+                       &creation_time);
+}
+
 int kernctl_create_stream(int fd)
 {
        return compat_ioctl_no_arg(fd, LTTNG_KERNEL_OLD_STREAM,
@@ -350,6 +375,11 @@ int kernctl_filter(int fd, struct lttng_filter_bytecode *filter)
        return ret;
 }
 
+int kernctl_add_callsite(int fd, struct lttng_kernel_event_callsite *callsite)
+{
+       return LTTNG_IOCTL_CHECK(fd, LTTNG_KERNEL_ADD_CALLSITE, callsite);
+}
+
 int kernctl_tracepoint_list(int fd)
 {
        return compat_ioctl_no_arg(fd, LTTNG_KERNEL_OLD_TRACEPOINT_LIST,
This page took 0.02499 seconds and 5 git commands to generate.