Skip to content

Commit

Permalink
tetra: LSM events compact print support
Browse files Browse the repository at this point in the history
Adding LSM events compact printing like it is done
for kprobes in default case.

Signed-off-by: Andrei Fedotov <anfedotoff@yandex-team.ru>
  • Loading branch information
anfedotoff authored and kkourt committed Jul 26, 2024
1 parent 33da2bb commit b70ad86
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/encoder/encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,14 @@ func (p *CompactEncoder) EventToString(response *tetragon.GetEventsResponse) (st
event := p.Colorer.Blue.Sprintf("⁉️ %-7s", "tracepoint")
return CapTrailorPrinter(fmt.Sprintf("%s %s %s %s", event, processInfo, tp.Subsys, tp.Event), caps), nil
}
case *tetragon.GetEventsResponse_ProcessLsm:
lsm := response.GetProcessLsm()
if lsm.Process == nil {
return "", ErrMissingProcessInfo
}
processInfo, caps := p.Colorer.ProcessInfo(response.NodeName, lsm.Process)
event := p.Colorer.Blue.Sprintf("🔒 %-7s", "LSM")
return CapTrailorPrinter(fmt.Sprintf("%s %s %s", event, processInfo, lsm.FunctionName), caps), nil
}

return "", ErrUnknownEventType
Expand Down

0 comments on commit b70ad86

Please # to comment.