• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# binder事件上下文如何关联
2binder事件相对复杂,这里是从ftrace事件中抽离出来的binder相关消息,用来作为开发者或用户追踪binder事件的参考
3a binder event is identified by the sender and receive device, and a reply message only end
4the last binder msg which reply the calling one.
5the alloc_buf msg can always flow the binder_transaction, so we no need to identify the alloc msg with transactionID
6
7## TAG TT need reply!!!  needReply = !isReply && !(flags & 0x01);
8```
9RenderThread-2267  ( 1592) [003] ...1 168766.128108: binder_transaction: transaction=25155526 dest_node=25155471 dest_proc=506 dest_thread=0 reply=0 flags=0x10 code=0x9
10RenderThread-2267  ( 1592) [003] ...1 168766.128110: binder_transaction_alloc_buf: transaction=25155526 data_size=120 offsets_size=8
11```
12### received
13```
14Binder:506_2-537   (  506) [003] ...1 168766.128154: binder_transaction_received: transaction=25155526
15```
16### binder is in DB, TAG A needReply
17```
18Binder:506_2-537   (  506) [003] ...1 168766.128221: binder_transaction: transaction=25155529 dest_node=25155527 dest_proc=1592 dest_thread=2267 reply=0 flags=0x10 code=0x5f474854
19Binder:506_2-537   (  506) [003] ...1 168766.128223: binder_transaction_alloc_buf: transaction=25155529 data_size=72 offsets_size=0
20```
21##
22```
23RenderThread-2267  ( 1592) [003] ...1 168766.128243: binder_transaction_received: transaction=25155529
24```
25### the flowing is for TAG A, this is the reply for TAG A
26```
27RenderThread-2267  ( 1592) [003] ...1 168766.128262: binder_transaction: transaction=25155530 dest_node=0 dest_proc=506 dest_thread=537 reply=1 flags=0x8 code=0x0
28
29RenderThread-2267  ( 1592) [003] ...1 168766.128264: binder_transaction_alloc_buf: transaction=25155530 data_size=4 offsets_size=0
30```
31### calc the dur of TAG A
32```
33Binder:506_2-537   (  506) [003] ...1 168766.128288: binder_transaction_received: transaction=25155530
34```
35### binder last TAG A needReply, this is TAG B needReply!!!
36```
37Binder:506_2-537   (  506) [003] ...1 168766.128328: binder_transaction: transaction=25155532 dest_node=25155527 dest_proc=1592 dest_thread=2267 reply=0 flags=0x10 code=0x2
38Binder:506_2-537   (  506) [003] ...1 168766.128330: binder_transaction_alloc_buf: transaction=25155532 data_size=72 offsets_size=0
39```
40##	in db
41```
42RenderThread-2267  ( 1592) [003] ...1 168766.128347: binder_transaction_received: transaction=25155532
43```
44## the reply message is not in db Session D, this is the reply for TAG B
45```
46RenderThread-2267  ( 1592) [003] ...1 168766.128361: binder_transaction: transaction=25155533 dest_node=0 dest_proc=506 dest_thread=537 reply=1 flags=0x0 code=0x0
47RenderThread-2267  ( 1592) [003] ...1 168766.128363: binder_transaction_alloc_buf: transaction=25155533 data_size=4 offsets_size=0
48```
49### no this message in db, calcate the dur of TAG B
50```
51Binder:506_2-537   (  506) [003] ...1 168766.128385: binder_transaction_received: transaction=25155533
52```
53### no this message in db Session E, this is the reply for TAG TT
54```
55Binder:506_2-537   (  506) [003] ...1 168766.128412: binder_transaction: transaction=25155534 dest_node=0 dest_proc=1592 dest_thread=2267 reply=1 flags=0x0 code=0x0
56
57Binder:506_2-537   (  506) [003] ...1 168766.128413: binder_transaction_alloc_buf: transaction=25155534 data_size=68 offsets_size=0
58```
59## the dur of TAG TT is calcated by the flowing msg
60```
61RenderThread-2267  ( 1592) [003] ...1 168766.128430: binder_transaction_received: transaction=25155534
62```