summaryrefslogtreecommitdiffstats
path: root/schedutils
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'chcpu' of ↵Karel Zak2011-08-311-1/+1
|\ | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/heiko/util-linux * 'chcpu' of git://git.kernel.org/pub/scm/linux/kernel/git/heiko/util-linux: chcpu: new tool cpuset: add option to allow cpulist_parse() to fail
| * cpuset: add option to allow cpulist_parse() to failHeiko Carstens2011-08-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This is a preparation patch for chcpu. If a cpu should be added to a cpu_set where the cpu doesn't fit into the cpu_set this got silently ignored. Since the cpu-list is user space provided it should be checked if cpus are specified that are completely out of range of the system. In order to do that add a parameter which specifies if cpulist_parse() should fail if it parses a cpu-list with "impossible" cpus. The current callers have been converted so they behave like before. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
* | ionice: adjust synopsis and wording and formatting on the man pageBenno Schulenberg2011-08-291-27/+29
| | | | | | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* | docs: uniformize the header and footer lines in man pagesBenno Schulenberg2011-08-223-7/+7
|/ | | | | | | | | | Use dates without the day, use the full month name, put "util-linux" in the lower left corner, and "User Commands" or "System Administration" at the top center. Also improve here and there the one-line program description. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* ionice: slightly improve grammar, spacing and consistency of man pageBenno Schulenberg2011-08-081-37/+35Star
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* taskset: adjust style of man pageBenno Schulenberg2011-08-081-7/+7
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* chrt: adjust style of man page, alphabetize option -pBenno Schulenberg2011-08-081-28/+32
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* chrt: silently ignore -R if unsupportedKarel Zak2011-08-021-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* ionice: fix compiler warnings [-Wsign-compare]Karel Zak2011-08-011-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: use unsigned int for bit-filedsKarel Zak2011-07-291-1/+1
| | | | | Reported-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* ionice: make -t more tolerantKarel Zak2011-07-221-5/+11
| | | | | | | | | | | | | | | | | | | | | * replace errx() with warnx() for unknown -c class The right place to check I/O scheduler features is in kernel. We should not try to be more smart than kernel. * make the code ready (robust) for unknown sched.classes * fix -t behavior old version: $ ionice -c 4 -t bash ionice: bad prio class 4 new version: $ ionice -c 4 -t bash Reported-by: Voelker, Bernhard" <bernhard.voelker@siemens-enterprise.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* ionice: allow to use names for -c <class>Karel Zak2011-07-222-14/+37
| | | | | | | | for example: $ ionice -c best-effort bash Signed-off-by: Karel Zak <kzak@redhat.com>
* ionice: improve command line interpretationKarel Zak2011-07-222-19/+33
| | | | | | | | | | | | | ionice : print the current I/O prio. ionice COMMAND : exec command with default (best-effort) class ionice -p PID [...] : return info about the PID(s) ionice -c CLASS COMMAND : exec command with the class ionice -c CLASS -p PID [...] : modify PID(s) class This should be backwardly compatible and also compatible with nice(1) from coreutils. Signed-off-by: Karel Zak <kzak@redhat.com>
* chrt: add strings to use NLSSami Kerola2011-07-211-3/+3
| | | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* taskset: coding style fixesSami Kerola2011-07-211-17/+17
| | | | | | | Reindentation and deletion of few empty lines etc. There is no actual code changes in this patch. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* taskset: include-what-you-use header checkSami Kerola2011-07-211-0/+3
| | | | | | | | | taskset.c should add these lines: #include <sched.h> for sched_getaffinity, etc #include <stddef.h> for size_t #include <string.h> for memset Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* docs: mention long options in ionice.1Sami Kerola2011-07-211-16/+28
| | | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* ionice: coding style fixesSami Kerola2011-07-211-5/+4Star
| | | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* ionice: fix -V outputSami Kerola2011-07-211-1/+1
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* ionice: fix -pKarel Zak2011-07-211-2/+6
| | | | | | | | | | | | | | | | | $ ionice 123 none: prio 4 none: prio 4 It calls ioprio_get(0x1, 0) and ioprio_get(0x1, 123), because the code does not check it the "-p" options was specified. The proper command line syntax is: $ ionice -p 123 and the ioprio_get() should be called only once. Signed-off-by: Karel Zak <kzak@redhat.com>
* ionice: IOPRIO_PRIO_* macrosKarel Zak2011-07-211-23/+30
| | | | | | | | * make the code more robust * follow kernel conventions for variable names (data = classdata, ioprio = classdata | class) Signed-off-by: Karel Zak <kzak@redhat.com>
* ionice: add long optionsSami Kerola2011-07-211-16/+38
| | | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* chrt: coding style fixSami Kerola2011-07-211-20/+26
| | | | | | | Make horizontal list vertical and few other enhancements to readability. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* chrt: data type compiler warning fixedSami Kerola2011-07-211-1/+1
| | | | | | | chrt.c:158:16: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare] Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* build-sys: move BUILD_SCHEDUTILS to top-level MakefileKarel Zak2011-06-201-4/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* chrt: clarify use of -a optionDavidlohr Bueso2011-05-171-1/+1
| | | | | | | With this option we can operate on all the thread group of a process not just for changes, but also when obtaining information via sched_getscheduler(). Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* taskset: make threads awareDavidlohr Bueso2011-05-112-47/+103
| | | | | | | | | | | | | | | | | | | | | | | 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>
* taskset: use xalloc libDavidlohr Bueso2011-05-111-3/+2Star
| | | | Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* chrt.1: fix grammarDavidlohr Bueso2011-05-101-1/+1
| | | | | | Corrent the English grammar for the new -a option. Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* chrt: allow to use --all-tasks when retrieve infoKarel Zak2011-05-052-5/+16
| | | | | | | | | | master thread: $ chrt --pid $(pidof firefox) all threads: $ chrt --all-tasks --pid $(pidof firefox) Signed-off-by: Karel Zak <kzak@redhat.com>
* chrt: make threads awareDavidlohr Bueso2011-05-053-5/+30
| | | | | | | | | | | | | | | | | | | | | | | | | Currently this program works only with the master thread. Add a '-t' option to propagate changes to the entire group of threads. Example: root@offworld:~/projects/util-linux/schedutils# ls /proc/2111/task/ 2111 2112 2119 2121 2138 2139 2159 2160 root@offworld:~/projects/util-linux/schedutils# ./chrt -p 2111 pid 2111's current scheduling policy: SCHED_RR pid 2111's current scheduling priority: 3 root@offworld:~/projects/util-linux/schedutils# ./chrt -t -p 2 2111 root@offworld:~/projects/util-linux/schedutils# ./chrt -p 2112 pid 2112's current scheduling policy: SCHED_RR pid 2112's current scheduling priority: 2 root@offworld:~/projects/util-linux/schedutils# ./chrt -p 2111 pid 2111's current scheduling policy: SCHED_RR pid 2111's current scheduling priority: 2 [kzak@redhat.com: - rename -t/--thread to -a/--all-tasks] Signed-off-by: Davidlohr Bueso <dave@gnu.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* move struct option to .rodataKarel Zak2011-03-032-2/+2
| | | | | | | It does not make sense to have writable large arrays of "struct option" on the stack. Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: provide alternatives for err, errx, warn and warnxFabian Groffen2011-02-143-5/+2Star
| | | | | | | | Solaris lacks err, errx, warn and warnx. This also means the err.h header doesn't exist. Removed err.h include from all files, and included err.h from c.h instead if it exists, otherwise alternatives are provided. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* schedutils: remove unneeded header filesDavidlohr Bueso2011-02-082-5/+0Star
| | | | Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* schedutils: fix typosDavidlohr Bueso2011-01-172-2/+2
| | | | Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* rename util-linux-ng back to util-linuxKarel Zak2010-11-303-6/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib: [strutils] general purpose string handling functionsDavidlohr Bueso2010-11-236-53/+12Star
| | | | | | | | | | | | | This patch replaces a few functions used throughout the source: * Renames getnum (from schedutils) to strtol_or_err * Moves strtosize (from lib/strtosize.c) * Moves xstrncpy (from include/xstrncpy.h) * Adds strnlen, strnchr and strndup if not available (remove it from libmount utils) A few Makefile.am files were modified to compile accordingly along with trivial renaming in schedutils source code. Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* chrt: Add noreturn attribute to show_usage() functionMarek Polacek2010-10-291-1/+1
| | | | Signed-off-by: Marek Polacek <mmpolacek@gmail.com>
* taskset: proper numbers parsingKarel Zak2010-09-306-35/+61
| | | | | Reported-by: Davidlohr Bueso <dave@gnu.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* chrt: add --verbose to man page, correct -V for --version, alphabetizeBenno Schulenberg2010-06-151-13/+16
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* chrt: slice help text into manageable chunks for translatorsBenno Schulenberg2010-06-151-6/+13
| | | | | | | [kzak@redhat.com: - clean up usage() function] Signed-off-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* chrt: change two messages into four translatable sentencesBenno Schulenberg2010-06-151-6/+14
| | | | | | | | | | | In several languages the translations for "current" and "new" will have to be slightly different depending on whether they apply to "policy" or "priority". (As a general rule, translatable messages should be full sentences, and not partial ones with optional words filled in via %s.) Signed-off-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: minor changes for GNU/HurdSamuel Thibault2010-06-141-0/+10
| | | | | | Here is a patch to fix the build on GNU/Hurd. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
* taskset: move NR_CPUS determination to lib/cpuset.cKarel Zak2010-06-011-36/+3Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* taskset: add NLS support, use err.h, cleanupKarel Zak2010-06-011-101/+78Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* taskset: use libc based cpu_set_tKarel Zak2010-06-011-35/+47
| | | | | | | The glibc already supports dynamically allocated CPU sets. We don't have to maintains our private non-compatible implementation. Signed-off-by: Karel Zak <kzak@redhat.com>
* taskset: move bitmap routines to lib/cpuset.cKarel Zak2010-06-012-237/+2Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* ionice: non-cryptic error message when ionice can't execvpÆvar Arnfjörð Bjarmason2010-05-061-1/+1
| | | | | | | | | | | | | | | | Previously ionice would reply like this when it couldn't find the command to execute: $ ionice -c 3 does-not-exist ionice: execvp failed: No such file or directory Getting that message from cron because you haven't set the right $PATH makes it hard to track down the problem. Now it says: $ ionice -c 3 does-not-exist ionice: executing does-not-exist failed: No such file or directory Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
* ionice: fix typoPierre Hauweele2010-03-141-1/+1
| | | | Signed-off-by: Pierre Hauweele <antegallya@gmail.com>
* chrt: add --reset-on-forkKarel Zak2010-02-022-2/+30
| | | | | | | | | | | | | | | This new option allows to set SCHED_RESET_ON_FORK flag for FIFO and RR policies. Example: $ chrt --fifo --reset-on-fork 1 /bin/bash $ schedutils/chrt --pid $$ pid 31579's current scheduling policy: SCHED_FIFO|SCHED_RESET_ON_FORK pid 31579's current scheduling priority: 1 Signed-off-by: Karel Zak <kzak@redhat.com>