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

wip: new(driver/modern_bpf,userspace/libpman): support multiple programs for each event #2255

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

FedeDP
Copy link
Contributor

@FedeDP FedeDP commented Jan 23, 2025

What type of PR is this?

/kind feature

Any specific area of the project related to this PR?

/area driver-modern-bpf
/area libpman

Does this PR require a change in the driver versions?

What this PR does / why we need it:

Allow to specify multiple program names for each event type and try to inject each of them until success.
This allows us to inject bpf_loop sendmmsg and recvmmsg programs where supported, and fallback at a program just sending first message where it isn't.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

This superseedes #2233

Does this PR introduce a user-facing change?:

new(driver/modern_bpf,userspace/libpman): support multiple programs for each event

@poiana
Copy link
Contributor

poiana commented Jan 23, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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

Copy link

github-actions bot commented Jan 23, 2025

Perf diff from master - unit tests

     8.16%     -0.64%  [.] sinsp_evt::get_type
     5.30%     +0.61%  [.] next_event_from_file
    10.74%     -0.59%  [.] sinsp_parser::reset
     2.89%     -0.40%  [.] sinsp_parser::process_event
     3.80%     -0.37%  [.] sinsp_evt::load_params
     1.14%     +0.36%  [.] libsinsp::sinsp_suppress::process_event
     1.78%     +0.27%  [.] std::_Hashtable<unsigned long, std::pair<unsigned long const, std::shared_ptr<ppm_evt_hdr> >, std::allocator<std::pair<unsigned long const, std::shared_ptr<ppm_evt_hdr> > >, std::__detail::_Select1st, std::equal_to<unsigned long>, std::hash<unsigned 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.88%     +0.22%  [.] sinsp_evt::get_syscall_return_value
     1.99%     -0.21%  [.] 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.57%     +0.21%  [.] sinsp_fdtable::find

Heap diff from master - unit tests

peak heap memory consumption: -5.18K
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.0610         +0.0609           144           153           144           153
BM_sinsp_split_median                                          +0.0618         +0.0617           144           153           144           153
BM_sinsp_split_stddev                                          +0.8249         +0.8251             1             2             1             2
BM_sinsp_split_cv                                              +0.7201         +0.7202             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_mean                  +0.0634         +0.0634            57            61            57            61
BM_sinsp_concatenate_paths_relative_path_median                +0.0635         +0.0635            57            61            57            61
BM_sinsp_concatenate_paths_relative_path_stddev                +0.3425         +0.3420             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_cv                    +0.2624         +0.2619             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_mean                     +0.0107         +0.0107            25            25            25            25
BM_sinsp_concatenate_paths_empty_path_median                   +0.0127         +0.0127            25            25            25            25
BM_sinsp_concatenate_paths_empty_path_stddev                   -0.4391         -0.4395             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_cv                       -0.4450         -0.4455             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_mean                  +0.0542         +0.0542            56            59            56            59
BM_sinsp_concatenate_paths_absolute_path_median                +0.0363         +0.0363            56            58            56            58
BM_sinsp_concatenate_paths_absolute_path_stddev                +5.5188         +5.5192             0             3             0             3
BM_sinsp_concatenate_paths_absolute_path_cv                    +5.1835         +5.1839             0             0             0             0
BM_sinsp_split_container_image_mean                            -0.0032         -0.0032           389           388           389           388
BM_sinsp_split_container_image_median                          -0.0025         -0.0025           389           388           389           388
BM_sinsp_split_container_image_stddev                          -0.1732         -0.1731             3             3             3             3
BM_sinsp_split_container_image_cv                              -0.1705         -0.1705             0             0             0             0

@FedeDP FedeDP changed the title new(driver/modern_bpf,userspace/libpman): support multiple programs for each event wip: new(driver/modern_bpf,userspace/libpman): support multiple programs for each event Jan 23, 2025
Copy link

codecov bot commented Jan 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.16%. Comparing base (6c46ed3) to head (24581f6).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2255   +/-   ##
=======================================
  Coverage   75.16%   75.16%           
=======================================
  Files         278      278           
  Lines       34478    34478           
  Branches     5922     5923    +1     
=======================================
  Hits        25916    25916           
  Misses       8562     8562           
Flag Coverage Δ
libsinsp 75.16% <ø> (ø)

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.

Copy link

github-actions bot commented Jan 23, 2025

X64 kernel testing matrix

KERNEL CMAKE-CONFIGURE KMOD BUILD KMOD SCAP-OPEN BPF-PROBE BUILD BPF-PROBE SCAP-OPEN MODERN-BPF SCAP-OPEN
amazonlinux2-4.19 🟢 🟢 🟢 🟢 🟢 🟡
amazonlinux2-5.10 🟢 🟢 🟢 🟢 🟢 🟢
amazonlinux2-5.15 🟢 🟢 🟢 🟢 🟢 🟢
amazonlinux2-5.4 🟢 🟢 🟢 🟢 🟢 🟡
amazonlinux2022-5.15 🟢 🟢 🟢 🟢 🟢 🟢
amazonlinux2023-6.1 🟢 🟢 🟢 🟢 🟢 🟢
archlinux-6.0 🟢 🟢 🟢 🟢 🟢 🟢
archlinux-6.7 🟢 🟢 🟢 🟢 🟢 🟢
centos-3.10 🟢 🟢 🟢 🟡 🟡 🟡
centos-4.18 🟢 🟢 🟢 🟢 🟢 🟢
centos-5.14 🟢 🟢 🟢 🟢 🟢 🟢
fedora-5.17 🟢 🟢 🟢 🟢 🟢 🟢
fedora-5.8 🟢 🟢 🟢 🟢 🟢 🟢
fedora-6.2 🟢 🟢 🟢 🟢 🟢 🟢
oraclelinux-3.10 🟢 🟢 🟢 🟡 🟡 🟡
oraclelinux-4.14 🟢 🟢 🟢 🟢 🟢 🟡
oraclelinux-5.15 🟢 🟢 🟢 🟢 🟢 🟢
oraclelinux-5.4 🟢 🟢 🟢 🟢 🟢 🟡
ubuntu-4.15 🟢 🟢 🟢 🟢 🟢 🟡
ubuntu-5.8 🟢 🟢 🟢 🟢 🟢 🟡
ubuntu-6.5 🟢 🟢 🟢 🟢 🟢 🟢

ARM64 kernel testing matrix

KERNEL CMAKE-CONFIGURE KMOD BUILD KMOD SCAP-OPEN BPF-PROBE BUILD BPF-PROBE SCAP-OPEN MODERN-BPF SCAP-OPEN
amazonlinux2-5.4 🟢 🟢 🟢 🟢 🟢 🟡
amazonlinux2022-5.15 🟢 🟢 🟢 🟢 🟢 🟢
fedora-6.2 🟢 🟢 🟢 🟢 🟢 🟢
oraclelinux-4.14 🟢 🟢 🟢 🟡 🟡 🟡
oraclelinux-5.15 🟢 🟢 🟢 🟢 🟢 🟢
ubuntu-6.5 🟢 🟢 🟢 🟢 🟢 🟢

@FedeDP FedeDP force-pushed the new/support_recvmmsg_sendmmsg_bpf_loop branch from 6096d33 to 92df24d Compare January 23, 2025 14:10
Copy link

Please double check driver/API_VERSION file. See versioning.

/hold

@FedeDP FedeDP force-pushed the new/support_recvmmsg_sendmmsg_bpf_loop branch from 3bbfcfd to aa354b6 Compare January 24, 2025 10:46
…or each event.

Try to inject each of them until success.
This allows us to inject `bpf_loop` sendmmsg and recvmmsg programs where supported,
and fallback at just sending first message where it isn't.

Signed-off-by: Federico Di Pierro <[email protected]>
@FedeDP FedeDP force-pushed the new/support_recvmmsg_sendmmsg_bpf_loop branch from aa354b6 to 24581f6 Compare January 24, 2025 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

2 participants