diff options
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/eventloop.go | 12 | ||||
| -rw-r--r-- | internal/flamegraph/iordatacollector.go | 1 |
2 files changed, 8 insertions, 5 deletions
diff --git a/internal/eventloop.go b/internal/eventloop.go index a6e17ca..b6381ba 100644 --- a/internal/eventloop.go +++ b/internal/eventloop.go @@ -254,7 +254,9 @@ func (e *eventLoop) syscallExit(exitEv event.Event, ch chan<- *event.Pair) { } // Duplicating fd newFd := int32(ev.ExitEv.(*RetEvent).Ret) - e.files[newFd] = fdFile.Dup(newFd) + if newFd != -1 { + e.files[newFd] = fdFile.Dup(newFd) + } } case *Dup3Event: @@ -276,9 +278,11 @@ func (e *eventLoop) syscallExit(exitEv event.Event, ch chan<- *event.Pair) { panic("expected a file.FdFile") } newFd := int32(ev.ExitEv.(*RetEvent).Ret) - duppedFdFile := fdFile.Dup(newFd) - duppedFdFile.AddFlags(dup3Event.Flags & syscall.O_CLOEXEC) - e.files[newFd] = duppedFdFile + if newFd != -1 { + duppedFdFile := fdFile.Dup(newFd) + duppedFdFile.AddFlags(dup3Event.Flags & syscall.O_CLOEXEC) + e.files[newFd] = duppedFdFile + } case *NullEvent: ev.Comm = e.comm(ev.EnterEv.GetTid()) diff --git a/internal/flamegraph/iordatacollector.go b/internal/flamegraph/iordatacollector.go index 6a97379..a63b742 100644 --- a/internal/flamegraph/iordatacollector.go +++ b/internal/flamegraph/iordatacollector.go @@ -10,7 +10,6 @@ import ( "sync" ) -// TODO: Idea, show time spent between the syscalls (off syscalls) as well, but in a different color type IorDataCollector struct { flags flags.Flags Ch chan *event.Pair |
