From 527e7b1ee8d439a8d0c9032d6054fbdd08ea43e3 Mon Sep 17 00:00:00 2001 From: Liangliang Li Date: Wed, 12 May 2021 18:25:07 +0800 Subject: [PATCH] ANDROID: vendor_hooks: Add hooks for account irqtime process tick Add a hook in irqtime_account_process_tick, which helps to get information about the high load task. Bug: 187904818 Change-Id: I644f7d66b09d047ca6b0a0fbd2915a6387c8c007 Signed-off-by: Liangliang Li (cherry picked from commit fe580539f6cec43ddb0d6ecfd39aa2f4e45754ca) (cherry picked from commit bf3b384e0876a3111d114392b405ed269dcb9c9e) --- include/trace/hooks/sched.h | 4 ++++ kernel/sched/cputime.c | 1 + kernel/sched/vendor_hooks.c | 1 + 3 files changed, 6 insertions(+) diff --git a/include/trace/hooks/sched.h b/include/trace/hooks/sched.h index 4883b02436e2..3f5ab6962c9a 100644 --- a/include/trace/hooks/sched.h +++ b/include/trace/hooks/sched.h @@ -258,6 +258,10 @@ DECLARE_HOOK(android_vh_free_task, TP_PROTO(struct task_struct *p), TP_ARGS(p)); +DECLARE_HOOK(android_vh_irqtime_account_process_tick, + TP_PROTO(struct task_struct *p, struct rq *rq, int user_tick, int ticks), + TP_ARGS(p, rq, user_tick, ticks)); + enum uclamp_id; struct uclamp_se; DECLARE_RESTRICTED_HOOK(android_rvh_uclamp_eff_get, diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c index 5051b63986b4..5c15ed0065d2 100644 --- a/kernel/sched/cputime.c +++ b/kernel/sched/cputime.c @@ -418,6 +418,7 @@ static void irqtime_account_process_tick(struct task_struct *p, int user_tick, } else { account_system_index_time(p, cputime, CPUTIME_SYSTEM); } + trace_android_vh_irqtime_account_process_tick(p, this_rq(), user_tick, ticks); } static void irqtime_account_idle_ticks(int ticks) diff --git a/kernel/sched/vendor_hooks.c b/kernel/sched/vendor_hooks.c index 0ef7b1efef68..df97123e2c2f 100644 --- a/kernel/sched/vendor_hooks.c +++ b/kernel/sched/vendor_hooks.c @@ -93,3 +93,4 @@ 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); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_irqtime_account_process_tick);