summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2024-02-13 19:33:43 +0200
committerPaul Buetow <paul@buetow.org>2024-02-13 19:33:43 +0200
commit00b7b0383d6610a585dbea190a2c9c6326174fe9 (patch)
tree1b6e628e90f8dc044abec79ab857b73fe075f935 /internal
parent63962589e66007324edcff458bd076de34b76d77 (diff)
rename
Diffstat (limited to 'internal')
-rw-r--r--internal/ioriotng.go4
-rw-r--r--internal/types/types.go15
2 files changed, 7 insertions, 12 deletions
diff --git a/internal/ioriotng.go b/internal/ioriotng.go
index b189590..890ac73 100644
--- a/internal/ioriotng.go
+++ b/internal/ioriotng.go
@@ -78,13 +78,13 @@ func Run(flags flags.Flags) {
go func() {
defer wg.Done()
for ev := range listenToEvents[types.FdEvent](ctx, bpfModule, "fd_event_map") {
- log.Println(ev)
+ fmt.Println(ev)
}
}()
go func() {
defer wg.Done()
for ev := range listenToEvents[types.OpenEvent](ctx, bpfModule, "open_event_map") {
- log.Println(ev)
+ fmt.Println(ev)
}
}()
diff --git a/internal/types/types.go b/internal/types/types.go
index 890891b..c9e2101 100644
--- a/internal/types/types.go
+++ b/internal/types/types.go
@@ -3,21 +3,16 @@ package types
import "fmt"
type OpenEvent struct {
- FD int32
- OpID int32
- TID uint32
- EnterTime uint64
- ExitTime uint64
- Filename [256]byte // TODO, use same value as in ioriot.bpf.h
- Comm [16]byte
+ FD int32
+ TID uint32
+ Filename [256]byte // TODO, use same value as in ioriot.bpf.h
+ Comm [16]byte
}
func (e OpenEvent) String() string {
filename := e.Filename[:]
comm := e.Comm[:]
- duration := (e.ExitTime - e.EnterTime) / 1000000000000.0
- return fmt.Sprintf("%vms opId:%d tid:%d fd:%d filename:%s, comm:%s",
- duration, e.OpID, e.TID, e.FD, string(filename), string(comm))
+ return fmt.Sprintf("tid:%d fd:%d filename:%s, comm:%s", e.TID, e.FD, string(filename), string(comm))
}
type FdEvent struct {