1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
3 * Copyright (c) 2021, Microsoft Corporation.
8 #ifndef _UAPI_LINUX_USER_EVENTS_H
9 #define _UAPI_LINUX_USER_EVENTS_H
11 #include <linux/types.h>
12 #include <linux/ioctl.h>
15 #include <linux/uio.h>
20 #define USER_EVENTS_SYSTEM "user_events"
21 #define USER_EVENTS_PREFIX "u:"
23 /* Bits 0-6 are for known probe types, Bit 7 is for unknown probes */
24 #define EVENT_BIT_FTRACE 0
25 #define EVENT_BIT_PERF 1
26 #define EVENT_BIT_OTHER 7
28 #define EVENT_STATUS_FTRACE (1 << EVENT_BIT_FTRACE)
29 #define EVENT_STATUS_PERF (1 << EVENT_BIT_PERF)
30 #define EVENT_STATUS_OTHER (1 << EVENT_BIT_OTHER)
32 /* Create dynamic location entry within a 32-bit value */
33 #define DYN_LOC(offset, size) ((size) << 16 | (offset))
36 * Describes an event registration and stores the results of the registration.
37 * This structure is passed to the DIAG_IOCSREG ioctl, callers at a minimum
38 * must set the size and name_args before invocation.
42 /* Input: Size of the user_reg structure being used */
45 /* Input: Pointer to string with event name, description and flags */
48 /* Output: Byte index of the event within the status page */
51 /* Output: Index of the event to use when writing data */
55 #define DIAG_IOC_MAGIC '*'
57 /* Requests to register a user_event */
58 #define DIAG_IOCSREG _IOWR(DIAG_IOC_MAGIC, 0, struct user_reg*)
60 /* Requests to delete a user_event */
61 #define DIAG_IOCSDEL _IOW(DIAG_IOC_MAGIC, 1, char*)
63 #endif /* _UAPI_LINUX_USER_EVENTS_H */