aboutsummaryrefslogtreecommitdiffstats
path: root/filter/global.go
diff options
context:
space:
mode:
Diffstat (limited to 'filter/global.go')
-rw-r--r--filter/global.go25
1 files changed, 20 insertions, 5 deletions
diff --git a/filter/global.go b/filter/global.go
index 37af52b..bade895 100644
--- a/filter/global.go
+++ b/filter/global.go
@@ -22,6 +22,7 @@ type Process struct {
22 RootFS string `bson:"rootfs"` 22 RootFS string `bson:"rootfs"`
23 Cwd string `bson:"cwd"` 23 Cwd string `bson:"cwd"`
24 Children []int `bson:"children"` 24 Children []int `bson:"children"`
25 DockerId string `bson:"docker_id"`
25 Execve []Exec `bson:"execve"` 26 Execve []Exec `bson:"execve"`
26 ExitCode int `bson:"exit_code"` 27 ExitCode int `bson:"exit_code"`
27 ExitSignal int `bson:"exit_signal"` 28 ExitSignal int `bson:"exit_signal"`
@@ -44,26 +45,40 @@ func (p Process) String() string {
44 for i := 0; i < len(p.Args); i++ { 45 for i := 0; i < len(p.Args); i++ {
45 res += fmt.Sprintf("%s ", p.Args[i]) 46 res += fmt.Sprintf("%s ", p.Args[i])
46 } 47 }
47 res += fmt.Sprintf("\ncomm\t%s\ncwd\t%s\n", p.Comm, p.Cwd) 48 res += fmt.Sprintf("\ncomm\t%s\ncwd\t%s\nrootfs\t%s\ndocker_id\t%s\n", p.Comm, p.Cwd, p.RootFS, p.DockerId)
48 if len(p.Execve) != 0 { 49 if len(p.Execve) != 0 {
49 res += fmt.Sprintf("exec:\n") 50 res += "exec:\n"
50 for i := 0; i < len(p.Execve); i++ { 51 for i := 0; i < len(p.Execve); i++ {
51 res += fmt.Sprintf("\ttimestamp: %v\n\texecArgs:\t", p.Execve[i].Timestamp) 52 res += fmt.Sprintf("\ttimestamp: %v\n\texecArgs:\t", p.Execve[i].Timestamp)
52 for j := 0; j < len(p.Execve[i].ExecArgs); j++ { 53 for j := 0; j < len(p.Execve[i].ExecArgs); j++ {
53 res += fmt.Sprintf("%s ", p.Execve[i].ExecArgs[j]) 54 res += fmt.Sprintf("%s ", p.Execve[i].ExecArgs[j])
54 } 55 }
55 res += fmt.Sprintf("\n") 56 res += "\n"
56 } 57 }
57 } 58 }
58 res += fmt.Sprintf("children: ") 59 res += "children: "
59 for i := 0; i < len(p.Children); i++ { 60 for i := 0; i < len(p.Children); i++ {
60 res += fmt.Sprintf("%d ", p.Children[i]) 61 res += fmt.Sprintf("%d ", p.Children[i])
61 } 62 }
62 res += fmt.Sprintf("\n") 63 res += "\n"
63 res += fmt.Sprintf("exit_timestamp:\t%v\nexit_code:\t%d\nexit_signal:\t%d\n", p.ExitTimestamp, p.ExitCode, p.ExitSignal) 64 res += fmt.Sprintf("exit_timestamp:\t%v\nexit_code:\t%d\nexit_signal:\t%d\n", p.ExitTimestamp, p.ExitCode, p.ExitSignal)
64 return res 65 return res
65} 66}
66 67
68func (node tgidNode) String() string {
69 var res string
70 res += fmt.Sprintf("==============================\ntgid: %6d, size: %6d, children: ", node.Tgid, len(node.Threads))
71 for _, child := range node.ChildTgid {
72 res += fmt.Sprintf("%7d", child)
73 }
74 res += "\n"
75 for _, process := range node.Threads {
76 res += fmt.Sprintf("%v\n", process)
77 }
78 res += "\n"
79 return res
80}
81
67type File struct { 82type File struct {
68 OpenTimestamp time.Time `bson:"timestamp"` 83 OpenTimestamp time.Time `bson:"timestamp"`
69 FileName string `bson:"fileName"` 84 FileName string `bson:"fileName"`