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
This commit is contained in:
zhang chuang
2021-06-16 19:11:38 +08:00
committed by Todd Kjos
parent 12902c9996
commit eabe9707f2
3 changed files with 7 additions and 0 deletions

View File

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

View File

@@ -333,3 +333,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_aes_encrypt);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_aes_decrypt); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_aes_decrypt);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_force_compatible_pre); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_force_compatible_pre);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_force_compatible_post); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_force_compatible_post);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_print_transaction_info);

View File

@@ -17,6 +17,7 @@ struct binder_alloc;
struct binder_proc; struct binder_proc;
struct binder_thread; struct binder_thread;
struct binder_transaction_data; struct binder_transaction_data;
struct seq_file;
DECLARE_HOOK(android_vh_binder_transaction_init, DECLARE_HOOK(android_vh_binder_transaction_init,
TP_PROTO(struct binder_transaction *t), TP_PROTO(struct binder_transaction *t),
TP_ARGS(t)); TP_ARGS(t));
@@ -65,6 +66,10 @@ DECLARE_HOOK(android_vh_binder_new_ref,
DECLARE_HOOK(android_vh_binder_del_ref, DECLARE_HOOK(android_vh_binder_del_ref,
TP_PROTO(struct task_struct *proc, uint32_t ref_desc), TP_PROTO(struct task_struct *proc, uint32_t ref_desc),
TP_ARGS(proc, ref_desc)); TP_ARGS(proc, ref_desc));
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));
/* macro versions of hooks are no longer required */ /* macro versions of hooks are no longer required */