Feature #12153
closed
netstat can use /proc/<PID>/fdinfo and avoid grabbing processes
Added by Andy Fiddaman over 2 years ago.
Updated over 1 year ago.
Category:
cmd - userland programs
Description
Once we have /proc/<PID>/fdinfo
, the code for netstat -u
can be simplified using the associated new libproc interfaces, and also made to work properly in any zone brand which uses a /native
namespace (for example, lx
on SmartOS and OmniOS)
Ran tests to compare the output of various invocations of netstat
from before and after this change and observed no difference (save things like counters incrementing between runs)
There's also a speed difference, with the new version being faster (this on a relatively loaded web server)
# ptime netstat~ -anu >/dev/null
real 1.320607853
user 0.152432182
sys 0.821588392
# ptime netstat -anu >/dev/null
real 0.063456723
user 0.009650681
sys 0.052829888
- % Done changed from 0 to 100
git commit 1dd4766bd0d7ab56961ce97c9c39de612ae2e7d1
commit 1dd4766bd0d7ab56961ce97c9c39de612ae2e7d1
Author: Andy Fiddaman <omnios@citrus-it.co.uk>
Date: 2020-01-24T08:04:42.000Z
12153 netstat can use /proc/<PID>/fdinfo and avoid grabbing processes
Reviewed by: John Levon <john.levon@joyent.com>
Reviewed by: Robert Mustacchi <rm@fingolfin.org>
Approved by: Dan McDonald <danmcd@joyent.com>
- Status changed from In Progress to Closed
Also available in: Atom
PDF