forked from iovisor/bcc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bcc/syms: Fix shared lib module offset <-> global addr conversion
`bcc` does various conversions of "global address" to "module offset" and vice versa. Previous work (iovisor#1670) modified the "global address" -> "module offset" calculation in `ProcSyms::Module::contains` to account for differences between the file offset a section is loading bytes from and the requested start address (relative to the base address of the `.so`). Unfortunately that change didn't also modify "module offset" -> "global address" calculations, such as the one in bcc_resolve_global_addr. Update that calculation to account for the same. This calculation discrepancy was most apparent for us in production when trying to attach USDTs to a shared lib with differing requested start address and file offset. This patch also adds a test w/ comments describing our specific situation and demonstrating how the patch fixes the issue. Signed-off-by: Dave Marchevsky <[email protected]>
- Loading branch information
1 parent
5370855
commit 4b3cbf4
Showing
3 changed files
with
101 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters