| ... | @@ -3814,3 +3814,35 @@ pub fn machTaskForPid(pid: std.os.pid_t) MachError!MachTask { | ... | @@ -3814,3 +3814,35 @@ pub fn machTaskForPid(pid: std.os.pid_t) MachError!MachTask { |
| 3814 | pub fn machTaskForSelf() MachTask { | 3814 | pub fn machTaskForSelf() MachTask { |
| 3815 | return .{ .port = mach_task_self() }; | 3815 | return .{ .port = mach_task_self() }; |
| 3816 | } | 3816 | } |
| | 3817 | |
| | 3818 | pub const os_signpost_id_t = u64; |
| | 3819 | |
| | 3820 | pub const OS_SIGNPOST_ID_NULL: os_signpost_id_t = 0; |
| | 3821 | pub const OS_SIGNPOST_ID_INVALID: os_signpost_id_t = !0; |
| | 3822 | pub const OS_SIGNPOST_ID_EXCLUSIVE: os_signpost_id_t = 0xeeeeb0b5b2b2eeee; |
| | 3823 | |
| | 3824 | pub const os_log_t = opaque {}; |
| | 3825 | pub const os_log_type_t = enum(u8) { |
| | 3826 | /// default messages always captures |
| | 3827 | OS_LOG_TYPE_DEFAULT = 0x00, |
| | 3828 | /// messages with additional infos |
| | 3829 | OS_LOG_TYPE_INFO = 0x01, |
| | 3830 | /// debug messages |
| | 3831 | OS_LOG_TYPE_DEBUG = 0x02, |
| | 3832 | /// error messages |
| | 3833 | OS_LOG_TYPE_ERROR = 0x10, |
| | 3834 | /// unexpected conditions messages |
| | 3835 | OS_LOG_TYPE_FAULT = 0x11, |
| | 3836 | }; |
| | 3837 | |
| | 3838 | pub const OS_LOG_CATEGORY_POINTS_OF_INTEREST: *const u8 = "PointsOfInterest"; |
| | 3839 | pub const OS_LOG_CATEGORY_DYNAMIC_TRACING: *const u8 = "DynamicTracing"; |
| | 3840 | pub const OS_LOG_CATEGORY_DYNAMIC_STACK_TRACING: *const u8 = "DynamicStackTracing"; |
| | 3841 | |
| | 3842 | pub extern "c" fn os_log_create(subsystem: [*]const u8, category: [*]const u8) os_log_t; |
| | 3843 | pub extern "c" fn os_log_type_enabled(log: os_log_t, tpe: os_log_type_t) bool; |
| | 3844 | pub extern "c" fn os_signpost_id_generate(log: os_log_t) os_signpost_id_t; |
| | 3845 | pub extern "c" fn os_signpost_interval_begin(log: os_log_t, signpos: os_signpost_id_t, func: [*]const u8, ...) void; |
| | 3846 | pub extern "c" fn os_signpost_interval_end(log: os_log_t, signpos: os_signpost_id_t, func: [*]const u8, ...) void; |
| | 3847 | pub extern "c" fn os_signpost_id_make_with_pointer(log: os_log_t, ptr: ?*anyopaque) os_signpost_id_t; |
| | 3848 | pub extern "c" fn os_signpost_enabled(log: os_log_t) bool; |