ANDROID: vendor_hooks: add hooks in driver/android/binder.c
Add hooks to support oem's binder feature of improving certain scenarios sched priority by moving these scenarios' work to a fixed binder thread. Add the following new vendor hooks to drivers/android/binder.c: 1 trace_android_vh_binder_spawn_new_thread in our os, some binder_transaction will be marked as vip flag, it can be named vip transaction, the binder_work within the vip transaction can be named vip work. here will force a thread (named vip thread) to be spawned and skip the normal conditions to spawn a thread. vip thread will just select vip transaction to process. 2 trace_android_vh_binder_ioctl_end in our os, in binder_proc, about binder threads,special thread (called vip thread) will work for special binder_transaction (called vip transaction). here will expand one ioctl cmd for binder driver, it will set the max count about special thread (called vip thread) in binder_proc, and if it has vip thread in the binder_proc. 3 trace_android_vh_binder_looper_exited while BC_REGISTER_LOOPER cmd, will set special thread as vip thread. the flag saved in binder_thread:looper here will unset the vip flag saved in binder_thread, while BC_EXIT_LOOPER cmd, if the thread is vip thread(reference above about vip thread) 4 trace_android_vh_binder_has_special_work_ilocked for special binder thread(called vip thread), it will deal with special binder_work (called vip work) within special transaction (call vip transaction), here, if the thread is vip thread, it will check the vip work if exist or not. 5 trace_android_vh_binder_select_special_worklist for special binder thread(called vip thread), it will select the worklist for special binder_work(called vip work) within special binder_transaction(called vip transaction) here, it will make sure the selected worklist, the head of it is vip work within vip transaction Bug: 318782978 Bug: 321674240 Change-Id: I8e544d9be2644a6144a9cfbd477e087d46b0073f Signed-off-by:songfeng <songfeng@oppo.com> (cherry picked from commit 24bb8fc8)
Loading
Please sign in to comment