hc
2024-01-31 f9004dbfff8a3fbbd7e2a88c8a4327c7f2f8e5b2
kernel/include/trace/events/cgroup.h
....@@ -59,19 +59,19 @@
5959
6060 TP_STRUCT__entry(
6161 __field( int, root )
62
- __field( int, id )
6362 __field( int, level )
63
+ __field( u64, id )
6464 __string( path, path )
6565 ),
6666
6767 TP_fast_assign(
6868 __entry->root = cgrp->root->hierarchy_id;
69
- __entry->id = cgrp->id;
69
+ __entry->id = cgroup_id(cgrp);
7070 __entry->level = cgrp->level;
7171 __assign_str(path, path);
7272 ),
7373
74
- TP_printk("root=%d id=%d level=%d path=%s",
74
+ TP_printk("root=%d id=%llu level=%d path=%s",
7575 __entry->root, __entry->id, __entry->level, __get_str(path))
7676 );
7777
....@@ -103,6 +103,20 @@
103103 TP_ARGS(cgrp, path)
104104 );
105105
106
+DEFINE_EVENT(cgroup, cgroup_freeze,
107
+
108
+ TP_PROTO(struct cgroup *cgrp, const char *path),
109
+
110
+ TP_ARGS(cgrp, path)
111
+);
112
+
113
+DEFINE_EVENT(cgroup, cgroup_unfreeze,
114
+
115
+ TP_PROTO(struct cgroup *cgrp, const char *path),
116
+
117
+ TP_ARGS(cgrp, path)
118
+);
119
+
106120 DECLARE_EVENT_CLASS(cgroup_migrate,
107121
108122 TP_PROTO(struct cgroup *dst_cgrp, const char *path,
....@@ -112,8 +126,8 @@
112126
113127 TP_STRUCT__entry(
114128 __field( int, dst_root )
115
- __field( int, dst_id )
116129 __field( int, dst_level )
130
+ __field( u64, dst_id )
117131 __field( int, pid )
118132 __string( dst_path, path )
119133 __string( comm, task->comm )
....@@ -121,14 +135,14 @@
121135
122136 TP_fast_assign(
123137 __entry->dst_root = dst_cgrp->root->hierarchy_id;
124
- __entry->dst_id = dst_cgrp->id;
138
+ __entry->dst_id = cgroup_id(dst_cgrp);
125139 __entry->dst_level = dst_cgrp->level;
126140 __assign_str(dst_path, path);
127141 __entry->pid = task->pid;
128142 __assign_str(comm, task->comm);
129143 ),
130144
131
- TP_printk("dst_root=%d dst_id=%d dst_level=%d dst_path=%s pid=%d comm=%s",
145
+ TP_printk("dst_root=%d dst_id=%llu dst_level=%d dst_path=%s pid=%d comm=%s",
132146 __entry->dst_root, __entry->dst_id, __entry->dst_level,
133147 __get_str(dst_path), __entry->pid, __get_str(comm))
134148 );
....@@ -149,6 +163,47 @@
149163 TP_ARGS(dst_cgrp, path, task, threadgroup)
150164 );
151165
166
+DECLARE_EVENT_CLASS(cgroup_event,
167
+
168
+ TP_PROTO(struct cgroup *cgrp, const char *path, int val),
169
+
170
+ TP_ARGS(cgrp, path, val),
171
+
172
+ TP_STRUCT__entry(
173
+ __field( int, root )
174
+ __field( int, level )
175
+ __field( u64, id )
176
+ __string( path, path )
177
+ __field( int, val )
178
+ ),
179
+
180
+ TP_fast_assign(
181
+ __entry->root = cgrp->root->hierarchy_id;
182
+ __entry->id = cgroup_id(cgrp);
183
+ __entry->level = cgrp->level;
184
+ __assign_str(path, path);
185
+ __entry->val = val;
186
+ ),
187
+
188
+ TP_printk("root=%d id=%llu level=%d path=%s val=%d",
189
+ __entry->root, __entry->id, __entry->level, __get_str(path),
190
+ __entry->val)
191
+);
192
+
193
+DEFINE_EVENT(cgroup_event, cgroup_notify_populated,
194
+
195
+ TP_PROTO(struct cgroup *cgrp, const char *path, int val),
196
+
197
+ TP_ARGS(cgrp, path, val)
198
+);
199
+
200
+DEFINE_EVENT(cgroup_event, cgroup_notify_frozen,
201
+
202
+ TP_PROTO(struct cgroup *cgrp, const char *path, int val),
203
+
204
+ TP_ARGS(cgrp, path, val)
205
+);
206
+
152207 #endif /* _TRACE_CGROUP_H */
153208
154209 /* This part must be outside protection */