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

fix(libsinsp): max proc lookup number logging #2164

Merged

Conversation

deepskyblue86
Copy link
Contributor

What type of PR is this?

/kind bug

Any specific area of the project related to this PR?

/area libsinsp

Does this PR require a change in the driver versions?

What this PR does / why we need it:
m_n_proc_lookups was incremented before doing the proc lookup, causing Reached max process lookup number, duration=0ms logs when max is configured to 1.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

m_n_proc_lookups was incremented before doing the proc lookup, causing
<Reached max process lookup number, duration=0ms> logs when max is
configured to 1.

Signed-off-by: Angelo Puglisi <angelopuglisi86@gmail.com>
Copy link

Perf diff from master - unit tests

     3.21%     +1.51%  [.] sinsp_parser::process_event
     9.88%     -1.02%  [.] sinsp_parser::reset
     3.62%     -0.96%  [.] sinsp_thread_manager::find_thread
     5.49%     -0.75%  [.] sinsp_evt::get_type
     4.51%     +0.55%  [.] next
     1.02%     -0.52%  [.] std::_Hashtable<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, libsinsp::state::dynamic_struct::field_info>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, libsinsp::state::dynamic_struct::field_info> >, std::__detail::_Select1st, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_M_find_before_node
     2.22%     -0.51%  [.] sinsp::fetch_next_event
     3.15%     +0.45%  [.] sinsp_evt::load_params
     0.52%     +0.40%  [.] sinsp_utils::find_longest_matching_evt_param
     2.01%     +0.40%  [.] std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release

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: 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.0185         -0.0185           146           143           146           143
BM_sinsp_split_median                                          -0.0159         -0.0159           146           144           146           144
BM_sinsp_split_stddev                                          +2.1327         +2.1368             1             2             1             2
BM_sinsp_split_cv                                              +2.1918         +2.1960             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_mean                  +0.0115         +0.0115            60            61            60            61
BM_sinsp_concatenate_paths_relative_path_median                +0.0116         +0.0116            60            61            60            61
BM_sinsp_concatenate_paths_relative_path_stddev                +0.5392         +0.5364             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_cv                    +0.5217         +0.5189             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_mean                     -0.0190         -0.0190            25            25            25            25
BM_sinsp_concatenate_paths_empty_path_median                   -0.0168         -0.0167            25            24            25            24
BM_sinsp_concatenate_paths_empty_path_stddev                   -0.4595         -0.4592             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_cv                       -0.4490         -0.4488             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_mean                  +0.0189         +0.0189            62            63            62            63
BM_sinsp_concatenate_paths_absolute_path_median                +0.0098         +0.0098            62            63            62            63
BM_sinsp_concatenate_paths_absolute_path_stddev                -0.8649         -0.8649             1             0             1             0
BM_sinsp_concatenate_paths_absolute_path_cv                    -0.8674         -0.8675             0             0             0             0
BM_sinsp_split_container_image_mean                            +0.0129         +0.0129           373           378           373           378
BM_sinsp_split_container_image_median                          +0.0142         +0.0142           372           377           372           377
BM_sinsp_split_container_image_stddev                          +0.2100         +0.2090             3             3             3             3
BM_sinsp_split_container_image_cv                              +0.1946         +0.1936             0             0             0             0

Copy link

codecov bot commented Nov 19, 2024

Codecov Report

Attention: Patch coverage is 55.55556% with 4 lines in your changes missing coverage. Please review.

Project coverage is 74.77%. Comparing base (facfcc3) to head (56d5289).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
userspace/libsinsp/threadinfo.cpp 55.55% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2164   +/-   ##
=======================================
  Coverage   74.77%   74.77%           
=======================================
  Files         254      254           
  Lines       33505    33505           
  Branches     5748     5747    -1     
=======================================
+ Hits        25053    25054    +1     
+ Misses       8452     8451    -1     
Flag Coverage Δ
libsinsp 74.77% <55.55%> (+<0.01%) ⬆️

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 19, 2024

LGTM label has been added.

Git tree hash: efcf6e609e23e648009ddaf5fce076ef581c3d65

@FedeDP
Copy link
Contributor

FedeDP commented Nov 19, 2024

/milestone 0.20.0

@poiana poiana added this to the 0.20.0 milestone Nov 19, 2024
Copy link
Member

@Andreagit97 Andreagit97 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 19, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Andreagit97, deepskyblue86, 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 Andreagit97 modified the milestones: 0.20.0, 0.19.0 Nov 19, 2024
@poiana poiana merged commit 512f9b7 into falcosecurity:master Nov 19, 2024
47 of 49 checks passed
@Andreagit97
Copy link
Member

This is probably ok for 0.19.0

@deepskyblue86 deepskyblue86 deleted the fix/reached-max-proc-lookup branch November 19, 2024 17:30
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