mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-11-13 13:03:22 +09:00
[MG_Util, MG_Test, MG_IntegrationTest, CI] (P6): one log per role, and every reader moved with it
The spawn work had the two roles append to one MOBILEGL_LOG_FILE_PATH under O_APPEND. It was correct - two processes at one offset would corrupt the file, O_APPEND made each write atomic - but it put two sessions' lines in one place and made every per-side assertion a search. This splits the sink: the client role writes <base>.client.log and the server role writes <base>.server.log. THE BASE NAME NAMES NO FILE ANY MORE, AND THAT IS THE POINT. Leaving the client at the old unsuffixed path would have been the compatible choice and the wrong one: a reader that was not updated would go on finding a file, go on passing, and go on seeing only half the session - and a refusal census that reports a confident zero for the half it cannot see is worse than one that fails. With both names moved, an un-updated reader gets "file not found" and says so. There were 34 such readers; every one is moved here. THE ROLE IS PER-THREAD, not per-process, because under inproc both roles are threads of one process. Log.cpp keys the sink on a thread-local role: the apply thread declares itself server (ServerLoop.cpp), a spawned image is server for its whole life (MOBILEGL_IPC_ROLE=server, read once), and everything else is the client. The naming rule (RoleLogPath) and the two whole-log operations (ReadRoleLogs / TruncateRoleLogs) are EXPORTED from the library, so no reader reimplements the derivation - a second copy is the copy that falls behind. Readers, by how they read: - unit mains set MOBILEGL_LOG_FILE_PATH and read a role file: they keep the base in the env and derive the client path from the library helper. - the death-test child runners (ReadLog) now concatenate BOTH roles: a death test asserts the CHILD said something, and the applier's refusals - the very diagnostics these check - are written under the server role. - the offset-based Emit readers derive the client path once after setenv. - PipeStatsWindow reads both, because draws/vbs increment in the backend's PrepareForDraw - the apply thread, the server role - so the summary line is in the server file even under inproc. - run_trace_case.cmake's split census reads both files; the client keeps the transport markers. - split_log_paths.py (and its self-test, and the control stub) derive both role files from the declared base. - the Android script pulls both role files off the device and concatenates them, so every downstream check is unchanged - and it judges a role file by CONTENT, because `run-as test -f` through `exec-out` returned 0 for a missing file on the device and `exec-out` folds cat's own not-found line into stdout. The monolith arm legitimately has no server file, and that is a silent skip rather than a one-line server log. Guarded so a pull build is untouched: RoleLogPath and the role sink are wholly inside MOBILEGL_BUILD_DISAGGREGATED; a non-disaggregated build writes the base path exactly as before. G1 re-measured - 0 symbol diff, .text unchanged at 0xa52203. Verified on device 2f7cbe2e: monolith writes only the client log (no phantom server log), inproc and spawn each write both and pass their transport proofs (spawn: server role in pid 16125). Unit 2353 (one pre-existing environmental failure), integration-split 186/186, integration-spawn 102/102, retrace 6/6, control smoke 12/12, split-log-paths self-test 9/9.
This commit is contained in:
@@ -101,7 +101,17 @@ message(STATUS "${replay_stdout}")
|
||||
message(STATUS "${replay_stderr}")
|
||||
|
||||
set(retrace_log "${TRACE_OUTPUT_DIR}/output/retrace.log")
|
||||
set(mobilegl_log "${TRACE_OUTPUT_DIR}/output/mobilegl.log")
|
||||
# BOTH ROLES ARE SUFFIXED, and the client's rename is deliberate. Leaving it at the old
|
||||
# `mobilegl.log` would have been the compatible choice and the wrong one: a reader that was not
|
||||
# updated would go on finding a file, go on passing, and go on seeing only half the session.
|
||||
# With both names moved, an un-updated reader gets "file not found" and says so.
|
||||
set(mobilegl_log "${TRACE_OUTPUT_DIR}/output/mobilegl.client.log")
|
||||
# P6: THE SERVER ROLE HAS ITS OWN LOG, and the census below must read BOTH or a server-side
|
||||
# Fatal{ is invisible to it. Not hypothetical: under spawn the server is where every applier
|
||||
# refusal and Fatal{UnmigratedSurface} is raised, which are exactly the lines this lane counts.
|
||||
# The client file keeps the unsuffixed name, so every other reader here - the transport markers,
|
||||
# the pipe-verify block, the artifact copy - is unchanged.
|
||||
set(mobilegl_server_log "${TRACE_OUTPUT_DIR}/output/mobilegl.server.log")
|
||||
if(EXISTS "${retrace_log}")
|
||||
file(STRINGS "${retrace_log}" gl_identity_lines REGEX "MOBILEGL_TRACE_GL_")
|
||||
foreach(line IN LISTS gl_identity_lines)
|
||||
@@ -128,8 +138,12 @@ if(DEFINED TRACE_ARTIFACT_DIR AND NOT "${TRACE_ARTIFACT_DIR}" STREQUAL "")
|
||||
if(EXISTS "${retrace_log}")
|
||||
file(COPY_FILE "${retrace_log}" "${TRACE_ARTIFACT_DIR}/${TRACE_CASE_NAME}-${TRACE_BACKEND}-retrace.log")
|
||||
endif()
|
||||
if(EXISTS "${mobilegl_server_log}")
|
||||
file(COPY_FILE "${mobilegl_server_log}"
|
||||
"${TRACE_ARTIFACT_DIR}/${TRACE_CASE_NAME}-${TRACE_BACKEND}-mobilegl.server.log")
|
||||
endif()
|
||||
if(EXISTS "${mobilegl_log}")
|
||||
file(COPY_FILE "${mobilegl_log}" "${TRACE_ARTIFACT_DIR}/${TRACE_CASE_NAME}-${TRACE_BACKEND}-mobilegl.log")
|
||||
file(COPY_FILE "${mobilegl_log}" "${TRACE_ARTIFACT_DIR}/${TRACE_CASE_NAME}-${TRACE_BACKEND}-mobilegl.client.log")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -336,10 +350,19 @@ if(DEFINED ENV{MOBILEGL_TRANSPORT} AND NOT "$ENV{MOBILEGL_TRANSPORT}" STREQUAL "
|
||||
endif()
|
||||
endif()
|
||||
# The refusal census. Recorded on every split run, pass or fail.
|
||||
#
|
||||
# BOTH FILES, and the server's is the one that matters most: under spawn every
|
||||
# applier refusal is raised over there, so a census reading only the client's would
|
||||
# report a confident zero for the half of the session it cannot see.
|
||||
file(STRINGS "${mobilegl_log}" split_fatals REGEX "Fatal\\{")
|
||||
if(EXISTS "${mobilegl_server_log}")
|
||||
file(STRINGS "${mobilegl_server_log}" split_server_fatals REGEX "Fatal\\{")
|
||||
list(APPEND split_fatals ${split_server_fatals})
|
||||
endif()
|
||||
list(LENGTH split_fatals split_fatal_count)
|
||||
message(STATUS "MGPipe split: ${split_case} transport=$ENV{MOBILEGL_TRANSPORT}, "
|
||||
"Fatal{ lines in ${mobilegl_log}: ${split_fatal_count}")
|
||||
"Fatal{ lines across ${mobilegl_log} and ${mobilegl_server_log}: "
|
||||
"${split_fatal_count}")
|
||||
if(split_fatals)
|
||||
foreach(line IN LISTS split_fatals)
|
||||
message(STATUS "${line}")
|
||||
|
||||
Reference in New Issue
Block a user