summaryrefslogtreecommitdiffstats
path: root/schedutils
Commit message (Collapse)AuthorAgeFilesLines
* misc: consolidate version printing and close_stdout()Karel Zak2019-04-163-10/+9Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tastset: (man) add :N stride for CPU listsKarel Zak2019-03-291-0/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* man: Use the correct macro for a font change of one argumentBjarni Ingi Gislason2018-05-232-11/+11
| | | | | | | | Use the correct macro (I, B) for the font change of one argument, not those that are used for alternating two fonts, like "BR", "IR", "RB", or "RI". Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
* chrt: fix compiler warning [-Wmaybe-uninitialized]Karel Zak2018-02-201-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* schedutils: use errexec()Karel Zak2018-02-013-3/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: consolidate macro style USAGE_HELP_OPTIONSRuediger Meier2017-06-293-6/+6
| | | | | | | | | changed in include/c.h and applied via sed: sed -i 's/fprintf.*\(USAGE_MAN_TAIL.*\)/printf(\1/' $(git ls-files -- "*.c") sed -i 's/print_usage_help_options\(.*\);/printf(USAGE_HELP_OPTIONS\1);/' $(git ls-files -- "*.c") Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: consolidate all --help option descriptionsRuediger Meier2017-06-271-2/+3
| | | | | | | | Now we are always using the same text also for commands which had still hardcoded descriptions or where we can't use the standard print_usage_help_options macro. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: introduce print_usage_help_options()Ruediger Meier2017-06-273-5/+2Star
| | | | | | | | | | | | Consolidate --help and --version descriptions. We are now able to align them to the other options. We changed include/c.h. The rest of this patch was generated by sed, plus manually setting the right alignment numbers. We do not change anything but white spaces in the --help output. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: never use usage(stderr)Ruediger Meier2017-06-262-11/+16
| | | | | | | Here we fix all cases where we have usage(FILE*) functions. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: never use usage(ERROR)Ruediger Meier2017-06-261-6/+8
| | | | | | | | | | We are using better/shorter error messages and somtimes also errtryhelp(). Here we fix all cases where the usage function took an int argument for exit_code. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: add static keyword to where needed [smatch scan]Sami Kerola2017-02-201-1/+1
| | | | | | | text-utils/rev.c:68:9: warning: symbol 'buf' was not declared. Should it be static? Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* taskset: don't use zero PID in messagesKarel Zak2017-02-101-7/+14
| | | | | | | | The pid 0 is technically correct, but very confusing for end users. Use getpid() in the messages. Addresses: https://github.com/karelzak/util-linux/issues/413 Signed-off-by: Karel Zak <kzak@redhat.com>
* Use --help suggestion on invalid optionKarel Zak2016-12-193-8/+4Star
| | | | | | | | The current default is to print all usage() output. This is overkill in many case. Addresses: https://github.com/karelzak/util-linux/issues/338 Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: replace FTP by HTTPS in kernel.org URLsSébastien Helleu2016-12-193-3/+3
| | | | | | | The links to ftp://ftp.kernel.org/ are replaced by https://www.kernel.org/. Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: ionice(1): SEE ALSO: add ioprio_set(2)Michael Kerrisk2016-12-091-0/+2
| | | | | | ioprio_set(2) is the system call that underlies this command. Signed-off-by: Michael Kerrisk <mtk.man-pages@gmail.com>
* docs: taskset(1): Wording fixMichael Kerrisk2016-12-091-1/+1
| | | | Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
* chrt: default to SCHED_RR policyAndreas Henriksson2016-12-051-1/+1
| | | | | | | | | | | | | | | | | This fixes a regression introduced in: commit 7a4ea5664edba98bff28adec3a9c3cfb5763a495 "chrt: add control struct" Previously (and as documented in the manpage) the default policy was SCHED_RR. Now it's implicitly SCHED_OTHER (0) as the value is not initialized explicitly anymore. Test-command: chrt 90 echo hello Reported-by: Patrick Pelissier <patrick.pelissier@gmail.com> Addresses: http://bugs.debian.org/846572 Signed-off-by: Andreas Henriksson <andreas@fatal.se>
* Fix reference for scheduling discussionMichael Kerrisk (man-pages)2016-11-291-1/+1
| | | | | | | | Some time back, I moved the discussion of scheduling from sched_setscheduler(2) to a new sched(7) page. Adjust the cross reference in the taskset(1) page accordingly. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
* Place SEE ALSO entries in orderMichael Kerrisk (man-pages)2016-11-292-3/+3
| | | | | | | | | | | | This patch does only the following: * Order SEE ALSO entries first by section name, then alphabetically within section * Adds one or two missing commas in SEE ALSO lists * Removes one or two periods that were (inconsistently) used at the end of SEE ALSO lists. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
* chrt: fix HAVE_SCHED_SETATTR fallback caseRuediger Meier2016-10-271-2/+3
| | | | | | | | | | | Broken since 6f27e449. We could not enter the fallback if HAVE_SCHED_SETATTR is not defined. Two gcc warnings made this issue visible: schedutils/chrt.c:247:1: warning: label 'fallback' defined but not used [-Wunused-label] schedutils/chrt.c:266:9: warning: 'policy' may be used uninitialized in this function [-Wuninitialized] Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* chrt: follow nice setting, prefer sched_setscheduler()Karel Zak2016-10-031-16/+18
| | | | | | | | | | | | | | | | * do not reset 'nice' setting by sched_setattr(), if 'nice' setting is not zero then chrt ends with EPERM for non-root users: $ renice -n 5 -p $$; chrt -v -b 0 date 12475 (process ID) old priority 0, new priority 5 chrt: failed to set pid 0's policy: Operation not permitted * it seems more elegant to always use old sched_setscheduler() API for non-deadline policies; in this case we do not need getpriority() to keep 'nice' unchanged. Addresses: https://github.com/karelzak/util-linux/issues/359 Signed-off-by: Karel Zak <kzak@redhat.com>
* taskset: clarify that masks are always hex in man pageChris Metcalf2016-08-091-2/+11
| | | | | | | | | | | The man page confusingly says that the mask is "typically" hexadecimal, when in fact it is always hexadecimal. Fix the language, and provide an additional example with no leading "0x". Also, provide an example using the --cpu-list option. Signed-off-by: Chris Metcalf <cmetcalf@mellanox.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* chrt: add fallback to be usable on kernels without sched_{get,set}attrKarel Zak2016-07-111-8/+43
| | | | | | | | | | We have fallback for compilation with/without proper glibc and kernel headers, but it's not enough, because people can switch between kernels with and without the syscalls. (For example RT kernels for RHEL/CentOS). Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1353340 Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: add chrt testKarel Zak2016-07-111-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* ionice: clarify description of --classdataDaniel Shahaf2016-06-071-1/+1
| | | | | | | | Before this patch, it wasn't clear whether '0' or '7' should be used to specify "highest priority". (The answer could have been inferred from the 'Examples' section of the man page.) Signed-off-by: Daniel Shahaf <danielsh@apache.org>
* chrt: validate priority before trying to use itSami Kerola2016-04-131-1/+5
| | | | | | | | | | | | | | | | Earlier message: $ chrt -i 1 ls chrt: failed to set pid 0's policy: Invalid argument basically told 'something failed', while the new one tries to be more helpful. $ chrt -i 1 ls chrt: unsupported priority value for the policy: 1: see --max for valid range Addresses: https://bugs.debian.org/791707 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* chrt: make --sched-* short options to require an argumentSami Kerola2016-04-041-1/+1
| | | | | | | These options are expecting an argument, and the long options struct already required them. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* chrt: remove duplicate words and tweak some phrasings in the man pageBenno Schulenberg2016-03-171-16/+16
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* taskset: fix description of `-c` option in the man pageYuriy M. Kaminskiy2016-03-071-3/+3
| | | | | | | | | | | | | Commit 42f15e9848dc07e86a2b80c742a0179aaced6c71 introduced a certain inaccuracy in -c option description; it is not _the option with an argument_, but it is the flag that changes interpretation of `mask` parameter. The difference is almost not noticeable, but there are one corner case where it is: taskset -c 1 -p $$ fails (but it would work if 42f15e was correct). Instead, taskset -c -p 1 $$ works (but it should not have if 42f15e was correct). Signed-off-by: Karel Zak <kzak@redhat.com>
* chrt: restore removed ifdef SCHED_RESET_ON_FORKRuediger Meier2016-02-241-0/+4
| | | | | | They got lost in acde3a05. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* chrt: fix case SCHED_RRRuediger Meier2016-02-241-1/+1
| | | | | | Looks like the logic was mistakenly changed in acde3a05. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* chrt: use sched_getattr()Karel Zak2016-01-201-67/+92
|
* chrt: make man page more structuredKarel Zak2016-01-201-70/+59Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* chrt: add support for SCHED_DEADLINEKarel Zak2016-01-202-25/+119
| | | | | | | | | | | | | | This patch introduces -d, --deadline -T, --sched-runtime -D, --sched-deadline -P, --sched-period command line options. The functionality is available only for Linux with sched_setattr() [kernel >=3.14] Signed-off-by: Karel Zak <kzak@redhat.com>
* chrt: use sched_setattr() if availableKarel Zak2016-01-201-7/+66
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* chrt: make usage more readableKarel Zak2016-01-191-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* chrt: set function refactoringKarel Zak2016-01-191-19/+27
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* chrt: output function refactoringKarel Zak2016-01-191-16/+26
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* chrt: add control structKarel Zak2016-01-191-39/+45
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* chrt: slice up the usage text and normalize its layoutBenno Schulenberg2015-06-151-25/+28
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* chrt: make the usage synopsis clearerBenno Schulenberg2015-06-151-1/+2
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* chrt: fix --help inconsistencyKarel Zak2015-06-091-1/+1
| | | | | Reported-by: Martin Steigerwald <ms@teamix.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* chrt: add note about zero priority for IDLE and BATCHKarel Zak2015-01-261-2/+2
| | | | | Reported-by: dE <de.techno@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch 'opts' of https://github.com/jwpi/util-linuxKarel Zak2015-01-261-2/+2
|\
| * docs: restore minus symbols in long optsJ William Piggott2015-01-211-2/+2
| | | | | | | | Signed-off-by: J William Piggott <elseifthen@gmx.com>
* | ionice: drop the duplicate docstringBenno Schulenberg2015-01-261-2/+0Star
|/ | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* docs: remove obsolete and unneeded comments from man-page filesBenno Schulenberg2015-01-122-6/+0Star
| | | | | | | Transform some of them into copyright lines. Also fix three header lines and snip some trailing whitespace. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* textual: add a docstring to most of the utilitiesBenno Schulenberg2015-01-063-1/+8
| | | | | | | | | This adds a concise description of a tool to its usage text. A first form of this patch was proposed by Steven Honeyman (see http://www.spinics.net/lists/util-linux-ng/msg09994.html). Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* textual: use manual tail usage() macroSami Kerola2014-10-012-1/+2
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* textual: use version printing macro everywhereSami Kerola2014-10-012-4/+2Star
| | | | | | | Only mount, umount, and blkid remains not using the macro because they are print also library references. Signed-off-by: Sami Kerola <kerolasa@iki.fi>