Skip to content

fix(userspace/libpman): fix modern bpf engine hot-reload. #2389

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

Merged
merged 1 commit into from
May 6, 2025

Conversation

FedeDP
Copy link
Contributor

@FedeDP FedeDP commented May 6, 2025

What type of PR is this?

/kind bug

Any specific area of the project related to this PR?

/area libpman

Does this PR require a change in the driver versions?

What this PR does / why we need it:

In #2255 i forgot to manage the hot-reload case; basically, in case bpf_loop was not supported, we put as first prog the _old one, the one that is not using bpf_loop.
BUT, we lost track of the other prog (the one using bpf_loop) that, upon an hot-reload, needs to be disabled (bpf_program__set_autoload(p, false)) once again, otherwise we would try to load it and fail.
This PR addresses the issue by storing the 0-indexed prog in chosen_idx to keep track of it.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
@poiana
Copy link
Contributor

poiana commented May 6, 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

@poiana poiana requested a review from LucaGuerra May 6, 2025 10:07
@poiana poiana added the approved label May 6, 2025
@FedeDP
Copy link
Contributor Author

FedeDP commented May 6, 2025

/milestone 0.21.0

@poiana poiana added this to the 0.21.0 milestone May 6, 2025
@poiana poiana added the size/XS label May 6, 2025
@FedeDP
Copy link
Contributor Author

FedeDP commented May 6, 2025

/cc @Andreagit97

@poiana poiana requested a review from Andreagit97 May 6, 2025 10:07
Copy link

github-actions bot commented May 6, 2025

Perf diff from master - unit tests

     1.94%     -0.78%  [.] libsinsp::sinsp_suppress::process_event
     6.33%     -0.49%  [.] sinsp::next
    35.04%     +0.35%  [.] sinsp_thread_manager::create_thread_dependencies
     1.05%     -0.33%  [.] sinsp_parser::event_cleanup
     5.43%     -0.29%  [.] sinsp_evt::get_type
     6.30%     +0.28%  [.] sinsp_parser::reset
     2.67%     +0.28%  [.] gzfile_read
     0.51%     +0.22%  [.] sinsp_evt::get_ts
     0.38%     +0.18%  [.] libsinsp::events::is_unknown_event
     2.15%     +0.18%  [.] sinsp_evt::load_params

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

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.0096         +0.0097           149           151           149           151
BM_sinsp_split_median                                          +0.0037         +0.0038           150           150           150           150
BM_sinsp_split_stddev                                          +1.3237         +1.3239             1             2             1             2
BM_sinsp_split_cv                                              +1.3017         +1.3016             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_mean                  +0.0040         +0.0041            56            56            56            56
BM_sinsp_concatenate_paths_relative_path_median                +0.0002         +0.0003            56            56            56            56
BM_sinsp_concatenate_paths_relative_path_stddev                +3.2944         +3.2944             0             1             0             1
BM_sinsp_concatenate_paths_relative_path_cv                    +3.2771         +3.2768             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_mean                     +0.0486         +0.0487            24            25            24            25
BM_sinsp_concatenate_paths_empty_path_median                   +0.0465         +0.0466            24            25            24            25
BM_sinsp_concatenate_paths_empty_path_stddev                   +3.7933         +3.7981             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_cv                       +3.5713         +3.5754             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_mean                  +0.1403         +0.1404            56            64            56            64
BM_sinsp_concatenate_paths_absolute_path_median                +0.1385         +0.1386            56            64            56            64
BM_sinsp_concatenate_paths_absolute_path_stddev                +0.4586         +0.4585             0             1             0             1
BM_sinsp_concatenate_paths_absolute_path_cv                    +0.2792         +0.2789             0             0             0             0

Copy link

codecov bot commented May 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.18%. Comparing base (00641e1) to head (5841bd2).
Report is 7 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2389   +/-   ##
=======================================
  Coverage   77.18%   77.18%           
=======================================
  Files         231      231           
  Lines       30357    30357           
  Branches     4658     4658           
=======================================
  Hits        23430    23430           
  Misses       6927     6927           
Flag Coverage Δ
libsinsp 77.18% <ø> (ø)

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

github-actions bot commented May 6, 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 🟢 🟢 🟢 🟢 🟢 🟢

@github-project-automation github-project-automation bot moved this from Todo to In progress in Falco Roadmap May 6, 2025
@poiana poiana merged commit 928c973 into master May 6, 2025
48 checks passed
@github-project-automation github-project-automation bot moved this from In progress to Done in Falco Roadmap May 6, 2025
@poiana poiana deleted the fix/modern_bpf_reload branch May 6, 2025 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants