From ed2a228522b98300ecccd958506a9a2833eca780 Mon Sep 17 00:00:00 2001 From: Xuewen Yan Date: Tue, 27 Jun 2023 19:10:18 +0800 Subject: [PATCH] ANDROID: fix build error when use cpu_cgroup_online vh When register_trace_rvh_cpu_cgroup_online, it would report error: declaration of 'struct cgroup_subsys_state' will not be visible outside of this function: TP_PROTO(struct cgroup_subsys_state *css), So add declaration of 'struct cgroup_subsys_state' on the top of vh. Bug: 289018298 Fixes: 5f657b04f4f2 ("ANDROID: subsystem-specific vendor_hooks.c for sched") Change-Id: I3da0bee61b193ef9d998ebff79ceb91fec12ceff Signed-off-by: Xuewen Yan --- include/trace/hooks/cgroup.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/trace/hooks/cgroup.h b/include/trace/hooks/cgroup.h index 15582cc572bd..dc6b47dcb21d 100644 --- a/include/trace/hooks/cgroup.h +++ b/include/trace/hooks/cgroup.h @@ -8,6 +8,9 @@ #include struct task_struct; +struct cgroup_taskset; +struct cgroup_subsys; +struct cgroup_subsys_state; DECLARE_HOOK(android_vh_cgroup_set_task, TP_PROTO(int ret, struct task_struct *task), TP_ARGS(ret, task)); @@ -16,8 +19,6 @@ DECLARE_RESTRICTED_HOOK(android_rvh_refrigerator, TP_PROTO(bool f), TP_ARGS(f), 1); -struct cgroup_subsys; -struct cgroup_taskset; DECLARE_HOOK(android_vh_cgroup_attach, TP_PROTO(struct cgroup_subsys *ss, struct cgroup_taskset *tset), TP_ARGS(ss, tset)) @@ -25,8 +26,6 @@ DECLARE_RESTRICTED_HOOK(android_rvh_cgroup_force_kthread_migration, TP_PROTO(struct task_struct *tsk, struct cgroup *dst_cgrp, bool *force_migration), TP_ARGS(tsk, dst_cgrp, force_migration), 1); -struct cgroup_taskset; -struct cgroup_subsys; DECLARE_RESTRICTED_HOOK(android_rvh_cpuset_fork, TP_PROTO(struct task_struct *p, bool *inherit_cpus),