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>
This commit is contained in:
Liujie Xie
2021-03-23 07:54:24 +08:00
committed by Todd Kjos
parent 11f8c783df
commit 63399b4e2e
3 changed files with 5 additions and 0 deletions

View File

@@ -217,3 +217,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cache_show);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_typec_tcpci_override_toggling);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_typec_tcpci_chk_contaminant);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_typec_tcpci_get_vbus);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_account_task_time);

View File

@@ -282,6 +282,9 @@ DECLARE_RESTRICTED_HOOK(android_rvh_util_est_update,
TP_PROTO(struct cfs_rq *cfs_rq, struct task_struct *p, bool task_sleep, int *ret),
TP_ARGS(cfs_rq, p, task_sleep, ret), 1);
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

@@ -486,6 +486,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);