ANDROID: binder: Add vendor hooks

Add below vendor hooks to make vendor extensions possible.
	1. android_vh_binder_wakeup_poll_threads_ilocked
	2. android_vh_binder_wakeup_thread_ilocked

Bug: 174219217
Change-Id: I9f55ca4427583bbfb29a6808280a7d09e1fc22ee
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
This commit is contained in:
Satya Durga Srinivasu Prabhala
2020-11-25 05:17:58 -08:00
committed by Todd Kjos
parent c8c2f1966f
commit 37d7ed1b22
3 changed files with 12 additions and 0 deletions

View File

@@ -957,6 +957,7 @@ static void binder_wakeup_poll_threads_ilocked(struct binder_proc *proc,
thread = rb_entry(n, struct binder_thread, rb_node); thread = rb_entry(n, struct binder_thread, rb_node);
if (thread->looper & BINDER_LOOPER_STATE_POLL && if (thread->looper & BINDER_LOOPER_STATE_POLL &&
binder_available_for_proc_work_ilocked(thread)) { binder_available_for_proc_work_ilocked(thread)) {
trace_android_vh_binder_wakeup_poll_threads_ilocked(thread->task);
if (sync) if (sync)
wake_up_interruptible_sync(&thread->wait); wake_up_interruptible_sync(&thread->wait);
else else
@@ -1016,6 +1017,7 @@ static void binder_wakeup_thread_ilocked(struct binder_proc *proc,
assert_spin_locked(&proc->inner_lock); assert_spin_locked(&proc->inner_lock);
if (thread) { if (thread) {
trace_android_vh_binder_wakeup_thread_ilocked(thread->task);
if (sync) if (sync)
wake_up_interruptible_sync(&thread->wait); wake_up_interruptible_sync(&thread->wait);
else else

View File

@@ -49,6 +49,8 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_is_fpsimd_save);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_transaction_init); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_transaction_init);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_set_priority); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_set_priority);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_restore_priority); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_restore_priority);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_wakeup_poll_threads_ilocked);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_wakeup_thread_ilocked);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_init); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_init);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_wake); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_wake);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_write_finished); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_write_finished);

View File

@@ -23,10 +23,18 @@ DECLARE_HOOK(android_vh_binder_set_priority,
DECLARE_HOOK(android_vh_binder_restore_priority, DECLARE_HOOK(android_vh_binder_restore_priority,
TP_PROTO(struct binder_transaction *t, struct task_struct *task), TP_PROTO(struct binder_transaction *t, struct task_struct *task),
TP_ARGS(t, task)); TP_ARGS(t, task));
DECLARE_HOOK(android_vh_binder_wakeup_poll_threads_ilocked,
TP_PROTO(struct task_struct *task),
TP_ARGS(task));
DECLARE_HOOK(android_vh_binder_wakeup_thread_ilocked,
TP_PROTO(struct task_struct *task),
TP_ARGS(task));
#else #else
#define trace_android_vh_binder_transaction_init(t) #define trace_android_vh_binder_transaction_init(t)
#define trace_android_vh_binder_set_priority(t, task) #define trace_android_vh_binder_set_priority(t, task)
#define trace_android_vh_binder_restore_priority(t, task) #define trace_android_vh_binder_restore_priority(t, task)
#define trace_android_vh_binder_wakeup_poll_threads_ilocked(task)
#define trace_android_vh_binder_wakeup_thread_ilocked(task)
#endif #endif
#endif /* _TRACE_HOOK_BINDER_H */ #endif /* _TRACE_HOOK_BINDER_H */
/* This part must be outside protection */ /* This part must be outside protection */