summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2024-01-09 22:55:34 +0100
committercgzones <cgzones@googlemail.com>2024-04-06 19:42:28 +0200
commit76a13dbb4ea82c0a22c8d3a74476b9446aa91a0b (patch)
tree08a3318c54c83c42bb57ea93e382673fa24b10bb
parent213411173ca92fe3efe96d0e38e89562da3f295d (diff)
Linux: do not always read /proc/<pid>/status
#1211 showed reading /proc/<pid>/status might have a significant performance impact. Do not read by default only if actually needed, since the permitted capabilities are no longer gather from it. Improves: 8ea144df ("Linux: Refactor /proc/<pid>/status parsing") Improves: #1211
-rw-r--r--linux/LinuxProcessTable.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/linux/LinuxProcessTable.c b/linux/LinuxProcessTable.c
index 9139dbe5..64a0fd93 100644
--- a/linux/LinuxProcessTable.c
+++ b/linux/LinuxProcessTable.c
@@ -1525,8 +1525,15 @@ static bool LinuxProcessTable_recurseProcTree(LinuxProcessTable* this, openat_ar
if (!LinuxProcessTable_updateUser(host, proc, procFd, mainTask))
goto errorReadingProcess;
- if (!LinuxProcessTable_readStatusFile(proc, procFd))
- goto errorReadingProcess;
+ if (ss->flags & PROCESS_FLAG_LINUX_CTXT
+ || hideRunningInContainer
+#ifdef HAVE_VSERVER
+ || ss->flags & PROCESS_FLAG_LINUX_VSERVER
+#endif
+ ) {
+ if (!LinuxProcessTable_readStatusFile(proc, procFd))
+ goto errorReadingProcess;
+ }
if (!preExisting) {

© 2014-2024 Faster IT GmbH | imprint | privacy policy