]> git.ipfire.org Git - thirdparty/util-linux.git/commit
lsfd: use NAME column to show cooked file names
authorMasatake YAMATO <yamato@redhat.com>
Mon, 5 Sep 2022 21:27:50 +0000 (06:27 +0900)
committerMasatake YAMATO <yamato@redhat.com>
Mon, 12 Sep 2022 12:46:54 +0000 (21:46 +0900)
commitf3609f0ac5d4a7ede5e0a6de3fb5252a5cddb65c
tree77797ef4685b150972afa50aeda2340bea389f4f
parentbe019f664db6eef7f2df38d31f1627d74a82fe65
lsfd: use NAME column to show cooked file names

This change splits the NAME column
into cooked NAME column and raw KNAME column.

KNAME represents the type information extracted from /proc/$pid/fd or
/proc/$pid/map_files. NAME is the same as KNAME but humans friendly
and talkative if a special handler is implemented for the type of the
file.

Currently only pidfd has such a handler.

Below an example output:

    $ ./lsfd -o TYPE,STTYPE,KNAME,NAME -Q '(TYPE == "pidfd")'
     TYPE STTYPE KNAME              NAME
    pidfd   UNKN anon_inode:[pidfd] pid=4661 comm=dbus-broker nspid=4661
    pidfd   UNKN anon_inode:[pidfd] pid=4924 comm=dbus-broker nspid=4924

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
misc-utils/lsfd-file.c
misc-utils/lsfd-sock.c
misc-utils/lsfd-unkn.c
misc-utils/lsfd.1.adoc
misc-utils/lsfd.c
misc-utils/lsfd.h
tests/expected/lsfd/column-name [new file with mode: 0644]
tests/expected/lsfd/mkfds-pidfd
tests/ts/lsfd/column-name [new file with mode: 0755]