Improvements to the trace analysis feature#62
Merged
AvdLee merged 2 commits intoApr 29, 2026
Conversation
AvdLee
approved these changes
Apr 28, 2026
Owner
AvdLee
left a comment
There was a problem hiding this comment.
LGTM but let's also see what Copilot has to say
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the Instruments trace analysis scripts used by the SwiftUI expert skill by fixing signpost parsing (previously yielding empty results) and adding proper support for multi-run .trace files.
Changes:
- Added a safe helper for selecting the first present XML column to avoid Element truthiness pitfalls that were dropping valid timestamps.
- Introduced per-run TOC metadata (
RunInfo) and added--run/--list-runssupport, threadingrun=through all lane analyzers and discovery commands. - Expanded signpost discovery to read both
os-signpost-interval(pre-paired intervals) andos-signpost(raw events) while avoiding duplicates.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| swiftui-expert-skill/scripts/instruments_parser/xml_utils.py | Adds first_present() to correctly choose between alternative timestamp keys. |
| swiftui-expert-skill/scripts/instruments_parser/xctrace.py | Refactors TOC parsing to be run-aware and exports schemas by run via XPath. |
| swiftui-expert-skill/scripts/instruments_parser/time_profiler.py | Plumbs run through to schema export. |
| swiftui-expert-skill/scripts/instruments_parser/swiftui.py | Plumbs run through to schema export for SwiftUI lane schemas. |
| swiftui-expert-skill/scripts/instruments_parser/hitches.py | Plumbs run through to schema export. |
| swiftui-expert-skill/scripts/instruments_parser/hangs.py | Plumbs run through to schema export. |
| swiftui-expert-skill/scripts/instruments_parser/events.py | Fixes signpost discovery: reads os-signpost-interval + os-signpost, pairs events, and avoids duplicates. |
| swiftui-expert-skill/scripts/instruments_parser/causes.py | Uses first_present() and plumbs run through to schema export. |
| swiftui-expert-skill/scripts/analyze_trace.py | Adds --run / --list-runs support and routes analysis/discovery to the selected run. |
| swiftui-expert-skill/references/trace-analysis.md | Documents multi-run usage and the new CLI flags. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While using the trace analysis feature of the skill, I came across two different things: