-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
uprobes: don't grab the process over and over again
In a foolish quest to push knowledge of libproc out of dtprobed.c, I had the lowest-level uprobe_spec_by_addr() function, that gets given an address and needs to know what mapping it is part of also be the function that grabs the process with libproc's Pgrab(). This seems neat, but Pgrab() is *expensive*, and this is needlessly inefficient: all probes for a given mapping are registered in one go, always, but we are grabbing the mapping *and the pid* over and over again for every probe. As a fix for this, lift the Pgrab()/Prelease() pair out of uprobe_spec_by_addr() into process_dof() in dtprobed. This massively speeds up dtprobed when large numbers of probes are involved. (We are still grabbing the process once per lump-of-DOF, but arranging to grab it only once for all the DOF in a process is more complex, since it requires us to maintain the grab across ioctl()s but not keep it for too long even though we never get told when the initial splurge of DOF contribution at process startup is about to be over. We'll get there, but not quite yet.) Signed-off-by: Nick Alcock <nick.alcock@oracle.com> Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>
- Loading branch information
1 parent
8fcffe8
commit 91b0ab3
Showing
4 changed files
with
35 additions
and
42 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