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

cleanup(scap,sinsp): return event flags directly #1420

Merged
merged 3 commits into from
Oct 17, 2023

Conversation

gnosek
Copy link
Contributor

@gnosek gnosek commented Oct 17, 2023

The event flags are (currently) specific to the savefile engine but accessing them requires an awkward reacharound through a dedicated vtable method to a field stored on each call to next().

We can simplify this a bit and express the intent better by simply returning the flags from next() via an out pointer.

What type of PR is this?

Uncomment one (or more) /kind <> lines:

/kind bug

/kind cleanup

/kind design

/kind documentation

/kind failing-test

/kind feature

Any specific area of the project related to this PR?

Uncomment one (or more) /area <> lines:

/area API-version

/area build

/area CI

/area driver-kmod

/area driver-bpf

/area driver-modern-bpf

/area libscap-engine-bpf

/area libscap-engine-gvisor

/area libscap-engine-kmod

/area libscap-engine-modern-bpf

/area libscap-engine-nodriver

/area libscap-engine-noop

/area libscap-engine-source-plugin

/area libscap-engine-savefile

/area libscap-engine-udig

/area libscap

/area libpman

/area libsinsp

/area tests

/area proposals

Does this PR require a change in the driver versions?

/version driver-API-version-major

/version driver-API-version-minor

/version driver-API-version-patch

/version driver-SCHEMA-version-major

/version driver-SCHEMA-version-minor

/version driver-SCHEMA-version-patch

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

The "rename pcpuid to pdevid" commit is a pure no-op, the second one is where things happen (as well as changes in all the engines to switch to the new signature).

Also, I pulled in the unused variable fix from #1401 as well, since this breaks the build with -Werror otherwise.

Does this PR introduce a user-facing change?:

NONE

The device id does not necessarily correspond to the CPU id even
for the kmod engine (when CPUs are offline). Rename the parameter
to match reality a bit better.

Signed-off-by: Grzegorz Nosek <[email protected]>
The event flags are (currently) specific to the savefile engine
but accessing them requires an awkward reacharound through
a dedicated vtable method to a field stored on each call to next().

We can simplify this a bit and express the intent better by simply
returning the flags from next() via an out pointer.

Signed-off-by: Grzegorz Nosek <[email protected]>
@gnosek gnosek force-pushed the return-event-flags-directly branch from 43eebdb to 9a4d0b1 Compare October 17, 2023 07:35
Copy link
Contributor

@FedeDP FedeDP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve
Nice cleanup!

@poiana
Copy link
Contributor

poiana commented Oct 17, 2023

LGTM label has been added.

Git tree hash: 1bdbdcb9b0250c9cd70196decd70fcb4df046c89

@FedeDP
Copy link
Contributor

FedeDP commented Oct 17, 2023

/milestone 0.14.0

@poiana poiana added this to the 0.14.0 milestone Oct 17, 2023
@poiana poiana merged commit 006687d into falcosecurity:master Oct 17, 2023
@poiana
Copy link
Contributor

poiana commented Oct 17, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: FedeDP, gnosek, LucaGuerra

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:
  • OWNERS [FedeDP,LucaGuerra,gnosek]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@gnosek gnosek deleted the return-event-flags-directly branch October 17, 2023 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants