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

Add symbol size to Sym type #318

Merged
merged 2 commits into from
Sep 18, 2023
Merged

Conversation

danielocfb
Copy link
Collaborator

With this change we expose the symbol's size in the form of the newly added Sym::size member, if it is available. Currently the only symbolization source that does not expose the size is kallsyms.

With this change we expose the symbol's size in the form of the newly
added Sym::size member, if it is available. Currently the only
symbolization source that does not expose the size is kallsyms.

Signed-off-by: Daniel Müller <[email protected]>
@codecov
Copy link

codecov bot commented Sep 18, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +3.91% 🎉

Comparison is base (474c57f) 85.54% compared to head (6bf34fe) 89.46%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #318      +/-   ##
==========================================
+ Coverage   85.54%   89.46%   +3.91%     
==========================================
  Files          37       37              
  Lines        4627     4640      +13     
==========================================
+ Hits         3958     4151     +193     
+ Misses        669      489     -180     
Files Changed Coverage Δ
src/elf/resolver.rs 90.32% <ø> (ø)
src/resolver.rs 0.00% <ø> (ø)
src/symbolize/symbolizer.rs 64.61% <ø> (ø)
src/dwarf/resolver.rs 92.30% <100.00%> (+0.22%) ⬆️
src/elf/parser.rs 95.50% <100.00%> (+0.07%) ⬆️
src/gsym/resolver.rs 62.79% <100.00%> (+0.43%) ⬆️
src/ksym.rs 87.41% <100.00%> (+0.16%) ⬆️

... and 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

This patch changes the symbol used for testing purposes in the ELF
demangle test from Normalizer::new to Normalizer::normalize_user_addrs_sorted.
The former has been seen to be reported as Inspector::new on release
builds, which has the exact same body and may be merged as an
optimization.

Signed-off-by: Daniel Müller <[email protected]>
@danielocfb
Copy link
Collaborator Author

The CI failure is due to:

thread 'symbolize_elf_demangle' panicked at 'Sym { name: "_ZN8blazesym7inspect9inspector9Inspector3new17h1596b080f117ae30E", addr: 2116f0, offset: 0, size: Some(1), dir: None, file: None, line: None, column: None, _non_exhaustive: () }', tests/blazesym.rs:216:5

What I think is happening here is that because Inspector::new and Normalizer::new have the exact same body, the compiler will just merge the two.

@danielocfb danielocfb merged commit 8754cb5 into libbpf:main Sep 18, 2023
22 checks passed
@danielocfb danielocfb deleted the topic/sym-size branch September 18, 2023 19:01
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