diff --git a/thorlog/v3/process.go b/thorlog/v3/process.go index bb22a41..e84d768 100644 --- a/thorlog/v3/process.go +++ b/thorlog/v3/process.go @@ -46,6 +46,10 @@ type ProcessInfo struct { ProcessConnections `textlog:",expand"` + Handles []ProcessHandle `json:"handles" textlog:"handles,expand"` + + Threads []Thread `json:"threads" textlog:"threads,expand"` + Sections Sections `json:"sections,omitempty" textlog:"-"` } @@ -96,6 +100,17 @@ type ProcessConnections struct { ConnectionCount int `json:"-" textlog:"connection_count"` } +type ProcessHandle struct { + Name string `json:"name" textlog:"name"` + Handle uint64 `json:"handle" textlog:"handle,omitempty"` + Type string `json:"handle_type,omitempty" textlog:"type,omitempty"` +} + +type Thread struct { + ThreadId uint32 `json:"id"` + Stack StringList `json:"stack" jsonschema:"nullable"` +} + type ProcessListenPorts []uint32 func (p ProcessListenPorts) String() string { diff --git a/thorlog/v3/processconnection.go b/thorlog/v3/processconnection.go deleted file mode 100644 index 0f1cbd5..0000000 --- a/thorlog/v3/processconnection.go +++ /dev/null @@ -1,24 +0,0 @@ -package thorlog - -import ( - "github.com/NextronSystems/jsonlog" -) - -type ProcessConnectionObject struct { - jsonlog.ObjectHeader - ProcessConnection -} - -func (ProcessConnectionObject) observed() {} - -const typeProcessConnection = "process connection" - -func init() { AddLogObjectType(typeProcessConnection, &ProcessConnectionObject{}) } - -func NewProcessConnection() *ProcessConnectionObject { - return &ProcessConnectionObject{ - ObjectHeader: jsonlog.ObjectHeader{ - Type: typeProcessConnection, - }, - } -} diff --git a/thorlog/v3/processhandle.go b/thorlog/v3/processhandle.go deleted file mode 100644 index bf5b898..0000000 --- a/thorlog/v3/processhandle.go +++ /dev/null @@ -1,27 +0,0 @@ -package thorlog - -import ( - "github.com/NextronSystems/jsonlog" -) - -type ProcessHandle struct { - jsonlog.ObjectHeader - - Name string `json:"name" textlog:"name"` - Handle uint64 `json:"handle" textlog:"handle,omitempty"` - Type string `json:"handle_type,omitempty" textlog:"type,omitempty"` -} - -func (ProcessHandle) observed() {} - -const typeProcessHandle = "process handle" - -func init() { AddLogObjectType(typeProcessHandle, &ProcessHandle{}) } - -func NewProcessHandle() *ProcessHandle { - return &ProcessHandle{ - ObjectHeader: jsonlog.ObjectHeader{ - Type: typeProcessHandle, - }, - } -} diff --git a/thorlog/v3/thread.go b/thorlog/v3/thread.go deleted file mode 100644 index cf43480..0000000 --- a/thorlog/v3/thread.go +++ /dev/null @@ -1,26 +0,0 @@ -package thorlog - -import ( - "github.com/NextronSystems/jsonlog" -) - -type Thread struct { - jsonlog.ObjectHeader - ThreadId uint32 `json:"id"` - Stack StringList `json:"stack" jsonschema:"nullable"` -} - -func (Thread) observed() {} - -const typeThread = "thread" - -func init() { AddLogObjectType(typeThread, &Thread{}) } - -func NewThread(tid uint32) *Thread { - return &Thread{ - ObjectHeader: jsonlog.ObjectHeader{ - Type: typeThread, - }, - ThreadId: tid, - } -}