lsfd: print the detail of the timer associated with a timerfd
An example output:
# ./lsfd -p 1 -Q '(TYPE == "timerfd")' -oCOMMAND,PID,ASSOC,TYPE,INODE,NAME
COMMAND PID ASSOC TYPE INODE NAME
systemd 1 22 timerfd 1060 clockid=monotonic remaining=4625.
661834645
systemd 1 25 timerfd 1060 clockid=realtime remaining=398.
164618943
systemd 1 112 timerfd 1060 clockid=realtime remaining=
7537606384.
202715161
Added three new columns, TIMERFD.{CLOCKID,TIMERFD.REMAINING,INTERVAL}.
The filter engine works well with them.
An example listing timerfd files expiring within 1.2 seconds.
# ./lsfd -Q '(TIMERFD.REMAINING > 0.0) && (TIMERFD.REMAINING < 1.2)'
COMMAND PID USER ASSOC MODE TYPE SOURCE MNTID INODE NAME
Xorg 17069 jet 26 rw- timerfd anon_inodefs 15 1060 clockid=monotonic remaining=0.
061075544
systemd-oomd
2382701 systemd-oom 8 rw- timerfd anon_inodefs 15 1060 clockid=monotonic remaining=0.
178126915
Using SCOLS_JSON_NUMBER as the data type for TIMERFD.REMAINING and
TIMERFD.INTERVAL columns is suggested by Thomas Weißschuh
<thomas@t-8ch.de>.
Signed-off-by: Masatake YAMATO <yamato@redhat.com>