-
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.
uploader: more exhaustive search for debug symbols
uploader: add support for dry run upload this is useful for testing locally and getting a good grasp at how many binaries we will be uploading when the local symbol upload feature is active pfelf: refactor debug links support add OpenDebugBuildID method and refactor OpenDebugLink method so that it's compatible with https://sourceware.org/gdb/current/onlinedocs/gdb.html/Separate-Debug-Files.html this is the way that gdb searches for separate debug executables, so it should hopefully be more exhaustive. as a side note, -dbgsym packages on ubuntu (for example, openssh-server-dbgsym) only download symbols to the build ID directory /usr/lib/debug/.build-id/ (and not the debug link directories), hence the new method also maximizes the chance to find potential debug symbols on ubuntu. uploader: more exhaustive search for debug symbols take opportunity of the newly added functions in pfelf to look for debug symbols in /usr/lib/debug/.build-id and more generally in /usr/lib/debug, which maximizes our chances to find debug symbols locally. symbolication: refactor uploader multiple small refactors to hopefully make the code more robust: * remove the context in HandleExecutable(), now it should be clearer which parts are synchrounous, which part are async, and what timeouts apply to each section * do symbol extraction (via objcopy) asynchronously, we don't strictly need it to be synchronous so we do it async which should hopefully reduce the impact on the process manager run frequency * group extraction and upload in the same function (to which the async timeout of 10s by default applies) in the future it might make sense to make this timeout configurable uploader: avoid failing if golang binary does not have build ID some golang executables don't have a build ID, so we don't want to fail if we can't get the GNU build ID for those executables uploader: modify interface to not return error logging an error when the uploader fails to handle an executable turned out to be relatively noisy, so we modify the interface to no longer return an error, and we log.Debugf errors we encounter in the uploader pfelf: fix debug link path Co-authored-by: Nicolas Savoire <[email protected]>
- Loading branch information
Showing
6 changed files
with
161 additions
and
61 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
package symbolication | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/elastic/otel-profiling-agent/libpf" | ||
"github.com/elastic/otel-profiling-agent/libpf/pfelf" | ||
) | ||
|
||
type Uploader interface { | ||
HandleExecutable(ctx context.Context, elfRef *pfelf.Reference, fileID libpf.FileID) error | ||
HandleExecutable(elfRef *pfelf.Reference, fileID libpf.FileID) | ||
} |
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