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

Fix upload of ELF dynamic symbols #1579

Merged
merged 8 commits into from
Mar 21, 2025
Merged

Conversation

nsavoire
Copy link
Contributor

@nsavoire nsavoire commented Mar 8, 2025

What and why?

objcopy --only-keep-debug unexpectedly removes .dynsym and .dynstr sections. This leads to datadog-ci uplaoding ELF files with no symbol information when only dynamic symbols are available.

How?

This PR workaround this by first dumping these sections to files with objcopy --dump-section and adding them back with objcopy --add-section.

Other changes (separate commits):

  • fix typo in README
  • fix objcopy supported targets listing
  • when checking for a section existence also check that it is non empty (i.e. it has a type different from NOBITS): this what caused tests checking for dynamic symbol extraction to incorrectly succeed
  • enable debug section compression (zstd if available otherwise zlib)
  • correctly detect debug info compressed with zlib-gnu compression (.zdebug_info section)
  • allow duplicate buildIDs with different archs
  • fix test case on node 23
  • change codeowner of elf symbol upload to @DataDog/profiling-full-host

Review checklist

  • Feature or bugfix MUST have appropriate tests (unit, integration)

@nsavoire nsavoire requested review from a team as code owners March 8, 2025 22:58
@nsavoire nsavoire force-pushed the nsavoire/fix_elf_dynamic_symbols branch from 3f1b9a4 to 9280a87 Compare March 8, 2025 23:08
@nsavoire nsavoire added bug Something isn't working profiling Related to [elf-symbols] and [pe-symbols] labels Mar 8, 2025
@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Mar 8, 2025

Datadog Report

Branch report: nsavoire/fix_elf_dynamic_symbols
Commit report: 37dcfdf
Test service: datadog-ci-tests

✅ 0 Failed, 2685 Passed, 0 Skipped, 1m 51.94s Total duration (37.55s time saved)

@nsavoire nsavoire force-pushed the nsavoire/fix_elf_dynamic_symbols branch 3 times, most recently from fb3ddbd to a4ced2f Compare March 8, 2025 23:47
Copy link
Contributor

@Drarig29 Drarig29 left a comment

Choose a reason for hiding this comment

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

LGTM

@nsavoire nsavoire force-pushed the nsavoire/fix_elf_dynamic_symbols branch from de93a96 to 51450f8 Compare March 19, 2025 09:48
@nsavoire nsavoire marked this pull request as draft March 19, 2025 09:55
@nsavoire nsavoire marked this pull request as ready for review March 19, 2025 09:55
@nsavoire nsavoire force-pushed the nsavoire/fix_elf_dynamic_symbols branch from 51450f8 to 37dcfdf Compare March 21, 2025 09:56
@nsavoire nsavoire merged commit 9973aa3 into master Mar 21, 2025
15 checks passed
@nsavoire nsavoire deleted the nsavoire/fix_elf_dynamic_symbols branch March 21, 2025 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working profiling Related to [elf-symbols] and [pe-symbols]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants