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(ci): move perf CI to a composite action. #1926

Merged
merged 2 commits into from
Jun 21, 2024
Merged

Conversation

FedeDP
Copy link
Contributor

@FedeDP FedeDP commented Jun 20, 2024

What type of PR is this?

/kind feature

Any specific area of the project related to this PR?

/area CI

Does this PR require a change in the driver versions?

What this PR does / why we need it:

It will be ran by perf CI on PRs and pages CI on master.
Also, add a new gh pages section with flamegraphs (svgs) built from master.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@poiana poiana requested review from hbrueckner and LucaGuerra June 20, 2024 13:38
@FedeDP FedeDP changed the title new(ci): move perf CI to a composite action. wip: new(ci): move perf CI to a composite action. Jun 20, 2024
Copy link

Perf diff from master - unit tests

@FedeDP FedeDP force-pushed the new/gh_pages_flamegraphs branch from 087b102 to bb2c268 Compare June 20, 2024 13:47
Copy link

Perf diff from master - unit tests

@FedeDP FedeDP force-pushed the new/gh_pages_flamegraphs branch from bb2c268 to 1aad3ca Compare June 20, 2024 14:01
Copy link

Perf diff from master - unit tests

     9.04%     -1.14%  [.] sinsp_thread_manager::find_thread
     1.99%     +1.06%  [.] sinsp_parser::event_cleanup
     3.57%     -0.72%  [.] std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release
     3.26%     +0.69%  [.] sinsp_evt::load_params
     0.53%     +0.65%  [.] scap_event_encode_params_v
     2.12%     +0.64%  [.] sinsp::fetch_next_event
     0.38%     +0.58%  [.] sinsp_utils::find_longest_matching_evt_param
     4.12%     +0.52%  [.] sinsp_parser::process_event
     1.19%     -0.51%  [.] std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count
     0.86%     -0.50%  [.] sinsp_parser::parse_rw_exit

Perf diff from master - scap file

    17.42%     +8.03%  [.] sinsp_filter_check::extract
    13.15%     -4.99%  [.] sinsp::next
    12.84%     -4.79%  [.] gzfile_read
     4.45%     +3.35%  [.] formatted_dump
     4.44%     +2.76%  [.] sinsp_threadinfo::~sinsp_threadinfo
    12.75%     +2.50%  [.] sinsp_evt_formatter::tostring_withformat
    17.20%     -1.67%  [.] libsinsp::runc::match_container_id
     4.44%     +0.34%  [.] sinsp_parser::reset
     4.43%     +0.34%  [.] 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
     4.44%     +0.28%  [.] sinsp_filter_check::tostring

@FedeDP FedeDP force-pushed the new/gh_pages_flamegraphs branch from 1aad3ca to 7396503 Compare June 20, 2024 14:07
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Composite action used by perf CI and pages CI.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Python script to inline an svg file inside a markdown.

@@ -17,6 +17,51 @@ jobs:
uses: ./.github/workflows/reusable_kernel_tests.yaml
secrets: inherit

perf-libs-master:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pages CI is now responsible to run perf on master.
Moreover, it generates flamegraph svg files using https://github.com/brendangregg/FlameGraph, and uploads it to be later consumed by deploy-pages job.

Copy link

Perf diff from master - unit tests

    12.82%     -1.46%  [.] sinsp_parser::reset
     4.22%     -0.90%  [.] gzfile_read
     9.11%     -0.85%  [.] sinsp_thread_manager::find_thread
     0.67%     +0.76%  [.] scap_event_decode_params
     2.14%     +0.68%  [.] sinsp::fetch_next_event
     4.02%     -0.66%  [.] sinsp_thread_manager::get_thread_ref
     7.04%     +0.58%  [.] next
     0.40%     +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> >::find
     0.87%     -0.45%  [.] sinsp_parser::parse_rw_exit
     0.86%     -0.43%  [.] sinsp_container_manager::resolve_container

Perf diff from master - scap file

    10.14%     -6.13%  [.] sinsp::next
     9.90%     -5.85%  [.] gzfile_read
    13.27%     -4.58%  [.] libsinsp::runc::match_container_id
    10.22%     -4.11%  [.] sinsp_filter_check_event::extract_single
     9.91%     -3.86%  [.] sinsp_filter_check_thread::extract_single
     3.42%     +3.20%  [.] sinsp_filter_check::tostring
     9.84%     -1.89%  [.] sinsp_evt_formatter::tostring_withformat
    13.44%     +1.80%  [.] sinsp_filter_check::extract
     6.75%     -1.51%  [.] sinsp_filter_check::rawval_to_string
     3.40%     -0.68%  [.] get_event

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extracted perf related steps to the new composite action.

It will be ran by perf CI on PRs and pages CI on master.
Also, add a new gh pages section with flamegraphs built from master.

Signed-off-by: Federico Di Pierro <[email protected]>
@FedeDP FedeDP force-pushed the new/gh_pages_flamegraphs branch from 7396503 to e55b577 Compare June 20, 2024 14:41
Copy link

Perf diff from master - unit tests

     0.67%     +1.40%  [.] scap_event_decode_params
     9.10%     -0.93%  [.] sinsp_thread_manager::find_thread
     0.94%     +0.65%  [.] sinsp_fdtable::find_ref
     4.22%     -0.56%  [.] gzfile_read
     0.40%     +0.55%  [.] sinsp_threadinfo::get_fd
     0.86%     -0.49%  [.] sinsp_container_manager::resolve_container
     0.54%     +0.48%  [.] scap_event_encode_params_v
     1.20%     +0.47%  [.] std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count
     0.25%     +0.46%  [.] scap_cgroup_get_thread
     0.38%     +0.46%  [.] sinsp_utils::find_longest_matching_evt_param

Perf diff from master - scap file

    15.82%     -7.83%  [.] libsinsp::runc::match_container_id
    12.18%     -5.34%  [.] sinsp_filter_check_event::extract_single
     4.08%     +2.79%  [.] sinsp_filter_check::tostring
     8.05%     -2.59%  [.] sinsp_filter_check::rawval_to_string
     4.07%     +2.56%  [.] 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
    16.02%     -2.35%  [.] sinsp_filter_check::extract
    11.73%     +0.46%  [.] sinsp_evt_formatter::tostring_withformat
    11.81%     +0.29%  [.] sinsp_filter_check_thread::extract_single
     4.07%     -0.04%  [.] sinsp_parser::process_event
     4.05%     +0.03%  [.] get_event

Copy link

Perf diff from master - unit tests

     8.17%     -1.85%  [.] sinsp::next
     3.62%     -1.11%  [.] std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release
     0.54%     +1.03%  [.] scap_event_encode_params_v
     0.67%     +0.99%  [.] scap_event_decode_params
     9.16%     -0.77%  [.] sinsp_thread_manager::find_thread
     2.36%     -0.76%  [.] libsinsp::sinsp_suppress::process_event
     1.02%     +0.74%  [.] sinsp_threadinfo::~sinsp_threadinfo
     4.18%     +0.73%  [.] sinsp_parser::process_event
     4.05%     +0.60%  [.] sinsp_thread_manager::get_thread_ref
     0.61%     +0.55%  [.] libsinsp::runc::match_container_id

Perf diff from master - scap file

     4.15%     +5.68%  [.] sinsp_utils::ts_to_string
    17.49%     +5.61%  [.] sinsp_filter_check::extract
    17.27%     -5.12%  [.] libsinsp::runc::match_container_id
    12.89%     -5.11%  [.] gzfile_read
     4.46%     +2.75%  [.] sinsp_filter_check::tostring
     4.45%     +2.74%  [.] sinsp_parser::process_event
     8.79%     -2.61%  [.] sinsp_filter_check::rawval_to_string
    12.80%     +0.90%  [.] sinsp_evt_formatter::tostring_withformat
    13.30%     +0.71%  [.] sinsp_filter_check_event::extract_single
     4.40%     +0.06%  [.] sinsp_thread_manager::get_thread_ref

@FedeDP FedeDP force-pushed the new/gh_pages_flamegraphs branch from 0a2ef83 to 1e2de44 Compare June 20, 2024 15:50
Copy link

Perf diff from master - unit tests

    12.69%     -2.12%  [.] sinsp_parser::reset
     6.96%     -1.71%  [.] next
     4.11%     +0.71%  [.] sinsp_parser::process_event
     8.03%     +0.64%  [.] sinsp::next
     0.66%     +0.54%  [.] scap_event_decode_params
     0.93%     +0.53%  [.] 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> >
     0.53%     +0.47%  [.] scap_event_encode_params_v
     1.19%     -0.45%  [.] std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count
     0.86%     -0.44%  [.] sinsp_parser::parse_rw_exit
     9.01%     -0.44%  [.] sinsp_thread_manager::find_thread

Perf diff from master - scap file

    11.69%     -5.44%  [.] sinsp::next
    11.41%     -5.33%  [.] gzfile_read
    11.33%     +4.63%  [.] sinsp_evt_formatter::tostring_withformat
    15.29%     -3.12%  [.] libsinsp::runc::match_container_id
    11.42%     -2.70%  [.] sinsp_filter_check_thread::extract_single
     3.83%     +2.47%  [.] sinsp_evt::get_param_as_str
    15.48%     -0.63%  [.] sinsp_filter_check::extract
     7.78%     -0.25%  [.] sinsp_filter_check::rawval_to_string
     3.95%     -0.16%  [.] formatted_dump
     3.94%     -0.13%  [.] sinsp_filter_check::tostring

…able.

Also, still do the scap file threshold check even if unit tests check failed.

Signed-off-by: Federico Di Pierro <[email protected]>
@FedeDP FedeDP force-pushed the new/gh_pages_flamegraphs branch from 1e2de44 to 92e94a9 Compare June 21, 2024 07:03
@FedeDP FedeDP changed the title wip: new(ci): move perf CI to a composite action. new(ci): move perf CI to a composite action. Jun 21, 2024
Copy link

Perf diff from master - unit tests

     0.67%     +1.43%  [.] scap_event_decode_params
     8.12%     +1.14%  [.] sinsp::next
     9.11%     -1.04%  [.] sinsp_thread_manager::find_thread
     4.02%     -0.89%  [.] sinsp_thread_manager::get_thread_ref
     2.35%     -0.79%  [.] libsinsp::sinsp_suppress::process_event
     0.61%     +0.58%  [.] libsinsp::runc::match_container_id
    12.83%     -0.56%  [.] sinsp_parser::reset
     0.58%     -0.48%  [.] sinsp_threadinfo::set_cgroups
     0.38%     +0.45%  [.] sinsp_utils::find_longest_matching_evt_param
     0.87%     -0.45%  [.] sinsp_parser::parse_rw_exit

Perf diff from master - scap file

    17.50%     +6.91%  [.] sinsp_filter_check::extract
    17.28%     -6.28%  [.] libsinsp::runc::match_container_id
     8.79%     -3.23%  [.] sinsp_filter_check::rawval_to_string
    12.91%     -3.03%  [.] sinsp_filter_check_thread::extract_single
    12.81%     -1.17%  [.] sinsp_evt_formatter::tostring_withformat
    13.31%     +0.60%  [.] sinsp_filter_check_event::extract_single
     4.45%     -0.58%  [.] sinsp_parser::process_event
     4.46%     -0.51%  [.] sinsp_filter_check::tostring
     4.45%     -0.48%  [.] 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
     4.03%     -0.43%  [.] libsinsp::container_engine::bpm::resolve

@FedeDP
Copy link
Contributor Author

FedeDP commented Jun 21, 2024

/milestone 0.18.0

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

[APPROVALNOTIFIER] This PR is APPROVED

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

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,jasondellaluce]

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 d26bc4c into master Jun 21, 2024
40 of 41 checks passed
@poiana poiana deleted the new/gh_pages_flamegraphs branch June 21, 2024 08:01
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