summaryrefslogtreecommitdiff
path: root/src/core/unit.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-08-18 20:58:10 +0200
committerLennart Poettering <lennart@poettering.net>2016-08-22 16:14:21 +0200
commitfe700f46ec5490efcb8da49e644bb4d781f896f2 (patch)
tree20564975ed016c16cc4029ca0c46582e484d15a9 /src/core/unit.h
parent8b3b6f588cd9aecbfb17664a5961f789b5a11386 (diff)
core: cache last CPU usage counter, before destorying a cgroup
It is useful for clients to be able to read the last CPU usage counter value of a unit even if the unit is already terminated. Hence, before destroying a cgroup's cgroup cache the last CPU usage counter and return it if the cgroup is gone.
Diffstat (limited to 'src/core/unit.h')
-rw-r--r--src/core/unit.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/core/unit.h b/src/core/unit.h
index e5a2a77b7b..31f0fef87b 100644
--- a/src/core/unit.h
+++ b/src/core/unit.h
@@ -194,6 +194,7 @@ struct Unit {
/* Where the cpu.stat or cpuacct.usage was at the time the unit was started */
nsec_t cpu_usage_base;
+ nsec_t cpu_usage_last; /* the most recently read value */
/* Counterparts in the cgroup filesystem */
char *cgroup_path;