diff options
author | Jeffrey Bosboom <jbosboom@jeffreybosboom.com> | 2024-07-25 03:14:24 +0200 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@gmail.com> | 2024-07-25 12:46:18 +0200 |
commit | f7fa6326820bbb75a2a7112072a7771944ad8ce3 (patch) | |
tree | 133762dcde4a2c2ff2af281f55c41423ee3ab580 /docs | |
parent | Merge pull request #33727 from intelfx/work/analyze-capability-masks (diff) | |
download | systemd-f7fa6326820bbb75a2a7112072a7771944ad8ce3.tar.xz systemd-f7fa6326820bbb75a2a7112072a7771944ad8ce3.zip |
docs/CONTROL_GROUP_INTERFACE.md: document accounting information available via D-Bus
Diffstat (limited to 'docs')
-rw-r--r-- | docs/CONTROL_GROUP_INTERFACE.md | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/docs/CONTROL_GROUP_INTERFACE.md b/docs/CONTROL_GROUP_INTERFACE.md index f95cf7607b..5298fa42c8 100644 --- a/docs/CONTROL_GROUP_INTERFACE.md +++ b/docs/CONTROL_GROUP_INTERFACE.md @@ -223,7 +223,7 @@ Use these APIs to register any kind of process workload with systemd to be place ### Reading Accounting Information -Note that there's currently no systemd API to retrieve accounting information from cgroups. For now, if you need to retrieve this information use `/proc/$PID/cgroup` to determine the cgroup path for your process in the `cpuacct` controller (or whichever controller matters to you), and then read the attributes directly from the cgroup tree. +Accounting information is available via the `MemoryCurrent`, `MemoryPeak`, `MemorySwapCurrent`, `MemorySwapPeak`, `MemoryZSwapCurrent`, `MemoryAvailable`, `EffectiveMemoryMax`, `EffectiveMemoryHigh`, `CPUUsageNSec`, `EffectiveCPUs`, `EffectiveMemoryNodes`, `TasksCurrent`, `EffectiveTasksMax`, `IPIngressBytes`, `IPIngressPackets`, `IPEgressBytes`, `IPEgressPackets`, `IOReadBytes`, `IOReadOperations`, `IOWriteBytes`, and `IOWriteOperations` D-Bus properties. To read this and other information directly from the cgroup tree, get the unit's cgroup path (relative to `/sys/fs/cgroup`) from the `ControlGroup` property, by calling [`sd_pid_get_cgroup()`](https://www.freedesktop.org/software/systemd/man/latest/sd_pid_get_cgroup.html), or by parsing `/proc/$PID/cgroup`. If you want to collect the exit status and other runtime parameters of your transient scope or service unit after the processes in them ended set the `RemainAfterExit` boolean property when creating it. This will has the effect that the unit will stay around even after all processes in it died, in the `SubState="exited"` state. Simply watch for state changes until this state is reached, then read the status details from the various properties you need, and finally terminate the unit via `StopUnit()` on the `Manager` object or `Stop()` on the `Unit` object itself. |