Skip to content

wip: new(libsinsp): prepare built in tables for multithreading support#2804

Draft
gnosek wants to merge 29 commits intofalcosecurity:masterfrom
gnosek:table-cleanup
Draft

wip: new(libsinsp): prepare built in tables for multithreading support#2804
gnosek wants to merge 29 commits intofalcosecurity:masterfrom
gnosek:table-cleanup

Conversation

@gnosek
Copy link
Copy Markdown
Contributor

@gnosek gnosek commented Jan 21, 2026

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

/kind sync

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 not intended to be merged, just to show where we're going with #2802. It should get shorter over time as we merge the individual PRs (that should be easier to review than this whole series).

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@poiana
Copy link
Copy Markdown
Contributor

poiana commented Jan 21, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gnosek

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

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 21, 2026

Perf diff from master - unit tests

    15.20%    -10.70%  [.] std::__shared_count<(__gnu_cxx::_Lock_policy)2>::_M_get_use_count() const
     3.46%     +8.83%  [.] sinsp_thread_manager::create_thread_dependencies(std::shared_ptr<sinsp_threadinfo> const&)
    11.46%     +7.51%  [.] std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_add_ref_lock_nothrow()
    10.48%     +6.02%  [.] std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release()
    13.21%     +4.72%  [.] sinsp_threadinfo::get_main_thread()
     9.58%     -4.41%  [.] sinsp_threadinfo::get_fd_table()
    17.44%     -3.79%  [.] std::__shared_ptr<sinsp_threadinfo, (__gnu_cxx::_Lock_policy)2>::__shared_ptr(std::__weak_ptr<sinsp_threadinfo, (__gnu_cxx::_Lock_policy)2> const&, std::nothrow_t)
     7.31%     +0.86%  [.] std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count(std::__weak_count<(__gnu_cxx::_Lock_policy)2> const&, std::nothrow_t)
     5.19%     +0.78%  [.] thread_group_info::get_first_thread() const
     0.17%     -0.14%  [.] std::basic_string_view<char, std::char_traits<char> >::compare(std::basic_string_view<char, std::char_traits<char> >) const

Heap diff from master - unit tests

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

Heap diff from master - scap file

peak heap memory consumption: 4.47K
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.0203         -0.0200           243           238           243           238
BM_sinsp_split_median                                          -0.0236         -0.0234           243           238           243           238
BM_sinsp_split_stddev                                          -0.0153         -0.0296             2             2             2             2
BM_sinsp_split_cv                                              +0.0051         -0.0098             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_mean                  +0.0205         +0.0207            68            69            68            69
BM_sinsp_concatenate_paths_relative_path_median                +0.0268         +0.0273            68            70            68            70
BM_sinsp_concatenate_paths_relative_path_stddev                -0.0185         -0.0246             1             1             1             1
BM_sinsp_concatenate_paths_relative_path_cv                    -0.0382         -0.0444             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_mean                     +0.0169         +0.0171            42            42            42            42
BM_sinsp_concatenate_paths_empty_path_median                   +0.0573         +0.0574            40            42            40            42
BM_sinsp_concatenate_paths_empty_path_stddev                   -0.9590         -0.9592             2             0             2             0
BM_sinsp_concatenate_paths_empty_path_cv                       -0.9597         -0.9599             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_mean                  -0.0117         -0.0118            70            69            70            69
BM_sinsp_concatenate_paths_absolute_path_median                -0.0151         -0.0150            70            69            70            69
BM_sinsp_concatenate_paths_absolute_path_stddev                +1.2118         +1.2451             0             1             0             1
BM_sinsp_concatenate_paths_absolute_path_cv                    +1.2381         +1.2720             0             0             0             0

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 21, 2026

Codecov Report

❌ Patch coverage is 83.76963% with 31 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.96%. Comparing base (ce1eae3) to head (4794b80).

Files with missing lines Patch % Lines
userspace/libsinsp/state/table_adapters.h 78.00% 11 Missing ⚠️
userspace/libsinsp/fdinfo.cpp 57.14% 6 Missing ⚠️
userspace/libsinsp/threadinfo.cpp 45.45% 6 Missing ⚠️
userspace/libsinsp/state/table.cpp 66.66% 3 Missing ⚠️
userspace/libsinsp/sinsp.cpp 0.00% 2 Missing ⚠️
userspace/libsinsp/state/table_entry.h 94.28% 2 Missing ⚠️
userspace/libsinsp/plugin_tables.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2804      +/-   ##
==========================================
+ Coverage   74.94%   74.96%   +0.02%     
==========================================
  Files         297      296       -1     
  Lines       31593    31492     -101     
  Branches     4987     4947      -40     
==========================================
- Hits        23678    23609      -69     
+ Misses       7915     7883      -32     
Flag Coverage Δ
libsinsp 74.96% <83.76%> (+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.

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

@gnosek
Copy link
Copy Markdown
Contributor Author

gnosek commented Jan 21, 2026

Of course I can't repro the ASAN/UBSAN failures locally 🙃

gnosek added 25 commits April 15, 2026 16:05
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
…value_table_entry_adapter

Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
@poiana
Copy link
Copy Markdown
Contributor

poiana commented Apr 15, 2026

Thanks for your pull request. Before we can look at it, you'll need to add a 'DCO signoff' to your commits.

📝 Please follow instructions in the contributing guide to update your commits with the DCO

Full details of the Developer Certificate of Origin can be found at developercertificate.org.

The list of commits missing DCO signoff:

  • 4794b80 untemplate libsinsp::state::table_accessor::set
Details

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. I understand the commands that are listed here.

@ekoops ekoops added this to the 0.25.0 milestone Apr 16, 2026
@leogr leogr modified the milestones: 0.25.0, 0.26.0 Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

4 participants