ANDROID: vendor_hooks: Add hooks to dup_task_struct

Add hook to dup_task_struct for vendor data fields initialisation.

Bug: 188004638

Change-Id: I4b58604ee822fb8d1e0cc37bec72e820e7318427
Signed-off-by: Liangliang Li <liliangliang@vivo.com>
(cherry picked from commit f66d96b14a)
(cherry picked from commit bafafe0ec4)
This commit is contained in:
Liangliang Li
2021-05-13 15:01:26 +08:00
committed by Treehugger Robot
parent 310995a546
commit 3b573277d4
3 changed files with 6 additions and 0 deletions

View File

@@ -359,6 +359,10 @@ DECLARE_HOOK(android_vh_account_task_time,
TP_PROTO(struct task_struct *p, struct rq *rq, int user_tick, int ticks),
TP_ARGS(p, rq, user_tick, ticks));
DECLARE_HOOK(android_vh_dup_task_struct,
TP_PROTO(struct task_struct *tsk, struct task_struct *orig),
TP_ARGS(tsk, orig));
/* macro versions of hooks are no longer required */
#endif /* _TRACE_HOOK_SCHED_H */

View File

@@ -1065,6 +1065,7 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node)
android_init_vendor_data(tsk, 1);
android_init_oem_data(tsk, 1);
trace_android_vh_dup_task_struct(tsk, orig);
return tsk;
free_stack:

View File

@@ -92,3 +92,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_set_cpus_allowed_comm);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sched_setaffinity_early);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_account_process_tick_gran);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_account_task_time);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_dup_task_struct);