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

new(build): introduce (experimental) ThreadSanitizer builds #2014

Merged
merged 2 commits into from
Aug 21, 2024

Conversation

LucaGuerra
Copy link
Contributor

What type of PR is this?

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

/kind feature

Any specific area of the project related to this PR?

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

/area build

Does this PR require a change in the driver versions?

No

What this PR does / why we need it:

This PR allows to build libs with ThreadSanitizer support. It's useful especially for unit tests that use several threads. This works best with clang.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

new(build): add experimental ThreadSanitizer build

Signed-off-by: Luca Guerra <luca@guerra.sh>
Signed-off-by: Luca Guerra <luca@guerra.sh>
Copy link

Perf diff from master - unit tests

     6.03%     +1.23%  [.] sinsp::next
     3.29%     -1.12%  [.] scap_event_decode_params
     1.62%     +0.87%  [.] sinsp::fetch_next_event
     1.17%     -0.68%  [.] thread_group_info::get_first_thread
     0.89%     +0.64%  [.] sinsp_parser::parse_context_switch
     1.36%     -0.61%  [.] scap_event_encode_params_v
     2.96%     +0.59%  [.] sinsp_thread_manager::get_thread_ref
     5.64%     -0.52%  [.] next
     1.61%     +0.48%  [.] 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
     0.67%     -0.47%  [.] 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.38%     +9.47%  [.] sinsp_filter_check_event::extract_single
    23.39%     -5.91%  [.] sinsp_filter_check::tostring
     9.95%     -3.96%  [.] std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char const*>
    16.74%     -3.93%  [.] sinsp_filter_check::extract_nocache
     2.92%     +3.71%  [.] libsinsp::runc::match_container_id
     6.74%     -1.95%  [.] sinsp_filter_check::rawval_to_string
     6.50%     -1.81%  [.] sinsp_thread_manager::get_thread_ref
     3.38%     +1.71%  [.] sinsp::next
    10.13%     -0.24%  [.] sinsp_evt_formatter::tostring_withformat
     3.38%     -0.09%  [.] sinsp::fetch_next_event

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

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.12%. Comparing base (df21b63) to head (fde5bf9).
Report is 7 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2014   +/-   ##
=======================================
  Coverage   74.12%   74.12%           
=======================================
  Files         253      253           
  Lines       30805    30805           
  Branches     5415     5397   -18     
=======================================
  Hits        22834    22834           
+ Misses       7967     7957   -10     
- Partials        4       14   +10     
Flag Coverage Δ
libsinsp 74.12% <ø> (ø)

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 changed the title new(build): allow (experimental) ThreadSanitizer builds new(build): introduce (experimental) ThreadSanitizer builds Aug 20, 2024
@LucaGuerra
Copy link
Contributor Author

/milestone 0.18.0

@poiana poiana added this to the 0.18.0 milestone Aug 20, 2024
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.

Yesss, nice 🚀 !

/approve

@poiana
Copy link
Contributor

poiana commented Aug 20, 2024

LGTM label has been added.

Git tree hash: 978e35887b69917ccd2b6a8559a7977e1532c92b

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 Aug 21, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Andreagit97, incertum, 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,LucaGuerra,incertum]

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 5724d78 into falcosecurity:master Aug 21, 2024
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