From a02945b39514953a3459ffabc14ab772c7c4fe92 Mon Sep 17 00:00:00 2001 From: Rafael David Tinoco Date: Thu, 31 Aug 2023 15:50:36 -0300 Subject: [PATCH] feature(types): add task identifier (#3425) --- 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 75eae9aac1b2..0be20f1224d1 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"`