]> git.ipfire.org Git - thirdparty/util-linux.git/commit
taskset: make threads aware
authorDavidlohr Bueso <dave@gnu.org>
Tue, 10 May 2011 22:03:09 +0000 (18:03 -0400)
committerKarel Zak <kzak@redhat.com>
Wed, 11 May 2011 14:17:56 +0000 (16:17 +0200)
commit42708f12f0847aec30839a4531ae016b1693f9c9
tree6df5c2e29446aea64e372ab3b407deb02f920981
parentdd29a762939f95c43e3afe5e9f32be1add6ac315
taskset: make threads aware

Add a new '-a' option to view/modify the CPU affinity for an entire
group of threads belonging to a given PID.  We create two new
functions, print_affinity() and do_taskset() for code simplification.

Example:

zeus@jilguero:~/src/util-linux/schedutils$ ./taskset -a -p 01 3142
pid 3142's current affinity mask: 2
pid 3142's new affinity mask: 1
pid 3164's current affinity mask: 2
pid 3164's new affinity mask: 1
pid 854's current affinity mask: 2
pid 854's new affinity mask: 1

[kzak@redhat.com: - clean up
                  - move variables to struct taskset]

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Tested-by: Jonathan Gonzalez <zeus@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
schedutils/taskset.1
schedutils/taskset.c