freebsd-dev/usr.bin/cpuset
Mateusz Guzik d9d5f2c042 cpuset: add --count
Can be used to count the number of hardware threads in the cpu set.

For example:
$ cpuset -g -p $$
pid 2440 mask: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
35, 36, 37, 38, 39
pid 2440 domain policy: first-touch mask: 0, 1
$ cpuset -g --count -p $$
40

The intent is to replace calls to sysctl hw.ncpu and kern.smp.cpus which
can be found in the tree, which are not adequate given existence of
cpusets.

Right now only -g -p combination is supported to reduce complexity.
As anything else errors out, this can be expanded later as needed.

Differential Revision:	https://reviews.freebsd.org/D36351
2023-02-04 17:50:41 +00:00
..
cpuset.1 cpuset: add --count 2023-02-04 17:50:41 +00:00
cpuset.c cpuset: add --count 2023-02-04 17:50:41 +00:00
Makefile Allow jail names (not just IDs) to be specified for: cpuset(1), ipfw(8), 2018-07-03 23:47:20 +00:00
Makefile.depend