Skip to content

fix(valgrind): tie --separate-threads to subprocess tracking - #510

Draft
not-matthias wants to merge 1 commit into
mainfrom
valgrind-separate-threads-subprocess
Draft

fix(valgrind): tie --separate-threads to subprocess tracking#510
not-matthias wants to merge 1 commit into
mainfrom
valgrind-separate-threads-subprocess

Conversation

@not-matthias

Copy link
Copy Markdown
Member

--separate-threads was keyed on --cycle-estimation, which is unrelated: cycle estimation changes how event costs are computed, not how they are partitioned across threads. As a side effect, turning cycle estimation off silently also merged thread data, and turning it on split it.

Per-thread dumps only matter when instrumentation is inherited across a traced exec (--instr-atstart=inherit), so the option now follows simulation_track_subprocess and is set explicitly in both branches:

  • tracking subprocesses: --instr-atstart=inherit --separate-threads=yes
  • otherwise: --instr-atstart=no --separate-threads=no (valgrind's default, so no behavior change for existing runs)

The flag now sits in the tool-agnostic branch rather than the callgrind arm. That is safe: tracegrind is a fork of callgrind and accepts --separate-threads in its own option parser, same as callgrind.

Thread separation was keyed on --cycle-estimation, which controls how
event costs are computed, not how they are partitioned. Per-thread dumps
only matter when instrumentation is inherited across a traced exec, so
key the option on the subprocess-tracking flag instead and set it
explicitly in both branches.
@codspeed-hq

codspeed-hq Bot commented Aug 20, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

✅ 17 untouched benchmarks


Comparing valgrind-separate-threads-subprocess (1405d07) with main (3798897)

Open in CodSpeed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant