kernel: event notifier: kernel-ctl interface
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Mon, 23 Mar 2020 21:03:37 +0000 (17:03 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 19 Jan 2021 21:36:47 +0000 (16:36 -0500)
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Idd3983c594ffecff0a20b71b7cd3d297e77446a1
Depends-on: lttng-ust: I5a800fc92e588c2a6a0e26282b0ad5f31c044479

src/common/kernel-ctl/kernel-ctl.c
src/common/kernel-ctl/kernel-ctl.h
src/common/kernel-ctl/kernel-ioctl.h
src/common/lttng-kernel.h

index 4470e77177d104011e88b37a0096b0036f6f61b0..f7b92f045498c870de9181c1e754228353ea033d 100644 (file)
@@ -418,6 +418,25 @@ int kernctl_stop_session(int fd)
                        LTTNG_KERNEL_SESSION_STOP);
 }
 
+int kernctl_create_event_notifier_group(int fd)
+{
+       return LTTNG_IOCTL_NO_CHECK(fd,
+                       LTTNG_KERNEL_EVENT_NOTIFIER_GROUP_CREATE);
+}
+
+int kernctl_create_event_notifier_group_notification_fd(int group_fd)
+{
+       return LTTNG_IOCTL_NO_CHECK(group_fd,
+                       LTTNG_KERNEL_EVENT_NOTIFIER_GROUP_NOTIFICATION_FD);
+}
+
+int kernctl_create_event_notifier(int group_fd,
+               const struct lttng_kernel_event_notifier *event_notifier)
+{
+       return LTTNG_IOCTL_NO_CHECK(group_fd,
+                       LTTNG_KERNEL_EVENT_NOTIFIER_CREATE, event_notifier);
+}
+
 int kernctl_filter(int fd, struct lttng_filter_bytecode *filter)
 {
        struct lttng_kernel_filter_bytecode *kb;
index 49925ea6c3affe8264b1f4b0a7cd00571c90dd39..b73a1d68effbd0eb507be842ead973dec2052616 100644 (file)
@@ -28,7 +28,14 @@ int kernctl_disable(int fd);
 int kernctl_start_session(int fd);
 int kernctl_stop_session(int fd);
 
-/* Apply on event FD */
+int kernctl_create_event_notifier_group(int fd);
+
+/* Apply on event notifier_group file descriptor. */
+int kernctl_create_event_notifier_group_notification_fd(int fd);
+int kernctl_create_event_notifier(int fd,
+               const struct lttng_kernel_event_notifier *event_notifier);
+
+/* Apply on event file descriptor. */
 int kernctl_filter(int fd, struct lttng_filter_bytecode *filter);
 int kernctl_add_callsite(int fd, struct lttng_kernel_event_callsite *callsite);
 
@@ -39,7 +46,8 @@ int kernctl_tracer_abi_version(int fd, struct lttng_kernel_tracer_abi_version *v
 int kernctl_wait_quiescent(int fd);
 
 /*
- * kernctl_syscall_mask - Get syscall mask associated to a channel FD.
+ * kernctl_syscall_mask - Get syscall mask associated to a channel file
+ * descriptor.
  *
  * The parameter @syscall_mask should initially be either NULL or point
  * to memory allocated with malloc(3) or realloc(3). When the function
@@ -52,7 +60,7 @@ int kernctl_wait_quiescent(int fd);
 int kernctl_syscall_mask(int fd, char **syscall_mask,
                uint32_t *nr_bits);
 
-/* Process ID tracking can be applied to session FD */
+/* Process ID tracking can be applied to session file descriptor. */
 int kernctl_track_pid(int fd, int pid);
 int kernctl_untrack_pid(int fd, int pid);
 int kernctl_list_tracker_pids(int fd);
index ed6555e10e47d87e59f3b4514a42dcee1b4db55a..8fa0a7d100c480ad8416ce06395d1fee2146fe73 100644 (file)
 #define LTTNG_KERNEL_SYSCALL_LIST              _IO(0xF6, 0x4A)
 #define LTTNG_KERNEL_TRACER_ABI_VERSION                \
        _IOR(0xF6, 0x4B, struct lttng_kernel_tracer_abi_version)
+#define LTTNG_KERNEL_EVENT_NOTIFIER_GROUP_CREATE \
+       _IO(0xF6, 0x4C)
 
 /* Session FD ioctl */
 #define LTTNG_KERNEL_METADATA                  \
 #define LTTNG_KERNEL_CONTEXT                   \
        _IOW(0xF6, 0x71, struct lttng_kernel_context)
 
-/* Event, Channel and Session ioctl */
+/* Event, event notifier, Channel and Session ioctl */
 #define LTTNG_KERNEL_ENABLE                    _IO(0xF6, 0x82)
 #define LTTNG_KERNEL_DISABLE                   _IO(0xF6, 0x83)
 
-/* Event FD ioctl */
+/* Event and event notifier FD ioctl */
 #define LTTNG_KERNEL_FILTER                    _IO(0xF6, 0x90)
 #define LTTNG_KERNEL_ADD_CALLSITE      _IO(0xF6, 0x91)
 
 #define LTTNG_KERNEL_SESSION_UNTRACK_ID                \
        _IOR(0xF6, 0xA2, struct lttng_kernel_tracker_args)
 
+/* Event notifier group file descriptor ioctl */
+#define LTTNG_KERNEL_EVENT_NOTIFIER_CREATE                     \
+       _IOW(0xF6, 0xB0, struct lttng_kernel_event_notifier)
+#define LTTNG_KERNEL_EVENT_NOTIFIER_GROUP_NOTIFICATION_FD      \
+       _IO(0xF6, 0xB1)
+
 #endif /* _LTT_KERNEL_IOCTL_H */
index 3dd866c75eb5fd0707a24606134e970f9c311af3..cd343bb766c81ea39f7f2ae8dbcd6de058954679 100644 (file)
@@ -178,6 +178,18 @@ struct lttng_kernel_event {
        } u;
 } LTTNG_PACKED;
 
+#define LTTNG_KERNEL_EVENT_NOTIFIER_PADDING    40
+struct lttng_kernel_event_notifier {
+       struct lttng_kernel_event event;
+       char padding[LTTNG_KERNEL_EVENT_NOTIFIER_PADDING];
+} LTTNG_PACKED;
+
+#define LTTNG_KERNEL_EVENT_NOTIFIER_NOTIFICATION_PADDING 34
+struct lttng_kernel_event_notifier_notification {
+       uint64_t token;
+       char padding[LTTNG_KERNEL_EVENT_NOTIFIER_NOTIFICATION_PADDING];
+} LTTNG_PACKED;
+
 struct lttng_kernel_tracer_version {
        uint32_t major;
        uint32_t minor;
This page took 0.027183 seconds and 4 git commands to generate.