Skip to content

Conversation

ekoops
Copy link
Contributor

@ekoops ekoops commented May 5, 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 sinsp_parser::reset code. Contextually, I fixed the condition checking for a scheduler switch event by adding the PPME_SCHEDSWITCH_1_E enter event type.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

Copy link

github-actions bot commented May 5, 2025

Perf diff from master - unit tests

    35.05%     -1.39%  [.] sinsp_thread_manager::create_thread_dependencies
     1.94%     -1.15%  [.] libsinsp::sinsp_suppress::process_event
     6.31%     -0.40%  [.] sinsp_parser::reset
     6.34%     +0.40%  [.] sinsp::next
     1.42%     +0.40%  [.] sinsp_parser::process_event
     0.51%     +0.36%  [.] sinsp_evt::get_ts
     5.43%     -0.30%  [.] sinsp_evt::get_type
     1.89%     +0.29%  [.] sinsp_thread_manager::get_thread_ref
     1.48%     +0.28%  [.] is_conversion_needed
     0.98%     +0.26%  [.] scap_event_decode_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.0028         +0.0029           149           150           149           150
BM_sinsp_split_median                                          +0.0006         +0.0007           150           150           150           150
BM_sinsp_split_stddev                                          -0.6214         -0.6214             1             0             1             0
BM_sinsp_split_cv                                              -0.6224         -0.6225             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_mean                  +0.0013         +0.0014            56            56            56            56
BM_sinsp_concatenate_paths_relative_path_median                +0.0031         +0.0031            56            56            56            56
BM_sinsp_concatenate_paths_relative_path_stddev                +1.0627         +1.0632             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_cv                    +1.0601         +1.0604             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_mean                     +0.0004         +0.0005            24            24            24            24
BM_sinsp_concatenate_paths_empty_path_median                   +0.0007         +0.0008            24            24            24            24
BM_sinsp_concatenate_paths_empty_path_stddev                   -0.1817         -0.1866             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_cv                       -0.1821         -0.1870             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_mean                  +0.0442         +0.0443            56            59            56            59
BM_sinsp_concatenate_paths_absolute_path_median                +0.0444         +0.0445            56            59            56            59
BM_sinsp_concatenate_paths_absolute_path_stddev                -0.2551         -0.2556             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_cv                    -0.2866         -0.2872             0             0             0             0

Copy link

codecov bot commented May 5, 2025

Codecov Report

Attention: Patch coverage is 86.30137% with 10 lines in your changes missing coverage. Please review.

Project coverage is 77.18%. Comparing base (003b502) to head (ef6205e).
Report is 24 commits behind head on master.

Files with missing lines Patch % Lines
userspace/libsinsp/parsers.cpp 86.30% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2384      +/-   ##
==========================================
+ Coverage   77.16%   77.18%   +0.01%     
==========================================
  Files         231      231              
  Lines       30339    30364      +25     
  Branches     4654     4657       +3     
==========================================
+ Hits        23412    23437      +25     
  Misses       6927     6927              
Flag Coverage Δ
libsinsp 77.18% <86.30%> (+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.

@FedeDP
Copy link
Contributor

FedeDP commented May 5, 2025

/milestone 0.21.0

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

@incertum incertum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ekoops

This is a critical section of code, and we've had many issues with this file before. There are quite a few distinct types of sub-cleanups happening here — what do you think about splitting the commits a bit? Totally fine to keep it all in this PR from my perspective.

@ekoops
Copy link
Contributor Author

ekoops commented May 5, 2025

@ekoops

This is a critical section of code, and we've had many issues with this file before. There are quite a few distinct types of sub-cleanups happening here — what do you think about splitting the commits a bit? Totally fine to keep it all in this PR from my perspective.

Yes sure, I'll split it!

ekoops added 5 commits May 6, 2025 10:02
Add event classification helpers and use them in
`sinsp_parser::reset()`.

Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
Account `PPME_SCHEDSWITCH_1_E` events as "schedswitch" event.

Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
@ekoops ekoops force-pushed the ekoops/parser-reset branch from 37a6996 to ef6205e Compare May 6, 2025 08:38
@ekoops ekoops requested a review from incertum May 6, 2025 08:38
@ekoops
Copy link
Contributor Author

ekoops commented May 6, 2025

I restructured it into multiple commits. Hope it fits your requirements! @incertum

Copy link
Contributor

@incertum incertum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ekoops thanks for the extra effort of splitting the PR into multiple commits. It made it so much easier to review ❤️

Also thanks for the comments and hints re future changes in 6d84277

Let's see what the other maintainers may spot; to me it all looks very clean and logical, plus it's a very much needed cleanup!

/approve

@poiana
Copy link
Contributor

poiana commented May 6, 2025

LGTM label has been added.

Git tree hash: 6b5fa68b3929e22deeca0ad61860b0cf99f005a5

@poiana poiana added the approved label May 6, 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

@github-project-automation github-project-automation bot moved this from Todo to In progress in Falco Roadmap 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, incertum

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 merged commit ff50d63 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/parser-reset branch May 9, 2025 07:27
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