Skip to content

Commit

Permalink
adding chan out
Browse files Browse the repository at this point in the history
  • Loading branch information
mtcherni95 committed Jun 28, 2021
1 parent 741e7bb commit 2579020
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tracee-ebpf/tracee/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,12 @@ func (t *Tracee) printEvent(done <-chan struct{}, in <-chan external.Event) (<-c
go func() {
defer close(errc)
for printEvent := range in {
t.stats.eventCounter.Increment()
t.printer.Print(printEvent)
if t.config.ChanEvents != nil {
t.config.ChanEvents <- printEvent
} else {
t.stats.eventCounter.Increment()
t.printer.Print(printEvent)
}
}
}()
return errc, nil
Expand Down
1 change: 1 addition & 0 deletions tracee-ebpf/tracee/tracee.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ type Config struct {
SecurityAlerts bool
maxPidsCache int // maximum number of pids to cache per mnt ns (in Tracee.pidsInMntns)
BPFObjPath string
ChanEvents chan external.Event
}

type Filter struct {
Expand Down

0 comments on commit 2579020

Please sign in to comment.