--spend-file <path> instruments every compiled function with vpf_enter(id, name) / vpf_leave(id); main additionally calls vpf_install(path, level). includes/vprofile.vp keeps the tables (no allocation on the hot path), times with QPC and writes the report from atexit, so normal return and exit() both produce it. --vpf 0 off | 1 call counts | 2 +per-function time (default) | 3 +caller/callee edges *A report path is resolved against the output exe directory, so ../prof.txt and absolute paths behave as documented regardless of the process cwd. *Instrumented include objects use their own cache suffix (.binary.vpf<N>, stacked with the asan/traceback suffixes) and that cache is cleared once when profiling is enabled. *StubMergerBuild force-adds the vprofile runtime to the reachable set; FuncGenBase emits a declare on demand because the instrumented module usually does not import vprofile. *--repl is rejected: the fragment DLL is loaded at runtime and does not link the runtime. --build-self no longer keeps a whitelist: SelfBuild.CollectForwardedArgs drops only --build-self / --project / --build-dir and forwards every other argument verbatim, so a self-build can enable the same modes as a normal build.
11 lines
468 B
Plaintext
11 lines
468 B
Plaintext
# GenFlags - process-wide codegen options shared by the CLI and the generators.
|
|
#
|
|
# Lives in its own tiny module so both main.vp and the Gen mixins can read it without an
|
|
# import cycle (it imports nothing).
|
|
#
|
|
# vpf_level / vpf_path implement --spend-file + --vpf:
|
|
# 0 = off, 1 = call counts, 2 = + per-function time, 3 = + caller/callee edges
|
|
# vpf_path is the absolute report path; the compiled program writes it at exit.
|
|
_vpf_level: int = 0
|
|
_vpf_path: str = None
|