Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PROF-9088] Fix symbolization for binaries with compressed debug information #395

Merged
merged 2 commits into from
Mar 28, 2024

Conversation

r1viollet
Copy link
Collaborator

@r1viollet r1viollet commented Mar 27, 2024

What does this PR do?

Ensure we retry without using debug information when symbolization fails

Motivation

Ensure we symbolize Go binaries

Additional Notes

This is pending an upstream fix in blazesym

How to test the change?

The change is tested through simple_malloc

…mation

Ensure we retry without using debug information when symbolization fails
@pr-commenter
Copy link

pr-commenter bot commented Mar 27, 2024

Benchmark results for collatz

Parameters

Baseline Candidate
config baseline candidate
profiler-version ddprof 0.17.0+452c5afc.30913982 ddprof 0.17.0+bdb40c2f.30962142

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 1 metrics, 0 unstable metrics.

See unchanged results
scenario Δ mean execution_time
scenario:ddprof -S bench-collatz --preset cpu_only collatz_runner.sh same

@pr-commenter
Copy link

pr-commenter bot commented Mar 27, 2024

Benchmark results for BadBoggleSolver_run

Parameters

Baseline Candidate
config baseline candidate
profiler-version ddprof 0.17.0+452c5afc.30913982 ddprof 0.17.0+bdb40c2f.30962142

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 1 metrics, 0 unstable metrics.

See unchanged results
scenario Δ mean execution_time
scenario:ddprof -S bench-bad-boggle-solver BadBoggleSolver_run work 1000 same

- Add an option to compress debug sections
- Compress debug sections for some of the simple_malloc tests
@r1viollet r1viollet marked this pull request as ready for review March 27, 2024 19:32
@r1viollet r1viollet assigned r1viollet and nsavoire and unassigned r1viollet Mar 27, 2024

explicit BlazeSymbolizerWrapper(std::string elf_src, bool inlined_fns)
: opts(create_opts(inlined_fns)),
static blaze_symbolizer_opts create_opts_no_debug() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need to change blaze_symbolizer_opts, calling blaze_symbolize_elf_virt_offsets with blaze_symbolize_src_elf.debug_syms set to false should be enough.

.demangle = false,
.reserved = {}};
}
explicit BlazeSymbolizerWrapper(std::string elf_src, bool inlined_fns,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consecutive bool arguments are error prone

blaze_symbolizer_opts opts;
std::unique_ptr<blaze_symbolizer, BlazeSymbolizerDeleter> _symbolizer;
ddprof::HeterogeneousLookupStringMap<std::string> _demangled_names;
std::string _elf_src;
bool _visited{true};
bool _use_debug;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public members don't need an underscore prefix

const blaze_result *blaze_res = nullptr;
if (!_disable_symbolization) {
while (retry_symbolization && !_disable_symbolization) {
const auto it = _symbolizer_map.find(file_id);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the inner loop could be refactored into another function

@r1viollet
Copy link
Collaborator Author

@nsavoire I 100% agree with your comments, I will fix this in the evening. I'll merge just to get new numbers and look out for other issues.

@r1viollet r1viollet merged commit c5c3b4d into main Mar 28, 2024
2 checks passed
@r1viollet r1viollet deleted the r1viollet/fix_compressed_debug branch March 28, 2024 14:02
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.

2 participants