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
tetragon: Remove sensors on exit not programs #1514
Merged
Merged
Conversation
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
olsajiri
added
the
release-note/minor
This PR introduces a minor user-visible change
label
Sep 27, 2023
olsajiri
force-pushed
the
remove_all_sensors
branch
4 times, most recently
from
September 28, 2023 08:11
ad743ef
to
f540ca1
Compare
✅ Deploy Preview for tetragon ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
olsajiri
force-pushed
the
remove_all_sensors
branch
7 times, most recently
from
October 3, 2023 12:06
4bfb762
to
bd6902a
Compare
Using sensor manager AddTracingPolicy call to load sensors, instead directly loading sensor. This will allow us to get sensor's PreUnloadHook and PostUnloadHook calls when we remove test observer object. Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Adding RemoveAllSensors to sensor manager that unloads and removes all registered sensors. Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Use new UnloadSensors function to unload sensors directly with sensor.Unload and not by unloading all programs separately. This way we call unload hooks on unload. Signed-off-by: Jiri Olsa <jolsa@kernel.org>
And use it to remove sensors for test and tetragon. Also making initial sensor a global variable so there's just single programs/maps set of base sensor. Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Currently, the observer uses a global variable for the sensor manager. Tests may use the observer or create their own sensor manager. For the latter case, a StartTestSensorManager was created. The idea behind the test functions is that they make it easier to write tests by failing when an error happens and registering cleanup functions when the test finishes. Some tests, however, require having an observer and others do not. This patch: - Makes the sensor manager global variable in the observer a private one, and introduces access functions for it - This allows us to check whether the global variable is set twice. - Changes the StartTestSensorManager to GetTestSensorManager that first checks if the global variable is set. If it is, it just returns the existing sensor manager. Signed-off-by: Kornilios Kourtis <kornilios@isovalent.com>
olsajiri
force-pushed
the
remove_all_sensors
branch
from
October 5, 2023 05:29
bd6902a
to
4887f79
Compare
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
kkourt
approved these changes
Oct 5, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The change loading and unloading sensors to be on the sensors level,
so instead of removing separate programs, we remove complete sensors.
This has benefit of triggering sensors' unload hooks.