Skip to content

Improvements to the trace analysis feature#62

Merged
AvdLee merged 2 commits into
AvdLee:mainfrom
polpielladev:improvement/signposts-and-multiple-runs
Apr 29, 2026
Merged

Improvements to the trace analysis feature#62
AvdLee merged 2 commits into
AvdLee:mainfrom
polpielladev:improvement/signposts-and-multiple-runs

Conversation

@polpielladev
Copy link
Copy Markdown
Contributor

While using the trace analysis feature of the skill, I came across two different things:

  • Signpost analysis was always returning empty
  • We did not handle multi-run traces

@AvdLee AvdLee requested a review from Copilot April 28, 2026 17:07
Copy link
Copy Markdown
Owner

@AvdLee AvdLee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but let's also see what Copilot has to say

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-runs support, threading run= through all lane analyzers and discovery commands.
  • Expanded signpost discovery to read both os-signpost-interval (pre-paired intervals) and os-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.

Comment thread swiftui-expert-skill/scripts/instruments_parser/xctrace.py
Comment thread swiftui-expert-skill/scripts/instruments_parser/events.py Outdated
Comment thread swiftui-expert-skill/scripts/analyze_trace.py
@AvdLee AvdLee merged commit 6e11d73 into AvdLee:main Apr 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants