CGXGET(1)

πŸ“¦
version 3.2.0 Β· 2 versions
, in alpine 3.24, debian trixie, nixos 26.05, nixpkgs unstable, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ NAME ✨

cgxget β€” print parameter(s) of given group(s) πŸ’–


🌸 SYNOPSIS 🌸

cgxget [-1] [-2] [-i] [-n] [-v] [-b] [-r <name>] [-g <controller>] [-a]
<path> ...
cgxget [-1] [-2] [-i] [-n] [-v] [-b] [-r <name>] -g <controller>:<path>
...

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay bestie, listen. cgxget prints the parameter(s) of whatever input cgroup(s) you hand it. That's the whole vibe. ✨

Here's the tea: if you specify neither a controller nor a variable, it just shows you the values of all possible variables β€” like, everything, no cap.

And when the request's cgroup version doesn't match the system's cgroup version, cgxget will attempt to translate from one version to the other. 🧚 When the request version and the system's version are the same? No translation happens at all, and cgxget just behaves like cgget. Simple.

⚠️ But if you don't tell it which version you want β€” like, no [-1] and no [-2] β€” the behavior is undefined. Not cute. Don't do that. πŸ’€
  • <path> β€” this is the name of the cgroup that should be read. And yes, you can use this parameter multiple times. Go off. πŸŽ€

πŸ’… The Options (the main characters)

  • -1, --v1 β€” data in/out of cgxget is in cgroup v1 format. In this mode, you provide values in cgroup v1 format and you receive values in v1 format. If the system is running in cgroup v2 mode, libcgroup will convert the data as necessary. 🫢
  • -2, --v2 β€” data in/out of cgxget is in cgroup v2 format. In this mode, you provide values in cgroup v2 format and you receive values in v2 format. If the system is running in cgroup v1 mode, libcgroup will convert the data as necessary. 🫢
  • -a, --all β€” print the variables for all controllers which consist in the given cgroup. All of them. Every last one. πŸ”₯
  • -b β€” ignores the default systemd delegated hierarchy path and constructs the path of the control groups relative to the cgroup root hierarchy. (lowkey a whole different route, iykyk)
  • -g <controller> β€” defines controllers whose values should be displayed. This option can be used multiple times. 🌈
  • -g <controller>:<path> β€” defines control groups whose values should be displayed. This option can also be used multiple times. πŸ‘‘
  • -h, --help β€” display help and exit. The classic. πŸŽ€
  • -i, --ignore-unmappable β€” ignore errors for values that cannot be converted from v1 to v2 or vice versa. Basically it's giving "we don't see it, it's not there." πŸ™ˆ
  • -n β€” do not print headers, i.e. names of groups. Just the raw goods. ✨
  • -r, --variable <name> β€” defines the parameter to display. This option can be used multiple times. Stack 'em. πŸ’œ
  • -v, --values-only β€” print only values, not parameter names. Minimalist era. 🌸

πŸ“ EXAMPLES πŸ“

Not me showing you exactly how it goes. Watch this. πŸ’…

$ cgxget -1 -r cpuset.cpus -r cpuset.mems first second
first:
cpuset.cpus=0-1
cpuset.mems=0

second:
cpuset.cpus=0
cpuset.mems=0

Now with -n so the headers dip out:

$ cgxget -1 -n -r cpuset.cpus -r cpuset.mems first second
cpuset.cpus=0-1
cpuset.mems=0
cpuset.cpus=0
cpuset.mems=0

And -nv because we're only here for the values, periodt:

$ cgxget -1 -nv -r cpuset.cpus -r cpuset.mems first second
0-1
0
0
0

Grabbing a whole controller at the root:

$ cgxget -1 -n -g cpu /
cpu.rt_period_us=1000000
cpu.rt_runtime_us=950000
cpu.shares=1024

And one in v2 flavor, because we contain multitudes:

$ cgxget -2 -r cpu.max first
first:
cpu.max: max 100000

🌈 ENVIRONMENT VARIABLES 🌈

  • CGROUP_LOGLEVEL β€” controls the verbosity of the tool. Allowed values are DEBUG, INFO, WARNING or ERROR. So if you want the full play-by-play, you know where to set it. πŸ“’

πŸ’œ AUTHOR πŸ’œ

Tom Hromatka <tom.hromatka@oracle.com>


πŸ‘‘ SEE ALSO πŸ‘‘

cgrules.conf (1), cgcreate (1), cgget (1), cgset (1), cgxset (1)


okay that's the whole page, bestie β€” you ate πŸ’…βœ¨

This one came from the libcgroup Manual and it's serving Linux, dated 2022-08-03, filed under CGXGET(1). Obsessed. πŸŽ€πŸ¦‹