Skip to content
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

Merged
merged 7 commits into from
Aug 25, 2023

Commits on Aug 24, 2023

  1. pkg/sensors: rename UnloadHook to PreUnloadHook

    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]>
    mtardy committed Aug 24, 2023
    Configuration menu
    Copy the full SHA
    1b54a0e View commit details
    Browse the repository at this point in the history
  2. pkg/sensors: add a new PostUnloadHook hook to sensors

    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]>
    mtardy committed Aug 24, 2023
    Configuration menu
    Copy the full SHA
    d5cacd6 View commit details
    Browse the repository at this point in the history
  3. pkg/sensors: remove Ops.Unloaded

    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]>
    mtardy committed Aug 24, 2023
    Configuration menu
    Copy the full SHA
    7b38657 View commit details
    Browse the repository at this point in the history
  4. sensors: remove GetConfig and SetConfig

    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]>
    mtardy committed Aug 24, 2023
    Configuration menu
    Copy the full SHA
    321be09 View commit details
    Browse the repository at this point in the history
  5. pkg/sensors: cleanup kprobe entry from table on unload

    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]>
    mtardy committed Aug 24, 2023
    Configuration menu
    Copy the full SHA
    310846e View commit details
    Browse the repository at this point in the history
  6. pkg/sensors: test that table cleanup is done on sensor unload

    Signed-off-by: Mahe Tardy <[email protected]>
    mtardy committed Aug 24, 2023
    Configuration menu
    Copy the full SHA
    b19964a View commit details
    Browse the repository at this point in the history
  7. pkg/sensors: use proper structured logging in *Sensor.Unload

    Signed-off-by: Mahe Tardy <[email protected]>
    mtardy committed Aug 24, 2023
    Configuration menu
    Copy the full SHA
    2b74b4b View commit details
    Browse the repository at this point in the history