2 * Copyright (c) 2015-2016 Apple Inc. All rights reserved.
4 * @APPLE_APACHE_LICENSE_HEADER_START@
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
18 * @APPLE_APACHE_LICENSE_HEADER_END@
21 #ifndef __FIREHOSE_TYPES_PRIVATE__
22 #define __FIREHOSE_TYPES_PRIVATE__
24 #include <mach/mach_types.h>
25 #include <mach/std_types.h>
28 OS_ASSUME_NONNULL_BEGIN
33 * @enum firehose_activity_flags_t
36 * The lower 8 bits are or-ed in the upper 8 bits of Activity ID and propagated
37 * to children activities
39 OS_ENUM(firehose_activity_flags
, unsigned long,
40 firehose_activity_flags_default
= 0x0000,
42 firehose_activity_flags_info_mode
= 0x0001,
43 firehose_activity_flags_debug_mode
= 0x0002,
44 firehose_activity_flags_stream_live_mode
= 0x0004,
46 firehose_activity_flags_precise_timestamp
= 0x0080,
50 * @typedef firehose_activity_id_t
53 * Opaque activity identifier.
56 * Scalar value type, not reference counted.
58 typedef uint64_t firehose_activity_id_t
;
59 #define FIREHOSE_ACTIVITY_ID_NULL ((firehose_activity_id_t)0)
60 #define FIREHOSE_ACTIVITY_ID_INVALID ((firehose_activity_id_t)~0ULL)
61 #define FIREHOSE_ACTIVITY_ID_FLAGS_SHIFT 56
62 #define FIREHOSE_ACTIVITY_ID_FLAGS(aid) \
63 ((firehose_activity_flags_t)((aid) >> FIREHOSE_ACTIVITY_ID_FLAGS_SHIFT))
64 #define FIREHOSE_ACTIVITY_ID_MERGE_FLAGS(aid, flags) (\
65 ((firehose_activity_id_t)(aid)) | \
66 ((firehose_activity_id_t)(flags) << FIREHOSE_ACTIVITY_ID_FLAGS_SHIFT))
69 * @enum firehose_stream_t
71 OS_ENUM(firehose_stream
, uint8_t,
72 firehose_stream_persist
= 0,
73 firehose_stream_special
= 1,
74 firehose_stream_memory
= 2,
75 firehose_stream_metadata
= 3,
76 firehose_stream_memory_high_traffic
= 4,
77 firehose_stream_memory_wifi
= 5,
78 firehose_stream_memory_baseband
= 6,
84 * @enum firehose_tracepoint_namespace_t
87 * Namespaces of tracepoints.
89 OS_ENUM(firehose_tracepoint_namespace
, uint8_t,
90 firehose_tracepoint_namespace_activity
= 0x02,
91 firehose_tracepoint_namespace_trace
= 0x03,
92 firehose_tracepoint_namespace_log
= 0x04,
93 firehose_tracepoint_namespace_metadata
= 0x05,
94 firehose_tracepoint_namespace_signpost
= 0x06,
98 * @enum firehose_tracepoint_code_t
101 * Codes of tracepoints.
103 OS_ENUM(firehose_tracepoint_code
, uint32_t,
104 firehose_tracepoint_code_load
= 0x01,
105 firehose_tracepoint_code_unload
= 0x02,
109 * @typedef firehose_tracepoint_type_t
112 * Type of tracepoints.
114 typedef uint8_t firehose_tracepoint_type_t
;
117 * @typedef firehose_tracepoint_flags_t
120 * Flags for tracepoints.
122 OS_ENUM(firehose_tracepoint_flags
, uint16_t,
123 _firehose_tracepoint_flags_base_has_current_aid
= 0x0001,
124 #define _firehose_tracepoint_flags_pc_style_mask (0x0007 << 1)
125 _firehose_tracepoint_flags_pc_style_none
= 0x0000 << 1,
126 _firehose_tracepoint_flags_pc_style_main_exe
= 0x0001 << 1,
127 _firehose_tracepoint_flags_pc_style_shared_cache
= 0x0002 << 1,
128 _firehose_tracepoint_flags_pc_style_main_plugin
= 0x0003 << 1,
129 _firehose_tracepoint_flags_pc_style_absolute
= 0x0004 << 1,
130 _firehose_tracepoint_flags_pc_style_uuid_relative
= 0x0005 << 1,
131 _firehose_tracepoint_flags_pc_style__unused6
= 0x0006 << 1,
132 _firehose_tracepoint_flags_pc_style__unused7
= 0x0007 << 1,
133 _firehose_tracepoint_flags_base_has_unique_pid
= 0x0010,
137 * @typedef firehose_tracepoint_id_t
140 * Opaque tracepoint identifier.
142 typedef uint64_t firehose_tracepoint_id_t
;
145 * @enum _firehose_tracepoint_type_activity_t
148 * Types of Activity tracepoints (namespace activity).
150 OS_ENUM(_firehose_tracepoint_type_activity
, firehose_tracepoint_type_t
,
151 _firehose_tracepoint_type_activity_create
= 0x01,
152 _firehose_tracepoint_type_activity_swap
= 0x02,
153 _firehose_tracepoint_type_activity_useraction
= 0x03,
157 * @enum firehose_tracepoint_flags_activity_t
160 * Flags for Activity tracepoints (namespace activity).
162 OS_ENUM(_firehose_tracepoint_flags_activity
, uint16_t,
163 _firehose_tracepoint_flags_activity_user_interface
= 0x0100,
164 _firehose_tracepoint_flags_activity_has_other_aid
= 0x0200,
168 * @enum firehose_tracepoint_type_trace_t
171 * Types of trace tracepoints (namespace trace).
173 OS_ENUM(_firehose_tracepoint_type_trace
, firehose_tracepoint_type_t
,
174 _firehose_tracepoint_type_trace_default
= 0x00,
175 _firehose_tracepoint_type_trace_info
= 0x01,
176 _firehose_tracepoint_type_trace_debug
= 0x02,
177 _firehose_tracepoint_type_trace_error
= 0x10,
178 _firehose_tracepoint_type_trace_fault
= 0x11,
182 * @enum firehose_tracepoint_type_log_t
185 * Types of Log tracepoints (namespace log).
187 OS_ENUM(_firehose_tracepoint_type_log
, firehose_tracepoint_type_t
,
188 _firehose_tracepoint_type_log_default
= 0x00,
189 _firehose_tracepoint_type_log_info
= 0x01,
190 _firehose_tracepoint_type_log_debug
= 0x02,
191 _firehose_tracepoint_type_log_error
= 0x10,
192 _firehose_tracepoint_type_log_fault
= 0x11,
196 * @enum firehose_tracepoint_flags_log_t
199 * Flags for Log tracepoints (namespace log).
201 OS_ENUM(_firehose_tracepoint_flags_log
, uint16_t,
202 _firehose_tracepoint_flags_log_has_private_data
= 0x0100,
203 _firehose_tracepoint_flags_log_has_subsystem
= 0x0200,
204 _firehose_tracepoint_flags_log_has_rules
= 0x0400,
205 _firehose_tracepoint_flags_log_has_oversize
= 0x0800,
209 * @enum _firehose_tracepoint_type_metadata_t
212 * Types for metadata tracepoints (namespace metadata).
214 OS_ENUM(_firehose_tracepoint_type_metadata
, firehose_tracepoint_type_t
,
215 _firehose_tracepoint_type_metadata_dyld
= 0x01,
216 _firehose_tracepoint_type_metadata_subsystem
= 0x02,
217 _firehose_tracepoint_type_metadata_kext
= 0x03,
221 * @enum firehose_tracepoint_type_signpost_t
224 * Types of Log tracepoints (namespace signpost).
226 OS_ENUM(_firehose_tracepoint_type_signpost
, firehose_tracepoint_type_t
,
227 _firehose_tracepoint_type_signpost_event
= 0x00,
228 _firehose_tracepoint_type_signpost_interval_begin
= 0x01,
229 _firehose_tracepoint_type_signpost_interval_end
= 0x02,
231 _firehose_tracepoint_type_signpost_scope_mask
= 0xc0,
232 _firehose_tracepoint_type_signpost_scope_thread
= 0x40,
233 _firehose_tracepoint_type_signpost_scope_process
= 0x80,
234 _firehose_tracepoint_type_signpost_scope_system
= 0xc0,
238 * @enum firehose_tracepoint_flags_signpost_t
241 * Flags for Log tracepoints (namespace signpost).
243 OS_ENUM(_firehose_tracepoint_flags_signpost
, uint16_t,
244 _firehose_tracepoint_flags_signpost_has_private_data
= 0x0100,
245 _firehose_tracepoint_flags_signpost_has_subsystem
= 0x0200,
246 _firehose_tracepoint_flags_signpost_has_rules
= 0x0400,
247 _firehose_tracepoint_flags_signpost_has_oversize
= 0x0800,
250 /* MIG firehose push reply structure */
251 typedef struct firehose_push_reply_s
{
252 uint64_t fpr_mem_flushed_pos
;
253 uint64_t fpr_io_flushed_pos
;
254 } firehose_push_reply_t
;
256 typedef struct firehose_buffer_map_info_s
{
257 mach_vm_address_t fbmi_addr
;
258 mach_vm_size_t fbmi_size
;
259 } firehose_buffer_map_info_t
;
261 #define FIREHOSE_PUSH_REPLY_CORRUPTED ((firehose_push_reply_t){ ~0ULL, ~0ULL })
263 typedef union firehose_buffer_u
*firehose_buffer_t
;
267 OS_ASSUME_NONNULL_END
269 #endif // __FIREHOSE_TYPES_PRIVATE__