Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up the table API #2193

Open
wants to merge 45 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
bf0d278
cleanup(sinsp): fold sinsp_table_input into sinsp_table_wrapper
gnosek Nov 20, 2024
35dd087
cleanup(sinsp): fold update into set/unset
gnosek Nov 20, 2024
0582bf0
cleanup(sinsp): prefer direct plugin vtable fields
gnosek Nov 20, 2024
39f4d55
cleanup(sinsp): drop sinsp_table_wrapper.m_key_type
gnosek Nov 20, 2024
5657396
cleanup(sinsp): introduce built_in_table
gnosek Nov 21, 2024
4ae8bc6
cleanup(sinsp): make m_last_owner_err public
gnosek Dec 9, 2024
bc1b39a
cleanup(sinsp): move m_field_list to base_table
gnosek Dec 9, 2024
9f993ad
cleanup(sinsp): split list_fields across table classes
gnosek Dec 9, 2024
96160f3
cleanup(sinsp): move sinsp_field_accessor_wrapper to libsinsp::state
gnosek Dec 9, 2024
6117f5b
cleanup(sinsp): split get_field across table classes
gnosek Dec 9, 2024
70f32e4
cleanup(sinsp): split add_field across table classes
gnosek Nov 21, 2024
405df4c
cleanup(sinsp): split get_name and get_size across table classes
gnosek Nov 21, 2024
f3a1c37
cleanup(sinsp): split get_entry across table classes
gnosek Nov 21, 2024
de93148
cleanup(sinsp): split release_entry across table classes
gnosek Nov 21, 2024
718abc3
cleanup(sinsp): split iterate_entries across table classes
gnosek Nov 21, 2024
277ff2c
cleanup(sinsp): split clear across table classes
gnosek Nov 21, 2024
b42c3ea
cleanup(sinsp): split erase_entry across table classes
gnosek Nov 21, 2024
5cf2804
cleanup(sinsp): split create_table_entry across table classes
gnosek Nov 21, 2024
569e1d1
cleanup(sinsp): split destroy_table_entry across table classes
gnosek Nov 21, 2024
656a661
cleanup(sinsp): split add_entry across table classes
gnosek Nov 21, 2024
d30bdb0
cleanup(sinsp): split read_entry_field across table classes
gnosek Nov 21, 2024
a9bf32f
cleanup(sinsp): split write_entry_field across table classes
gnosek Nov 21, 2024
90976b3
cleanup(sinsp): remove now unused fields from sinsp_table_wrapper
gnosek Nov 22, 2024
0bd7947
cleanup(sinsp): move get_key_as_data impls to a single place
gnosek Nov 27, 2024
14068a3
cleanup(sinsp): move sinsp_table_wrapper to state/table
gnosek Nov 25, 2024
cf5b41f
cleanup(sinsp): rename sinsp_table_wrapper to table_accessor
gnosek Nov 28, 2024
663b945
cleanup(sinsp): introduce sinsp_table_owner
gnosek Nov 25, 2024
330a85e
cleanup(sinsp): use sinsp_table_owner where we can
gnosek Nov 25, 2024
664e191
cleanup(sinsp): remove references to sinsp_table_wrapper
gnosek Nov 28, 2024
f981837
cleanup(sinsp): clean up includes in type_info.h
gnosek Dec 6, 2024
124c355
cleanup(sinsp): remove typeinfo::index_t
gnosek Dec 6, 2024
5cd37d7
cleanup(sinsp): rename typeinfo::index to type_id
gnosek Dec 6, 2024
0a4b0eb
new(sinsp)!: introduce a new C++ table api
gnosek Dec 6, 2024
54c1466
cleanup(sinsp): move m_this_ptr to built_in_table
gnosek Nov 21, 2024
3ba6d6b
cleanup(sinsp): move m_name to built_in_table
gnosek Dec 6, 2024
9149903
cleanup(sinsp): move m_static_fields to built_in_table
gnosek Nov 26, 2024
cce84a4
cleanup(sinsp): move get_entry to built_in_table
gnosek Nov 21, 2024
6f08f71
cleanup(sinsp): move entries_count to built_in_table
gnosek Nov 21, 2024
ae24a54
cleanup(sinsp): move clear to built_in_table
gnosek Nov 21, 2024
3fb47f7
cleanup(sinsp): move create_table_entry to built_in_table
gnosek Nov 21, 2024
ea5236f
cleanup(sinsp): move iterate_entries to built_in_table
gnosek Nov 21, 2024
fe11f26
cleanup(sinsp): move m_dynamic_fields to built_in_table
gnosek Nov 21, 2024
46ffabb
fix(sinsp): add explicit instantiations for table_accessor::set
gnosek Dec 13, 2024
0152ced
fix(sinsp): rename base_table::clear to clear_entries
gnosek Dec 13, 2024
7989c78
cleanup(sinsp): remove no longer necessary friend declarations
gnosek Dec 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions userspace/libsinsp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ add_library(
sinsp_suppress.cpp
events/sinsp_events.cpp
events/sinsp_events_ppm_sc.cpp
state/table.cpp
)

if(NOT WIN32
Expand Down
2 changes: 1 addition & 1 deletion userspace/libsinsp/fdinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ static const auto s_fdtable_static_fields = sinsp_fdinfo().static_fields();
// sinsp_fdtable implementation
///////////////////////////////////////////////////////////////////////////////
sinsp_fdtable::sinsp_fdtable(sinsp* inspector):
table("file_descriptors", &s_fdtable_static_fields) {
built_in_table("file_descriptors", &s_fdtable_static_fields) {
m_tid = 0;
m_inspector = inspector;
if(m_inspector != nullptr) {
Expand Down
2 changes: 1 addition & 1 deletion userspace/libsinsp/fdinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ struct sinsp_stats_v2;
///////////////////////////////////////////////////////////////////////////////
// fd info table
///////////////////////////////////////////////////////////////////////////////
class sinsp_fdtable : public libsinsp::state::table<int64_t> {
class sinsp_fdtable : public libsinsp::state::built_in_table<int64_t> {
public:
typedef std::function<bool(int64_t, sinsp_fdinfo&)> fdtable_visitor_t;

Expand Down
Loading
Loading