Skip to content

Commit

Permalink
Update Signpost and tracing API (#185)
Browse files Browse the repository at this point in the history
* Update Signpost

* Update Tracing

* Fix missing Signpost API call
  • Loading branch information
Kyle-Ye authored Jan 25, 2025
1 parent 74c4d2f commit 866bb21
Show file tree
Hide file tree
Showing 5 changed files with 282 additions and 88 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// OpenSwiftUICore
//
// Audited for iOS 18.0
// Status: Blocked by Tracing
// Status: Complete

import OpenGraphShims

Expand Down Expand Up @@ -55,8 +55,9 @@ struct EnvironmentalViewChild<V>: StatefulRule, AsyncAttribute, CustomStringConv
guard shouldReset else { return }
tracker.reset()
tracker.initializeValues(from: env.plist)
// TODO: Tracing
value = view.body(environment: env)
value = traceBody(V.self) {
view.body(environment: env)
}
}

var description: String {
Expand Down
26 changes: 23 additions & 3 deletions Sources/OpenSwiftUICore/Data/Update.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// OpenSwiftUI
//
// Audited for iOS 18.0
// Status: Blocked by Signpost
// Status: Complete
// ID: EA173074DA35FA471DC70643259B7E74 (SwiftUI)
// ID: 61534957AEEC2EDC447ABDC13B4D426F (SwiftUICore)

Expand Down Expand Up @@ -68,14 +68,34 @@ package enum Update {
lock()
depth += 1
if depth == 1 {
// TODO: Signpost.renderUpdate.trace + trackHost
#if canImport(Darwin)
Signpost.viewHost.traceEvent(
type: .begin,
object: trackHost,
"", // TODO: For os_log use
[
0,
UInt(bitPattern: Unmanaged.passUnretained(trackHost).toOpaque()),
]
)
#endif
}
}

package static func end() {
if depth == 1 {
dispatchActions()
// TODO: Signpost.renderUpdate.trace + trackHost
#if canImport(Darwin)
Signpost.viewHost.traceEvent(
type: .end,
object: trackHost,
"", // TODO: For os_log use
[
0,
UInt(bitPattern: Unmanaged.passUnretained(trackHost).toOpaque()),
]
)
#endif
}
depth -= 1
unlock()
Expand Down
Loading

0 comments on commit 866bb21

Please sign in to comment.