-
Notifications
You must be signed in to change notification settings - Fork 167
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
cleanup(userspace/libsinsp): drop user and group infos embedded in threadinfo #2165
Conversation
/milestone 0.20.0 |
3a9f7b0
to
727fce2
Compare
…readinfo. Only store `uid`, `gid` and `loginuid` info. Signed-off-by: Federico Di Pierro <[email protected]>
727fce2
to
43754ca
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2165 +/- ##
==========================================
+ Coverage 74.77% 75.06% +0.28%
==========================================
Files 254 255 +1
Lines 33505 33521 +16
Branches 5748 5719 -29
==========================================
+ Hits 25053 25162 +109
+ Misses 8452 8359 -93
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
…avior. Signed-off-by: Federico Di Pierro <[email protected]>
Perf diff from master - unit tests
Heap diff from master - unit tests
Heap diff from master - scap file
Benchmarks diff from master
|
new_child->set_user(new_child->m_user.uid()); | ||
new_child->set_loginuser(new_child->m_loginuser.uid()); | ||
new_child->set_group(new_child->m_group.gid()); | ||
new_child->set_group(new_child->m_gid); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Always group first, since it is used by set_user
as gid
to be passed to user_group_manager.add_user
: https://github.com/falcosecurity/libs/pull/2165/files#diff-f1f5adc2cc836ddaf885f86ded61c940d5c957781ea3ef5cef7f4c6f407054f7R539
userspace/libsinsp/threadinfo.cpp
Outdated
const sinsp_threadinfo::cgroups_t& sinsp_threadinfo::cgroups() const { | ||
return m_cgroups; | ||
} | ||
|
||
std::string sinsp_threadinfo::get_comm() const { | ||
return m_comm; | ||
} | ||
|
||
std::string sinsp_threadinfo::get_exe() const { | ||
return m_exe; | ||
} | ||
|
||
std::string sinsp_threadinfo::get_exepath() const { | ||
return m_exepath; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No changes here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the cleanup!
Thanks @Andreagit97 ! Pushed the changes addressing your review comments! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
ops you missed a replace of |
yup just saw that ahah |
Signed-off-by: Federico Di Pierro <[email protected]> Co-authored-by: Andrea Terzolo <[email protected]>
45cd5af
to
0791a6d
Compare
Fixed! Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Andreagit97, FedeDP The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind cleanup
Any specific area of the project related to this PR?
/area libsinsp
Does this PR require a change in the driver versions?
What this PR does / why we need it:
Only store
uid
,gid
andloginuid
info.Storing full info was done to workaround scenarios like:
Basically, we are now respecting what unix expects us to do, since user 1000 will now be mapped to "bar".
Moreover, since threadinfo is used many times, not embedding those bytes saves us lots of memory.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: