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(ebpf): disable gotable fallback by default, make gotablefallback smarter #2246

Merged
merged 2 commits into from
Aug 15, 2023

Conversation

korniltsev
Copy link
Collaborator

@korniltsev korniltsev commented Aug 14, 2023

for golang binaries we create symbol table from .gopclntab section. it is useful for striped binaries.
It may be usefull to still look into .sym sections for non go functions ie cgo . Thus there's a GoTableWithFallback.
However for unstripped binaries it now keeps in memory duplicate symbols for go functions (both from .gopclntab and .sym )

This PR:

  • disable gotable fallback by default
  • when gotable fallback is enabled, do not duplicate symbols between gotable and .sym table

Comment on lines 168 to 169
symbolOptions.FilterTo = goTable.Index.Entry.Get(0)
symbolOptions.FilterTo = goTable.Index.End
Copy link
Collaborator

Choose a reason for hiding this comment

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

There must be a typo:

symbolOptions.FilterFrom = goTable.Index.Entry.Get(0)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes!
I guess my test is broken as well :(

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

actually I dont know how to easily catch it with a test. the test works because it filters [0;last_go_symbol]
And in order to catch this typo I need to have a symbol in .sym in range [0;first_go_symbols] which I dont know how to do without messing with a linker.

I will just fix the typo and not improve test

Thanks!

@korniltsev korniltsev enabled auto-merge (squash) August 15, 2023 03:23
@korniltsev korniltsev merged commit 5acd4f8 into next Aug 15, 2023
16 checks passed
@korniltsev korniltsev deleted the ebpf/gotable_fallback_option branch August 15, 2023 03:39
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