Skip to content
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

update(sinsp): handle (deleted) in userspace #2151

Merged
merged 2 commits into from
Nov 7, 2024

Conversation

Andreagit97
Copy link
Member

@Andreagit97 Andreagit97 commented Nov 7, 2024

What type of PR is this?

/kind cleanup

Any specific area of the project related to this PR?

/area driver-kmod

/area libsinsp

Does this PR require a change in the driver versions?

No

What this PR does / why we need it:

Before this patch, the (deleted) suffix was removed only in the kernel module since it was the unique driver that was able to generate a path with this suffix. But this is a sort of inconsistent approach because also from /proc scan we could receive a path terminating with (deleted). Since many users probably write rules like proc.exepath endswith ... seems reasonable to clean the exepath directly in userspace.

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

Copy link

github-actions bot commented Nov 7, 2024

Please double check driver/SCHEMA_VERSION file. See versioning.

/hold

@Andreagit97 Andreagit97 changed the title Handle deleted suffix update(sinsp): handle (deleted) in userspace Nov 7, 2024
@Andreagit97 Andreagit97 removed the kind/bug Something isn't working label Nov 7, 2024
@Andreagit97 Andreagit97 changed the title update(sinsp): handle (deleted) in userspace update(sinsp): handle (deleted) in userspace Nov 7, 2024
@FedeDP
Copy link
Contributor

FedeDP commented Nov 7, 2024

I think this is a sensible fix/cleanup. +1 from me!
/lgtm

@poiana
Copy link
Contributor

poiana commented Nov 7, 2024

LGTM label has been added.

Git tree hash: 891f7f134ea36dc6c0cd848abc44bfe76aa8905d

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 Nov 7, 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

Copy link

github-actions bot commented Nov 7, 2024

Perf diff from master - unit tests

     5.55%     -0.99%  [.] sinsp_evt::get_type
     9.52%     +0.82%  [.] sinsp_parser::reset
     2.43%     +0.64%  [.] sinsp_thread_manager::find_thread
     1.66%     +0.63%  [.] sinsp::fetch_next_event
     0.59%     +0.61%  [.] 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> >::find
     1.60%     -0.58%  [.] std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char*>
     3.97%     +0.58%  [.] gzfile_read
     4.94%     -0.53%  [.] next
     1.80%     -0.51%  [.] 0x00000000000ea3b0
     1.07%     -0.47%  [.] 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

Heap diff from master - unit tests

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

Heap diff from master - scap file

peak heap memory consumption: 0B
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.0236         +0.0235           152           156           152           156
BM_sinsp_split_median                                          +0.0205         +0.0203           153           156           153           156
BM_sinsp_split_stddev                                          -0.7916         -0.7920             1             0             1             0
BM_sinsp_split_cv                                              -0.7964         -0.7967             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_mean                  -0.0006         -0.0007            62            62            62            62
BM_sinsp_concatenate_paths_relative_path_median                -0.0123         -0.0124            62            62            62            62
BM_sinsp_concatenate_paths_relative_path_stddev                +0.8320         +0.8312             1             1             1             1
BM_sinsp_concatenate_paths_relative_path_cv                    +0.8332         +0.8326             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_mean                     +0.0405         +0.0404            24            25            24            25
BM_sinsp_concatenate_paths_empty_path_median                   +0.0302         +0.0301            24            25            24            25
BM_sinsp_concatenate_paths_empty_path_stddev                   +7.7036         +7.7300             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_cv                       +7.3649         +7.3909             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_mean                  -0.0064         -0.0065            63            62            62            62
BM_sinsp_concatenate_paths_absolute_path_median                -0.0150         -0.0151            63            62            63            62
BM_sinsp_concatenate_paths_absolute_path_stddev                -0.8110         -0.8110             1             0             1             0
BM_sinsp_concatenate_paths_absolute_path_cv                    -0.8098         -0.8098             0             0             0             0
BM_sinsp_split_container_image_mean                            -0.0020         -0.0021           398           397           398           397
BM_sinsp_split_container_image_median                          -0.0015         -0.0016           397           397           397           397
BM_sinsp_split_container_image_stddev                          +0.2974         +0.2967             1             2             1             2
BM_sinsp_split_container_image_cv                              +0.3000         +0.2995             0             0             0             0

Copy link

codecov bot commented Nov 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.70%. Comparing base (39c0e0d) to head (4cd2b43).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2151      +/-   ##
==========================================
+ Coverage   74.67%   74.70%   +0.03%     
==========================================
  Files         254      254              
  Lines       33513    33557      +44     
  Branches     5757     5754       -3     
==========================================
+ Hits        25027    25070      +43     
+ Misses       8486     8480       -6     
- Partials        0        7       +7     
Flag Coverage Δ
libsinsp 74.70% <100.00%> (+0.03%) ⬆️

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 ded875b into falcosecurity:master Nov 7, 2024
58 of 59 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