forked from cilium/tetragon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cgrouprate: refactor base registration code
Instead of using base objects directly, it's cleaner to operate on the contents of the sensor object passed at registration time. Add some helper functions to identify these objects and use them instead. Also, refactor the global state so that everything is under a single object for easier access. Move everything into a single file for clarity. Signed-off-by: Kornilios Kourtis <[email protected]>
- Loading branch information
Showing
9 changed files
with
117 additions
and
87 deletions.
There are no files selected for viewing
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
This file was deleted.
Oops, something went wrong.
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
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
This file was deleted.
Oops, something went wrong.
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Copyright Authors of Tetragon | ||
|
||
package base | ||
|
||
import "github.com/cilium/tetragon/pkg/sensors/program" | ||
|
||
// IsExecve returns true if this is a base execve program | ||
func IsExecve(p *program.Program) bool { | ||
return p.PinName == "event_execve" && p.Policy == basePolicy | ||
} | ||
|
||
func IsFork(p *program.Program) bool { | ||
return p.PinName == "kprobe_pid_clear" && p.Policy == basePolicy | ||
} | ||
|
||
func IsExit(p *program.Program) bool { | ||
return p.PinName == "event_exit" && p.Policy == basePolicy | ||
} |