mirror of
https://github.com/systemd/systemd.git
synced 2025-03-01 08:58:29 +03:00
Merge pull request #11109 from poettering/cgroup-cpu-acct-fixes
cgroup cpuacct controller handling fixes
This commit is contained in:
commit
52da1a8b48
7
TODO
7
TODO
@ -23,6 +23,13 @@ Janitorial Clean-ups:
|
||||
|
||||
Features:
|
||||
|
||||
* make MAINPID= message reception checks even stricter: if service uses User=,
|
||||
then check sending UID and ignore message if it doesn't match the user or
|
||||
root.
|
||||
|
||||
* maybe trigger a uevent "change" on a device if "systemctl reload xyz.device"
|
||||
is issued.
|
||||
|
||||
* when importing an fs tree with machined, optionally apply userns-rec-chown
|
||||
|
||||
* when importing an fs tree with machined, complain if image is not an OS
|
||||
|
@ -2844,23 +2844,22 @@ static int unit_get_cpu_usage_raw(Unit *u, nsec_t *ret) {
|
||||
if (unit_has_host_root_cgroup(u))
|
||||
return procfs_cpu_get_usage(ret);
|
||||
|
||||
r = cg_all_unified();
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
/* Requisite controllers for CPU accounting are not enabled */
|
||||
if ((get_cpu_accounting_mask() & ~u->cgroup_realized_mask) != 0)
|
||||
return -ENODATA;
|
||||
|
||||
r = cg_all_unified();
|
||||
if (r < 0)
|
||||
return r;
|
||||
if (r > 0) {
|
||||
_cleanup_free_ char *val = NULL;
|
||||
uint64_t us;
|
||||
|
||||
r = cg_get_keyed_attribute("cpu", u->cgroup_path, "cpu.stat", STRV_MAKE("usage_usec"), &val);
|
||||
if (r < 0)
|
||||
return r;
|
||||
if (IN_SET(r, -ENOENT, -ENXIO))
|
||||
return -ENODATA;
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
r = safe_atou64(val, &us);
|
||||
if (r < 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user