mirror of https://github.com/xzeldon/htop.git
Skip system slice name
This shortens paths like /system.slice/system-postgres.slice/postgres@12-main.service to /[S]/postgres@12-main. Without this some cgroup names for getty processes explode in length.
This commit is contained in:
parent
23b56193d7
commit
c4239335b9
|
@ -66,6 +66,7 @@ static bool CGroup_filterName_internal(const char *cgroup, StrBuf_state* s, StrB
|
||||||
const char* str_user_slice = "user.slice";
|
const char* str_user_slice = "user.slice";
|
||||||
const char* str_machine_slice = "machine.slice";
|
const char* str_machine_slice = "machine.slice";
|
||||||
const char* str_user_slice_prefix = "/user-";
|
const char* str_user_slice_prefix = "/user-";
|
||||||
|
const char* str_system_slice_prefix = "/system-";
|
||||||
|
|
||||||
const char* str_lxc_monitor_legacy = "lxc.monitor";
|
const char* str_lxc_monitor_legacy = "lxc.monitor";
|
||||||
const char* str_lxc_payload_legacy = "lxc.payload";
|
const char* str_lxc_payload_legacy = "lxc.payload";
|
||||||
|
@ -102,6 +103,11 @@ static bool CGroup_filterName_internal(const char *cgroup, StrBuf_state* s, StrB
|
||||||
if (!StrBuf_putsz(s, w, "[S]"))
|
if (!StrBuf_putsz(s, w, "[S]"))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (String_startsWith(cgroup, str_system_slice_prefix)) {
|
||||||
|
cgroup = strchrnul(cgroup + 1, '/');
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue