binder学习笔记——binder trace


1. 异步binder trace打印

(1) 异步binder发送端显示:

Name    binder transaction async
Category    binder
Start time    17s 455ms 421us 82ns
Duration    0s
Thread    surfaceflinger 2731
Process    /system/bin/surfaceflinger 1606
User ID    1000
Slice ID    286208
flags    0x11 this is a one-way call: async, no return; allow replies with file descriptors; 
code    0x01 Java Layer Dependent
transaction id    7414482
destination node    56653
destination process    3713
reply transaction?    false
calling tid    2731
type    internal_slice
depth    0
stack_id    8598901110785906
parent_stack_id    0
parent_id    null
arg_set_id    373693

(2) 异步binder接收端显示:

Name    binder async rcv
Category    binder
Start time    17s 483ms 700us 666ns
Duration    0s
Thread    binder:4128_3 4209
Process    com.android.launcher 4128
User ID    10178
Slice ID    288578
flags    0x11 this is a one-way call: async, no return; allow replies with file descriptors; 
code    0x01 Java Layer Dependent
transaction id    7414483
destination node    36400
destination process    4128
reply transaction?    false
calling tid    2731
type    internal_slice
depth    0
stack_id    1717227819666250
parent_stack_id    0
parent_id    null
arg_set_id    373985

(3) 根据 “transaction id 7414483” 找到对应trace:

surfaceflinger-2731  ( 1606) [000] .... 69136.712199: binder_transaction: transaction=7414483 dest_node=36400 dest_proc=4128 dest_thread=0 reply=0 flags=0x11 code=0x1 binder:4128_3-4209  ( 4128) [005] .... 69136.740323: binder_transaction_received: transaction=7414483

(4) trace代码位置

binder_transaction
    trace_binder_transaction(reply, t, target_node); //运行在异步binder发送端进程上下文

binder_thread_read
    trace_binder_transaction_received(t); //运行在异步binder接收端进程上下文

(5) 按”{” “}” 键在异步binder的发送端和接收端跳转。

 

原创文章,作者:3628473679,如若转载,请注明出处:https://blog.ytso.com/278308.html

(0)
上一篇 2022年8月1日
下一篇 2022年8月1日

相关推荐

发表回复

登录后才能评论