Repository navigation
Expose renderer threads and improve CPU call trees - #16
Merged
jackfranklin merged 4 commits intoNov 19, 2026
Merged
Conversation
kurtextrem
force-pushed
the
codex/trace-cpu-analysis
branch
4 times, most recently
from
November 19, 2026 13:13
6404427 to
09fcbbc
Compare
kurtextrem
marked this pull request as ready for review
November 19, 2026 13:14
jackfranklin
left a comment
Collaborator
There was a problem hiding this comment.
The core changes here look great — nice fixes for sample-invariant category attribution, on-demand top-down expansion, and --thread support. A few things before merging:
- Rebase onto
main: Now that #15 has been squash-merged, this branch has conflicts and needs a rebase ontomain. - Route
threadsthroughformatResult(): Insrc/cli.ts, thethreadshandler branches onargs.format === 'md'and callsformatThreadsMarkdown()directly. AddingThreadsResulttosrc/engine/types.tsand a'threads'case informatMarkdown()(src/formatters/markdown.ts) would keep formatting dispatch consistent with the other commands. - Add CLI tests for option validation: This fixes
--top -5,--bucket 0, andfindwithout--function/--url, so it would be good to add test cases intest/cli.test.tsasserting those rejections. - (Minor) In
extractOverview()(src/engine/extractors/overview.ts), the category filter checks!isProfileCall(event) && !isPhaseAsync(event.ph)withoutentryToNode?.has(event)(unlikerendererCpuFilter()insrc/engine/helpers.ts). Just confirming whether omittingentryToNode?.has(event)there is intentional.
This was referenced Nov 19, 2026
kurtextrem
force-pushed
the
codex/trace-cpu-analysis
branch
from
November 19, 2026 15:17
09fcbbc to
bc43d82
Compare
jackfranklin
approved these changes
Nov 19, 2026
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.
Add
threadsand--thread PID:TIDso CPU commands can inspect an out-of-process iframe. Use instrumented timeline events for the overview breakdown so optional CPU samples preserve category attribution.Long tasks show a representative source frame when available. Top-down rows show call paths, aggregate rows show the first event timestamp, and
tasks --url-onlyandfind --urlhelp locate source-backed activity. Validate result limits and profile bucket sizes, and require a function or URL forfind.Task listing and bottom-up ranking select candidates before formatting rows. The agent skill and command reference show how to select a renderer thread for an iframe.
Synthetic tests cover sample invariance, call paths, timestamps, thread selection, URL search, Markdown and JSON thread output, and invalid arguments.
Part 2 of 5 for #14. Papercuts 2, 4, 6, 7, 8, 9, and 10. Extends the warnings for papercut 3 to
tasksandprofile.Fixes the invalid
tasks --top -5andprofile --bucket 0options reported in #9.