Repository navigation
fix(tools): profile-heap refuses a --bench-filter that matches no benchmark before starting heaptrack (#2987) - #3017
Merged
Conversation
…chmark before starting heaptrack (#2987) Google Benchmark exits 0 when its filter matches nothing, and heaptrack then recorded only startup and registration, which the script announced as the capture. As profile-perf.sh already does, bench mode lists the matches first and fails when there are none. Tested against a stub benchmark binary and a stub heaptrack (tests/tools/test_profile_heap_sh.py). Fixes #2987 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
mgradwohl
marked this pull request as ready for review
October 26, 2026 04:52
mgradwohl
enabled auto-merge (squash)
October 26, 2026 04:52
…y-filter-2987 # Conflicts: # tests/CMakeLists.txt
mgradwohl
disabled auto-merge
October 26, 2026 05:13
mgradwohl
enabled auto-merge (squash)
October 26, 2026 05:13
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.
Description
Fixes #2987
tools/profile-heap.sh benchannounced a successful allocation capture when--bench-filtermatched no benchmark. Google Benchmark exits 0 in that case, and heaptrack then recorded only startup and registration as though they were the workload. Bench mode now lists the matches first (--benchmark_list_tests=true, asprofile-perf.shalready does) and fails before starting heaptrack when there are none. Several matches are fine for a heap capture, unlike perf's time sampling, so only an empty selection is refused.PR Size
✅ Small (~15 lines of script, ~100 of test).
Type of Change
Checklist
pre-commit run --all-filesor installed pre-commit hooks (shellcheck included)Testing
New
tests/tools/test_profile_heap_sh.py, registered as CTestProfileHeapShScripton Linux, runs a copy of the script against a stub benchmark binary and a stubheaptrackthat records being started:Both pass.
Additional Notes
v0.10.0, no backport (the issue's milestone).
🤖 Generated with Claude Code