From 0fd43cbb092c97448c7a4ccfd9f9f4d193fe6fab Mon Sep 17 00:00:00 2001 From: Leonardo Di Giovanna Date: Tue, 10 Dec 2024 15:34:45 +0100 Subject: [PATCH] feat(sinsp/threadinfo): expose thread uid and gid as static fields Signed-off-by: Leonardo Di Giovanna --- userspace/libsinsp/test/state.ut.cpp | 2 +- userspace/libsinsp/threadinfo.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/userspace/libsinsp/test/state.ut.cpp b/userspace/libsinsp/test/state.ut.cpp index b549508848..7b95e97dd2 100644 --- a/userspace/libsinsp/test/state.ut.cpp +++ b/userspace/libsinsp/test/state.ut.cpp @@ -352,7 +352,7 @@ TEST(table_registry, defs_and_access) { TEST(thread_manager, table_access) { // note: used for regression checks, keep this updated as we make // new fields available - static const int s_threadinfo_static_fields_count = 30; + static const int s_threadinfo_static_fields_count = 33; sinsp inspector; auto table = static_cast*>(inspector.m_thread_manager.get()); diff --git a/userspace/libsinsp/threadinfo.cpp b/userspace/libsinsp/threadinfo.cpp index 01d581f0c9..274eb9775b 100644 --- a/userspace/libsinsp/threadinfo.cpp +++ b/userspace/libsinsp/threadinfo.cpp @@ -77,9 +77,9 @@ libsinsp::state::static_struct::field_infos sinsp_threadinfo::static_fields() co define_static_field(ret, this, m_container_id, "container_id"); define_static_field(ret, this, m_flags, "flags"); define_static_field(ret, this, m_fdlimit, "fd_limit"); - // m_user - // m_loginuser - // m_group + define_static_field(ret, this, m_uid, "uid"); + define_static_field(ret, this, m_gid, "gid"); + define_static_field(ret, this, m_loginuid, "loginuid"); // m_cap_permitted // m_cap_effective // m_cap_inheritable