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(libsinsp/runc): use old logic and fallback for containerd #2235

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

therealbobo
Copy link
Contributor

What type of PR is this?

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

/kind bug

/kind cleanup

/kind design

/kind documentation

/kind failing-test

/kind feature

Any specific area of the project related to this PR?

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

/area API-version

/area build

/area CI

/area driver-kmod

/area driver-bpf

/area driver-modern-bpf

/area libscap-engine-bpf

/area libscap-engine-gvisor

/area libscap-engine-kmod

/area libscap-engine-modern-bpf

/area libscap-engine-nodriver

/area libscap-engine-noop

/area libscap-engine-source-plugin

/area libscap-engine-savefile

/area libscap

/area libpman

/area libsinsp

/area tests

/area proposals

Does this PR require a change in the driver versions?

/version driver-API-version-major

/version driver-API-version-minor

/version driver-API-version-patch

/version driver-SCHEMA-version-major

/version driver-SCHEMA-version-minor

/version driver-SCHEMA-version-patch

What this PR does / why we need it:

The new logic is not always accurate. This readopts the old logic and adds a fallback to support containerd vanilla containers.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@poiana
Copy link
Contributor

poiana commented Jan 15, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: therealbobo
Once this PR has been reviewed and has the lgtm label, please assign mstemm for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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 leogr January 15, 2025 17:21
@therealbobo therealbobo changed the title Therealbobo misc fix(libsinsp/runc): use old logic and fallback for containerd Jan 15, 2025
Copy link

Perf diff from master - unit tests

     3.95%     -0.79%  [.] sinsp_thread_manager::find_thread
     9.96%     -0.78%  [.] sinsp_parser::reset
     5.46%     +0.62%  [.] next_event_from_file
     3.67%     +0.51%  [.] gzfile_read
     0.73%     +0.50%  [.] libsinsp::events::is_unknown_event
     0.33%     +0.38%  [.] convert_event
     8.26%     +0.36%  [.] sinsp_evt::get_type
     1.06%     +0.33%  [.] sinsp_parser::event_cleanup
     1.78%     -0.31%  [.] scap_event_decode_params
     1.11%     +0.29%  [.] std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char const*>

Heap diff from master - unit tests

peak heap memory consumption: -133B
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B

Heap diff from master - scap file

peak heap memory consumption: -133B
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.0206         +0.0206           148           151           148           151
BM_sinsp_split_median                                          +0.0237         +0.0236           147           151           147           151
BM_sinsp_split_stddev                                          +0.2731         +0.2729             1             1             1             1
BM_sinsp_split_cv                                              +0.2474         +0.2472             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_mean                  -0.0781         -0.0781            62            57            62            57
BM_sinsp_concatenate_paths_relative_path_median                -0.0795         -0.0795            62            57            62            57
BM_sinsp_concatenate_paths_relative_path_stddev                -0.4956         -0.4953             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_cv                    -0.4528         -0.4525             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_mean                     -0.0218         -0.0218            25            24            25            24
BM_sinsp_concatenate_paths_empty_path_median                   -0.0292         -0.0292            25            24            25            24
BM_sinsp_concatenate_paths_empty_path_stddev                   +2.6983         +2.7004             0             1             0             1
BM_sinsp_concatenate_paths_empty_path_cv                       +2.7807         +2.7828             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_mean                  -0.0902         -0.0902            61            56            61            56
BM_sinsp_concatenate_paths_absolute_path_median                -0.0876         -0.0876            61            56            61            56
BM_sinsp_concatenate_paths_absolute_path_stddev                +1.3468         +1.3473             1             2             1             2
BM_sinsp_concatenate_paths_absolute_path_cv                    +1.5795         +1.5800             0             0             0             0
BM_sinsp_split_container_image_mean                            -0.0059         -0.0059           391           389           391           389
BM_sinsp_split_container_image_median                          -0.0066         -0.0066           392           389           392           389
BM_sinsp_split_container_image_stddev                          -0.0289         -0.0279             2             2             2             2
BM_sinsp_split_container_image_cv                              -0.0231         -0.0221             0             0             0             0

Copy link

codecov bot commented Jan 15, 2025

Codecov Report

Attention: Patch coverage is 69.23077% with 4 lines in your changes missing coverage. Please review.

Project coverage is 75.11%. Comparing base (5891ebd) to head (810b2d6).

Files with missing lines Patch % Lines
userspace/libsinsp/runc.cpp 60.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2235      +/-   ##
==========================================
+ Coverage   75.09%   75.11%   +0.01%     
==========================================
  Files         276      276              
  Lines       34391    34392       +1     
  Branches     5927     5924       -3     
==========================================
+ Hits        25826    25832       +6     
+ Misses       8565     8560       -5     
Flag Coverage Δ
libsinsp 75.11% <69.23%> (+0.01%) ⬆️

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.

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.

2 participants