Skip to content

wip: bisect the table-cleanup PR#2811

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

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

Conversation

@gnosek
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown

github-actions bot commented Jan 22, 2026

Perf diff from master - unit tests

     9.35%    +15.27%  [.] std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count(std::__weak_count<(__gnu_cxx::_Lock_policy)2> const&, std::nothrow_t)
    16.44%    -12.47%  [.] std::__shared_count<(__gnu_cxx::_Lock_policy)2>::_M_get_use_count() const
    19.09%     -6.11%  [.] 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)
     5.86%     +4.33%  [.] thread_group_info::get_first_thread() const
     6.52%     +1.73%  [.] sinsp_threadinfo::get_fd_table()
     8.86%     +1.33%  [.] sinsp_threadinfo::get_main_thread()
     4.62%     +0.70%  [.] sinsp_thread_manager::create_thread_dependencies(std::shared_ptr<sinsp_threadinfo> const&)
    10.95%     +0.35%  [.] std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release()
    11.69%     -0.21%  [.] std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_add_ref_lock_nothrow()
     0.29%     -0.18%  [.] 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: 14.96M
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B

Heap diff from master - scap file

peak heap memory consumption: 381.73K
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.0306         +0.0306           237           244           237           244
BM_sinsp_split_median                                          +0.0316         +0.0316           237           244           237           244
BM_sinsp_split_stddev                                          -0.5343         -0.5232             1             1             1             1
BM_sinsp_split_cv                                              -0.5482         -0.5373             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_mean                  +0.0331         +0.0332            69            71            69            71
BM_sinsp_concatenate_paths_relative_path_median                +0.0529         +0.0529            68            72            68            72
BM_sinsp_concatenate_paths_relative_path_stddev                +0.5344         +0.5398             1             2             1             2
BM_sinsp_concatenate_paths_relative_path_cv                    +0.4853         +0.4903             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_mean                     +0.0130         +0.0131            42            42            42            42
BM_sinsp_concatenate_paths_empty_path_median                   +0.0146         +0.0146            42            42            42            42
BM_sinsp_concatenate_paths_empty_path_stddev                   -0.5520         -0.5557             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_cv                       -0.5578         -0.5614             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_mean                  +0.0052         +0.0052            68            69            68            69
BM_sinsp_concatenate_paths_absolute_path_median                +0.0001         +0.0002            68            68            68            68
BM_sinsp_concatenate_paths_absolute_path_stddev                +0.6797         +0.6782             1             1             1             1
BM_sinsp_concatenate_paths_absolute_path_cv                    +0.6710         +0.6695             0             0             0             0

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 22, 2026

Codecov Report

❌ Patch coverage is 83.03342% with 132 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.55%. Comparing base (7d5cc6c) to head (7b9e370).
⚠️ Report is 11 commits behind head on master.

Files with missing lines Patch % Lines
userspace/libsinsp/state/table_entry.h 76.00% 24 Missing ⚠️
userspace/libsinsp/state/table.cpp 54.54% 20 Missing ⚠️
userspace/libsinsp/state/table_adapters.h 64.91% 20 Missing ⚠️
userspace/libsinsp/fdinfo.cpp 77.61% 15 Missing ⚠️
userspace/libsinsp/state/static_struct.h 68.57% 11 Missing ⚠️
userspace/libsinsp/state/borrowed_state_data.h 72.00% 7 Missing ⚠️
userspace/libsinsp/state/type_info.h 56.25% 7 Missing ⚠️
userspace/libsinsp/state/extensible_struct.h 92.30% 5 Missing ⚠️
userspace/libsinsp/sinsp_filtercheck_thread.cpp 60.00% 4 Missing ⚠️
userspace/libsinsp/plugin.h 57.14% 3 Missing ⚠️
... and 8 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2811      +/-   ##
==========================================
- Coverage   74.67%   74.55%   -0.12%     
==========================================
  Files         292      295       +3     
  Lines       30597    30617      +20     
  Branches     4820     4811       -9     
==========================================
- Hits        22847    22827      -20     
- Misses       7750     7790      +40     
Flag Coverage Δ
libsinsp 74.55% <83.03%> (-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
Copy Markdown
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);

@gnosek gnosek force-pushed the table-cleanup-wip-bisect branch 5 times, most recently from 8aa0da8 to c6289a2 Compare February 2, 2026 10:17
@gnosek gnosek force-pushed the table-cleanup-wip-bisect branch from c6f8de9 to e4149de Compare February 9, 2026 17:33
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 <[email protected]>
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 <[email protected]>
Signed-off-by: Grzegorz Nosek <[email protected]>
Signed-off-by: Grzegorz Nosek <[email protected]>
Signed-off-by: Grzegorz Nosek <[email protected]>
@gnosek gnosek force-pushed the table-cleanup-wip-bisect branch from 9addef8 to 7b9e370 Compare February 16, 2026 15:51
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