diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index 66af98d4eb54..27f757c1e385 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -38,6 +38,7 @@ #include #include #include +#include /* * Export tracepoints that act as a bare tracehook (ie: have no trace event @@ -172,3 +173,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_do_wake_up_sync); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_wake_flags); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_uclamp_eff_value); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_cpufreq_transition); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cgroup_set_task); diff --git a/include/trace/hooks/cgroup.h b/include/trace/hooks/cgroup.h new file mode 100644 index 000000000000..cc44ccf9e109 --- /dev/null +++ b/include/trace/hooks/cgroup.h @@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM cgroup +#undef TRACE_INCLUDE_PATH +#define TRACE_INCLUDE_PATH trace/hooks +#if !defined(_TRACE_HOOK_CGROUP_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_HOOK_CGROUP_H +#include +#include + +struct task_struct; +DECLARE_HOOK(android_vh_cgroup_set_task, + TP_PROTO(int ret, struct task_struct *task), + TP_ARGS(ret, task)); +#endif + +#include diff --git a/kernel/cgroup/cgroup-v1.c b/kernel/cgroup/cgroup-v1.c index cffa6c9ba784..9dceb5ec4a8d 100644 --- a/kernel/cgroup/cgroup-v1.c +++ b/kernel/cgroup/cgroup-v1.c @@ -17,6 +17,7 @@ #include #include +#include /* * pidlists linger the following amount before being destroyed. The goal @@ -518,6 +519,7 @@ static ssize_t __cgroup1_procs_write(struct kernfs_open_file *of, goto out_finish; ret = cgroup_attach_task(cgrp, task, threadgroup); + trace_android_vh_cgroup_set_task(ret, task); out_finish: cgroup_procs_write_finish(task, locked);