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

Eliminate unnecessary file open in process symbolization path #513

Merged
merged 1 commit into from
Feb 6, 2024

Conversation

d-e-s-o
Copy link
Collaborator

@d-e-s-o d-e-s-o commented Feb 6, 2024

When using process symbolization, we instantiate an ElfParser object to calculate the address given a file offset. When we then later attempt to symbolize said address, we end up creating another ElfParser instance. That's plain unnecessary work.
With this change we instantiate an ELF resolver using our file caching infrastructure from the get-go, which means that we do not end up opening the file in question twice and any already parsed ELF related data structure will just be reused.

Refs: #511
Reported-by: r1viollet erwan.viollet@datadoghq.com

When using process symbolization, we instantiate an ElfParser object to
calculate the address given a file offset. When we then later attempt to
symbolize said address, we end up creating another ElfParser instance.
That's plain unnecessary work.
With this change we instantiate an ELF resolver using our file caching
infrastructure from the get-go, which means that we do not end up
opening the file in question twice and any already parsed ELF related
data structure will just be reused.

Refs: libbpf#511
Reported-by: r1viollet <erwan.viollet@datadoghq.com>
Signed-off-by: Daniel Müller <deso@posteo.net>
@d-e-s-o d-e-s-o merged commit 33d7ed1 into libbpf:main Feb 6, 2024
27 checks passed
@d-e-s-o d-e-s-o deleted the topic/cached-elf-parser branch February 6, 2024 15:59
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.

None yet

1 participant