libs
libs copied to clipboard
fix(libsinsp): expose main thread fd table
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
/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: This PR ensures that the plugin API exposes the file descriptor table of its main thread instead of its own. Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
fix(libsinsp): expose main thread fd table
Perf diff from master - unit tests
5.69% -1.35% [.] next
3.11% +0.63% [.] gzfile_read
8.07% -0.57% [.] sinsp::next
0.72% +0.57% [.] libsinsp::state::stl_container_table_adapter<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, libsinsp::state::value_table_entry_adapter<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, libsinsp::state::value_table_entry_adapter<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::dynamic_fields_t>::stl_container_table_adapter
1.29% -0.55% [.] sinsp_parser::parse_context_switch
4.04% +0.51% [.] sinsp_evt::load_params
0.31% +0.48% [.] copy_and_sanitize_path
2.58% -0.46% [.] sinsp_thread_manager::get_thread_ref
0.46% +0.46% [.] scap_event_encode_params_v
0.72% -0.44% [.] libsinsp::state::stl_container_table_adapter<std::vector<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, libsinsp::state::pair_table_entry_adapter<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, libsinsp::state::pair_table_entry_adapter<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::dynamic_fields_t>::stl_container_table_adapter
Heap diff from master - unit tests
peak heap memory consumption: -80.01K
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B
Heap diff from master - scap file
peak heap memory consumption: -2.02K
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B
Benchmarks diff from master
Comparing gbench_data.json to /root/actions-runner/_work/libs/libs/build/gbench_data.json
Benchmark Time CPU Time Old Time New CPU Old CPU New
----------------------------------------------------------------------------------------------------------------------------------------------
BM_sinsp_split_mean +0.0015 +0.0015 151 151 151 151
BM_sinsp_split_median -0.0106 -0.0106 153 151 153 151
BM_sinsp_split_stddev -0.7564 -0.7564 5 1 5 1
BM_sinsp_split_cv -0.7567 -0.7568 0 0 0 0
BM_sinsp_concatenate_paths_relative_path_mean +0.0956 +0.0957 56 61 56 61
BM_sinsp_concatenate_paths_relative_path_median +0.0884 +0.0885 56 60 56 60
BM_sinsp_concatenate_paths_relative_path_stddev +2.2877 +2.2877 0 1 0 1
BM_sinsp_concatenate_paths_relative_path_cv +2.0007 +2.0004 0 0 0 0
BM_sinsp_concatenate_paths_empty_path_mean -0.0122 -0.0121 25 25 25 25
BM_sinsp_concatenate_paths_empty_path_median -0.0135 -0.0134 25 25 25 25
BM_sinsp_concatenate_paths_empty_path_stddev -0.0556 -0.0523 0 0 0 0
BM_sinsp_concatenate_paths_empty_path_cv -0.0439 -0.0406 0 0 0 0
BM_sinsp_concatenate_paths_absolute_path_mean +0.0801 +0.0801 56 61 56 61
BM_sinsp_concatenate_paths_absolute_path_median +0.0781 +0.0781 56 61 56 61
BM_sinsp_concatenate_paths_absolute_path_stddev +0.1212 +0.1217 0 0 0 0
BM_sinsp_concatenate_paths_absolute_path_cv +0.0381 +0.0385 0 0 0 0
BM_sinsp_split_container_image_mean +0.0114 +0.0114 391 396 391 395
BM_sinsp_split_container_image_median +0.0118 +0.0118 391 396 391 396
BM_sinsp_split_container_image_stddev +0.5866 +0.5874 3 5 3 5
BM_sinsp_split_container_image_cv +0.5688 +0.5695 0 0 0 0
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 74.46%. Comparing base (
b4ca436) to head (4dc461c). Report is 2 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #2133 +/- ##
=======================================
Coverage 74.46% 74.46%
=======================================
Files 254 254
Lines 33333 33340 +7
Branches 5708 5715 +7
=======================================
+ Hits 24820 24827 +7
+ Misses 8487 8486 -1
- Partials 26 27 +1
| Flag | Coverage Δ | |
|---|---|---|
| libsinsp | 74.46% <100.00%> (+<0.01%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
/cc @Andreagit97 @jasondellaluce
LGTM label has been added.
Can you rebase on latest master to unlock arm64 CI? :) We switched runners from actuated to the cncf provided ones.
LGTM label has been added.
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: Andreagit97, mrgian
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [Andreagit97]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment