Skip to content

wip: bisect the table-cleanup PR#2811

Open
gnosek wants to merge 77 commits intofalcosecurity:masterfrom
gnosek:table-cleanup-wip-bisect
Open

wip: bisect the table-cleanup PR#2811
gnosek wants to merge 77 commits intofalcosecurity:masterfrom
gnosek:table-cleanup-wip-bisect

Conversation

@gnosek
Copy link
Contributor

@gnosek gnosek commented Jan 22, 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 serves as a CI runner for issues I can't repro locally. Don't mind me :)

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@poiana
Copy link
Contributor

poiana commented Jan 22, 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

@poiana poiana requested a review from terror96 January 22, 2026 11:01
@github-actions
Copy link

github-actions bot commented Jan 22, 2026

Perf diff from master - unit tests

    12.50%     +1.12%  [.] std::__shared_count<(__gnu_cxx::_Lock_policy)2>::_M_get_use_count() const
    12.03%     -0.91%  [.] sinsp_threadinfo::get_main_thread()
     9.89%     -0.90%  [.] std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release()
    15.31%     +0.80%  [.] 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)
     6.49%     +0.66%  [.] std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count(std::__weak_count<(__gnu_cxx::_Lock_policy)2> const&, std::nothrow_t)
     9.85%     -0.50%  [.] std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_add_ref_lock_nothrow()
     9.11%     +0.41%  [.] sinsp_threadinfo::update_main_fdtable()
     5.18%     -0.37%  [.] thread_group_info::get_first_thread() const
     3.55%     -0.24%  [.] sinsp_thread_manager::create_thread_dependencies(std::shared_ptr<sinsp_threadinfo> const&)
     0.32%     -0.22%  [.] void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char*>(char*, char*, std::forward_iterator_tag)

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.0198         -0.0200           239           234           239           234
BM_sinsp_split_median                                          -0.0178         -0.0181           238           234           238           234
BM_sinsp_split_stddev                                          -0.2539         -0.2653             2             1             2             1
BM_sinsp_split_cv                                              -0.2388         -0.2504             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_mean                  +0.0113         +0.0111            72            73            72            73
BM_sinsp_concatenate_paths_relative_path_median                +0.0162         +0.0159            72            73            72            73
BM_sinsp_concatenate_paths_relative_path_stddev                -0.5771         -0.5782             1             0             1             0
BM_sinsp_concatenate_paths_relative_path_cv                    -0.5818         -0.5828             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_mean                     +0.0325         +0.0326            40            41            40            41
BM_sinsp_concatenate_paths_empty_path_median                   +0.0199         +0.0194            39            40            39            40
BM_sinsp_concatenate_paths_empty_path_stddev                   +0.8639         +0.8727             1             1             1             1
BM_sinsp_concatenate_paths_empty_path_cv                       +0.8052         +0.8135             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_mean                  +0.0680         +0.0681            68            73            68            73
BM_sinsp_concatenate_paths_absolute_path_median                +0.0666         +0.0667            68            73            68            73
BM_sinsp_concatenate_paths_absolute_path_stddev                +0.3776         +0.3587             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_cv                    +0.2899         +0.2720             0             0             0             0

@codecov
Copy link

codecov bot commented Jan 22, 2026

Codecov Report

❌ Patch coverage is 85.83062% with 87 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.41%. Comparing base (7250ae9) to head (c6f8de9).
⚠️ Report is 11 commits behind head on master.

Files with missing lines Patch % Lines
userspace/libsinsp/state/table_adapters.h 67.24% 19 Missing ⚠️
userspace/libsinsp/state/dynamic_struct.h 91.40% 11 Missing ⚠️
userspace/libsinsp/state/static_struct.cpp 37.50% 10 Missing ⚠️
userspace/libsinsp/state/extensible_struct.h 63.15% 7 Missing ⚠️
userspace/libsinsp/state/type_info.h 56.25% 7 Missing ⚠️
userspace/libsinsp/fdinfo.cpp 62.50% 6 Missing ⚠️
userspace/libsinsp/threadinfo.cpp 53.84% 6 Missing ⚠️
userspace/libsinsp/sinsp_filtercheck_thread.cpp 33.33% 4 Missing ⚠️
userspace/libsinsp/plugin.h 57.14% 3 Missing ⚠️
userspace/libsinsp/plugin_table_api.cpp 40.00% 3 Missing ⚠️
... and 7 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2811      +/-   ##
==========================================
- Coverage   74.53%   74.41%   -0.12%     
==========================================
  Files         292      298       +6     
  Lines       29987    30476     +489     
  Branches     4660     4829     +169     
==========================================
+ Hits        22350    22679     +329     
- Misses       7637     7797     +160     
Flag Coverage Δ
libsinsp 74.41% <85.83%> (-0.12%) ⬇️

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 gnosek force-pushed the table-cleanup-wip-bisect branch 2 times, most recently from 976672c to c75e0b4 Compare January 22, 2026 15:43
auto container_id_field_ptr = dynamic_cast<libsinsp::state::typed_accessor<std::string>*>(
container_id_field.release());
if(container_id_field_ptr == nullptr) {
delete container_id_field_ptr;
Copy link
Contributor

@terror96 terror96 Jan 29, 2026

Choose a reason for hiding this comment

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

I guess this does nothing because container_id_field_ptr is nullptror ...

...and maybe something along the lines if this was the intention:

auto raw = container_id_field.release();
auto typed = dynamic_cast<libsinsp::state::typed_accessor<std::string>*>(raw);
if(typed == nullptr) {
    delete raw;   // delete the original pointer, not the cast result
    throw ...;
}
m_container_id_field.reset(typed);

This does introduce some code duplication but we'll clean it up later.

Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
This does introduce some code duplication but we'll clean it up later.

Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
This does introduce some code duplication but we'll clean it up later.

Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
@gnosek gnosek force-pushed the table-cleanup-wip-bisect branch 2 times, most recently from 5e4ff0e to 9ca1646 Compare February 2, 2026 08:41
The two obvious implementations are `static_struct`
and `dynamic_struct`, but there's another one hiding inside the STL
table adapter support code.

Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
@gnosek gnosek force-pushed the table-cleanup-wip-bisect branch 2 times, most recently from 0bee999 to 8aa0da8 Compare February 2, 2026 09:22
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
This is a wrapper around both static_struct and dynamic_struct.
Its purpose is to make life for types inheriting from both
a little bit easier (no need to disambiguate parent method calls).

Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
gnosek added 28 commits February 2, 2026 11:14
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>
…r class

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>
@gnosek gnosek force-pushed the table-cleanup-wip-bisect branch from 8aa0da8 to c6289a2 Compare February 2, 2026 10:17
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
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.

3 participants