summaryrefslogtreecommitdiff
path: root/include/uapi/linux/user_events.h
diff options
context:
space:
mode:
authorBeau Belgrave <beaub@linux.microsoft.com>2023-03-28 16:52:12 -0700
committerSteven Rostedt (Google) <rostedt@goodmis.org>2023-03-29 06:52:08 -0400
commitdcb8177c13953872c9e5ce4a99b63a87a3c2f683 (patch)
treea5b552e9688432c2d5bf0ccf3f2ce26afb479467 /include/uapi/linux/user_events.h
parent81f8fb65499817a4d1d5d66d9e74a903061ce637 (diff)
tracing/user_events: Add ioctl for disabling addresses
Enablements are now tracked by the lifetime of the task/mm. User processes need to be able to disable their addresses if tracing is requested to be turned off. Before unmapping the page would suffice. However, we now need a stronger contract. Add an ioctl to enable this. A new flag bit is added, freeing, to user_event_enabler to ensure that if the event is attempted to be removed while a fault is being handled that the remove is delayed until after the fault is reattempted. Link: https://lkml.kernel.org/r/20230328235219.203-6-beaub@linux.microsoft.com Signed-off-by: Beau Belgrave <beaub@linux.microsoft.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Diffstat (limited to 'include/uapi/linux/user_events.h')
-rw-r--r--include/uapi/linux/user_events.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/uapi/linux/user_events.h b/include/uapi/linux/user_events.h
index 22521bc622db..3e7275e3234a 100644
--- a/include/uapi/linux/user_events.h
+++ b/include/uapi/linux/user_events.h
@@ -46,6 +46,27 @@ struct user_reg {
__u32 write_index;
} __attribute__((__packed__));
+/*
+ * Describes an event unregister, callers must set the size, address and bit.
+ * This structure is passed to the DIAG_IOCSUNREG ioctl to disable bit updates.
+ */
+struct user_unreg {
+ /* Input: Size of the user_unreg structure being used */
+ __u32 size;
+
+ /* Input: Bit to unregister */
+ __u8 disable_bit;
+
+ /* Input: Reserved, set to 0 */
+ __u8 __reserved;
+
+ /* Input: Reserved, set to 0 */
+ __u16 __reserved2;
+
+ /* Input: Address to unregister */
+ __u64 disable_addr;
+} __attribute__((__packed__));
+
#define DIAG_IOC_MAGIC '*'
/* Request to register a user_event */
@@ -54,4 +75,7 @@ struct user_reg {
/* Request to delete a user_event */
#define DIAG_IOCSDEL _IOW(DIAG_IOC_MAGIC, 1, char *)
+/* Requests to unregister a user_event */
+#define DIAG_IOCSUNREG _IOW(DIAG_IOC_MAGIC, 2, struct user_unreg*)
+
#endif /* _UAPI_LINUX_USER_EVENTS_H */