Skip to content

Commit

Permalink
docs: upddate docs regarding the changes in youki-dev#2411
Browse files Browse the repository at this point in the history
Signed-off-by: fengxsong <[email protected]>
  • Loading branch information
fengxsong committed Oct 13, 2023
1 parent fd25afb commit 785899f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/src/developer/libcgroups.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This crates exposes several functions and modules that can be used to work with

- Trait `CgroupManager`, this abstracts over the underlying implementation of interacting with specific version of cgroups, and gives functions to add certain process to a certain cgroup, apply resource restrictions, get statistics of a cgroups, freeze a cgroup, remove a cgroup or get list of all processes belonging to a cgroup. v1 and v2 modules both contain a version specific cgroup manager which implements this trait, and thus either can be given to functions or structs which expects a cgroup manager, depending on which cgroups the host system uses.
- Apart from the trait, this also contains functions which help with reading cgroups files, and write data to a cgroup file, which are used throughout this crate.
- A function to detect which cgroup setup (v1, v2 or hybrid) is on the host system, as well as a function to get the corresponding cgroups manager.
- Functions to detect which cgroup setup (v1, v2 or hybrid) is on the host system with/without specified mounted cgroup root path, as well as functions to get the corresponding cgroups manager w/o cgroup root path.

- Functions and structs to get and store the statistics of a cgroups such as

Expand Down Expand Up @@ -38,4 +38,4 @@ Note that this implements the minimal required functionality for youki to use db
- Refer to see [dbus specification](https://dbus.freedesktop.org/doc/dbus-specification.html) and [header format](https://dbus.freedesktop.org/doc/api/html/structDBusHeader.html) for the individual specifications.

- For systemd interface and types, you can generate the following file and take help from the auto-generated functions
`dbus-codegen-rust -s -g -m None -d org.freedesktop.systemd1 -p /org/freedesktop/systemd1`, see https://github.com/diwic/dbus-rs
`dbus-codegen-rust -s -g -m None -d org.freedesktop.systemd1 -p /org/freedesktop/systemd1`, see https://github.com/diwic/dbus-rs
5 changes: 4 additions & 1 deletion docs/src/user/libcgroups.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ This module contains functionality that is general to any type of cgroup. Some o

- functions `write_cgroup_file_str` and `write_cgroup_file` which write data to a cgroup file
- function `read_cgroup_file` which reads data from given cgroup file
- function `get_cgroup_setup` which returns setup of cgroups (v1,v2, hybrid) on the system
- function `get_cgroup_setup_with_root` which returns setup of cgroups (v1,v2, hybrid) on the system with specified cgroup root path
- function `get_cgroup_setup` which returns setup of cgroups (v1,v2, hybrid) on the system with default cgroup root path `/sys/fs/cgroup`
- function `create_cgroup_manager_with_root` which returns corresponding cgroup manager on the system with specified cgroup root path, if the passed `root_path` argument is `None`, then it's same as function `create_cgroup_manager`
- function `create_cgroup_manager` which returns corresponding cgroup manager on the system with default cgroup root path `/sys/fs/cgroup`

### stats

Expand Down

0 comments on commit 785899f

Please sign in to comment.