Use systrace to track the binder communication process

The trace log captured by systrace will record many communication processes of the android system, including the communication details of the binder. Here we use a trace log for simple analysis:

 Red box: site name and thread number, here is a screenshot so it is not reflected, this thread is the 1102 1546 InputReader thread in system_server.

Blue box: Indicates that the status of the current thread is runable, click on the blue horizontal bar, we can see more detailed information:

The information in the red box above shows that the thread switches from the sleeping state to the Runable state and is woken up by tid 0.

Click on the green horizontal bar, you can see that this thread is running on CPU5. and the start time & duration of its run.

 Click the binder transaction async box to see more binder communication information

 Then click the information in the slice column below to know the communication direction of the binder:

 As can be seen from the trace, the 1546 InputReader thread sent a message to the surfaceflinger (501) thread through the binder.

 

Guess you like

Origin blog.csdn.net/kill150/article/details/131243749