From b5400ac6d1407886a88c357759db5e9d6b7602cc Mon Sep 17 00:00:00 2001 From: Rafael David Tinoco Date: Mon, 21 Aug 2023 17:28:24 -0300 Subject: [PATCH] feature(types): add task identifier --- types/trace/trace.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/types/trace/trace.go b/types/trace/trace.go index 75eae9aac1b..0be20f1224d 100644 --- a/types/trace/trace.go +++ b/types/trace/trace.go @@ -42,10 +42,18 @@ type Event struct { Syscall string `json:"syscall"` StackAddresses []uint64 `json:"stackAddresses"` ContextFlags ContextFlags `json:"contextFlags"` - Args []Argument `json:"args"` // Arguments are ordered according their appearance in the original event + EntityID uint32 `json:"-"` // task unique identifier (*) + Args []Argument `json:"args"` // args are ordered according their appearance in the original event Metadata *Metadata `json:"metadata,omitempty"` } +// (*) For an OS task to be uniquely identified, tracee builds a hash consisting of: +// +// u64: task start time (from event context) +// u32: task thread id (from event context) +// +// murmur([]byte) where slice of bytes is a concatenation (not a sum) of the 2 values above. + type Container struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"`