feat(libkernel): trace semaphore lifecycle under sync logging #6123
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6123"
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 MarcZX10 on 2026-10-14T22:50:19Z.
What
Extend
APS5_TRACE_SYNCto log semaphore creation, successful signals with token counts before and after, and wait begin/end with the same semaphore address, name, need, available count, timeout and guest caller. This makes semaphore instances traceable across their lifecycle and shows whether any signal reaches a waiter. It also passes the guest caller address to the existing wait aggregator rather than the internal lambda call site. Tracing remains disabled unless the environment variable is set.Related to #6006, where the report needs to distinguish which same-named semaphore instance receives signals.
Tested
Linux x86-64, GCC 12.2, Release, Ninja:
libkernel,guest_semaphore_testsand the standalonesemaphore_trace_teststarget.guest_semaphore_tracepassed. It captures stderr with tracing disabled and enabled, then checks create/signal/wait records use the same semaphore address and identify an indefinite wait astimeout=-1.python3 tools/check_conventions.py --base upstream/main,python3 tools/check_test_registration.py <build>, andgit diff --checkpassed.guest_semaphoretest cannot run on this host: the Xeon E5-1620 v2 lacks LZCNT, BMI1, BMI2, MOVBE, AVX2 and FMA required by the emulator. The standalone test exercises the production semaphore and timed-wait sources without that emulator CPU gate.Checklist
main; no other open pull request implements this changeImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T12:15:06Z.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-16T23:31:31Z.
Checked the new
guest_semaphore_tracetest: it passes with the PR and fails againstmain'sSemaphore.cpp; tracing stays off withoutAPS5_TRACE_SYNC. Merging once the full Build is green.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T23:38:07Z.
Thanks for checking the regression and its
maincontrol. I independently built PR heada741cd435on Linux x86-64 with GCC 12.2, Release, andBUILD_TESTING=ON.libkernel,guest_semaphore_tests, andsemaphore_trace_testsall built, andctest --test-dir /tmp/AnyPS5-pr6123-build --output-on-failure -R '^guest_semaphore_trace$'passed (1/1).I did not run
guest_semaphore; this host lacks the CPU features required by the emulator. The hosted Linux and Windows Build jobs remain skipped on this PR, so this is focused local validation, not a full Build result.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-18T18:24:01Z.
Merged while @adriadam10 is away: the review passed and full CI is green on this head.