Skip to content

Conversation

@ekoops
Copy link
Contributor

@ekoops ekoops commented Sep 29, 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 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 performs three major tasks:

  1. revert the addition of EF_TMP_CONVERTER_MANAGED to some old enter events; since these enter events are not needed anymore by the upper layers, it is possible to leverage the new default scap converter logic dropping old enter events not having the EF_TMP_CONVERTER_MANAGED flag to do the job; this also allows to remove the corresponding entries from the event table
  2. simplify the conversion result returned by the scap converter APIs by merging CONVERSION_COMPLETED and CONVERSION_SKIP; these two converter result are not distinguishable anymore, and there is no reason to keep them separate; the new resulting code is called CONVERSION_PASS, which states clearly what is the intention (i.e.: passing the event to the upper layers)
  3. change the default behaviour of C_ACTION_STORE from "store a copy of the event and let the original one proceed to the upper layers" to "store a copy of the event and don't propagate anything to the upper layers"

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Not bumping the driver schema version is currently a practice we are following as we will bump it in a single shot once we are done with the #2068 proposal.

/milestone 0.22.0

Does this PR introduce a user-facing change?:

feat!: prevent event propagation to upper layers for `C_ACTION_STORE`
feat!: merge `CONVERSION_{COMPLETED,SKIP}` into `CONVERSION_PASS
feat!: let the scap converter drop some uneeded old enter events

Remove `EF_TMP_CONVERTER_MANAGED` flag for some some old enter events,
and remove the related conversion instructions from the scap converter
table.

BREAKING CHANGE: some old enter events are not delivered anymore to
  sinsp

Signed-off-by: Leonardo Di Giovanna <[email protected]>
Rename `C_ACTION_{SKIP,STORE_AND_SKIP}` to
`C_ACTION_{PASS,STORE_AND_PASS}` to make clearer the intention to pass
the event to the upper layers.

Signed-off-by: Leonardo Di Giovanna <[email protected]>
@github-actions
Copy link

Please double check driver/SCHEMA_VERSION file. See versioning.

/hold

@poiana
Copy link
Contributor

poiana commented Sep 29, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ekoops

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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

`C_ACTION_STORE` now stores the event in the internal scap converter
event storage and returns `CONVERSION_DROP`, preventing the event
being passed up to the upper layers.

BREAKING CHANGE: all scap converter's internally-stored events are not
  propagated anymore to sinsp

Signed-off-by: Leonardo Di Giovanna <[email protected]>
@codecov
Copy link

codecov bot commented Sep 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.18%. Comparing base (6f4e7c1) to head (c56139a).
⚠️ Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2657      +/-   ##
==========================================
- Coverage   78.21%   78.18%   -0.03%     
==========================================
  Files         292      292              
  Lines       31781    31781              
  Branches     4654     4656       +2     
==========================================
- Hits        24856    24848       -8     
- Misses       6925     6933       +8     
Flag Coverage Δ
libsinsp 78.18% <100.00%> (-0.03%) ⬇️

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.

@leogr
Copy link
Member

leogr commented Sep 30, 2025

/remove-hold

@github-project-automation github-project-automation bot moved this from Todo to In progress in Falco Roadmap Sep 30, 2025
@poiana poiana merged commit 00a87de into falcosecurity:master Sep 30, 2025
55 of 57 checks passed
@github-project-automation github-project-automation bot moved this from In progress to Done in Falco Roadmap Sep 30, 2025
@ekoops ekoops deleted the ekoops/scap-drop branch September 30, 2025 12:18
@github-actions
Copy link

Perf diff from master - unit tests

     8.48%     -2.57%  [.] sinsp::next
     4.05%     +2.42%  [.] std::_Hashtable<unsigned long, std::pair<unsigned long const, std::shared_ptr<ppm_evt_hdr> >, std::allocator<std::pair<unsigned long const, std::shared_ptr<ppm_evt_hdr> > >, std::__detail::_Select1st, std::equal_to<unsigned long>, std::hash<unsigned long>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::_M_find_before_node
     5.95%     -2.23%  [.] sinsp_thread_manager::find_thread
     2.54%     +2.07%  [.] 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.23%     -2.05%  [.] sinsp_evt::get_type
     5.70%     -1.76%  [.] sinsp_parser::reset
     1.46%     +1.45%  [.] convert_event
     0.81%     +0.97%  [.] 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> >::find
     2.78%     -0.92%  [.] sinsp_thread_manager::get_thread_ref
     2.66%     -0.85%  [.] sinsp_parser::process_event

Heap diff from master - unit tests

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

Heap diff from master - scap file

peak heap memory consumption: 1.04K
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.0496         -0.0496           152           144           152           144
BM_sinsp_split_median                                          -0.0473         -0.0473           151           144           151           144
BM_sinsp_split_stddev                                          -0.6695         -0.6693             3             1             3             1
BM_sinsp_split_cv                                              -0.6522         -0.6520             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_mean                  +0.0732         +0.0732            54            58            54            58
BM_sinsp_concatenate_paths_relative_path_median                +0.0926         +0.0927            52            57            52            57
BM_sinsp_concatenate_paths_relative_path_stddev                -0.6509         -0.6509             2             1             2             1
BM_sinsp_concatenate_paths_relative_path_cv                    -0.6747         -0.6747             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_mean                     -0.0329         -0.0329            25            24            25            24
BM_sinsp_concatenate_paths_empty_path_median                   -0.0320         -0.0319            25            24            25            24
BM_sinsp_concatenate_paths_empty_path_stddev                   -0.5685         -0.5679             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_cv                       -0.5538         -0.5532             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_mean                  +0.0550         +0.0550            60            64            60            64
BM_sinsp_concatenate_paths_absolute_path_median                +0.0534         +0.0534            60            64            60            64
BM_sinsp_concatenate_paths_absolute_path_stddev                -0.1382         -0.1384             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_cv                    -0.1832         -0.1834             0             0             0             0

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