ANDROID: sched: create trace points for 32bit execve

Module code would like to hold some locks when affinity is being updated
for 32 bit task exec.

Create pre and post tracepoints in force_compatible_cpus_allowed_ptr()

Bug: 187917024
Change-Id: I95bff9f4d5b5d37c1d5440acbd6857d2855c2b43
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Signed-off-by: Shaleen Agrawal <shalagra@codeaurora.org>
This commit is contained in:
Abhijeet Dharmapurikar
2021-06-01 16:40:51 -07:00
committed by Todd Kjos
parent 79cb255c79
commit 3f5e8b830c
3 changed files with 12 additions and 0 deletions

View File

@@ -312,3 +312,5 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_fill_ext_fmtdesc);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_clear_mask_adjust);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_scmi_timeout_sync);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_find_new_ilb);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_force_compatible_pre);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_force_compatible_post);

View File

@@ -370,6 +370,14 @@ DECLARE_RESTRICTED_HOOK(android_rvh_find_new_ilb,
TP_PROTO(struct cpumask *nohz_idle_cpus_mask, int *ilb),
TP_ARGS(nohz_idle_cpus_mask, ilb), 1);
DECLARE_HOOK(android_vh_force_compatible_pre,
TP_PROTO(void *unused),
TP_ARGS(unused));
DECLARE_HOOK(android_vh_force_compatible_post,
TP_PROTO(void *unused),
TP_ARGS(unused));
/* macro versions of hooks are no longer required */
#endif /* _TRACE_HOOK_SCHED_H */

View File

@@ -2103,6 +2103,7 @@ void force_compatible_cpus_allowed_ptr(struct task_struct *p)
* offlining of the chosen destination CPU, so take the hotplug
* lock to ensure that the migration succeeds.
*/
trace_android_vh_force_compatible_pre(NULL);
cpus_read_lock();
if (!cpumask_available(new_mask))
goto out_set_mask;
@@ -2127,6 +2128,7 @@ out_set_mask:
WARN_ON(set_cpus_allowed_ptr(p, override_mask));
out_free_mask:
cpus_read_unlock();
trace_android_vh_force_compatible_post(NULL);
free_cpumask_var(new_mask);
}