-
Notifications
You must be signed in to change notification settings - Fork 169
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
cleanup(sinsp): move engine/platform selection code to libsinsp #1401
cleanup(sinsp): move engine/platform selection code to libsinsp #1401
Conversation
b6d9147
to
fab324f
Compare
053a960
to
4401d55
Compare
/milestone 0.14.0 |
I don't know, but I would still signal it as a breaking change in the release-note block |
4401d55
to
ce02d53
Compare
ce02d53
to
aeda51d
Compare
Signed-off-by: Grzegorz Nosek <[email protected]>
AS of now, libscap doesn't know anything about selecting engines or platforms and defers this to sinsp (or the consumer, when using scap directly) Signed-off-by: Grzegorz Nosek <[email protected]>
They are handled by the (Linux) platform, not the engine Signed-off-by: Grzegorz Nosek <[email protected]>
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.
Thank you for this!
/approve
LGTM label has been added. Git tree hash: c01b0b03d91d8676f419a92de9db6efa494604b4
|
libscap doesn't need it any more and sinsp can pass it to the only place that needs it (sinsp::open_common) directly. Note: we could just also set m_mode in the individual sinsp::open_* methods but this way we save a tiny bit of code duplication. Signed-off-by: Grzegorz Nosek <[email protected]>
…form_vtable Signed-off-by: Grzegorz Nosek <[email protected]>
It matches the new role of the function better Signed-off-by: Grzegorz Nosek <[email protected]>
Signed-off-by: Grzegorz Nosek <[email protected]>
Signed-off-by: Grzegorz Nosek <[email protected]>
053d38f
to
af92f50
Compare
switch(mode) | ||
{ | ||
case SCAP_MODE_PLUGIN: | ||
platform = scap_generic_alloc_platform(::on_new_entry_from_proc, this); |
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.
Amazing thank you!
scap_mode_t is now named sinsp_mode_t to reflect that it's not used in libscap at all, and all the enum values are renamed from SCAP_MODE_* to SINSP_MODE_* Signed-off-by: Grzegorz Nosek <[email protected]>
if the CI becomes green we are good to go IMO |
af92f50
to
7a197f5
Compare
the s390x build only took a bit over two and a half hours :D |
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.
/approve
LGTM label has been added. Git tree hash: 140f211f7235ebd1299c012fbbb667eeb0f697b6
|
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.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Andreagit97, FedeDP, gnosek The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind cleanup
/kind design
Any specific area of the project related to this PR?
/area libscap
/area libsinsp
Does this PR require a change in the driver versions?
What this PR does / why we need it:
This PR continues the work of decoupling libscap from platform code. The motivation is to (eventually):
Baby steps though, this PR moves the code responsible for engine/platform selection to libsinsp (in particular, sinsp::open_* methods). All the platform code still lives in libscap for the time being.
I'm planning some follow up PRs (though this one feels okay as a standalone submission too):
All but the last one are more or less done, for the actual rewrite I have some sketches but not yet finished code as I'd rather avoid rebasing the inevitable giant patch set over and over :)
In the end, I see the platform class as owning ~all the syscall parser code, with e.g. container/k8s support building on top of that. It's going to substantially change the center of gravity of libsinsp, which would become a pipeline for events into various "plugins" (using the term very loosely), but also enables us to e.g. support non-Linux OSes cleanly.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
This PR does not affect any sinsp APIs but does affect scap. Not sure whether we consider this an API change: does anybody use raw libscap in the real world?
Does this PR introduce a user-facing change?: