-
Notifications
You must be signed in to change notification settings - Fork 360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sensors: modify unload hooks and remove GetConfig and SetConfig #1385
Conversation
UnloadHook is called before the programs and maps are being removed. In preparation to the addition of a PostUnloadHook, we rename the hook to PreUnloadHook to be more explicit. Signed-off-by: Mahe Tardy <[email protected]>
This hook is a complement to PreUnloadHook freshly renamed in previous commit. It is intended to replace Ops.Unloaded to be called at the sensor level and not the collection level. Signed-off-by: Mahe Tardy <[email protected]>
This operation was replaced with previous commit's PostUnloadHook and is now directly called from *Sensor.Unload instead of collection caller. Signed-off-by: Mahe Tardy <[email protected]>
✅ Deploy Preview for tetragon ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
This removes the Ops Operations field on the Sensor struct since it's no longer needed. It removes the Loaded hook that was called at a collection of sensor loading time. We can add LoadHook (similarly as Pre and Post UnloadHook) in the future if it's needed again. It removes GetConfig and SetConfig along and removes those functions from the API since they were already not used, see this note: > NB: sensorConfigSet was used before tracing policies were > introduced. The idea was that it could be used to provide > sensor-specifc configuration values. We can either modify the > call to specify a sensor within a collection, or completely > remove it. TBD. Signed-off-by: Mahe Tardy <[email protected]>
06fef18
to
321be09
Compare
Previously, we kept all the unloaded kprobe entries in the generic kprobe table forever, never calling RemoveEntry. This patch uses PostUnloadHook to cleanup the entry from the table at unload time, other cleanups could be performed there if needed. Signed-off-by: Mahe Tardy <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but it would be great if you could add a test to ensure that removing the entries works as expected.
Thanks will add a test in this PR! |
Signed-off-by: Mahe Tardy <[email protected]>
Signed-off-by: Mahe Tardy <[email protected]>
df0e1ce
to
2b74b4b
Compare
See individual commits, the last one removes a deprecated and unused thing in sensors.
These patches were made in order for us (me) to be able to use
PostUnloadHook
later on.