diff options
Diffstat (limited to 'internal/streamrow')
| -rw-r--r-- | internal/streamrow/row.go | 3 | ||||
| -rw-r--r-- | internal/streamrow/row_test.go | 8 |
2 files changed, 7 insertions, 4 deletions
diff --git a/internal/streamrow/row.go b/internal/streamrow/row.go index 026aa93..5bccb61 100644 --- a/internal/streamrow/row.go +++ b/internal/streamrow/row.go @@ -15,6 +15,7 @@ type Row struct { Seq uint64 TimeNs uint64 Syscall string + Family string Comm string PID uint32 TID uint32 @@ -101,6 +102,7 @@ func New(seq uint64, pair *event.Pair) Row { Seq: seq, TimeNs: pair.EnterEv.GetTime(), Syscall: pair.EnterEv.GetTraceId().Name(), + Family: string(pair.EnterEv.GetTraceId().Family()), Comm: pair.Comm, PID: pair.EnterEv.GetPid(), TID: pair.EnterEv.GetTid(), @@ -138,6 +140,7 @@ func NewWarning(seq uint64, message string) Row { Seq: seq, TimeNs: now, Syscall: "warning", + Family: string(types.FamilyMisc), Comm: "ior", FileName: message, FD: UnknownFD, diff --git a/internal/streamrow/row_test.go b/internal/streamrow/row_test.go index ea63bcc..304aa12 100644 --- a/internal/streamrow/row_test.go +++ b/internal/streamrow/row_test.go @@ -66,8 +66,8 @@ func TestNewPopulatesFieldsFromPair(t *testing.T) { if got.Seq != 9 || got.TimeNs != 1234 { t.Fatalf("Seq/TimeNs = %d/%d, want 9/1234", got.Seq, got.TimeNs) } - if got.Syscall != "openat" || got.Comm != "cat" { - t.Fatalf("Syscall/Comm = %q/%q, want openat/cat", got.Syscall, got.Comm) + if got.Syscall != "openat" || got.Family != "FS" || got.Comm != "cat" { + t.Fatalf("Syscall/Family/Comm = %q/%q/%q, want openat/FS/cat", got.Syscall, got.Family, got.Comm) } if got.PID != 42 || got.TID != 84 { t.Fatalf("PID/TID = %d/%d, want 42/84", got.PID, got.TID) @@ -88,8 +88,8 @@ func TestNewWarningPopulatesSyntheticWarningFields(t *testing.T) { if got.Seq != 7 || got.TimeNs == 0 { t.Fatalf("Seq/TimeNs = %d/%d, want 7/non-zero", got.Seq, got.TimeNs) } - if got.Syscall != "warning" || got.Comm != "ior" { - t.Fatalf("Syscall/Comm = %q/%q, want warning/ior", got.Syscall, got.Comm) + if got.Syscall != "warning" || got.Family != "Misc" || got.Comm != "ior" { + t.Fatalf("Syscall/Family/Comm = %q/%q/%q, want warning/Misc/ior", got.Syscall, got.Family, got.Comm) } if got.FileName != "Dropped malformed event" || got.FD != UnknownFD { t.Fatalf("FileName/FD = %q/%d, want warning text/%d", got.FileName, got.FD, UnknownFD) |
