Skip to content

Commit 4116264

Browse files
committed
Worked on Apple Unified Logging format support
1 parent 785cfaf commit 4116264

File tree

8 files changed

+872
-340
lines changed

8 files changed

+872
-340
lines changed

documentation/Apple Unified Logging and Activity Tracing formats.asciidoc

Lines changed: 52 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -298,10 +298,10 @@ The header (chunk) is 224 bytes of size and consists of:
298298
| 4 | 4 | 0x0011 | Chunk sub tag (subtag)
299299
| 8 | 8 | 208 | Chunk data size (length)
300300
4+| _Chunk data (tracev3_chunk_header)_
301-
| 16 | 4 | | Mach timebase numerator (first number in timebase # / #)
302-
| 20 | 4 | | Mach timebase denominator (second number in timebase # / #)
301+
| 16 | 4 | | Timebase numerator (first number in timebase # / #)
302+
| 20 | 4 | | Timebase denominator (second number in timebase # / #)
303303
| 24 | 8 | | Start time +
304-
Contains a continuous time
304+
Contains a Mach continuous timestamp
305305
| 32 | 4 | | [yellow-background]*Unknown time (related to starttime?)* +
306306
Contains number of seconds since January 1, 1970 00:00:00 UTC (POSIX epoch), disregarding leap seconds
307307
| 36 | 4 | | [yellow-background]*Unknown*
@@ -341,7 +341,8 @@ The header continuous time sub chunk is 16 bytes of size and consist of:
341341
| 4 | 4 | | Sub chunk data size +
342342
The size value does not include the 8 bytes of the sub chunk tag and data size
343343
4+| _The continuous time sub chunk data (tracev3_subchunk_continuous)_
344-
| 8 | 8 | | Continuous time (value data related to starttime?)
344+
| 8 | 8 | | Continuous time +
345+
Contains a Mach continuous timestamp
345346
|===
346347

347348
==== [[header_system_information_sub_chunk]]Header system information sub chunk
@@ -423,7 +424,7 @@ The offset is relative to the start of the catalog UUIDs
423424
| 24 | 2 | | Number of sub chunks
424425
| 26 | 6 | | [yellow-background]*Unknown (Reserved or Padding)*
425426
| 32 | 8 | | Earliest firehose timestamp +
426-
Contains continuous time
427+
Contains a Mach continuous timestamp
427428
| 40 | 16 x ... | | Catalog UUIDs +
428429
Contains an array of UUIDs stored in big-endian
429430
| ... | ... | | Catalog sub system strings +
@@ -501,8 +502,10 @@ The catalog sub chunk describes metadata for the chunk to follow and consists of
501502
[cols="1,1,1,5",options="header"]
502503
|===
503504
| Offset | Size | Value | Description
504-
| 0 | 8 | | Start (earliest) continuous time
505-
| 8 | 8 | | End (latest) continuous time
505+
| 0 | 8 | | Start (earliest) continuous time +
506+
Contains a Mach continuous timestamp
507+
| 8 | 8 | | End (latest) continuous time +
508+
Contains a Mach continuous timestamp
506509
| 16 | 4 | | Uncompressed size of chunk
507510
| 20 | 4 | 0x100 | Compression algorithm used (0x100 = LZ4)
508511
| 24 | 4 | | Number of indexes (num_indexes or procinfos)
@@ -599,7 +602,8 @@ Contains 4096 (0x1000) if there is no private data and `-(4096 - offset)` as off
599602
| 36 | 2 | | [yellow-background]*Unknown*
600603
| 38 | 1 | | Stream type
601604
| 39 | 1 | | [yellow-background]*Unknown3*
602-
| 40 | 8 | | Base continuous time for events in the firehose chunk
605+
| 40 | 8 | | Base continuous time for events in the firehose chunk +
606+
Contains a Mach continuous timestamp
603607
4+|
604608
| 48 | data size | | data +
605609
Contains one or more <<tracev3_firehose_tracepoint,Firehose tracepoints>>
@@ -792,11 +796,11 @@ Contains inline data or a value data range
792796
[cols="1,1,5",options="header"]
793797
|===
794798
| Value | Identifier | Description
795-
| 0x00 | | [yellow-background]*Unknown (floating-point value?)* +
799+
| 0x00 | | [yellow-background]*Unknown (integer or floating-point value)* +
796800
Contains a 32-bit or 64-bit value
797801
| 0x01 | | [yellow-background]*Unknown (private value)* +
798802
Contains a 32-bit value, formatted as "<private>"
799-
| 0x02 | | [yellow-background]*Unknown (integer)* +
803+
| 0x02 | | [yellow-background]*Unknown (integer or floating-point value)* +
800804
Contains a 8-bit, 16-bit, 32-bit or 64-bit value
801805
3+|
802806
| 0x10 | | [yellow-background]*Unknown (integer format precision)* +
@@ -918,6 +922,8 @@ Contains the delta relative to the base continuous time in the <<tracev3_firehos
918922
Note that "has private data range flag (0x0100)" has been observed to be set
919923
but without any obvious changes to the activity firehose tracepoint structure.
920924

925+
[yellow-background]*TODO: determine meaning of MSB of UUID entry load address (lower 32-bit)*
926+
921927
==== [[tracev3_firehose_tracepoint_trace]]Trace firehose tracepoint
922928

923929
A trace firehose tracepoint is variable of size and consists of:
@@ -989,6 +995,8 @@ Where the range offset is a virtual private strings offset in the <<tracev3_fire
989995
| ... | ... | | 64-bit alignment padding
990996
|===
991997

998+
[yellow-background]*TODO: determine meaning of MSB of UUID entry load address (lower 32-bit)*
999+
9921000
==== [[tracev3_firehose_tracepoint_singpost]]Signpost firehose tracepoint
9931001

9941002
A signpost firehose tracepoint is variable of size and consists of:
@@ -1039,6 +1047,8 @@ Where the range offset is a virtual private strings offset in the <<tracev3_fire
10391047
| ... | ... | | 64-bit alignment padding
10401048
|===
10411049

1050+
[yellow-background]*TODO: determine meaning of MSB of UUID entry load address (lower 32-bit)*
1051+
10421052
==== [[tracev3_firehose_tracepoint_loss]]Loss firehose tracepoint
10431053

10441054
A loss firehose tracepoint is variable of size and consists of:
@@ -1135,6 +1145,7 @@ Other observerd value type decoders are:
11351145
| "mdnsresponder:domain_name" | |
11361146
| "mdnsresponder:ip_addr" | | Formatted as a <<mdnsresponder_ip_address,mDNSResponder IP address>>
11371147
| "mdnsresponder:mac_addr" | | Formatted as a <<mdnsresponder_mac_address,mDNSResponder MAC address>>
1148+
| "name=NAME" | | Name formatting argument, where NAME is the name of the value, which has no additional formatting
11381149
| "network:in_addr" | | Formatted as an IPv4 address, for example "127.0.0.1"
11391150
| "network:in6_addr" | | Formatted as an IPv6 address, for example "fe80::f:86ff:fee9:5c16"
11401151
| "network:sockaddr" | |
@@ -1144,9 +1155,14 @@ Other observerd value type decoders are:
11441155
| "odtypes:mbr_details" | |
11451156
| "odtypes:mbridtype" | |
11461157
| "odtypes:nt_sid_t" | |
1147-
| "sensitive" | | Sensitive log argument, which is formatted as "<private>"
1148-
| "private" | | Private log argument, which is formatted as "<private>"
1149-
| "public" | | Public log argument, which has no additional formatting
1158+
| "sensitive" | | Sensitive formatting argument, which is formatted as "<private>"
1159+
| "signpost.description:attribute" | | Formatted as a signpost description attribute, for example `__##__signpost.description#____#attribute#_##_#efilogin-helper##__##`
1160+
| "signpost.description:begin_time" | | Formatted as a signpost description begin time, for example `__##__signpost.description#____#begin_time#_##_#2180300470618##__##`
1161+
| "signpost.description:end_time" | | Formatted as a signpost description end time, for example `__##__signpost.description#____#end_time#_##_#1005756624719##__##`
1162+
| "signpost.telemetry:number1" | | For example `__##__signpost.telemetry#____#number1#_##_#5.8203125##__##`
1163+
| "signpost.telemetry:string1" | | For example `__##__signpost.telemetry#____#string1#_##_#executeQueryBegin##__##`
1164+
| "private" | | Private formatting argument, which is formatted as "<private>"
1165+
| "public" | | Public formatting argument, which has no additional formatting
11501166
|===
11511167

11521168
[NOTE]
@@ -1238,7 +1254,8 @@ The oversize chunk is variable of size and consists of:
12381254
| 24 | 4 | | Second number in proc_id #@#
12391255
| 28 | 1 | | TTL
12401256
| 29 | 3 | 0 | [yellow-background]*Unknown (Reserved?)*
1241-
| 32 | 8 | | Continuous time
1257+
| 32 | 8 | | Timestamp +
1258+
Contains a Mach continuous timestamp
12421259
| 40 | 4 | | Data reference index
12431260
| 44 | 2 | | Size of public data
12441261
| 46 | 2 | | Size of private data
@@ -1265,16 +1282,17 @@ The StateDump chunk is variable of size and consists of:
12651282
| 24 | 4 | | Second number in proc_id #@#
12661283
| 28 | 1 | | TTL
12671284
| 29 | 3 | 0 | [yellow-background]*Unknown (Reserved?)*
1268-
| 32 | 8 | | Continuous time
1285+
| 32 | 8 | | Timestamp +
1286+
Contains a Mach continuous timestamp
12691287
| 40 | 8 | | Activity identifier
12701288
| 48 | 16 | | [yellow-background]*Unknown identifier* +
12711289
Contains a UUID stored in big-endian
12721290
| 64 | 4 | | Data type
12731291
| 68 | 4 | | Data size
12741292
| 72 | 64 | | [yellow-background]*Unknown* +
1275-
[yellow-background]*Oncly used when data type is 3?*
1293+
[yellow-background]*Only used when data type is 3?*
12761294
| 136 | 64 | | [yellow-background]*Unknown* +
1277-
[yellow-background]*Oncly used when data type is 3?*
1295+
[yellow-background]*Only used when data type is 3?*
12781296
| 200 | 64 | | Name +
12791297
Contains an UTF-8 formatted string with an end-of-string character
12801298
| 264 | data size | | Data
@@ -1308,7 +1326,7 @@ The SimpleDump chunk is variable of size and consists of:
13081326
| 29 | 1 | | Type
13091327
| 29 | 2 | 0 | [yellow-background]*Unknown (Reserved?)*
13101328
| 32 | 8 | | Timestamp +
1311-
Contains a continuous time
1329+
Contains a Mach continuous timestamp
13121330
| 40 | 8 | | Thread identifier
13131331
| 48 | 8 | | Offset
13141332
| 56 | 16 | | Sender identifier +
@@ -1356,14 +1374,14 @@ The timesync boot record is 48 bytes of size and consists of:
13561374
| Offset | Size | Value | Description
13571375
| 0 | 2 | "\xb0\xbb" | Signature
13581376
| 2 | 2 | 48 | Size of record
1359-
| 4 | 4 | | [yellow-background]*Unknown*
1377+
| 4 | 4 | | [yellow-background]*Unknown (Seen: 0)*
13601378
| 8 | 16 | | Boot identifier (boot UUID)
1361-
| 24 | 4 | | Timebase numerator (first number in timebase # / #)
1362-
| 28 | 4 | | Timebase denominator (second number in timebase # / #)
1379+
| 24 | 4 | | (Mach) Timebase numerator (first number in timebase # / #)
1380+
| 28 | 4 | | (Mach) Timebase denominator (second number in timebase # / #)
13631381
| 32 | 8 | | Timestamp (or boot time) +
13641382
Signed integer that contains the number of nanoseconds since January 1, 1970 00:00:00 UTC or 0 if not set
13651383
| 40 | 4 | | Time zone offset in minutes +
1366-
Contains a signed integer
1384+
Contains a signed integer that contains the number of minutes relative from UTC, for example -60 represents UTC+1
13671385
| 44 | 4 | | Daylight savings (DST) flag (0 = no DST, 1 = DST)
13681386
|===
13691387

@@ -1383,14 +1401,13 @@ The timesync sync record is 32 bytes of size and consists of:
13831401
| Offset | Size | Value | Description
13841402
| 0 | 2 | "Ts" | Signature
13851403
| 2 | 2 | 32 | Size of record
1386-
| 4 | 4 | | [yellow-background]*Unknown (flags?)* +
1387-
Seen: 0 and 1
1404+
| 4 | 4 | | [yellow-background]*Unknown (Seen: 0 and 1)*
13881405
| 8 | 8 | | Kernel time +
13891406
Contains a Mach continuous timestamp
13901407
| 16 | 8 | | Timestamp (or wall time) +
13911408
Signed integer that contains the number of nanoseconds since January 1, 1970 00:00:00 UTC or 0 if not set
13921409
| 24 | 4 | | Time zone offset in minutes +
1393-
Contains a signed integer
1410+
Contains a signed integer that contains the number of minutes relative from UTC, for example -60 represents UTC+1
13941411
| 28 | 4 | | Daylight savings (DST) flag (0 = no DST, 1 = DST)
13951412
|===
13961413

@@ -1492,10 +1509,9 @@ and consist of:
14921509
| Offset | Size | Value | Description
14931510
| 0 | 4 | | (dsc) text offset
14941511
| 4 | 4 | | (dsc) text size
1495-
| 8 | 16 | | Sender (process or library) identifier +
1496-
Contains a UUID stored in big-endian +
1497-
[yellow-background]*Does this reference to the uuidtext file?*
1498-
| 24 | 4 | | Path offset +
1512+
| 8 | 16 | | Image (process or library) identifier +
1513+
Contains a UUID stored in big-endian
1514+
| 24 | 4 | | Image (process or library) path offset +
14991515
The offset is relative to the start of the file
15001516
|===
15011517

@@ -1509,10 +1525,9 @@ and consist of:
15091525
| Offset | Size | Value | Description
15101526
| 0 | 8 | | (dsc) text offset
15111527
| 8 | 4 | | (dsc) text size
1512-
| 12 | 16 | | Sender (process or library) identifier +
1513-
Contains a UUID stored in big-endian +
1514-
[yellow-background]*Does this reference to the uuidtext file?*
1515-
| 28 | 4 | | Path offset +
1528+
| 12 | 16 | | Image (process or library) identifier +
1529+
Contains a UUID stored in big-endian
1530+
| 28 | 4 | | Image (process or library) path offset +
15161531
The offset is relative to the start of the file
15171532
|===
15181533

@@ -1566,7 +1581,7 @@ The UUID text (uuidtext) entry descriptor is 8 bytes of size and consists of:
15661581
[cols="1,1,1,5",options="header"]
15671582
|===
15681583
| Offset | Size | Value | Description
1569-
| 0 | ... | | Path of sender process/library +
1584+
| 0 | ... | | Image (process or library) path +
15701585
Contains an UTF-8 formatted string with an end-of-string character
15711586
|===
15721587

@@ -1854,6 +1869,9 @@ Output starts with *.tracev3 files under "Signpost" followed by
18541869
}]
18551870
....
18561871

1872+
traceID consists of:
1873+
( fmt lower 32-bit << 32 ) | ( tp flags << 16 ) | ( tp log type << 8 ) | ( tp record type )
1874+
18571875
:numbered!:
18581876
[appendix]
18591877
== References

dtformats/aul_dsc.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ members:
9191
data_type: uint32
9292
- name: text_size
9393
data_type: uint32
94-
- name: sender_identifier
94+
- name: image_identifier
9595
data_type: uuid_be
9696
- name: path_offset
9797
data_type: uint32
@@ -106,7 +106,7 @@ members:
106106
data_type: uint64
107107
- name: text_size
108108
data_type: uint32
109-
- name: sender_identifier
109+
- name: image_identifier
110110
data_type: uuid_be
111111
- name: path_offset
112112
data_type: uint32

dtformats/aul_tracev3.yaml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,6 @@ attributes:
7575
size: 8
7676
units: bytes
7777
---
78-
name: float32
79-
type: floating-point
80-
attributes:
81-
size: 4
82-
units: bytes
83-
---
84-
name: float64
85-
type: floating-point
86-
attributes:
87-
size: 8
88-
units: bytes
89-
---
9078
name: cstring
9179
type: string
9280
encoding: utf8
@@ -141,6 +129,20 @@ attributes:
141129
size: 8
142130
units: bytes
143131
---
132+
name: float32le
133+
type: floating-point
134+
attributes:
135+
byte_order: little-endian
136+
size: 4
137+
units: bytes
138+
---
139+
name: float64le
140+
type: floating-point
141+
attributes:
142+
byte_order: little-endian
143+
size: 8
144+
units: bytes
145+
---
144146
name: uuid_be
145147
type: uuid
146148
attributes:
@@ -771,7 +773,7 @@ members:
771773
data_type: uint8
772774
- name: unknown2
773775
data_type: uint16
774-
- name: continuous_time
776+
- name: timestamp
775777
data_type: uint64
776778
- name: data_reference_index
777779
data_type: uint32
@@ -845,7 +847,7 @@ members:
845847
data_type: uint8
846848
- name: unknown2
847849
data_type: uint16
848-
- name: continuous_time
850+
- name: timestamp
849851
data_type: uint64
850852
- name: activity_identifier
851853
data_type: uint64

dtformats/aul_uuidtext.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ description: UUIDtext file footer.
7171
attributes:
7272
byte_order: little-endian
7373
members:
74-
- name: library_path
74+
- name: image_path
7575
type: string
7676
encoding: utf8
7777
element_data_type: char

0 commit comments

Comments
 (0)