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(ci): introduce "libsinsp" component for test coverage #1968

Merged

Conversation

LucaGuerra
Copy link
Contributor

@LucaGuerra LucaGuerra commented Jul 19, 2024

What type of PR is this?

Uncomment one (or more) /kind <> lines:

/kind bug

Any specific area of the project related to this PR?

Uncomment one (or more) /area <> lines:

/area CI

Does this PR require a change in the driver versions?

No

What this PR does / why we need it:

It seems like we can specify a "component" in this case libsinsp so we can have coverage there. The actual line coverage computed locally is about 74% but codecov seems to compute percentages a bit differently, probably because it factors in branch coverage somehow. Anyhow, let's add the libsinsp component

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

Copy link

Perf diff from master - unit tests

     5.14%     +0.90%  [.] next
     1.73%     -0.88%  [.] libsinsp::sinsp_suppress::process_event
     1.88%     -0.77%  [.] 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
     3.32%     -0.76%  [.] sinsp_thread_manager::find_thread
     5.16%     -0.73%  [.] sinsp_parser::process_event
    10.17%     +0.64%  [.] sinsp_parser::reset
     3.45%     +0.58%  [.] gzfile_read
     1.55%     -0.48%  [.] 0x00000000000e83b0
     7.19%     +0.44%  [.] sinsp::next
     0.58%     -0.40%  [.] 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_emplace<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, libsinsp::state::dynamic_struct::field_info> >

Perf diff from master - scap file

     3.88%    +12.86%  [.] sinsp_evt_formatter::tostring_withformat
    16.76%     +8.08%  [.] sinsp_filter_check::extract_nocache
    12.77%     -4.70%  [.] sinsp::next
     3.88%     +4.28%  [.] next
    11.65%     -3.98%  [.] sinsp_filter_check::tostring
    11.22%     -3.80%  [.] std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char const*>
     8.01%     -2.06%  [.] sinsp_filter_check::rawval_to_string
     4.84%     -0.40%  [.] sinsp_parser::process_event
     8.19%     -0.14%  [.] sinsp_filter_check::apply_transformers
     3.78%     +0.12%  [.] gzfile_read

Heap diff from master - unit tests

total runtime: -0.07s.
calls to allocation functions: 768 (-10971/s)
temporary memory allocations: 350 (-5000/s)
peak heap memory consumption: 0B
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B

Heap diff from master - scap file

total runtime: 0.00s.
calls to allocation functions: 0 (0/s)
temporary memory allocations: 5 (5/s)
peak heap memory consumption: 0B
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B

Copy link

codecov bot commented Jul 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 50.95%. Comparing base (6ea7fcd) to head (70b2148).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1968      +/-   ##
==========================================
- Coverage   54.99%   50.95%   -4.04%     
==========================================
  Files         305      310       +5     
  Lines       35399    39540    +4141     
  Branches     4774    17332   +12558     
==========================================
+ Hits        19466    20146     +680     
- Misses      14158    14346     +188     
- Partials     1775     5048    +3273     
Flag Coverage Δ
libsinsp ?

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.

@LucaGuerra LucaGuerra force-pushed the fix/codecov-exclude-non-libsinsp branch from 36e72e6 to a18e1ef Compare July 19, 2024 15:04
Copy link

Perf diff from master - unit tests

     7.27%     +1.37%  [.] sinsp::next
     3.48%     +0.99%  [.] gzfile_read
     4.94%     -0.59%  [.] sinsp_evt::get_type
     1.57%     -0.58%  [.] 0x00000000000e83b0
     0.49%     +0.53%  [.] thread_group_info::get_first_thread
     0.31%     +0.44%  [.] 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> >::find
     5.19%     +0.40%  [.] next
     5.21%     -0.40%  [.] sinsp_parser::process_event
     0.54%     -0.40%  [.] std::_Hashtable<long, std::pair<long const, std::shared_ptr<sinsp_fdinfo> >, std::allocator<std::pair<long const, std::shared_ptr<sinsp_fdinfo> > >, 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
     1.33%     -0.40%  [.] sinsp_threadinfo::~sinsp_threadinfo

Perf diff from master - scap file

    13.45%     +6.10%  [.] sinsp_filter_check::tostring
     4.48%     +5.80%  [.] sinsp_evt_formatter::tostring_withformat
    19.36%     -5.26%  [.] sinsp_filter_check::extract_nocache
    14.75%     -4.92%  [.] sinsp::next
    12.97%     -2.41%  [.] std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char const*>
     3.90%     +1.85%  [.] 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
     4.45%     +1.51%  [.] std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release
     9.26%     -0.65%  [.] sinsp_filter_check::rawval_to_string
     4.37%     -0.37%  [.] gzfile_read
     4.06%     -0.26%  [.] std::_Sp_counted_ptr_inplace<libsinsp::state::dynamic_struct::field_infos, std::allocator<libsinsp::state::dynamic_struct::field_infos>, (__gnu_cxx::_Lock_policy)2>::_M_destroy

Heap diff from master - unit tests

total runtime: -0.04s.
calls to allocation functions: 601 (-14658/s)
temporary memory allocations: 256 (-6243/s)
peak heap memory consumption: 0B
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B

Heap diff from master - scap file

total runtime: 0.00s.
calls to allocation functions: 0 (0/s)
temporary memory allocations: 0 (0/s)
peak heap memory consumption: 0B
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B

@LucaGuerra LucaGuerra force-pushed the fix/codecov-exclude-non-libsinsp branch from a18e1ef to 70b2148 Compare July 19, 2024 15:30
Copy link

Perf diff from master - unit tests

     1.89%     -0.60%  [.] 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
     3.47%     +0.57%  [.] gzfile_read
     1.14%     -0.55%  [.] sinsp_evt::get_ts
     0.76%     -0.55%  [.] scap_event_has_large_payload
     1.24%     -0.46%  [.] libsinsp::events::is_unknown_event
     0.16%     +0.45%  [.] sinsp_evt::is_filtered_out
     3.83%     +0.39%  [.] std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release
     3.34%     +0.38%  [.] sinsp_thread_manager::find_thread
    10.24%     +0.37%  [.] sinsp_parser::reset
     1.13%     -0.35%  [.] sinsp_parser::event_cleanup

Perf diff from master - scap file

     3.67%     +8.12%  [.] sinsp_evt_formatter::tostring_withformat
    15.83%     -5.09%  [.] sinsp_filter_check::extract_nocache
    14.22%     -4.19%  [.] 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
    11.00%     +4.05%  [.] sinsp_filter_check::tostring
    12.07%     -3.40%  [.] sinsp::next
     7.74%     -2.60%  [.] sinsp_filter_check::apply_transformers
     9.47%     -1.81%  [.] 0x00000000000a76c4
     3.57%     +1.56%  [.] sinsp_evt::get_thread_info
     3.66%     +1.34%  [.] formatted_dump
     4.57%     +0.84%  [.] sinsp_parser::process_event

Heap diff from master - unit tests

total runtime: 0.02s.
calls to allocation functions: 666 (27750/s)
temporary memory allocations: 319 (13291/s)
peak heap memory consumption: 0B
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B

Heap diff from master - scap file

total runtime: -0.01s.
calls to allocation functions: 0 (0/s)
temporary memory allocations: 1 (-166/s)
peak heap memory consumption: 0B
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B

@LucaGuerra LucaGuerra changed the title wip: fix(ci): exclude non-libsinsp files from libsinsp test coverage fix(ci): introduce isolate "libsinsp" component for test coverage Jul 19, 2024
@LucaGuerra LucaGuerra changed the title fix(ci): introduce isolate "libsinsp" component for test coverage fix(ci): introduce "libsinsp" component for test coverage Jul 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 Jul 19, 2024

LGTM label has been added.

Git tree hash: a326d8f7555f387ac04d07af62b73ac6312cfdbe

@FedeDP
Copy link
Contributor

FedeDP commented Jul 19, 2024

/milestone 0.18.0

@poiana poiana added this to the 0.18.0 milestone Jul 19, 2024
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 Jul 19, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Andreagit97, FedeDP, LucaGuerra

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:
  • OWNERS [Andreagit97,FedeDP,LucaGuerra]

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 4e3aebe into falcosecurity:master Jul 19, 2024
45 of 46 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