From 4302cbf28a9d9efd2416ab6ea95168f9e39c29ec Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 26 Feb 2026 10:37:40 +0200 Subject: tui: add fd trace drilldown and fd column in stream --- internal/file/file.go | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) (limited to 'internal/file') diff --git a/internal/file/file.go b/internal/file/file.go index ff8dae2..e8c818f 100644 --- a/internal/file/file.go +++ b/internal/file/file.go @@ -14,6 +14,7 @@ type File interface { String() string Name() string Flags() Flags + FD() int32 } type FdFile struct { @@ -24,15 +25,15 @@ type FdFile struct { } func NewFd(fd int32, name string, flags int32) FdFile { - f := FdFile{ - fd: fd, - name: name, - flags: Flags(flags), - } - if f.flags == -1 { - f.flags = unknownFlag - } - return f + f := FdFile{ + fd: fd, + name: name, + flags: Flags(flags), + } + if f.flags == -1 { + f.flags = unknownFlag + } + return f } func NewFdWithPid(fd int32, pid uint32) (f FdFile) { @@ -99,6 +100,10 @@ func (f FdFile) Flags() Flags { return f.flags } +func (f FdFile) FD() int32 { + return f.fd +} + func (f *FdFile) SetFlags(flags int32) { f.flags = Flags(flags) } @@ -123,6 +128,10 @@ func (f oldnameNewnameFile) Flags() Flags { return unknownFlag } +func (f oldnameNewnameFile) FD() int32 { + return -1 +} + func (f oldnameNewnameFile) String() string { var sb strings.Builder @@ -153,6 +162,10 @@ func (f pathnameFile) Flags() Flags { return unknownFlag } +func (f pathnameFile) FD() int32 { + return -1 +} + func (f pathnameFile) String() string { var sb strings.Builder -- cgit v1.2.3