-
Notifications
You must be signed in to change notification settings - Fork 392
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading: Check if probe type is registered
The loadInstance() function loads a BPF program. It checks its type against the list of registered types and calls the appropriate handler if there is a match. Otherwise it tries to match against some known types. If that fails, it attempts to load the program as a kprobe. If a new probe type is created but isn't registered (due to a typo, bug, or some other error), then the program will silently attempt to load as a kprobe, instead of using the supplied handler. This commit makes a list of inbuilt probe types, and checks the program type against it (calling the appropriate handler if it is in the list), then checks the program type against the registered probe types (again, calling the appropriate handler if it exists). If both of these fail, it returns an error instead of silently attempting a kprobe load. This will catch bugs where program types are accidentally specified with an invalid type, or where probes are registered with incorrect names. Signed-off-by: Kevin Sheldrake <kevin.sheldrake@isovalent.com>
- Loading branch information
1 parent
e82f39c
commit 0d4a97e
Showing
2 changed files
with
19 additions
and
19 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