Skip to content

Conversation

Andreagit97
Copy link
Member

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?

no

What this PR does / why we need it:

This PR adds Gvisor support to sinsp-example

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
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

@poiana
Copy link
Contributor

poiana commented Dec 5, 2024

LGTM label has been added.

Git tree hash: 8b1cc16b08e2247add2b56ae0f4ab633fb69bd92

@@ -60,10 +60,10 @@ add_library(
scap_engine_gvisor ${scap_engine_gvisor_sources} ${scap_engine_gvisor_generated_sources}
)

add_dependencies(scap_engine_gvisor uthash jsoncpp)
add_dependencies(scap_engine_gvisor uthash jsoncpp scap_event_schema)
Copy link
Member Author

Choose a reason for hiding this comment

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

in an initial attempt, i tried to add gvisor to scap open but I faced a link error for scap_event_encode_params so it seems correct to link against scap_event_schema

@poiana
Copy link
Contributor

poiana commented Dec 5, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Andreagit97, 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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Andreagit97
Copy link
Member Author

I tried to add the support to scap-open but gvisor requires the platform as a scap-open argument, the issue is that scap_gvisor_alloc_platform requires a callback to populate proc as an argument and we don't have it at scap-level. Not sure we can initialize gvisor at scap-level, but maybe I'm missing something

Copy link

github-actions bot commented Dec 5, 2024

Perf diff from master - unit tests

     2.34%     -0.97%  [.] sinsp::fetch_next_event
     3.55%     +0.82%  [.] sinsp_evt::load_params
     1.37%     +0.76%  [.] scap_event_decode_params
     8.70%     +0.67%  [.] sinsp_parser::reset
     9.35%     -0.60%  [.] sinsp::next
     2.02%     +0.58%  [.] std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release
     1.67%     -0.57%  [.] std::_Hashtable<long, std::pair<long const, std::shared_ptr<sinsp_threadinfo> >, std::allocator<std::pair<long const, std::shared_ptr<sinsp_threadinfo> > >, std::__detail::_Select1st, std::equal_to<long>, std::hash<long>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::_M_find_before_node
     6.33%     -0.51%  [.] sinsp_evt::get_type
     0.76%     -0.44%  [.] sinsp_evt::get_direction
     1.36%     -0.42%  [.] 0x00000000000eb3b0

Heap diff from master - unit tests

peak heap memory consumption: 0B
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B

Heap diff from master - scap file

peak heap memory consumption: -36B
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.0324         -0.0324           151           146           151           146
BM_sinsp_split_median                                          -0.0327         -0.0326           151           146           151           146
BM_sinsp_split_stddev                                          -0.0093         -0.0086             1             1             1             1
BM_sinsp_split_cv                                              +0.0238         +0.0246             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_mean                  +0.0168         +0.0168            61            62            61            62
BM_sinsp_concatenate_paths_relative_path_median                +0.0159         +0.0160            61            62            61            62
BM_sinsp_concatenate_paths_relative_path_stddev                +1.4904         +1.4886             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_cv                    +1.4493         +1.4475             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_mean                     -0.0010         -0.0010            25            25            25            25
BM_sinsp_concatenate_paths_empty_path_median                   -0.0001         -0.0001            25            25            25            25
BM_sinsp_concatenate_paths_empty_path_stddev                   -0.1935         -0.1935             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_cv                       -0.1927         -0.1927             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_mean                  -0.0712         -0.0712            65            61            65            61
BM_sinsp_concatenate_paths_absolute_path_median                -0.0435         -0.0435            64            61            64            61
BM_sinsp_concatenate_paths_absolute_path_stddev                -0.8056         -0.8055             2             0             2             0
BM_sinsp_concatenate_paths_absolute_path_cv                    -0.7907         -0.7906             0             0             0             0
BM_sinsp_split_container_image_mean                            -0.0306         -0.0306           398           385           398           385
BM_sinsp_split_container_image_median                          -0.0332         -0.0332           398           385           398           385
BM_sinsp_split_container_image_stddev                          +0.3504         +0.3504             2             3             2             3
BM_sinsp_split_container_image_cv                              +0.3930         +0.3931             0             0             0             0

Copy link

codecov bot commented Dec 5, 2024

Codecov Report

Attention: Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.

Project coverage is 75.06%. Comparing base (9bf9463) to head (e2ae71e).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
userspace/libsinsp/examples/test.cpp 0.00% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2185      +/-   ##
==========================================
- Coverage   75.08%   75.06%   -0.02%     
==========================================
  Files         257      257              
  Lines       33792    33799       +7     
  Branches     5781     5785       +4     
==========================================
- Hits        25373    25372       -1     
- Misses       8419     8427       +8     
Flag Coverage Δ
libsinsp 75.06% <0.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@poiana poiana merged commit 7dcb01f into falcosecurity:master Dec 5, 2024
47 of 49 checks passed
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