Project

General

Profile

Actions

Feature #12153

closed

netstat can use /proc/<PID>/fdinfo and avoid grabbing processes

Added by Andy Fiddaman almost 2 years ago. Updated 9 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

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)


Related issues

Blocked by illumos gate - Feature #12046: Provide /proc/<PID>/fdinfo/ClosedAndy Fiddaman

Actions
Actions #1

Updated by Andy Fiddaman almost 2 years ago

Actions #2

Updated by Andy Fiddaman almost 2 years ago

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)

Actions #3

Updated by Andy Fiddaman almost 2 years ago

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

Actions #4

Updated by Electric Monk almost 2 years ago

  • % 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>

Actions #5

Updated by Andy Fiddaman 9 months ago

  • Status changed from In Progress to Closed
Actions

Also available in: Atom PDF