|  | 
| 11 | 11 | #endif | 
| 12 | 12 | #include "ep-getter-setter.h" | 
| 13 | 13 | 
 | 
|  | 14 | +#if HAVE_LINUX_USER_EVENTS_H | 
|  | 15 | +#include <linux/user_events.h> // DIAG_IOCSREG | 
|  | 16 | +#else // HAVE_LINUX_USER_EVENTS_H | 
|  | 17 | +/* | 
|  | 18 | + * Describes an event registration and stores the results of the registration. | 
|  | 19 | + * This structure is passed to the DIAG_IOCSREG ioctl, callers at a minimum | 
|  | 20 | + * must set the size and name_args before invocation. | 
|  | 21 | + */ | 
|  | 22 | +struct user_reg { | 
|  | 23 | + | 
|  | 24 | +	/* Input: Size of the user_reg structure being used */ | 
|  | 25 | +	uint32_t size; | 
|  | 26 | + | 
|  | 27 | +	/* Input: Bit in enable address to use */ | 
|  | 28 | +	uint8_t enable_bit; | 
|  | 29 | + | 
|  | 30 | +	/* Input: Enable size in bytes at address */ | 
|  | 31 | +	uint8_t enable_size; | 
|  | 32 | + | 
|  | 33 | +	/* Input: Flags to use, if any */ | 
|  | 34 | +	uint16_t flags; | 
|  | 35 | + | 
|  | 36 | +	/* Input: Address to update when enabled */ | 
|  | 37 | +	uint64_t enable_addr; | 
|  | 38 | + | 
|  | 39 | +	/* Input: Pointer to string with event name, description and flags */ | 
|  | 40 | +	uint64_t name_args; | 
|  | 41 | + | 
|  | 42 | +	/* Output: Index of the event to use when writing data */ | 
|  | 43 | +	uint32_t write_index; | 
|  | 44 | +}; | 
|  | 45 | + | 
|  | 46 | +/* | 
|  | 47 | + * Describes an event unregister, callers must set the size, address and bit. | 
|  | 48 | + * This structure is passed to the DIAG_IOCSUNREG ioctl to disable bit updates. | 
|  | 49 | + */ | 
|  | 50 | +struct user_unreg { | 
|  | 51 | +	/* Input: Size of the user_unreg structure being used */ | 
|  | 52 | +	uint32_t size; | 
|  | 53 | + | 
|  | 54 | +	/* Input: Bit to unregister */ | 
|  | 55 | +	uint8_t disable_bit; | 
|  | 56 | + | 
|  | 57 | +	/* Input: Reserved, set to 0 */ | 
|  | 58 | +	uint8_t _reserved; | 
|  | 59 | + | 
|  | 60 | +	/* Input: Reserved, set to 0 */ | 
|  | 61 | +	uint16_t _reserved2; | 
|  | 62 | + | 
|  | 63 | +	/* Input: Address to unregister */ | 
|  | 64 | +	uint64_t disable_addr; | 
|  | 65 | +}; | 
|  | 66 | + | 
|  | 67 | +/* Request to register a user_event */ | 
|  | 68 | +#define DIAG_IOCSREG 0xC0082A00 | 
|  | 69 | + | 
|  | 70 | +/* Requests to unregister a user_event */ | 
|  | 71 | +#define DIAG_IOCSUNREG 0x40082A02 | 
|  | 72 | + | 
|  | 73 | +#endif // HAVE_LINUX_USER_EVENTS_H | 
|  | 74 | + | 
| 14 | 75 | /* | 
| 15 | 76 |  * EventPipeSessionProviderTracepoint. | 
| 16 | 77 |  */ | 
|  | 
0 commit comments