maybe fixed fork logging
This commit is contained in:
@@ -14,13 +14,13 @@ log() {
|
||||
}
|
||||
|
||||
count_processes() {
|
||||
find /proc -maxdepth 1 -type d -regex '/proc/[0-9]+' 2>/dev/null | wc -l
|
||||
# Avoid find -regex portability issues (busybox) by using globbing on /proc.
|
||||
ls -d /proc/[0-9]* 2>/dev/null | wc -l
|
||||
}
|
||||
|
||||
count_threads_total() {
|
||||
find /proc -maxdepth 2 -type f -regex '/proc/[0-9]+/status' -print0 2>/dev/null \
|
||||
| xargs -0 awk '/^Threads:/ {sum+=$2} END {print sum+0}' 2>/dev/null \
|
||||
|| echo 0
|
||||
# Sum Threads: from all /proc/<pid>/status entries.
|
||||
awk '/^Threads:/ {sum+=$2} END {print sum+0}' /proc/[0-9]*/status 2>/dev/null || echo 0
|
||||
}
|
||||
|
||||
get_mem_kb() {
|
||||
|
||||
Reference in New Issue
Block a user