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: chore(userspace/libsinsp): move user group manager on container_id changed refresh to a RAII object #2192

Closed
wants to merge 1 commit into from

Conversation

FedeDP
Copy link
Contributor

@FedeDP FedeDP commented Dec 9, 2024

What type of PR is this?

/kind cleanup

Any specific area of the project related to this PR?

/area libsinsp

What this PR does / why we need it:

If a way similar to #2182, move logic to refresh user/group info upon container_id changes to a RAII object instantiated by sinsp::next().
This allows to take into consideration eventual "container_id" changes made by plugin parsers.
While right now there is no need for this, it will be mandatory for the container plugin, since it will be responsible to actually write the container_id state entry for threadinfo.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@FedeDP
Copy link
Contributor Author

FedeDP commented Dec 9, 2024

/milestone 0.20.0

@poiana poiana added this to the 0.20.0 milestone Dec 9, 2024
@poiana poiana added the size/M label Dec 9, 2024
@poiana
Copy link
Contributor

poiana commented Dec 9, 2024

[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 added the approved label Dec 9, 2024
@FedeDP FedeDP force-pushed the chore/user_grp_manager_parsers_raii branch from 0c9c8c6 to 93c0fb8 Compare December 9, 2024 13:37
@poiana poiana added size/L and removed size/M labels Dec 9, 2024
…anged refresh to a RAII object.

Signed-off-by: Federico Di Pierro <[email protected]>
@FedeDP FedeDP force-pushed the chore/user_grp_manager_parsers_raii branch from 93c0fb8 to d613b3e Compare December 9, 2024 13:39
Copy link

github-actions bot commented Dec 9, 2024

Perf diff from master - unit tests

     3.05%     +2.33%  [.] sinsp_thread_manager::find_thread
     9.24%     +2.19%  [.] sinsp::next
     5.79%     +2.06%  [.] next_event_from_file
    10.56%     -1.12%  [.] sinsp_parser::reset
     3.80%     -0.86%  [.] sinsp_thread_manager::get_thread_ref
     2.27%     -0.81%  [.] scap_event_decode_params
     2.51%     -0.70%  [.] next
     8.09%     -0.63%  [.] sinsp_evt::get_type
     1.37%     -0.44%  [.] sinsp_evt::get_ts
     0.23%     +0.33%  [.] sinsp_evt::is_filtered_out

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.0307         +0.0307           142           146           142           146
BM_sinsp_split_median                                          +0.0423         +0.0424           140           146           140           146
BM_sinsp_split_stddev                                          -0.8467         -0.8468             3             1             3             1
BM_sinsp_split_cv                                              -0.8512         -0.8514             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_mean                  +0.0016         +0.0016            57            57            57            57
BM_sinsp_concatenate_paths_relative_path_median                +0.0017         +0.0016            57            57            57            57
BM_sinsp_concatenate_paths_relative_path_stddev                +0.3963         +0.3967             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_cv                    +0.3941         +0.3945             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_mean                     +0.0476         +0.0476            24            25            24            25
BM_sinsp_concatenate_paths_empty_path_median                   +0.0453         +0.0453            24            25            24            25
BM_sinsp_concatenate_paths_empty_path_stddev                   +1.7073         +1.7047             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_cv                       +1.5844         +1.5819             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_mean                  -0.0002         -0.0001            56            56            56            56
BM_sinsp_concatenate_paths_absolute_path_median                +0.0004         +0.0004            56            56            56            56
BM_sinsp_concatenate_paths_absolute_path_stddev                -0.2290         -0.2293             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_cv                    -0.2289         -0.2291             0             0             0             0
BM_sinsp_split_container_image_mean                            +0.0002         +0.0002           386           386           386           386
BM_sinsp_split_container_image_median                          -0.0008         -0.0008           387           386           387           386
BM_sinsp_split_container_image_stddev                          -0.0932         -0.0937             2             2             2             2
BM_sinsp_split_container_image_cv                              -0.0934         -0.0939             0             0             0             0

@FedeDP FedeDP changed the title chore(userspace/libsinsp): move user group manager on container_id changed refresh to a RAII object wip: chore(userspace/libsinsp): move user group manager on container_id changed refresh to a RAII object Dec 9, 2024
Copy link

codecov bot commented Dec 9, 2024

Codecov Report

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

Project coverage is 75.22%. Comparing base (0b53bd7) to head (d613b3e).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
userspace/libsinsp/user.h 97.22% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2192      +/-   ##
==========================================
+ Coverage   75.20%   75.22%   +0.02%     
==========================================
  Files         259      259              
  Lines       33890    33901      +11     
  Branches     5801     5796       -5     
==========================================
+ Hits        25487    25503      +16     
+ Misses       8403     8398       -5     
Flag Coverage Δ
libsinsp 75.22% <97.29%> (+0.02%) ⬆️

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.

@FedeDP
Copy link
Contributor Author

FedeDP commented Dec 9, 2024

/close
for now; am working on a better version.

@poiana poiana closed this Dec 9, 2024
@poiana
Copy link
Contributor

poiana commented Dec 9, 2024

@FedeDP: Closed this PR.

In response to this:

/close
for now; am working on a better version.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@FedeDP
Copy link
Contributor Author

FedeDP commented Dec 9, 2024

/reopen

@poiana
Copy link
Contributor

poiana commented Dec 9, 2024

@FedeDP: Failed to re-open PR: state cannot be changed. The chore/user_grp_manager_parsers_raii branch was force-pushed or recreated.

In response to this:

/reopen

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

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