Fix a bug that processes in statistics may be empty by retrieving tasks from cpuset subsystem instead of cpuacct subsystem in cgroup

This commit is contained in:
chezhang 2021-06-30 17:20:36 +08:00
Родитель 0731b03962
Коммит 15b7529103
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -22,10 +22,10 @@ function GetCpuStatFile
GetGroupFile "$groupName" cpuacct cpuacct.stat
}
function GetCpuacctTasksFile
function GetCpusetTasksFile
{
local groupName=$1
GetGroupFile "$groupName" cpuacct tasks
GetGroupFile "$groupName" cpuset tasks
}
function GetMemoryMaxusageFile
@ -44,8 +44,8 @@ if $CGInstalled && ! $cgDisabled; then
fi
statFile=$(GetCpuStatFile "$groupName")
tasksFile=$(GetCpuacctTasksFile "$groupName")
workingSetFile=$(GetMemoryMaxusageFile "$groupName")
tasksFile=$(GetCpusetTasksFile "$groupName")
cut -d" " -f2 "$statFile"
cat "$workingSetFile"