@@ -32,7 +32,8 @@ func HumanizeByteCount(b int) string {
32
32
func PrintTracingPolicies (output io.Writer , policies []* tetragon.TracingPolicyStatus , skipPolicy func (pol * tetragon.TracingPolicyStatus ) bool ) {
33
33
// tabwriter config imitates kubectl default output, i.e. 3 spaces padding
34
34
w := tabwriter .NewWriter (output , 0 , 0 , 3 , ' ' , 0 )
35
- fmt .Fprintln (w , "ID\t NAME\t STATE\t FILTERID\t NAMESPACE\t SENSORS\t KERNELMEMORY\t MODE" )
35
+ header := "ID\t NAME\t STATE\t FILTERID\t NAMESPACE\t SENSORS\t KERNELMEMORY\t MODE\t NPOST\t NENFORCE\t NMONITOR"
36
+ fmt .Fprintln (w , header )
36
37
37
38
for _ , pol := range policies {
38
39
if skipPolicy != nil && skipPolicy (pol ) {
@@ -70,7 +71,8 @@ func PrintTracingPolicies(output io.Writer, policies []*tetragon.TracingPolicySt
70
71
}
71
72
}
72
73
73
- fmt .Fprintf (w , "%d\t %s\t %s\t %d\t %s\t %s\t %s\t %s\t \n " ,
74
+ counters := pol .GetStats ().GetActionCounters ()
75
+ fmt .Fprintf (w , "%d\t %s\t %s\t %d\t %s\t %s\t %s\t %s\t %d\t %d\t %d\n " ,
74
76
pol .Id ,
75
77
pol .Name ,
76
78
strings .TrimPrefix (strings .ToLower (pol .State .String ()), "tp_state_" ),
@@ -79,7 +81,9 @@ func PrintTracingPolicies(output io.Writer, policies []*tetragon.TracingPolicySt
79
81
sensors ,
80
82
HumanizeByteCount (int (pol .KernelMemoryBytes )),
81
83
strings .TrimPrefix (strings .ToLower (pol .Mode .String ()), "tp_mode_" ),
82
- )
84
+ counters .GetPost (),
85
+ counters .GetSignal ()+ counters .GetOverride ()+ counters .GetNotifyEnforcer (),
86
+ counters .GetMonitorSignal ()+ counters .GetMonitorOverride ()+ counters .GetMonitorNotifyEnforcer ())
83
87
}
84
88
w .Flush ()
85
89
}
0 commit comments