-
Notifications
You must be signed in to change notification settings - Fork 26
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
[RFC] freplace removal #476
base: main
Are you sure you want to change the base?
Conversation
This is more logical and allows adding collectors to retis/src/collect in later patches. Signed-off-by: Antoine Tenart <[email protected]>
This is only moving patches, not changing anything besides the import mod paths. Following patches will further remove the module concept. Signed-off-by: Antoine Tenart <[email protected]>
Signed-off-by: Antoine Tenart <[email protected]>
Instead directly use collectors. In details this removes the ModuleId, Module trait, Modules abstraction and a lot of the dynamic steps that used to happen when using modules. Following-up patches are needed to complete to make things completely clean but those are not strictly about removing the module concept. Signed-off-by: Antoine Tenart <[email protected]>
This also unties the SectionId <> collector cli arguments relationship. Signed-off-by: Antoine Tenart <[email protected]>
There is no remaining user after collectors stopped from using it. Signed-off-by: Antoine Tenart <[email protected]>
Using a more logical order, grouping related parameters and trying to display then in a logical order (of importance). Signed-off-by: Antoine Tenart <[email protected]>
Signed-off-by: Antoine Tenart <[email protected]>
Convert hooks to be statically built in the probes. Signed-off-by: Antoine Tenart <[email protected]>
Signed-off-by: Antoine Tenart <[email protected]>
I added an initial (incomplete, eg. retval in The main advantage is As a summary, with those changes, the preferred probe types in Retis would be:
|
Just for reference, we've discussed this and there is a potential problem with this approach: Originally, filter code was freplaced. This is the clean and elegant approach of injecting the filter code. However, in order to support older kernels (RHEL 8.4) that did not support pointer arguments, we moved to the current approach that intercepts the program registration and modifies the program on the fly.
This API was introduced because perf needed it and has received some pushback. Perf no longer needs it and there is a chance it gets deprecated, in which case we would be left with:
|
Le'ts also note (as per my understanding) having |
u8 nft; | ||
} __binding hooks = {}; | ||
|
||
static __always_inline int call_hooks(struct retis_context *ctx, |
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.
I guess we should be fine if this turns from __always_inline to __noinline keeping it static.
The advantage would be not sharing the stack with the main prog (512 bytes are not that much).
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.
alternatively, and probably better, we could avoid inlining in DEFINE_HOOK()
.
@@ -23,6 +24,8 @@ impl EventFmt for KernelEvent { | |||
"raw_tracepoint" => "tp", | |||
"kprobe" => "k", | |||
"kretprobe" => "kr", | |||
"fentry" => "f", | |||
"fexit" => "fe", |
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.
maybe fx
for this one?
fe
is common between fentry and fexit :)
just a general comment here. |
We discussed removing the use of freplace and instead statically compile hooks into the probes. This is based on top of #464 and the last patch only is about $topic. The goal is only to show what this change could look like.
Notes:
Hook
object containing the hooks' instructions was repurposed to be an enum about which hooks to enable.ovs
collector wasn't converted.Overall this requires a bit more maintenance but it doesn't look that bad.
Thoughts?