-
Notifications
You must be signed in to change notification settings - Fork 165
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
new(userspace): plugin api to dump async events #2152
base: master
Are you sure you want to change the base?
Conversation
/milestone 0.19.0 |
[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 |
@@ -159,7 +159,7 @@ bool sinsp::is_initialstate_event(scap_evt* pevent) const { | |||
return pevent->type == PPME_CONTAINER_E || pevent->type == PPME_CONTAINER_JSON_E || | |||
pevent->type == PPME_CONTAINER_JSON_2_E || pevent->type == PPME_USER_ADDED_E || | |||
pevent->type == PPME_USER_DELETED_E || pevent->type == PPME_GROUP_ADDED_E || | |||
pevent->type == PPME_GROUP_DELETED_E; | |||
pevent->type == PPME_GROUP_DELETED_E || pevent->type == PPME_ASYNCEVENT_E; |
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.
Initial state events parsing enablement for PPME_ASYNCEVENT_E
.
}; | ||
|
||
// scenario: a plugin with dump capability is requested a dump and then the capture file is read. | ||
TEST_F(sinsp_with_test_input, plugin_dump) { |
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.
Very simple test:
- register a plugin with async event capability
- open inspector in no driver mode
- request a scap file dump to a temporary text file
- at this stage, the plugin will be requested to dump its state; in our test case, the plugin will just dump 10 fake events
- open a replay inspector to read the generated scap file
- register our event processor that just counts number of
PPME_ASYNC_EVENT_E
- remove the test scap file
Perf diff from master - unit tests
Heap diff from master - unit tests
Heap diff from master - scap file
Benchmarks diff from master
|
/hold |
56f40b5
to
6615ce7
Compare
/unhold |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2152 +/- ##
==========================================
+ Coverage 74.70% 74.79% +0.08%
==========================================
Files 254 255 +1
Lines 33557 33606 +49
Branches 5737 5778 +41
==========================================
+ Hits 25070 25135 +65
- Misses 8458 8471 +13
+ Partials 29 0 -29
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Also, ASYNCEVENT_E will not be correctly pre-parsed at init time while reading from captures. Signed-off-by: Federico Di Pierro <[email protected]>
Signed-off-by: Federico Di Pierro <[email protected]>
We now expect `PPME_ASYNCEVENT_E` whose `name` matches one of the plugin supported ones (get_async_events() API). The new API is not required for async capability. Added also a test. Signed-off-by: Federico Di Pierro <[email protected]>
Other tests using no_driver engine and async plugin are also disabled on it. Signed-off-by: Federico Di Pierro <[email protected]>
Signed-off-by: Federico Di Pierro <[email protected]>
a58b66a
to
ef8f0cc
Compare
…_t` callback. Signed-off-by: Federico Di Pierro <[email protected]>
Signed-off-by: Federico Di Pierro <[email protected]>
What type of PR is this?
/kind feature
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:
This PR adds a new
dump()
API under theasync events
plugin capability.It is used to dump plugin state (as list of
PPME_ASYNCEVENT_E
events) when a scap file dump is requested.Note:
PPME_ASYNCEVENT_E
can be dumpedPPME_ASYNCEVENT_E
dumped must have a name supported by the plugin (seeget_async_events()
API)Moreover, enable initialstate consuming of
PPME_ASYNCEVENT_E
events while opening the inspector.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: