Skip to content

fix(tools): analyze-perf fails when every TaskSmack function it sampled is an unresolved address, and says why (#2977) - #3016

Merged
mgradwohl merged 1 commit into
mainfrom
fix/analyze-perf-unresolved-2977
Oct 26, 2026
Merged

mgradwohl merged 1 commit into
mainfrom
fix/analyze-perf-unresolved-2977

Conversation

@mgradwohl

Copy link
Copy Markdown
Owner

Description

Fixes #2977

tools/analyze-perf.sh printed a normal "Top N functions" summary and exited 0 even when every TaskSmack function was a bare address. That's what a perf without libelf/DWARF, such as WSL's, produces. Its "(No symbols found)" fallback never ran either, because head made the pipeline succeed.

  • It now counts the report's user-space rows. When all of TaskSmack's own rows (its executables and test/benchmark programs) are unresolved addresses, it exits 3. It shows perf's libelf / dwarf / libunwind build options and suggests a perf with symbol support or llvm-symbolizer.
  • --allow-unresolved keeps the address-only report, with a warning, for whoever wants it anyway.
  • Partly unresolved: a warning, plus an "Unresolved: N of M" line in the summary.
  • System libraries' unresolved rows get a note only, since their debug symbols usually just aren't installed.
  • No user-space rows at all: "(No user-space functions sampled)", which actually prints now.

PR Size

✅ Small to medium (~80 lines of script, ~120 of test).

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Checklist

  • I have read the CONTRIBUTING guidelines
  • I have run pre-commit run --all-files or installed pre-commit hooks (shellcheck included)
  • I have added tests that prove my fix/feature works
  • All new and existing tests pass

Testing

New tests/tools/test_analyze_perf_sh.py, registered as CTest AnalyzePerfShScript on Linux, runs a copy of the script against a stub perf that serves canned reports. It covers all-unresolved (exit 3, with the explanation), --allow-unresolved, resolved, partly unresolved, and kernel-only reports. All 5 pass.

Additional Notes

v0.10.0, no backport (the issue's milestone).

🤖 Generated with Claude Code

…ed is an unresolved address, and says why (#2977)

A perf without libelf/DWARF (WSL's) names no function, and the script printed
the bare addresses as a normal "Top N functions" summary with exit 0; its
"(No symbols found)" fallback never ran either, since head made the pipeline
succeed. It now counts the report's user-space rows: when all of TaskSmack's
own are addresses it exits 3 and shows perf's libelf/DWARF/libunwind build
options and what to do (--allow-unresolved keeps the report with a warning);
some unresolved warns; system libraries' only get a note. Tested against a
stub perf (tests/tools/test_analyze_perf_sh.py).

Fixes #2977

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mgradwohl mgradwohl added this to the v0.10.0 milestone Oct 26, 2026
@mgradwohl mgradwohl added bug Something isn't working tooling Developer tooling, CI, editor config, and automation agent:WSL Owned by the Linux/WSL Claude session (bug-fix conveyor) labels Oct 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@mgradwohl
mgradwohl marked this pull request as ready for review October 26, 2026 04:51
@mgradwohl
mgradwohl enabled auto-merge (squash) October 26, 2026 04:51
@mgradwohl
mgradwohl merged commit 9db3081 into main Oct 26, 2026
30 checks passed
@mgradwohl
mgradwohl deleted the fix/analyze-perf-unresolved-2977 branch October 26, 2026 04:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent:WSL Owned by the Linux/WSL Claude session (bug-fix conveyor) bug Something isn't working testing tooling Developer tooling, CI, editor config, and automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Linux perf analysis reports success when all target symbols are unresolved

1 participant