libkernel: process time counts from the first call, not from process start, so the first reading is about 0 #3366
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 Zurisen on 2026-10-11T09:07:47Z.
On
main1c75f4d2,sceKernelGetProcessTimeandsceKernelGetProcessTimeCountermeasure from a start thatGetStartNanoscaptures in a function-local static, i.e. on their first call. The first reading is therefore about 0 however long the process has run, and exactly 0 when the capture and the read fall in one tick of the host clock (QueryPerformanceCounter, 100 ns on Windows here). On the console these count from process start. Not specific to one title.Measured
Windows 11 Home (26200), WinLibs GCC 15.2.0 r7, Release.
guest_ampr_markersfails intermittently onmain: 6 of 10 runs alone, atGuestAmpr.cpp:381. Printing the values there showsresult=0 single=3 pair=0x400000003 time=0in every failing run: theWriteAddressFromTimeCountercommand is the process's firstsceKernelGetProcessTimeCountercall.Fix branch
Zurisen:fix/libkernel-process-time-start(one commit onmain1c75f4d2):Time.cppcaptures the start when libkernel loads (static const std::uint64_t g_processStart = GetStartNanos();). The function-local static stays, so a call during another library's static initialization still gets a valid start.GuestProcessTime.cppsleeps 50 ms before the first call and requires the first reading to include it (scaled byAPS5_TIME_SCALEfor the_scaledvariants). The fourguest_process_time*tests fail onmainand pass 5/5 with the change.guest_ampr_markers: 19/20 with the change. The remaining failure is unrelated:fixed guest mapping 0xec00000000+0x1000000000 overlaps a host region in the guest arena, after line 381 has passed (3 of 40 runs).--repeat until-fail:3: 815/816; the failure ispr_overlap_encoding, which also fails onmainhere (Python 3.10). Conventions check passes.PR intake is limited, so I have not opened a PR; anyone eligible is welcome to carry the commit.
Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-11T09:13:54Z.
Carried as #3368 with your commit unchanged. On Windows 11 / GCC 15.2, the four
guest_process_time*tests fail onmainwith your test and pass 5/5 with the fix, andctest -E "^agc_|video_out"passes 441/441.