Skip to content

Commit

Permalink
Add BPF helper mapping
Browse files Browse the repository at this point in the history
BPF helpers can be very specific to kernel versions, and the set of
available helpers may differ between the system where DTrace was
compiled and the system where it is being used.

We add runtime checking of specific BPF helpers, with support for
possible fallback helpers.  E.g. if probe_read_user() is not found,
we can use probe_read() instead (though that may not guarantee
successful execution).

This can also be used to check whether certain helpers exist.  By
convention, when the BPF helper function id maps to 0 (BPF_FUNC_unspec),
the helper is known not to be supported on the runtime system.

We include bpf.h from a kernel recent enough to support all the BPF
features that DTrace can make use of.

Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
Reviewed-by: Eugene Loh <eugene.loh@oracle.com>
  • Loading branch information
kvanhees committed Jul 28, 2022
1 parent e100caf commit d91f091
Show file tree
Hide file tree
Showing 5 changed files with 6,839 additions and 2 deletions.

0 comments on commit d91f091

Please sign in to comment.