Commit Graph

207 Commits

Author SHA1 Message Date
Qais Yousef 6da826a521 uclampset: Fix left over optind++
The code was changed to use ':' in getopt_long() but these were left
over by mistake causing weird random errors when using these options
depending on the order they were fed.

Signed-off-by: Qais Yousef <qais.yousef@arm.com>
2021-06-08 15:56:00 +02:00
Karel Zak d8d54e4bfc build-sys: keep adoc files in dist_noinst_DATA
* rename MANPAGES_EXTRA= to ADOCFILES_COMMON=

* keep track about individual adoc files by dist_noinst_DATA=
  This variable is not effected by automake conditions, so the files
  are always distributed.

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-05 13:35:30 +02:00
Rafael Fontenelle 993556aaa5 Fix misspellings 2021-04-22 20:31:05 -03:00
Karel Zak 2b84ac2dbd Merge branch 'topic/po4a' of https://github.com/mariobl/util-linux
* 'topic/po4a' of https://github.com/mariobl/util-linux:
  mount.a.adoc: Fix markup
  Asciidoc: Add missing macro definition in uclampset.1
  Asciidoc: Fix markup in example man page
  Asciidoc: Fix markup
  Asciidoc: Remove artifact from merge conflict
  Asciidoc: Convert man-common/README to Markdown
  po-man: Fix the example man page
  po-man: Fix typos in po-man/README.md
  po-man: Update the example man page
  po-man: Add po-man/README.md
  po-man: Add (incomplete) de.po for testing purposes
  po-man: Add (incomplete) de.po for testing purposes
  po-man: Adjust paths in po4a.cfg and update .pot file
  po-man: Move Po4a config file and translation template to po-man
2021-04-22 15:23:27 +02:00
Karel Zak a96932103e chrt: non-Linux fix
Reported-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-04-12 16:21:18 +02:00
Mario Blättermann 56af5af405 Asciidoc: Add missing macro definition in uclampset.1 2021-04-09 22:55:21 +02:00
Karel Zak 625e9c61e8 build-sys: make man pages location independent
We need to evaluate "include::" directive relatively to project
top-level source directory rather than to the current document
location.

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-31 11:50:47 +02:00
Karel Zak 4f79d3032e build-sys: split man pages and man page links
The symlinks are generated by asciidoctor and current dist_man_MANS
depends on order (nan page before man link). This solutions is useless
when execute "make -j". The real solution is to keep man pages in
separate variable and use only this variable evaluate what we need to
generate.

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-26 11:49:59 +01:00
Mario Blättermann 5a52459e0f Asciidoc: Review schedutils man pages 2021-03-23 20:43:52 +01:00
Mario Blättermann f42ed8190c Asciidoc: Unify spelling of »User Commands« 2021-03-21 10:00:16 +01:00
Mario Blättermann 295b3979d9 Asciidoc: Add Po4a hint to file headers 2021-03-20 16:42:47 +01:00
Mario Blättermann d315cc4d96 Asciidoc: Re-add empty lines to man pages 2021-03-19 20:52:00 +01:00
Mario Blättermann 4d29743519 Asciidoc: Some formatting cleanup in man pages 2021-03-19 18:25:50 +01:00
Mario Blättermann b366e6fc6b Asciidoc: Remove already imported *roff man pages 2021-03-16 19:35:37 +01:00
Mario Blättermann e2db4d9410 Add asciidoc man pages and some include files 2021-03-11 18:38:46 +01:00
Karel Zak 0edc239542 build-sys: fix schedutils/sched_attr.h include
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-05 10:23:04 +01:00
Karel Zak f4b07719ee uclampset: cleanup --hel output
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-02 16:54:22 +01:00
Qais Yousef f59654bb06 uclampset: Plump into the build system
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
2021-02-02 10:56:26 +00:00
Qais Yousef 9dd95bea42 uclampset: Add man page
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
2021-02-02 10:56:26 +00:00
Qais Yousef 5407f89782 Add uclampset schedutil
Utilization clamping is a new kernel feature that got merged in 5.3. It
allows controlling the performance of a process by manipulating the
utilization such that the task appears bigger or smaller than what it
really is.

There's a system-wide control to to restrict what maximum values the
process are allowed to use.

Man page added in a later patch attempts to explain the usage in more
detail.

Signed-off-by: Qais Yousef <qais.yousef@arm.com>
2021-02-02 10:56:26 +00:00
Qais Yousef ee3f4a3dfc Move sched_attr struct and syscall definitions into header file
So that we can re-use them in other files.

Signed-off-by: Qais Yousef <qais.yousef@arm.com>
2021-01-30 17:13:17 +00:00
Karel Zak 865f5f469c chrt: don't restrict --reset-on-fork, add more info to man page
The flag works (= kernel accepts it) for all scheduling policies
and sched_getattr() returns the flag for all policies.

There is no reason for userspace to be more smart than kernel or hide
the flag when it prints sched_getattr()/sched_getscheduler() results.

 # chrt -v --reset-on-fork --batch 0 /bin/true
 pid 1315019's new scheduling policy: SCHED_BATCH|SCHED_RESET_ON_FORK

 # chrt -v --reset-on-fork --fifo 1 /bin/true
 pid 1315055's new scheduling policy: SCHED_FIFO|SCHED_RESET_ON_FORK

 # chrt -v --reset-on-fork --deadline --sched-period 10000 0 /bin/true
 pid 1315182's new scheduling policy: SCHED_DEADLINE|SCHED_RESET_ON_FORK

 # chrt -v --reset-on-fork --idle 0 /bin/true
 pid 1315247's new scheduling policy: SCHED_IDLE|SCHED_RESET_ON_FORK

 # chrt -v --reset-on-fork --rr 1 /bin/true
 pid 1315275's new scheduling policy: SCHED_RR|SCHED_RESET_ON_FORK

 # chrt -v --reset-on-fork --other 0 /bin/true
 pid 1315311's new scheduling policy: SCHED_OTHER|SCHED_RESET_ON_FORK

Signed-off-by: Karel Zak <kzak@redhat.com>
2020-10-01 11:51:12 +02:00
Karel Zak fb4f1da4e0 chrt: (man) add human-readable names for policies
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-10-01 11:04:29 +02:00
Karel Zak 240634f80c chrt: use SCHED_FLAG_RESET_ON_FORK for sched_setattr()
Reviewed by many people, used for years (but probably nobody uses
SCHED_DEADLINE with reset-on-fork), but we all missed:

- sched_setscheduler() uses SCHED_RESET_ON_FORK (0x40000000)
- sched_setattr() uses SCHED_FLAG_RESET_ON_FORK (0x01)

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1883013
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-10-01 10:40:27 +02:00
Bjarni Ingi Gislason 75ba1d8c28 doc: schedutils/*: Fix some warnings from "mandoc -T lint"
mandoc: ./schedutils/chrt.1:37:2: WARNING: skipping paragraph macro: PP after SH

mandoc: ./schedutils/ionice.1:120:2: WARNING: skipping paragraph macro: PP empty

mandoc: ./schedutils/taskset.1:36:2: WARNING: skipping paragraph macro: PP after SH

####

  There is no change in the ouput from "nroff" and "groff".

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
2020-06-15 11:28:01 +02:00
Michael Kerrisk (man-pages) 3bc92f313a Manual pages: rename EXAMPLE section to EXAMPLES
Earlier, I patched various pages to consistently use EXAMPLE as a
section heading, rather than EXAMPLES.  (At that time, both headings
occurred in util-linux, with roughly equal frequency.)

Since then, I've observed that EXAMPLES is the more common usage
across a large corpus of manual pages. So, in Linux the man-pages
project, I switched to using EXAMPLES also. This patch makes the same
change for util-linux.

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
2020-05-28 14:51:54 +02:00
Michael Kerrisk (man-pages) 67e63c1263 Manual pages: order NOTES / HISTORY / BUGS / EXAMPLE consistently
There is value in ensuring that manual page sections use consistently
named sections, as far as possible, and also that sections have a
consistent order within manual pages. This is one of a series of patches
to place manual page sections in a consistent order.

In this patch, we ensure that the NOTES, HISTORY, BUGS, and EXAMPLE
sections are always placed near the end of the page, just above
AUTHORS, COPYRIGHT, SEE ALSO, and AVAILABILITY.

One page is not fixed by this patch: term-utils/agetty.8. This page
is a mess of unusual section names, and probably requires an individual
edit.

Testing that no gross editing mistake (causing accidental loss or addition
of text) was performed as follows:

    $ cat $(grep '\.SH' -l $(find . -name '*.[1-9]') |sort) | sort > a
    [Apply patch]
    $ cat $(grep '\.SH' -l $(find . -name '*.[1-9]') |sort) | sort > b
    $ diff a b
    $ echo $?
    0

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-22 10:25:50 +02:00
Michael Kerrisk (man-pages) ade04bb89c Manual pages: order AUTHORS / COPYRIGHT / SEE ALSO / AVAILABILITY consistently
There is value in ensuring that manual page sections use consistently
named sections, as far as possible, and also that sections have a
consistent order within manual pages. This is one of a series of patches
to place manual page sections in a consistent order.

In this patch, we ensure that the AUTHORS, COPYRIGHT, SEE ALSO, and
AVAILABILITY sections are always placed at the end of the page.

Testing that no gross editing mistake (causing accidental loss or addition
of text) was performed as follows:

    $ cat $(grep '\.SH' -l $(find . -name '*.[1-9]') |sort) | sort > a
    [Apply patch]
    $ cat $(grep '\.SH' -l $(find . -name '*.[1-9]') |sort) | sort > b
    $ diff a b
    $ echo $?
    0

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-22 10:25:49 +02:00
Michael Kerrisk (man-pages) bc281b0991 Manual pages: Standardize on EXAMPLE as section title
There is quite some value (in terms of readability and user
expectations) if consistent names are used for the sections
within manual pages. This patch is one of a series to bring
about this consistency.

Currently we have EXAMPLE (10) or EXAMPLES (23).
Let's standardize on the EXAMPLE (which is also what is
suggested in man-pages(7)) and used consistently across
a large number of pages in the Linux man-pages project.

(I realize the choice to go EXAMPLE, rather than EXAMPLES,
may be debatable. If necessary, I'd write a patch that instead
goes the other way, but I'd prefer to follow man-pages(7).)

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-20 12:56:12 +02:00
Michael Kerrisk (man-pages) a8d0d330cf Manual pages: Standardize on AUTHORS as section title
There is quite some value (in terms of readability and user
expectations) if consistent names are used for the sections
within manual pages. This patch is one of a series to bring
about this consistency.

In the Linux man-pages project, I long ago did away with the
AUTHOR(S) section, but I realize some projects like to keep this.

But, let's make sure that the section is consistently titled
across pages. Currently we have AUTHOR (47) or AUTHORS (41).
Let's standardize on the latter (which is also what is
suggested in man-pages(7)).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-20 12:56:12 +02:00
Michael Kerrisk (man-pages) 5a82980632 docs: (man) remove double quotes (") in .SH lines
Using double quotes in .SH lines containing multiple words is unneeded,
and in any case is not consistently done in the util-linux manual pages,
where double quotes are used in only around half of the cases.
(This usage was long ago elminated in the man-pages project, with
no ill effects reported to date.)

Remove these quotes, so that .SH lines are more uniform, in preparation
for some (more easily) scripted doiscovery of consistency problems in
(and possibly global fixes to) the manual pages.

Other than stripping the double quotes, this patch makes no changes to
the content of the manual pages.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-19 12:15:34 +02:00
jonnyh64 fcc3078754 chrt: Use sched_setscheduler system call directly
musl libc does not support the sched_setscheduler library function
because the underlying Linux system call does not confirm to Posix;
this patch makes chrt use the system call directly

[kzak@redhat.com:
    - note that musl libc implements sched_setscheduler()
      but returns -ENOSYS all time...
    - add ifdefs to the patch
    - make sure we include syscall.h]

References: http://git.musl-libc.org/cgit/musl/commit/src/sched/sched_setscheduler.c?id=1e21e78bf7a5c24c217446d8760be7b7188711c2
Addresses: https://github.com/karelzak/util-linux/issues/943
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-01-30 10:45:32 +01:00
Bjarni Ingi Gislason 1c4c602427 man pages: Change a HYPHEN-MINUS (-) to a minus (\-) for options and numbers
Change a HYPHEN-MINUS (code 0x55, 2D) to a minus (\-), if in front of

1) a name of an option

2) a negative number to be printed.

  See man-pages(7) [Debian package "manpages"].

  The output from "nroff" is unchanged.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
2019-12-17 12:32:43 +01:00
Karel Zak 2c308875a7 misc: consolidate version printing and close_stdout()
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-04-16 15:14:13 +02:00
Karel Zak c313ee737b tastset: (man) add :N stride for CPU lists
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-03-29 13:00:42 +01:00
Bjarni Ingi Gislason 0bb7e904d7 man: Use the correct macro for a font change of one argument
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>
2018-05-23 10:43:27 +02:00
Karel Zak 685f544918 chrt: fix compiler warning [-Wmaybe-uninitialized]
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-02-20 10:43:32 +01:00
Karel Zak 61b6222269 schedutils: use errexec()
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-02-01 15:40:59 +01:00
Ruediger Meier f45f3ec34a misc: consolidate macro style USAGE_HELP_OPTIONS
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>
2017-06-29 16:54:33 +02:00
Ruediger Meier b305445495 misc: consolidate all --help option descriptions
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>
2017-06-27 12:28:36 +02:00
Ruediger Meier b1a294c448 misc: introduce print_usage_help_options()
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>
2017-06-27 12:26:19 +02:00
Ruediger Meier 6e1eda6f22 misc: never use usage(stderr)
Here we fix all cases where we have usage(FILE*)
functions.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2017-06-26 14:38:24 +02:00
Ruediger Meier 5118d1be2a misc: never use usage(ERROR)
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>
2017-06-26 14:38:24 +02:00
Sami Kerola 2ba641e5f3 misc: add static keyword to where needed [smatch scan]
text-utils/rev.c:68:9: warning: symbol 'buf' was not declared. Should it be
static?

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-02-20 12:58:49 +01:00
Karel Zak 6433fcad71 taskset: don't use zero PID in messages
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>
2017-02-10 11:46:37 +01:00
Karel Zak 677ec86cef Use --help suggestion on invalid option
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>
2016-12-19 13:13:34 +01:00
Sébastien Helleu d673b74e9d docs: replace FTP by HTTPS in kernel.org URLs
The links to ftp://ftp.kernel.org/ are replaced by
https://www.kernel.org/.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-19 11:22:26 +01:00
Michael Kerrisk 82b3c4c291 docs: ionice(1): SEE ALSO: add ioprio_set(2)
ioprio_set(2) is the system call that underlies this command.

Signed-off-by: Michael Kerrisk <mtk.man-pages@gmail.com>
2016-12-09 13:45:09 +01:00
Michael Kerrisk cef04ac8da docs: taskset(1): Wording fix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-09 13:45:09 +01:00
Andreas Henriksson c7adc2f204 chrt: default to SCHED_RR policy
This fixes a regression introduced in:

commit 7a4ea5664e
"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>
2016-12-05 13:07:50 +01:00