-
Notifications
You must be signed in to change notification settings - Fork 168
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(userspace/libsinsp): call sinsp_observer methods after an event has been processed by all parsers #2222
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: FedeDP 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 |
Perf diff from master - unit tests
Heap diff from master - unit tests
Heap diff from master - scap file
Benchmarks diff from master
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2222 +/- ##
==========================================
+ Coverage 75.06% 75.10% +0.04%
==========================================
Files 267 276 +9
Lines 34259 34390 +131
Branches 5930 5930
==========================================
+ Hits 25715 25830 +115
- Misses 8544 8560 +16
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
4aa6d10
to
aecb8af
Compare
/milestone 0.20.0 |
LGTM, just a minor comment |
would also be nice to add a couple tests, since this patch is lowering coverage for libsinsp |
It seems a little bit too hard to add tests around it; i don't even know where i could start. I mean, of course i could create an inspector, add a sinsp_observer, create an event and check that my observer gets called; is this what you mean? |
Yes, I believe you can simply add a test based on the usual |
Yep i'll do it! |
…ine during parsing. Instead, push them onto a queue owned by the inspector to be later called, 1 by 1, as requested. This ensures that the whole libsinsp state has been processed, even by plugins, before sinsp_observer methods are called. Signed-off-by: Federico Di Pierro <[email protected]>
…program_hashscript` fields from threadinfo. They are unused and can be eventually directly implemented by consumers, if needed. Signed-off-by: Federico Di Pierro <[email protected]>
Signed-off-by: Federico Di Pierro <[email protected]>
aecb8af
to
6ba4e77
Compare
@LucaGuerra pushed a small test file! |
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.
LGTM
/cc @jasondellaluce |
Signed-off-by: Federico Di Pierro <[email protected]>
Moreover, improved sinsp_observer tests. Signed-off-by: Federico Di Pierro <[email protected]>
Signed-off-by: Federico Di Pierro <[email protected]>
/unhold |
What type of PR is this?
/kind cleanup
Any specific area of the project related to this PR?
/area libsinsp
Does this PR require a change in the driver versions?
What this PR does / why we need it:
The PR contains 2 distinct commits:
sinsp_observer
methods once all parsers (plugins too!) processed the event; in this way, we can be sure that libsinsp state has been fully processed and is consistentm_program_hash
andm_program_hash_scripts
, and theircompute_program_hash
method. They were completely unused and their implementation can be eventually offloaded to libs consumers (by either attaching aparse
plugin or using thesinsp_observer
.IMHO in the future
sinsp_observer
class should go away and consumers should rely upon parse plugins.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: