summaryrefslogtreecommitdiffstats
path: root/src/cgtop/cgtop.c
diff options
context:
space:
mode:
authorChris Down <chris@chrisdown.name>2018-11-17 12:47:44 +0100
committerChris Down <chris@chrisdown.name>2018-11-18 13:21:41 +0100
commit94ddb08d74559d23358cd3b75e619abf43f39197 (patch)
tree56021ba686f5bbcab0fb6290b60524b4bd1e62d0 /src/cgtop/cgtop.c
parentcgroup v2: Don't require CPU controller for CPU accounting in 4.15+ (diff)
downloadsystemd-94ddb08d74559d23358cd3b75e619abf43f39197.tar.xz
systemd-94ddb08d74559d23358cd3b75e619abf43f39197.zip
cgtop: Still try to get CPU statistics if controller-free
If CPU accounting is cheap, no controller necessarily needs to be enabled here for us to be able to read statistics.
Diffstat (limited to '')
-rw-r--r--src/cgtop/cgtop.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c
index efbfd240a6..af2ef853bd 100644
--- a/src/cgtop/cgtop.c
+++ b/src/cgtop/cgtop.c
@@ -231,7 +231,7 @@ static int process(
if (g->n_tasks > 0)
g->n_tasks_valid = true;
- } else if (STR_IN_SET(controller, "cpu", "cpuacct")) {
+ } else if (STR_IN_SET(controller, "cpu", "cpuacct") || cpu_accounting_is_cheap()) {
_cleanup_free_ char *p = NULL, *v = NULL;
uint64_t new_usage;
nsec_t timestamp;