This command implements waiting for the exit of multiple processes.
Especially it allows to wait for process that are not children of the
current process.
In contrast to wait(1P) it does not allow to retrieve the processes exit
codes.
Typically a modern block device supports mutil queues feature, count
queues by walking '$sysfs/mq' directory. If no '$sysfs/mq' exists, it
is a legacy single queue.
~# lsblk --nvme -o NAME,TYPE,MODEL,TRAN,RQ-SIZE,MQ
NAME TYPE MODEL TRAN RQ-SIZE MQ
nvme0n1 disk INTEL SSDPF2KX038TZ nvme 1023 135
nvme3n1 disk INTEL SSDPE2KX020T8 nvme 1023 128
nvme1n1 disk SAMSUNG MZQL23T8HCLS-00A07 nvme 1023 129
nvme2n2 disk RP2A03T8RK004LX nvme 1023 64
nvme2n3 disk RP2A03T8RK004LX nvme 1023 64
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
Add -N/--nvme to filter NVMe device only, NVMe usually has a larger
I/O depth, also show COL_RQ_SIZE by default.
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
Specify cpus list format to show by -C/--cpu-list parameters, for
example, on an AMD server with 192 CPUs, to show statistics on NUMA
node 1:
~# ./irqtop -d 1 -C 48-95,144-191
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
Implement the RTC_PARAM_SET RTC ioctl in hwclock. The ioctl interface was
introduced with [1], which went mainline in Kernel v5.16. The parameters
are independent of hardware/driver. This means we can read and set
parameters in a generic way.
The new --param-set hwclock function accepts aliases for parameters
currently existent (Kernel v5.16). They can be extended later on. As
fallback and for values, hexadecimal (if prefixed with 0x) and decimal
values, as defined in [2], are accepted.
Example:
$ hwclock --param-set bsm=0x0
[1] https://lore.kernel.org/all/20211018151933.76865-1-alexandre.belloni@bootlin.com/
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/rtc.h
Signed-off-by: Bastian Krause <bst@pengutronix.de>
Implement the RTC_PARAM_GET RTC ioctl in hwclock. The ioctl interface was
introduced with [1], which went mainline in Kernel v5.16. The parameters
are independent of hardware/driver. This means we can read and set
parameters in a generic way.
The new --param-get hwclock function accepts aliases for parameters
currently existent (Kernel v5.16). They can be extended later on. As
fallback, hexadecimal (if prefixed with 0x) and decimal values, as
defined in [2], are accepted.
Example:
$ hwclock --param-get features
[1] https://lore.kernel.org/all/20211018151933.76865-1-alexandre.belloni@bootlin.com/
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/rtc.h
Signed-off-by: Bastian Krause <bst@pengutronix.de>
The current option --backup is usable only when used with others sfdisk
commands. The new command --backup-pt-sectors create backup and exit.
Signed-off-by: Karel Zak <kzak@redhat.com>
The current --wd=<dir> changes CWD to the path which is opened
*before* nsenter calls setns(). It may be useful if you want to use in
namespace something from your current namespace. In this case, the
option --wd works like a "tunnel" between namespaces.
For some other use-cases, this is useless and you want to be sure that
CWD always points to the target namespace. For this purpose this patch
implements --wdns <dir>.
Example:
Setup the namespaces:
# unshare --mount
# mount /dev/sdc /mnt/A
# touch /mnt/A/fooooo
# echo $$
2425872
Enter the namespace from another session:
# nsenter --all --target 2425872 --wd=/mnt/A ls -a
. ..
# nsenter --all --target 2425872 --wdns=/mnt/A ls -a
. .. fooooo lost+found
Fixes: https://github.com/util-linux/util-linux/issues/1500
Signed-off-by: Karel Zak <kzak@redhat.com>
Since a23aecc1bf("irqtop: add per-cpu stats"), irqtop always shows
per-cpu stats. Test on a modern AMD server with 2 socket(256 CPU),
irqtop shows messy output with too many columns.
In this patch, add -c/--cpu-stat option to enable/disable per-cpu stats.
And 'auto' option auto-detect window size, only show per-cpu stats
if the length of per-cpu stats is shorter than the width of window.
[kzak@redhat.com: - shorten the commit message
- rename --cpu to --cpu-stat
- use scols_table_enable_nowrap() rather than trim in irqtop.c
- reduce --help for the new option]
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Several parameters for zoned devices are missing from lsblk's columns. This
commit introduces them as following.
ZONE-SZ zone size
ZONE-WGRAN zone write granularity
ZONE-APP zone append max bytes
ZONE-NR number of zones
ZONE-OMAX maximum number of open zones
ZONE-AMAX maximum number of active zones
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Currently, the Bash completions for `whereis <TAB>` gives
`whereis file` ("file" is not a placeholder here, it literally expands
to that). This fixes that by passing the `-c` flag to `compgen` to
request completions for command names.
Signed-off-by: Smitty van Bodegom <me@smitop.com>
Renaming files with rename often involves multiple passes in order
to, say, replace all spaces with underscores because traditionally
rename only replaces the first occurrence of the expression. The
--all parameter makes this task simple.
With the addition of --last, rename becomes much safer to use when
replacing file extensions, whereas before it would mangle a file
which had its extension also embedded elsewhere in its name.
The implied --first, together with --all and --last, round out the
common cases for renaming files.
We do not need to provide details in the default output. It seems
better to hide it behind --verbose to be user-friendly.
Signed-off-by: Karel Zak <kzak@redhat.com>
Option --follow-new (-W) works the same as --follow (-w) but initially
seeks to the end of kernel ring buffer, so it prints only new messages.
Useful for capturing kernel messages during actions without past log.
Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
This new option works like --all but it allows to specify multiple
files with filesystems to make fstrim configuration more portable
between distributions. For example:
fstrim --listed-in /etc/fstab:/proc/self/mountinfo
forces fstrim to try fstab and if unsuccessful than try mountinfo.
Addresses: https://github.com/karelzak/util-linux/issues/1019
Signed-off-by: Karel Zak <kzak@redhat.com>
This patch brings support for automatic dangerous shell characters
escape in umount autocompletion. Due to the very peculiar way for
bash to handle autocompletion routines, proper escaping of the shell
sequences only worked properly inside a function: _umount_point_list,
which will add to the user's namespace at the next umount attempt of
autocompleting mount point.
It also translates calls of gensub to the portable alternatives sub
and gsub, in order to allow the use of various awk implementations
(mawk, Gnu, Busybox, etc), and as such kind of undoes a recent change
to enforce the use of Gnu awk. The whole story landed into the Debian
BTS initially:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=933934
PS: It's been a few months since the patch is available, sorry for the
delay; I only got myself a Github account quite recently...
Signed-off-by: Étienne Mollier <etienne.mollier@mailoo.org>
gensub() is a gawk extension, so use it explicitly. Otherwise users will
get an error if their 'awk' defaults to something else.
Fixes: 3ebfc8d37 ("bash-completion: umount support relative path and ~ as home shorthands")
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
This commit also includes fix to how initial skip lines and search are
instructed in the code. Earlier version was pretty close impossible to make
work with getopt_long() and had minor flaw - if both initial skip lines and
search were defined at the same time the skipping did not happen. That is
now corrected.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>