ANDROID: update is_cpu_allowed hook prototype

Vendor module needs access to the task structure
through is_cpu_allowed tracehook to better
assess whether the chosen cpu can be allowed.

Update the existing is_cpu_allowed tracehook to
pass the task struct of the task currently being
handled.

Bug: 228392842
Change-Id: I882b593ccb77da0755e076c7e636db304ee74b42
Signed-off-by: Stephen Dickey <quic_dickey@quicinc.com>
This commit is contained in:
Stephen Dickey
2022-04-06 21:02:57 -07:00
committed by Carlos Llamas
parent 07c3480a9d
commit 457758d86c
2 changed files with 3 additions and 3 deletions

View File

@@ -65,8 +65,8 @@ DECLARE_RESTRICTED_HOOK(android_rvh_rto_next_cpu,
TP_ARGS(rto_cpu, rto_mask, cpu), 1);
DECLARE_RESTRICTED_HOOK(android_rvh_is_cpu_allowed,
TP_PROTO(int cpu, bool *allowed),
TP_ARGS(cpu, allowed), 1);
TP_PROTO(struct task_struct *p, int cpu, bool *allowed),
TP_ARGS(p, cpu, allowed), 1);
DECLARE_RESTRICTED_HOOK(android_rvh_get_nohz_timer_target,
TP_PROTO(int *cpu, bool *done),

View File

@@ -2230,7 +2230,7 @@ static inline bool is_cpu_allowed(struct task_struct *p, int cpu)
return cpu_online(cpu);
/* check for all cases */
trace_android_rvh_is_cpu_allowed(cpu, &allowed);
trace_android_rvh_is_cpu_allowed(p, cpu, &allowed);
/* Non kernel threads are not allowed during either online or offline. */
if (!(p->flags & PF_KTHREAD))