Open
Conversation
Contributor
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ekoops The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Please double check driver/API_VERSION file. See versioning. /hold |
Perf diff from master - unit testsHeap diff from master - unit testsHeap diff from master - scap fileBenchmarks diff from master |
8d6c209 to
ce917e8
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #2847 +/- ##
==========================================
- Coverage 75.07% 74.79% -0.28%
==========================================
Files 297 299 +2
Lines 31800 31960 +160
Branches 5013 5065 +52
==========================================
+ Hits 23875 23906 +31
- Misses 7925 8054 +129
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
a5a9e97 to
f012841
Compare
44bd717 to
c6f6d4c
Compare
79332df to
2cb8232
Compare
d99382b to
a4acc62
Compare
Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
guard scap_modern_bpf_engine with HAS_ENGINE_MODERN_BPF, fix atomic_fetch_add to use address of counter, add missing return for is_multiple_workers_mode_enabled Signed-off-by: irozzo-1A <iacopo@sysdig.com>
Add missing terminating quotes to buffers-num option description string literals Signed-off-by: irozzo-1A <iacopo@sysdig.com>
/home/runner/work/libs/libs/userspace/libsinsp/parsers.h:39:1: error: 'sinsp_parser_shared_params' defined as a struct here but previously declared as a class; this is valid, but may result in linker errors under the Microsoft C++ ABI [-Werror,-Wmismatched-tags]
39 | struct sinsp_parser_shared_params {
| ^
/home/runner/work/libs/libs/userspace/libsinsp/sinsp.h:96:1: note: did you mean struct here?
96 | class sinsp_parser_shared_params;
| ^~~~~
| struct
/home/runner/work/libs/libs/userspace/libsinsp/sinsp_buffer.h:27:1: note: did you mean struct here?
27 | class sinsp_parser_shared_params;
| ^~~~~
| struct
1 error generated
Signed-off-by: irozzo-1A <iacopo@sysdig.com>
open_common() called init() before allocating m_buffers. init() runs consume_initialstate_events() when is_capture(), which uses m_buffers.at(SINSP_INVALID_BUFFER_HANDLE). With an empty m_buffers this threw std::out_of_range when opening a savefile (e.g. in plugin_dump test). Move the m_buffers allocation block to before init() so the default buffer exists when consume_initialstate_events() runs. Signed-off-by: irozzo-1A <iacopo@sysdig.com>
Force reset of last_access_time in remove_inactive_threads method of sinsp_with_test_input. Signed-off-by: irozzo-1A <iacopo@sysdig.com>
Signed-off-by: irozzo-1A <iacopo@sysdig.com>
Signed-off-by: irozzo-1A <iacopo@sysdig.com>
error: "C atomics require C11 or later" Signed-off-by: irozzo-1A <iacopo@sysdig.com>
Signed-off-by: irozzo-1A <iacopo@sysdig.com>
Signed-off-by: irozzo-1A <iacopo@sysdig.com>
Signed-off-by: irozzo-1A <iacopo@sysdig.com>
Signed-off-by: irozzo-1A <iacopo@sysdig.com>
Signed-off-by: irozzo-1A <iacopo@sysdig.com>
Extend BPF iterator logic to be useful in multi-thread mode. Specifically, BPF iterator maps have different shapes depending on the number of "maximum allowed iterator threads" (that is specified at probe initialization through a `iters_num` parameter): - if there is at most a single iterator, these will be array maps with a single entry; - otherwise, they will be hash maps with an entry for each iterator, indexed by the thread id of the iterator thread. Before starting event fetching, the implementation checks if it is the first time that the calling thread uses one of the `pman_fetch_*` APIs and, if it is, initializes maps to take the new ecountered thread into account (specifically, this means that both `iter_auxiliary_map` and `iter_counters_map` are initialized). Iterator maps initialization is done from userspace, and leverages thread local flags and atomic counters to ensure maps are not initialized twice for the same thread, and that no more than `iters_num` different threads will ever call `pman_fetch_*` APIs. In multi-thread mode, iterator maps initialization is done by adding a new entry for each encountered new thread to each map. Entries' values are initialized leveraging zeroed values allocated in static memory. In single-thread mode, the array map has simply a pre-initialized single entry, and no additional work is required when the single thread is encountered for the first time. The whole design makes the switch between single- and multi-thread mode transparent to users, apart from the `iters_num` probe parameter: this must be evaluated in advance, and include any thread that will ever use any `fetch_*` API. Each iterator metric is the result of the sum of the corresponding counters on each `iter_counters_map` entry. Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
/kind cleanup
/kind design
/kind test
/kind feature
Any specific area of the project related to this PR?
/area driver-modern-bpf
/area libscap
/area libpman
/area libsinsp
/area tests
Does this PR require a change in the driver versions?
What this PR does / why we need it:
Initial attempt for multi-thread support.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: