Skip to content

Commit 05669cf

Browse files
committed
Worked on Apple Unified Logging format support
1 parent edb3484 commit 05669cf

File tree

4 files changed

+274
-134
lines changed

4 files changed

+274
-134
lines changed

documentation/Apple Unified Logging and Activity Tracing formats.asciidoc

Lines changed: 63 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ in the section entitled "GNU Free Documentation License".
5151
| 0.0.7 | J.B. Metz | August 2022 | Additional changes based on format analysis.
5252
| 0.0.8 | Fry | November 2022 | Additional changes based on format analysis.
5353
| 0.0.9 | J.B. Metz | May 2023 | Additional changes based on format analysis.
54+
| 0.0.10 | J.B. Metz | June 2023 | Additional changes based on format analysis.
5455
|===
5556

5657
:numbered:
@@ -1014,15 +1015,21 @@ Where the range offset is a virtual private strings offset in the <<tracev3_fire
10141015
| ... | 1 | | Number of data items
10151016
| ... | number of data items | | Array of data items +
10161017
See section: <<tracev3_firehose_tracepoint_data_item,Data item>>
1018+
4+| _Values data_
10171019
4+| _Has backtrace flag (0x1000) is set_
10181020
| ... | ... | | Backtrace data +
10191021
See section: <<tracev3_firehose_tracepoint_backtrace_data,Backtrace data>>
10201022
4+| _Common_
1021-
| ... | ... | | Values data
1023+
| ... | ... | | Data items values data
1024+
4+| _End of values data_
10221025
4+| _End of data_
10231026
| ... | ... | | 64-bit alignment padding
10241027
|===
10251028

1029+
[NOTE]
1030+
The backtrace data is stored as part of the values data. Value data offsets
1031+
of data items are relative from the start of the values data.
1032+
10261033
==== [[tracev3_firehose_tracepoint_singpost]]Signpost firehose tracepoint
10271034

10281035
A signpost firehose tracepoint is variable of size and consists of:
@@ -1076,7 +1083,9 @@ See section: <<tracev3_firehose_tracepoint_string_reference,String reference>>
10761083
| ... | 1 | | Number of data items
10771084
| ... | number of data items | | Array of data items +
10781085
See section: <<tracev3_firehose_tracepoint_data_item,Data item>>
1079-
| ... | ... | | Values data
1086+
4+| _Values data_
1087+
| ... | ... | | Data items values data
1088+
4+| _End of values data_
10801089
4+| _End of data_
10811090
| ... | ... | | 64-bit alignment padding
10821091
|===
@@ -1134,6 +1143,39 @@ To calculate a name string reference:
11341143
* ( name string reference upper 16-bit << 31 ) | ( name string reference lower 32-bit & 0x7fffffff )
11351144
* ( name string reference lower 32-bit & 0x7fffffff )
11361145

1146+
===== Invalid shared cache code pointer offset
1147+
1148+
....
1149+
tp 2872 + 117: log info (has_current_aid, has_large_offset, large_shared_cache, has_subsystem)
1150+
thread: 00000000000009ba
1151+
time: +42.683s
1152+
walltime: 1659846550 - 2022-08-07 06:29:10 (Sunday)
1153+
cur_aid: 8000000000001652
1154+
location: pc:0x8008ecf707e9 fmt:0x1117a0720
1155+
image uuid: CC386FB1-8C26-3CB7-8329-CC63095FCA7D
1156+
format: START %{public}@
1157+
error: ~~> <Invalid shared cache code pointer offset>
1158+
subsystem: 21 com.apple.reminderkit.utility
1159+
1160+
Format string reference : 0x117a0720
1161+
UUID entry load address (lower 32-bit) : 0xecf707e9
1162+
Large offset data : 0x8008
1163+
Large shared cache data : 0x0002
1164+
1165+
Calculated format string reference : 0x1117a0720
1166+
Strings file identifier : cc386fb1-8c26-3cb7-8329-cc63095fca7d
1167+
Image identifier : cc386fb1-8c26-3cb7-8329-cc63095fca7d
1168+
Load address : 0x8008ecf707e9
1169+
....
1170+
1171+
Observed behavior:
1172+
1173+
* Large shared cache data is used to calculate format string
1174+
* Image identifier = strings file identifier (value from Shared-Cache Strings (dsc) is not used)
1175+
* Image path is not set
1176+
* Image text offset is set to 0
1177+
* Load address = ( Large offset data << 32 ) | UUID entry load address (lower 32-bit)
1178+
11371179
==== [[tracev3_firehose_tracepoint_format_string]]Firehose tracepoint format string
11381180

11391181
Format string operators are defined in the following format:
@@ -1202,6 +1244,7 @@ Other observerd value type decoders are:
12021244
| "mdnsresponder:ip_addr" | | Formatted as a <<mdnsresponder_ip_address,mDNSResponder IP address>>
12031245
| "mdnsresponder:mac_addr" | | Formatted as a <<mdnsresponder_mac_address,mDNSResponder MAC address>>
12041246
| "name=NAME" | | Name formatting argument, where NAME is the name of the value, which has no additional formatting
1247+
| "Name:NAME" | | [yellow-background]*Unknown, see notes below*
12051248
| "network:in_addr" | | Formatted as an IPv4 address, for example "127.0.0.1"
12061249
| "network:in6_addr" | | Formatted as an IPv6 address, for example "fe80::f:86ff:fee9:5c16"
12071250
| "network:sockaddr" | |
@@ -1217,7 +1260,9 @@ Other observerd value type decoders are:
12171260
| "signpost.description:end_time" | | Formatted as a signpost description end time, for example `__##__signpost.description#____#end_time#_##_#1005756624719##__##`
12181261
| "signpost.telemetry:number1" | | For example `__##__signpost.telemetry#____#number1#_##_#5.88671875##__##`, where a avalue can be an integer or floating-point which is formatted as (at least) "%.9g"
12191262
| "signpost.telemetry:number2" | | For example `__##__signpost.telemetry#____#number2#_##_#6.05859375##__##`, where a avalue can be an integer or floating-point and which is formatted as (at least) "%.9g"
1263+
| "signpost.telemetry:number3" | | For example `__##__signpost.telemetry#____#number3#_##_#6.05859375##__##`, where a avalue can be an integer or floating-point and which is formatted as (at least) "%.9g"
12201264
| "signpost.telemetry:string1" | | For example `__##__signpost.telemetry#____#string1#_##_#executeQueryBegin##__##`
1265+
| "signpost.telemetry:string2" | | For example `__##__signpost.telemetry#____#string2#_##_#executeQueryBegin##__##`
12211266
| "private" | | Private formatting argument, which is formatted as "<private>"
12221267
| "public" | | Public formatting argument, which has no additional formatting
12231268
|===
@@ -1296,6 +1341,22 @@ The types are defined as:
12961341
| "X" | | Hexadecimal interger value, formatter in upper case
12971342
|===
12981343

1344+
===== Notes
1345+
1346+
For format string:
1347+
1348+
....
1349+
enableTelemetry=YES ResultCount=%{public, signpost.telemetry:number1, Name:ResultCount}ld DataSize=%{public, signpost.telemetry:number2, Name:DataSize}ld
1350+
....
1351+
1352+
Seen:
1353+
1354+
....
1355+
enableTelemetry=YES ResultCount=0 DataSize=256
1356+
....
1357+
1358+
Is "Name:NAME" used for some kind of formatting override?
1359+
12991360
=== Oversize chunk
13001361

13011362
The oversize chunk is variable of size and consists of:

0 commit comments

Comments
 (0)