From 63ed39482219ba9172e151d9c82692aff9a622ad Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Wed, 11 Nov 2026 12:23:25 +0100 Subject: fix(network): list NFS traffic on the drawer's network page A pcmanfm-qt copy of 8GB from an NFS share never appeared among the busiest processes. The copy's bytes travel on the kernel NFS client's TCP socket to port 2049, which ss reports with no users:(()) owner, and sockets() skipped every ownerless socket. The file manager itself owns no socket for the transfer at all. Ownerless sockets whose peer port is 2049 are now kept and named "NFS ". Which process drives the traffic is not knowable from ss, so the row names the share's server instead. Other ownerless sockets (other users', without root) are still skipped. Co-Authored-By: Claude Opus 5.5 --- desktop/modules/perf/Perf.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'desktop/modules/perf/Perf.js') diff --git a/desktop/modules/perf/Perf.js b/desktop/modules/perf/Perf.js index d067d3b..eb0dbd7 100644 --- a/desktop/modules/perf/Perf.js +++ b/desktop/modules/perf/Perf.js @@ -186,16 +186,21 @@ function procs(text) { // One {key, name, rx, tx} per TCP socket in `ss -tinpH` output: a line // naming the owner in users:((...)), then the -i line under it with the // byte counters. Sockets ss names no owner for (other users', without root) -// are skipped. The key is both endpoints and the pid, so a reused port in -// another process is a new socket. +// are skipped, except NFS: the kernel's client owns that socket, so a file +// manager copying to or from a share shows nothing of its own, and the +// traffic is listed as "NFS " instead. The key is both endpoints and +// the pid, so a reused port in another process is a new socket. function sockets(text) { const out = []; let cur = null; for (const line of text.split("\n")) { - const u = /^\S+\s+\d+\s+\d+\s+(\S+)\s+(\S+)\s+users:\(\("([^"]*)",pid=(\d+)/.exec(line); + let u = /^\S+\s+\d+\s+\d+\s+(\S+)\s+(\S+)\s+users:\(\("([^"]*)",pid=(\d+)/.exec(line); if (u) { cur = { key: u[1] + " " + u[2] + " " + u[4], name: u[3], rx: 0, tx: 0 }; out.push(cur); + } else if ((u = /^\S+\s+\d+\s+\d+\s+(\S+)\s+(\S+):2049\s*$/.exec(line))) { + cur = { key: u[1] + " " + u[2] + ":2049", name: "NFS " + u[2], rx: 0, tx: 0 }; + out.push(cur); } else if (cur && /^\s/.test(line)) { cur.rx = Number((/bytes_received:(\d+)/.exec(line) || [0, 0])[1]); cur.tx = Number((/bytes_sent:(\d+)/.exec(line) || [0, 0])[1]); -- cgit v1.2.3