2 #define TRACE_SYSTEM cgroup
4 #if !defined(_TRACE_CGROUP_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define _TRACE_CGROUP_H
7 #include <linux/cgroup.h>
8 #include <linux/tracepoint.h>
10 DECLARE_EVENT_CLASS(cgroup_root,
12 TP_PROTO(struct cgroup_root *root),
18 __field( u16, ss_mask )
19 __string( name, root->name )
23 __entry->root = root->hierarchy_id;
24 __entry->ss_mask = root->subsys_mask;
25 __assign_str(name, root->name);
28 TP_printk("root=%d ss_mask=%#x name=%s",
29 __entry->root, __entry->ss_mask, __get_str(name))
32 DEFINE_EVENT(cgroup_root, cgroup_setup_root,
34 TP_PROTO(struct cgroup_root *root),
39 DEFINE_EVENT(cgroup_root, cgroup_destroy_root,
41 TP_PROTO(struct cgroup_root *root),
46 DEFINE_EVENT(cgroup_root, cgroup_remount,
48 TP_PROTO(struct cgroup_root *root),
53 DECLARE_EVENT_CLASS(cgroup,
55 TP_PROTO(struct cgroup *cgrp),
63 __dynamic_array(char, path,
64 cgrp->kn ? cgroup_path(cgrp, NULL, 0) + 1
69 __entry->root = cgrp->root->hierarchy_id;
70 __entry->id = cgrp->id;
71 __entry->level = cgrp->level;
73 cgroup_path(cgrp, __get_dynamic_array(path),
74 __get_dynamic_array_len(path));
76 __assign_str(path, "(null)");
79 TP_printk("root=%d id=%d level=%d path=%s",
80 __entry->root, __entry->id, __entry->level, __get_str(path))
83 DEFINE_EVENT(cgroup, cgroup_mkdir,
85 TP_PROTO(struct cgroup *cgroup),
90 DEFINE_EVENT(cgroup, cgroup_rmdir,
92 TP_PROTO(struct cgroup *cgroup),
97 DEFINE_EVENT(cgroup, cgroup_release,
99 TP_PROTO(struct cgroup *cgroup),
104 DEFINE_EVENT(cgroup, cgroup_rename,
106 TP_PROTO(struct cgroup *cgroup),
111 DECLARE_EVENT_CLASS(cgroup_migrate,
113 TP_PROTO(struct cgroup *dst_cgrp, struct task_struct *task, bool threadgroup),
115 TP_ARGS(dst_cgrp, task, threadgroup),
118 __field( int, dst_root )
119 __field( int, dst_id )
120 __field( int, dst_level )
121 __dynamic_array(char, dst_path,
122 dst_cgrp->kn ? cgroup_path(dst_cgrp, NULL, 0) + 1
125 __string( comm, task->comm )
129 __entry->dst_root = dst_cgrp->root->hierarchy_id;
130 __entry->dst_id = dst_cgrp->id;
131 __entry->dst_level = dst_cgrp->level;
133 cgroup_path(dst_cgrp, __get_dynamic_array(dst_path),
134 __get_dynamic_array_len(dst_path));
136 __assign_str(dst_path, "(null)");
137 __entry->pid = task->pid;
138 __assign_str(comm, task->comm);
141 TP_printk("dst_root=%d dst_id=%d dst_level=%d dst_path=%s pid=%d comm=%s",
142 __entry->dst_root, __entry->dst_id, __entry->dst_level,
143 __get_str(dst_path), __entry->pid, __get_str(comm))
146 DEFINE_EVENT(cgroup_migrate, cgroup_attach_task,
148 TP_PROTO(struct cgroup *dst_cgrp, struct task_struct *task, bool threadgroup),
150 TP_ARGS(dst_cgrp, task, threadgroup)
153 DEFINE_EVENT(cgroup_migrate, cgroup_transfer_tasks,
155 TP_PROTO(struct cgroup *dst_cgrp, struct task_struct *task, bool threadgroup),
157 TP_ARGS(dst_cgrp, task, threadgroup)
160 #endif /* _TRACE_CGROUP_H */
162 /* This part must be outside protection */
163 #include <trace/define_trace.h>