Skip to content

Conversation

ekoops
Copy link
Contributor

@ekoops ekoops commented Apr 23, 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 is part of a series #2343.
It replaces sinsp::get_lastevent_ts() and sinsp::get_new_ts() accesses in sinsp_usergroup_manager with accesses to timestamper APIs.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

new(userspace/libsinsp)!: use `timestamper` in usergroup mgr

FedeDP
FedeDP previously approved these changes Apr 23, 2025
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 Apr 23, 2025

LGTM label has been added.

Git tree hash: 5f7fa0b8cdf500df78d38636e1216d5e19d9efff

@FedeDP
Copy link
Contributor

FedeDP commented Apr 23, 2025

/milestone 0.21.0

@poiana poiana added this to the 0.21.0 milestone Apr 23, 2025
Replace `sinsp::get_lastevent_ts()` and `sinsp::get_new_ts()`
accesses in `sinsp_usergroup_manager` with accesses to `timestamper`
APIs.

BREAKING CHANGE: update `sinsp_usergroup_manager` constructor

Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
@ekoops ekoops force-pushed the ekoops/isolate-ts-usergroup-mgr branch from f17247c to 2bc276b Compare April 23, 2025 09:14
@poiana poiana removed the lgtm label Apr 23, 2025
@poiana poiana requested a review from FedeDP April 23, 2025 09:15
@poiana poiana added size/M and removed size/S labels Apr 23, 2025
Copy link

Perf diff from master - unit tests

     3.47%     +0.81%  [.] next_event_from_file
     5.93%     -0.58%  [.] sinsp_evt::get_type
    35.87%     -0.50%  [.] sinsp_thread_manager::create_thread_dependencies
     2.08%     +0.39%  [.] sinsp_evt::load_params
     0.92%     +0.30%  [.] user_group_updater::~user_group_updater
     0.70%     -0.18%  [.] std::_Hashtable<conversion_key, std::pair<conversion_key const, conversion_info>, std::allocator<std::pair<conversion_key const, conversion_info> >, std::__detail::_Select1st, std::equal_to<conversion_key>, std::hash<conversion_key>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_M_find_before_node
     6.17%     -0.18%  [.] sinsp_parser::reset
     1.07%     -0.18%  [.] user_group_updater::user_group_updater
     0.49%     +0.16%  [.] std::vector<sinsp_evt_param, std::allocator<sinsp_evt_param> >::emplace_back<sinsp_evt*, unsigned int&, char const*, unsigned long&>
     1.01%     +0.15%  [.] scap_event_decode_params

Heap diff from master - unit tests

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

Heap diff from master - scap file

peak heap memory consumption: -8B
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.0048         +0.0048           149           150           149           150
BM_sinsp_split_median                                          +0.0069         +0.0069           149           150           149           150
BM_sinsp_split_stddev                                          -0.4543         -0.4553             1             1             1             1
BM_sinsp_split_cv                                              -0.4569         -0.4579             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_mean                  +0.1806         +0.1806            56            66            56            66
BM_sinsp_concatenate_paths_relative_path_median                +0.1827         +0.1827            56            66            56            66
BM_sinsp_concatenate_paths_relative_path_stddev                +1.0547         +1.0559             0             1             0             1
BM_sinsp_concatenate_paths_relative_path_cv                    +0.7404         +0.7415             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_mean                     -0.0051         -0.0051            25            25            25            25
BM_sinsp_concatenate_paths_empty_path_median                   -0.0066         -0.0066            25            25            25            25
BM_sinsp_concatenate_paths_empty_path_stddev                   +0.2567         +0.2583             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_cv                       +0.2632         +0.2647             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_mean                  +0.1316         +0.1316            57            65            57            65
BM_sinsp_concatenate_paths_absolute_path_median                +0.1336         +0.1337            57            64            57            64
BM_sinsp_concatenate_paths_absolute_path_stddev                +0.2796         +0.2766             0             1             0             1
BM_sinsp_concatenate_paths_absolute_path_cv                    +0.1308         +0.1282             0             0             0             0

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 poiana added the lgtm label Apr 23, 2025
@poiana
Copy link
Contributor

poiana commented Apr 23, 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
Copy link
Contributor

poiana commented Apr 23, 2025

LGTM label has been added.

Git tree hash: f63337a45a0054c44c44b4403f16e20b86e2d884

Copy link

codecov bot commented Apr 23, 2025

Codecov Report

Attention: Patch coverage is 95.83333% with 1 line in your changes missing coverage. Please review.

Project coverage is 77.02%. Comparing base (997bf75) to head (2bc276b).
Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
userspace/libsinsp/user.cpp 87.50% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2368   +/-   ##
=======================================
  Coverage   77.01%   77.02%           
=======================================
  Files         229      229           
  Lines       30329    30334    +5     
  Branches     4657     4657           
=======================================
+ Hits        23359    23364    +5     
  Misses       6970     6970           
Flag Coverage Δ
libsinsp 77.02% <95.83%> (+<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.

@github-project-automation github-project-automation bot moved this from Todo to In progress in Falco Roadmap Apr 23, 2025
@poiana poiana merged commit 9f139a0 into falcosecurity:master Apr 23, 2025
47 checks passed
@github-project-automation github-project-automation bot moved this from In progress to Done in Falco Roadmap Apr 23, 2025
@ekoops ekoops deleted the ekoops/isolate-ts-usergroup-mgr branch April 23, 2025 16:31
@FedeDP FedeDP changed the title feat(userspace/libsinsp)! use timestamper in usergroup mgr new(userspace/libsinsp)!: use timestamper in usergroup mgr May 19, 2025
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