retis-org / retis

Tracing packets in the Linux networking stack & friends
https://retis.readthedocs.io/en/stable/
100 stars 14 forks source link

Initial hooks support #22

Closed atenart closed 2 years ago

atenart commented 2 years ago

Initial support to build, register and load hooks into kernel probes. The API allows to register hooks running on all probes and hooks running on targeted ones. For now if a hook is loaded in a probe it will run unconditionally; this will change later by checking probe capabilities at runtime.

This implementation attach all generic hooks to all probes, including ones added for a specific hook whether or not if the probe was registered through add_probe. We could change this later and only attach generic hooks to probes explicitly added. WDYT?

More details in the commit logs and in the code itself. An example of this being used can be found in branch at/next.

This is based on #20

amorenoz commented 2 years ago

/lgtm