Skip to content

Conversation

ekoops
Copy link
Contributor

@ekoops ekoops commented May 6, 2025

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:

This PR cleans some sinsp APIs by declaring them const or static, and replaces NULL with nullptr in sinsp.cpp.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

feat(userspace/libsinsp)!: avoid arg copy in `sinsp::set_thread_pool`
feat(userspace/libsinsp)!: constify `set_track_connection_status()`

ekoops added 4 commits May 6, 2025 14:52
Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
BREAKING CHANGE: update `sinsp::set_thread_pool()` signature

Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
BREAKING CHANGE: make `sinsp::set_track_connection_status()` const

Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
Copy link

github-actions bot commented May 6, 2025

Perf diff from master - unit tests

     3.32%     +0.80%  [.] next_event_from_file
    34.77%     +0.57%  [.] sinsp_thread_manager::create_thread_dependencies
     1.08%     -0.57%  [.] sinsp_fdtable::find
     1.97%     -0.56%  [.] user_group_updater::~user_group_updater
     6.67%     -0.52%  [.] sinsp::next
     2.29%     +0.51%  [.] gzfile_read
     1.75%     -0.26%  [.] is_conversion_needed
     0.69%     -0.24%  [.] libsinsp::events::is_unknown_event
     3.90%     +0.22%  [.] sinsp_thread_manager::find_thread
     1.52%     -0.22%  [.] next

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.0002         -0.0002           149           149           149           149
BM_sinsp_split_median                                          -0.0011         -0.0011           149           149           149           149
BM_sinsp_split_stddev                                          -0.6230         -0.6232             1             0             1             0
BM_sinsp_split_cv                                              -0.6230         -0.6231             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_mean                  +0.0738         +0.0738            57            61            57            61
BM_sinsp_concatenate_paths_relative_path_median                +0.0733         +0.0733            57            61            57            61
BM_sinsp_concatenate_paths_relative_path_stddev                +0.1987         +0.1979             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_cv                    +0.1163         +0.1156             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_mean                     +0.0000         +0.0000            25            25            25            25
BM_sinsp_concatenate_paths_empty_path_median                   +0.0022         +0.0022            25            25            25            25
BM_sinsp_concatenate_paths_empty_path_stddev                   -0.5266         -0.5262             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_cv                       -0.5267         -0.5262             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_mean                  +0.0758         +0.0758            58            62            58            62
BM_sinsp_concatenate_paths_absolute_path_median                +0.0800         +0.0800            58            62            58            62
BM_sinsp_concatenate_paths_absolute_path_stddev                -0.1956         -0.1958             1             1             1             1
BM_sinsp_concatenate_paths_absolute_path_cv                    -0.2523         -0.2525             0             0             0             0

Copy link

codecov bot commented May 6, 2025

Codecov Report

Attention: Patch coverage is 61.70213% with 18 lines in your changes missing coverage. Please review.

Project coverage is 77.18%. Comparing base (59a68aa) to head (9dc808f).
Report is 9 commits behind head on master.

Files with missing lines Patch % Lines
userspace/libsinsp/sinsp.cpp 61.70% 18 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2392   +/-   ##
=======================================
  Coverage   77.18%   77.18%           
=======================================
  Files         231      231           
  Lines       30357    30359    +2     
  Branches     4658     4658           
=======================================
+ Hits        23430    23432    +2     
  Misses       6927     6927           
Flag Coverage Δ
libsinsp 77.18% <61.70%> (+<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.

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

Copy link
Contributor

@FedeDP FedeDP 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 May 6, 2025

LGTM label has been added.

Git tree hash: 899304d6f258a444469b162189f47c556074bca7

@FedeDP
Copy link
Contributor

FedeDP commented May 6, 2025

/milestone 0.21.0

@poiana poiana added this to the 0.21.0 milestone May 6, 2025
@poiana
Copy link
Contributor

poiana commented May 6, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ekoops, 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 added the approved label May 6, 2025
@github-project-automation github-project-automation bot moved this from Todo to In progress in Falco Roadmap May 6, 2025
@poiana poiana merged commit bca865f into falcosecurity:master May 6, 2025
46 of 47 checks passed
@github-project-automation github-project-automation bot moved this from In progress to Done in Falco Roadmap May 6, 2025
@ekoops ekoops deleted the ekoops/clean-sinsp branch May 9, 2025 07:28
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