File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,12 @@ const (
12
12
// cgroup of the task
13
13
DOCKER_ID_LENGTH = 128
14
14
15
+ // Length of the cgroup name as it is returned from BPF side
16
+ CGROUP_NAME_LENGTH = 128
17
+
18
+ // Length of the cgroup path as it is returned from BPF side
19
+ CGROUP_PATH_LENGTH = 4096
20
+
15
21
MSG_SIZEOF_MAXARG = 100
16
22
MSG_SIZEOF_EXECVE = 32
17
23
MSG_SIZEOF_CWD = 256
@@ -138,3 +144,29 @@ type MsgExitEvent struct {
138
144
ProcessKey MsgExecveKey `align:"current"`
139
145
Info MsgExitInfo `align:"info"`
140
146
}
147
+
148
+ // MsgCgroupData is complementary cgroup data that is collected from
149
+ // BPF side on various cgroup events.
150
+ type MsgCgroupData struct {
151
+ State int32 // State of cgroup
152
+ HierarchyId uint32 // Unique id for the hierarchy
153
+ Level uint32 // The depth this cgroup is at
154
+ Pad uint32
155
+ Name [CGROUP_NAME_LENGTH ]byte // Cgroup kernfs_node name
156
+ }
157
+
158
+ // MsgCgroupEvent is the data that is sent from BPF side on cgroup events
159
+ // into ring buffer.
160
+ type MsgCgroupEvent struct {
161
+ Common MsgCommon
162
+ Parent MsgExecveKey
163
+ CgrpOp uint32 // Current cgroup operation
164
+ PID uint32
165
+ NSPID uint32
166
+ Flags uint32
167
+ Ktime uint64
168
+ CgrpidTracker uint64 // The tracking cgroup ID
169
+ Cgrpid uint64 // Current cgroup ID
170
+ CgrpData MsgCgroupData // Complementary cgroup data
171
+ Path [CGROUP_PATH_LENGTH ]byte // Full path of the cgroup on fs
172
+ }
You can’t perform that action at this time.
0 commit comments