cgen: restore -trace-calls in the new compiler - #28788
Open
medvednikov wants to merge 3 commits into
Open
medvednikov wants to merge 3 commits into
medvednikov wants to merge 3 commits into
Conversation
Keep both the -trace-calls startup hook and upstream gc_runtime_init in _vinit. Rebuilt and passed the trace-calls codegen, integration, and parallel-worker tests with -new-compiler on the complete merged tree.
medvednikov
marked this pull request as ready for review
September 19, 2026 14:34
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Restore V1-compatible
-trace-callsin the new C backend, without routing through-old-compiler.tid/ns/ssize/nameoutput for function entries, module/function names and arity,C.main,_vinit, and_vcleanup. Traces go to stderr; program stdout is unchanged.-trace-fnsselection by function/module names and glob patterns, independently of the existing-d tracecustom call-site hooks._vinitfrom resetting the trace clock/stack baseline, which caused address-sized negative stack deltas. Exclude the tracing runtime from tracing/profiling recursion.$embed_file's runtime.-new-compilerin trace tests, and document the flags and stack-delta limitations../v -trace-calls examples/hello_world.v ./examples/hello_world ./v -trace-calls -trace-fns 'main.*,println,_vcleanup' run examples/hello_world.vThe
os.join_pathfixture uses a spread argument so it remains an actualjoin_pathcall rather than being lowered tojoin_path_singleby the new compiler.Upstream integration
Merged master
2b99da47ea7268c152d8b90aae18517b39c1f788, resolving the_vinitconflict by preserving both the trace hook and upstreamgc_runtime_init(). The implicit embed-import fix is committed, not pending.Published integration commit:
6415933439171a6da708b5c87e881ca1070ac4c6. Its complete tree,77a709228fd6a4dfcbad1ee6ec1d32369314d8c1, exactly matches the tree rebuilt and tested locally. No temporary workflows, patch-transport files, or synthetic assembly history are included in this PR.Validation
Rebuilt the integrated compiler on Linux with
VJOBS=2, then passed all three focused suites using the new compiler explicitly:The end-to-end suite covers filtering, recursive calls, normal dead-code elimination, serial/parallel generation,
-prod, combined profiling/tracing, and implicit embed imports. The final hello-world smoke test also passed, with stdout exactlyHello, World!\nand tracing on stderr, including builtin calls and cleanup without address-sized negative stack values.git diff --checkand formatting verification of the new tracing code/tests and modified tracing runtime passed.The pre-integration feature and implicit-import fix also passed the focused Linux Actions validation in run https://github.com/vlang/v/actions/runs/35445012768.
Validation limits
This is not a claim that the full repository CI is green. An earlier upstream-integration Actions attempt built successfully but exited 139 on its first codegen test (https://github.com/vlang/v/actions/runs/35445429442); that failure was not reproduced in the final local integrated build with
VJOBS=2. Fresh PR CI still needs to complete.Earlier broader validation reported the same 12 failing / 41 passing skip-unused compiler-error fixtures with both the modified and original unpatched compiler; the full C-generator directory run exceeded the local execution timeout. The 32-bit cases were skipped because 32-bit headers are unavailable. macOS/Windows were not executed locally.