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(driver/kmod): count the right number of events and drops #2000

Merged
merged 2 commits into from
Aug 8, 2024

Conversation

Andreagit97
Copy link
Member

@Andreagit97 Andreagit97 commented Aug 8, 2024

What type of PR is this?

/kind bug

Any specific area of the project related to this PR?

/area driver-kmod

Does this PR require a change in the driver versions?

No

What this PR does / why we need it:

This PR provides 2 fixes:

  • The preemptions are now taken into consideration and we don't increment the n_evts since the event is always dropped.
  • In case of some unknown error we had just an ASSERT(false) but not a n_drops_buffer increment. This means that in production we were not able to detect if we fell into the wrong branch or not. Now we increment the n_drops_buffer metric.

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

github-actions bot commented Aug 8, 2024

Perf diff from master - unit tests

     1.68%     +1.84%  [.] libsinsp::sinsp_suppress::process_event
     6.66%     -0.93%  [.] sinsp_evt::get_type
     0.34%     +0.58%  [.] sinsp_evt::get_param
     0.67%     -0.56%  [.] libsinsp::state::value_table_entry_adapter<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::dynamic_fields_t::dynamic_fields_t
     5.66%     -0.56%  [.] sinsp_parser::process_event
     4.65%     -0.48%  [.] gzfile_read
     0.89%     +0.47%  [.] libsinsp::events::is_unknown_event
     1.63%     -0.47%  [.] std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char const*>
     0.88%     -0.37%  [.] sinsp_split[abi:cxx11]
     4.81%     +0.37%  [.] next

Perf diff from master - scap file

    20.67%     -2.19%  [.] sinsp_evt_formatter::tostring_withformat
     8.26%     -2.00%  [.] sinsp_filter_check_container::extract_single
     4.14%     +1.95%  [.] sinsp_utils::ts_to_string
     8.28%     +1.81%  [.] sinsp_filter_check::extract_nocache
     5.36%     -0.64%  [.] sinsp_filter_check_thread::extract_single
    11.79%     +0.22%  [.] 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
     4.55%     -0.20%  [.] sinsp_threadinfo::~sinsp_threadinfo
     8.25%     -0.09%  [.] sinsp::next
     4.14%     -0.07%  [.] sinsp_filter_check::apply_transformers
     4.13%     -0.05%  [.] sinsp_parser::reset

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

Copy link

codecov bot commented Aug 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.08%. Comparing base (a118b0f) to head (b64057c).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2000      +/-   ##
==========================================
- Coverage   74.08%   74.08%   -0.01%     
==========================================
  Files         253      253              
  Lines       30766    30766              
  Branches     5399     5417      +18     
==========================================
- Hits        22794    22792       -2     
- Misses       7946     7970      +24     
+ Partials       26        4      -22     
Flag Coverage Δ
libsinsp 74.08% <ø> (-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.

@poiana
Copy link
Contributor

poiana commented Aug 8, 2024

LGTM label has been added.

Git tree hash: 074d6896e3619b806bab345fb12befa56ca0cd9d

Copy link
Contributor

@incertum incertum 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 Aug 8, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Andreagit97, incertum

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 poiana merged commit 686dfc0 into falcosecurity:master Aug 8, 2024
51 of 55 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