feat(agc): add APS5_TRACE_SUMMARY_EVERY for summary lines of a long session #4812
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4812"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-12T22:41:16Z.
Follow-up to #4526 and #4581, requested by TideOPL on #4526: profiling that runs in the background for a long session. This is mode 1 of the two modes proposed there,
APS5_TRACE_SUMMARY_EVERY: a summary line per interval, no trace. Repeated windows with rotation (APS5_TRACE_EVERY) and streaming are separate PRs.What
APS5_TRACE_SUMMARY_EVERY=<seconds>(a whole number above 0; a malformed value fails the first present). The first present opens the first interval. At the first present at least<seconds>s after the interval opened, the presenter appends one line toaps5-summary.jsonl(inAPS5_TRACE_DIRor the working directory) and opens the next interval at that same present, so intervals follow each other without a gap. An interval still open when the title exits writes nothing.commit,dirty,env,gpu,driver,os,resolution,window,presents,frame_msp50/p90/p99/max,gpu_busy_ms_per_present,worker_busy_pct,top_phases_ms_per_frame,trace_dropped) for that interval only, plusinterval_start_sandinterval_end_s(seconds since the first present).windowis{"spec":"summary_every <seconds>","first_present":...,"ms":...},traceis the empty string. Window lines are byte-identical to before.TraceThreadchecks one relaxed flag after accounting the total). The window's own summary line is taken from the totals at its open and close, so it holds only the time inside the window, as before; the interval lines continue unchanged around it.Configured()stays one static bool,Recording()one relaxed load; nothing is allocated and no output changes. A thread whose window switch is set behaves as before (the window's buffer flag is true exactly while it was recording).tools/trace_digest.py. A.jsonlargument prints the interval lines as one row per interval (frame p50, p90, p99, max, GPU busy per present, busiest queue worker, largest phase), an ASCII sparkline of the frame p99 and of the GPU busy time, and a note when commit, environment, GPU, driver or OS changes between intervals. Window lines in the file are skipped.--jsonprints the rows. Digesting a trace is unchanged.docs/dev/BUILD.md(Performance trace, "Summaries for a long session").Not in this PR: repeated windows with rotation, streaming a long trace to disk.
Tested
agc_performance_trace(extended): interval parsing and rejected values, when an interval is due and that it counts from its restart, a thread that is not buffering (totals kept, no slice, zero-capacity buffer untouched), the totals subtraction, and the exact JSON of an interval line.tools/tests/test_trace_digest.py(extended): window lines skipped, row contents, identity change, sparkline scaling, the table and--jsonthroughmain, a file without interval lines. 13 tests pass locally.main; the PR CI runs on this head.tools/check_conventions.py --base origin/mainpasses.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)APS5_TRACE_EVERY(repeated windows with rotation) and streaming, as separate PRs🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T09:39:36Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libSceAgcDriver/Execution/include/PerformanceTrace.hppL86, L406-407core/libs/prx/libSceAgcDriver/Execution/include/PerformanceTrace.hppL86, L406-407Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-13T16:00:22Z.
Checked the diff, built it merged onto current main and ran
agc_performance_trace(passes; it does not compile without the change, so it exercises the new code). Interval parsing is strict, the totals subtraction and the window/interval interplay match the description, and with no switch nothing is allocated or changed. Merging once the full Build is green.Note: #5046 and #5047 touch
PerformanceTrace.hppin the same places, so whichever lands second needs a rebase.