mirror of
https://github.com/juewuy/ShellCrash.git
synced 2026-03-11 07:51:45 +00:00
Merge pull request #1100 from sofia-riese/patch-4
fix: correct VmRSS unit conversion and simplify logic
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
|
||||
running_status(){
|
||||
VmRSS=$(cat /proc/$PID/status | grep -w VmRSS | awk 'unit="MB" {printf "%.2f %s\n", $2/1000, unit}')
|
||||
VmRSS=$(awk '/^VmRSS:/ {printf "%.2f MB\n", ($2 * 1024) / 1000000}' /proc/$PID/status)
|
||||
#获取运行时长
|
||||
touch "$TMPDIR"/crash_start_time #用于延迟启动的校验
|
||||
start_time=$(cat "$TMPDIR"/crash_start_time)
|
||||
|
||||
Reference in New Issue
Block a user