Skip to content

Commit 866bb21

Browse files
authored
Update Signpost and tracing API (#185)
* Update Signpost * Update Tracing * Fix missing Signpost API call
1 parent 74c4d2f commit 866bb21

File tree

5 files changed

+282
-88
lines changed

5 files changed

+282
-88
lines changed

Sources/OpenSwiftUICore/Data/Environment/EnvironmentalView.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// OpenSwiftUICore
44
//
55
// Audited for iOS 18.0
6-
// Status: Blocked by Tracing
6+
// Status: Complete
77

88
import OpenGraphShims
99

@@ -55,8 +55,9 @@ struct EnvironmentalViewChild<V>: StatefulRule, AsyncAttribute, CustomStringConv
5555
guard shouldReset else { return }
5656
tracker.reset()
5757
tracker.initializeValues(from: env.plist)
58-
// TODO: Tracing
59-
value = view.body(environment: env)
58+
value = traceBody(V.self) {
59+
view.body(environment: env)
60+
}
6061
}
6162

6263
var description: String {

Sources/OpenSwiftUICore/Data/Update.swift

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// OpenSwiftUI
44
//
55
// Audited for iOS 18.0
6-
// Status: Blocked by Signpost
6+
// Status: Complete
77
// ID: EA173074DA35FA471DC70643259B7E74 (SwiftUI)
88
// ID: 61534957AEEC2EDC447ABDC13B4D426F (SwiftUICore)
99

@@ -68,14 +68,34 @@ package enum Update {
6868
lock()
6969
depth += 1
7070
if depth == 1 {
71-
// TODO: Signpost.renderUpdate.trace + trackHost
71+
#if canImport(Darwin)
72+
Signpost.viewHost.traceEvent(
73+
type: .begin,
74+
object: trackHost,
75+
"", // TODO: For os_log use
76+
[
77+
0,
78+
UInt(bitPattern: Unmanaged.passUnretained(trackHost).toOpaque()),
79+
]
80+
)
81+
#endif
7282
}
7383
}
7484

7585
package static func end() {
7686
if depth == 1 {
7787
dispatchActions()
78-
// TODO: Signpost.renderUpdate.trace + trackHost
88+
#if canImport(Darwin)
89+
Signpost.viewHost.traceEvent(
90+
type: .end,
91+
object: trackHost,
92+
"", // TODO: For os_log use
93+
[
94+
0,
95+
UInt(bitPattern: Unmanaged.passUnretained(trackHost).toOpaque()),
96+
]
97+
)
98+
#endif
7999
}
80100
depth -= 1
81101
unlock()

0 commit comments

Comments
 (0)