From 5512e4441ba93d1a8d55faf56d66eaf9986551f1 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 29 Feb 2024 21:20:52 +0200 Subject: nicer output --- internal/eventloop.go | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'internal/eventloop.go') diff --git a/internal/eventloop.go b/internal/eventloop.go index 765345d..6163ebf 100644 --- a/internal/eventloop.go +++ b/internal/eventloop.go @@ -10,13 +10,12 @@ import ( bpf "github.com/aquasecurity/libbpfgo" ) -type openFile struct { - fd int32 - path string -} - -func (o openFile) String() string { - return fmt.Sprintf("(%d) %s", o.fd, o.path) +func eventLoop(bpfModule *bpf.Module, rawCh <-chan []byte) { + for ev := range events(rawCh) { + fmt.Println(ev) + ev.recycle() + } + fmt.Println("Good bye") } func events(rawCh <-chan []byte) <-chan enterExitEvent { @@ -64,12 +63,3 @@ func events(rawCh <-chan []byte) <-chan enterExitEvent { return evCh } - -func eventLoop(bpfModule *bpf.Module, rawCh <-chan []byte) { - for ev := range events(rawCh) { - fmt.Println(ev.dump()) - ev.recycle() - } - - fmt.Println("Good bye") -} -- cgit v1.2.3