swaptop 1.0.0

htop-style view of which processes are using swap, and how.
This commit is contained in:
Andy Dixon
2026-10-07 12:25:29 +01:00
parent c1ef35d039
commit ccbbd416b7
13 changed files with 1636 additions and 70 deletions
+4 -1
View File
@@ -19,7 +19,8 @@ type SwapDev struct {
}
type Proc struct {
PID, UID int
PID, PPID, UID int
Tree string // tree-view prefix, display only
User, Comm, Cmd string
Swap, SwapPss, RSS uint64
Delta int64 // change in Swap since previous sample
@@ -88,6 +89,8 @@ func readProc(pid int) (Proc, bool) {
switch k {
case "Name":
p.Comm = v
case "PPid":
p.PPID, _ = strconv.Atoi(v)
case "Uid":
p.UID, _ = strconv.Atoi(strings.Fields(v)[0])
case "VmRSS":