-
Notifications
You must be signed in to change notification settings - Fork 14
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
Untangle the section id, factories and modules #421
Conversation
2d000f2
to
46be6ba
Compare
Again we have a failure due to benchmarking being so difficult to maintain. I'm not going to fix this here as we have #412; so let's merge it first. |
Mainly I have comments on the last two patches. For the code refactorization, besides nits, it looks great to me and I think it goes in the right direction of getting rid of the module abstraction. |
46be6ba
to
8cc0c84
Compare
Rebased on top of #411 (as it seems to be ready) to avoid conflicts and removed the common type commits from this. I'll open a dedicated PR and we can have the discussion about those there. |
Same CI error as the others, this week our running CI can't work. |
8cc0c84
to
3d89873
Compare
Removed the same commit as in #411. |
The benchmarking CI is actually failing for a good reason; will have a look. |
3d89873
to
daf3558
Compare
All good now. |
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.
Leaving a nit aside, the PR LGTM.
daf3558
to
cbdf8ff
Compare
Renamed |
Since commit 2373796 ("events: split ebpf and json factories") raw factories are only parsing and converting raw events, aka BPF ones. Thus we no longer have to differentiate the user of such factories and can make raw factory implementations cleaner. Signed-off-by: Antoine Tenart <[email protected]>
This makes modules not required to produce events, as they can provide value by doing other scoped work (eg. installing probes). This shows again the limits of our module abstraction and it might be removed at some point to clean things up a bit. Signed-off-by: Antoine Tenart <[email protected]>
SectionId member can be directly casted as u8, there's no need to maintain an helper doing so. Signed-off-by: Antoine Tenart <[email protected]>
We no longer have a need to split both definitions, EventSection is never used outside of event_section. Signed-off-by: Antoine Tenart <[email protected]>
Those two were loosely tightened, when adding sub-sections to an event. Even more, the section names where both defined in the event sections and in the section ids. As there should be a 1:1 relationship between event sections and ids, make the id part of the event section. This has another advantage as a side effect: raw section factories do not need a 1:1 relationship with an event section and can generate any event section. Signed-off-by: Antoine Tenart <[email protected]>
Signed-off-by: Antoine Tenart <[email protected]>
Stop using SectionId for indexing event section factories; those are tied to a BPF counterpart, not to a section id. This helps modelizing that a factory can produce different sections and that a section does not necessarily have a BPF counterpart, such as the Tracking one. To do this use a dedicated FactoryId enum instead of reusing SectionId and use a similar logic as what we do for event sections (eg. embed the id into the factory definition). While doing this we can remove the TrackingInfoEventFactory. Signed-off-by: Antoine Tenart <[email protected]>
Stop using SectionId for indexing modules (aka. collectors nowadays); there is no 1:1 relationship between the two. Eg. core events are not tied to a module. To to this introduce a ModuleId enum. Hopefully this will go away once we remove the module abstraction. Signed-off-by: Antoine Tenart <[email protected]>
Cosmetic only. Signed-off-by: Antoine Tenart <[email protected]>
cbdf8ff
to
717bfee
Compare
Rebased on top of main to fix a conflict. No other change. |
Semi-RFC material; since code is ready let's not flag it but feel free to discuss the approach :)
The main goal of this series is $title, and some preliminary work for a possible future removal of the module concept. In any way this solve issues linked to how the section ids were used which did not map to the reality:
This also now allows to have a factory producing more than a single type of event section; this is no side effect and is intended.
Overall this was something I wanted to tackle for some time now, but I was keeping it for later. But adding support for
enum sk_rst_reason
showed w/o this preliminary rework things would have gotten even worse between event sections, factories and modules. This is why I chose to keep those patches in that PR; but I can split into two PRs if needed.One question I have is with the last commit: should be put all those "common types" into the same event section or add one for each. Having a dedicated section helps for possible future improvement (more fields when applicable), but makes event section count to potentially grow quite a lot. Also I should find a better name instead of "common types".