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.
Improve ProcSyms module path handling
Besides loading modules from /proc/<pid>/root/<path>, open /proc/<pid>/root in advance with open(..., O_PATH) first, then use openat to read the module file in case /proc/<pid>/root/<path> cannot be accessed. This enables the module file to be read even if <pid> is not running. A class named ModulePath is added, which does the openat call and manages the returned file descriptor, enabling functions expecting a path to use /proc/self/fd/... as the path to the module. This approach has a few limitations. Code using the module path for something different than open (e.g. debug info in .debug file or perf map detection) does not work with the /proc/self/fd/... path, and the accessibility check of /proc/<pid>/root/<path> is prone to a race condition.
- Loading branch information
1 parent
304692d
commit f6bdaba
Showing
3 changed files
with
232 additions
and
27 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