ANDROID: vendor_hooks: Add hook for trace_android_vh_copy_process

Add hook for trace_android_vh_copy_process, which gives the vendor a chance to monitor the total thread count of the system and the thread count under a particular process

Bug: 325765508
Change-Id: Ibeb8aa571d44997ac10623321cd00d1686bde033
Signed-off-by: chenweitao <chenweitao@oppo.com>
This commit is contained in:
chenweitao
2025-03-11 11:25:47 +08:00
parent bd702ad54e
commit 1dc69ebe20
3 changed files with 7 additions and 0 deletions

View File

@@ -265,6 +265,11 @@ 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));
DECLARE_HOOK(android_vh_copy_process,
TP_PROTO(struct task_struct *p, int nr_threads),
TP_ARGS(p, nr_threads));
enum uclamp_id;
struct uclamp_se;
DECLARE_RESTRICTED_HOOK(android_rvh_uclamp_eff_get,

View File

@@ -2611,6 +2611,7 @@ __latent_entropy struct task_struct *copy_process(
attach_pid(p, PIDTYPE_PID);
nr_threads++;
}
trace_android_vh_copy_process(current, nr_threads);
total_forks++;
hlist_del_init(&delayed.node);
spin_unlock(&current->sighand->siglock);

View File

@@ -45,6 +45,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_check_preempt_wakeup_fair);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_update_deadline);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_set_cpus_allowed_by_task);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_free_task);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_copy_process);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_uclamp_eff_get);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_after_enqueue_task);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_after_dequeue_task);