ANDROID: vendor_hooks: Add hooks for account process tick

Add a hook in account_process_tick, which help us to get information
about the high load task and the cpu they running on.

Bug: 183260319
Change-Id: I54162ce3c65bd69e08d2d4747e4d4883efe4c442
Signed-off-by: Liujie Xie <xieliujie@oppo.com>
(cherry picked from commit 63399b4e2e)
This commit is contained in:
Liujie Xie
2021-03-23 07:54:24 +08:00
committed by Todd Kjos
parent 0902cc73b7
commit 6fbdd5a252
3 changed files with 5 additions and 0 deletions

View File

@@ -322,3 +322,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mmap_region);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_try_to_unmap_one);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_shrink_node_memcgs);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mmc_sdio_pm_flag_set);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_account_task_time);

View File

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

View File

@@ -494,6 +494,7 @@ void account_process_tick(struct task_struct *p, int user_tick)
if (vtime_accounting_enabled_this_cpu())
return;
trace_android_vh_account_task_time(p, this_rq(), user_tick);
if (sched_clock_irqtime) {
irqtime_account_process_tick(p, user_tick, 1);