ANDROID: Add hook to show vendor info for transactions

When watchdog or anr occur, we need to read
dev/binderfs/binder_logs/proc/pid or dev/binderfs/binder_logs/state
node to know the time-consuming information of the binder call.
We need to add the time-consuming information of binder transaction.

Bug: 190413570

Signed-off-by: zhang chuang <zhangchuang3@xiaomi.com>
Change-Id: I0423d4e821d5cd725a848584133dc7245cbc233a
(cherry picked from commit eabe9707f2)
Signed-off-by: Carlos Llamas <cmllamas@google.com>
[cmllamas: fix trivial merge conflict in vendor_hooks.c]
This commit is contained in:
zhang chuang
2021-06-16 19:11:38 +08:00
committed by Carlos Llamas
parent 15a32b46ee
commit 1502f0ea7c
3 changed files with 8 additions and 0 deletions

View File

@@ -5623,6 +5623,7 @@ static void print_binder_transaction_ilocked(struct seq_file *m,
struct binder_buffer *buffer = t->buffer;
spin_lock(&t->lock);
trace_android_vh_binder_print_transaction_info(m, proc, prefix, t);
to_proc = t->to_proc;
seq_printf(m,
"%s %d: %pK from %d:%d to %d:%d code %x flags %x pri %d:%d r%d",

View File

@@ -335,3 +335,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tune_scan_type);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tune_swappiness);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_partial_init);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_mmc_cache_card_properties);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_print_transaction_info);

View File

@@ -12,6 +12,7 @@
*/
struct binder_transaction;
struct task_struct;
struct seq_file;
DECLARE_HOOK(android_vh_binder_transaction_init,
TP_PROTO(struct binder_transaction *t),
TP_ARGS(t));
@@ -37,6 +38,11 @@ DECLARE_RESTRICTED_HOOK(android_rvh_binder_transaction,
TP_PROTO(struct binder_proc *target_proc, struct binder_proc *proc,
struct binder_thread *thread, struct binder_transaction_data *tr),
TP_ARGS(target_proc, proc, thread, tr), 1);
DECLARE_HOOK(android_vh_binder_print_transaction_info,
TP_PROTO(struct seq_file *m, struct binder_proc *proc,
const char *prefix, struct binder_transaction *t),
TP_ARGS(m, proc, prefix, t));
#endif /* _TRACE_HOOK_BINDER_H */
/* This part must be outside protection */
#include <trace/define_trace.h>