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

cleanup(sinsp): remove some duplicated code #2156

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

Andreagit97
Copy link
Member

What type of PR is this?

/kind cleanup

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:

Remove some duplicated code and add some tests

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

Copy link

Perf diff from master - unit tests

     3.84%     -1.16%  [.] sinsp_thread_manager::find_thread
     1.69%     +1.03%  [.] std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release
     4.56%     +1.00%  [.] sinsp_evt::get_type
     3.48%     +1.00%  [.] gzfile_read
     1.76%     -0.76%  [.] libsinsp::sinsp_suppress::process_event
     5.14%     -0.58%  [.] next
     0.67%     +0.48%  [.] sinsp_parser::event_cleanup
     2.22%     -0.43%  [.] 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
     9.85%     +0.42%  [.] sinsp_parser::reset
     2.34%     -0.39%  [.] scap_event_decode_params

Heap diff from master - unit tests

peak heap memory consumption: -438B
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.0256         -0.0256           145           141           145           141
BM_sinsp_split_median                                          -0.0267         -0.0267           145           141           145           141
BM_sinsp_split_stddev                                          +1.3316         +1.3285             1             2             1             2
BM_sinsp_split_cv                                              +1.3929         +1.3897             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_mean                  +0.0561         +0.0561            57            61            57            61
BM_sinsp_concatenate_paths_relative_path_median                +0.0503         +0.0503            58            61            58            61
BM_sinsp_concatenate_paths_relative_path_stddev                -0.7878         -0.7880             1             0             1             0
BM_sinsp_concatenate_paths_relative_path_cv                    -0.7991         -0.7993             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_mean                     -0.0461         -0.0461            25            24            25            24
BM_sinsp_concatenate_paths_empty_path_median                   -0.0433         -0.0433            25            24            25            24
BM_sinsp_concatenate_paths_empty_path_stddev                   -0.8726         -0.8727             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_cv                       -0.8665         -0.8665             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_mean                  +0.0237         +0.0237            61            63            61            63
BM_sinsp_concatenate_paths_absolute_path_median                +0.0280         +0.0280            61            63            61            63
BM_sinsp_concatenate_paths_absolute_path_stddev                -0.8320         -0.8319             1             0             1             0
BM_sinsp_concatenate_paths_absolute_path_cv                    -0.8358         -0.8358             0             0             0             0
BM_sinsp_split_container_image_mean                            -0.0129         -0.0128           385           380           385           380
BM_sinsp_split_container_image_median                          -0.0113         -0.0113           384           380           384           380
BM_sinsp_split_container_image_stddev                          +0.2194         +0.2184             3             3             3             3
BM_sinsp_split_container_image_cv                              +0.2353         +0.2343             0             0             0             0

Copy link

codecov bot commented Nov 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.82%. Comparing base (0e177db) to head (4283225).
Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2156      +/-   ##
==========================================
+ Coverage   74.77%   74.82%   +0.04%     
==========================================
  Files         254      254              
  Lines       33505    33519      +14     
  Branches     5730     5749      +19     
==========================================
+ Hits        25054    25079      +25     
+ Misses       8444     8440       -4     
+ Partials        7        0       -7     
Flag Coverage Δ
libsinsp 74.82% <100.00%> (+0.04%) ⬆️

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.


🚨 Try these New Features:

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

@poiana
Copy link
Contributor

poiana commented Nov 11, 2024

LGTM label has been added.

Git tree hash: 41341ea96e8f22fe71386f86704869db6162298f

@poiana poiana merged commit 2e1c5b6 into falcosecurity:master Nov 22, 2024
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