Repository navigation
feat(libSceHttp): report a context's pool in sceHttpGetMemoryPoolStats - #8357
Conversation
|
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.
|
|
Independent Windows run of this PR (data only). Environment: Windows 10 Pro 10.0.19045, Ryzen 7 5800X3D, WinLibs GCC 15.2.0 r7 (MinGW-w64 UCRT), Release, BUILD_TESTING=ON. Merge-tree of the PR head against Results (3 runs each):
Not run: other platforms, the other Http tests, the full repository CTest, and any title or console run. AI-assisted (Claude Code). |
…ol-stats # Conflicts: # core/libs/prx/libSceHttp/Export.cpp # docs/dev/debt/libSceHttp.md
|
I opened #9630 to fix allocation-failure ownership in HTTP initialization, epoll creation and final-context teardown. Your pool-size registry also adds work to initialization and termination. I propose merging #9630 first, then rebasing this PR and retaining rollback across every context registry. #9630 has no dependency on the pool-stat implementation. |
|
@Ondra97 agreed: #9630 first, then I'll rebase this PR onto it. You're right about the registry. This PR inserts the pool size before I'll note the dependency here once #9630 is merged. |
…p-memory-pool-stats
|
Thanks for the detailed pool-stats work. My separate PPSA90210 request-transport PR also registers net/SSL state in |
|
@DoubleAAGuy yes, that order works for me: #9630, then this PR, then #9834. When #9630 lands I'll rebase here and put the pool-size insertion and its erase inside #9630's rollback and teardown, next to the context and options, so your transport map can sit beside it. I won't change the registry's shape after that rebase without telling you here. |
|
Re-checked against current main: the feature commit is unchanged, |
What
sceHttpGetMemoryPoolStatsthrewnot implemented, and its debt entry listed the signature as unknown. SharpProsperoHttp.csdocuments it asint sceHttpGetMemoryPoolStats(int httpCtxId, SceHttpMemoryPoolStats* currentStat), which reads a context's pool use. The struct holds the pool size, the peak and current use, and a 32-bit reserved word.mainhas since declared the struct as those three 64-bit fields (24 bytes) infix(http): recover request metadata and memory stats signatures, so only those 24 bytes are written and the reserved word is left to the caller.sceHttpInitnow keeps the pool size it is given for each context, andsceHttpTermdrops it. The call:{pool size given to sceHttpInit, 0, 0}and returns 0. The library takes nothing from the guest pool, so both use figures are 0; Http2 and NpWebApi2 already report their pools this way.ERROR_BEFORE_INIT(0x80431001) without writing.ERROR_INVALID_ID(0x80431100) without writing. Both errors and their order followsceHttpCookieFlush.currentStat: throws, as the console's error for it is unknown. It is checked first, as Http2 does.The debt entry records that nothing here is measured on a console and that a console already uses part of the pool for a live context.
Tested
Ubuntu 26.04.1, kernel 7.0.0-38, GCC 15.2.0, Release, full build with
BUILD_TESTING=ON. Windows was not compiled. No title was run.guest_http:sceHttpInit, ids 0, -1 and a request id returnERROR_BEFORE_INIT.INT32_MAXand a request id returnERROR_INVALID_ID. Two live contexts report their own pool sizes (0x10000 and 0x23000), and a pool above 32 bits (0x123456000) and a pool of 0 are reported unchanged.ERROR_INVALID_IDwhile the other is unaffected, andERROR_BEFORE_INITcomes back after the lastsceHttpTerm.main, where the call throws. Storing a constant pool size, not dropping it onsceHttpTerm, or skipping theERROR_BEFORE_INITcheck makes it fail.httppass.main524398151f. The branch adoptsmain's declaration and 24-byte struct. The test now checks that nothing past those 24 bytes is written; writing a reserved word after them makes it fail. All 4guest_httptests pass.tools/check_conventions.py --base origin/mainpasses.tools/pr_overlap.pyfinds no conflicting lines. It could not compare test: organize library tests and label CTest suites #6044 (test reorganization), which conflicts withmain. The branch also merges cleanly with feat(libSceHttp): keep options per template, connection and request and implement their getters #8245, which reworks the HTTP options in the same file.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)