TraceView-Carlo Inspection
TraceView is an Android platform-specific data acquisition and analysis tool, integrated in the Ddms tool, you can collect methods in the program execution time, call relationship, number of calls and resource consumption.
I. Methods of Use
1, start the virtual machine/connect the phone, cmd command input DDMS start DDMS tool. Open the app on your phone and select the process to test the app on Ddms. Click the Start Method Profiling button, when the red dot on the button turns black, it is in the state of collecting information.
2, the operation of the application of the module, after the operation is completed, click on the start Method profiling the end of the acquisition of information, this will pop up the TraceView interface, display the data collected during the operation process.
The TraceView interface is divided into two parts: the time line interface and the analysis interface, and the time interface shows the call information of the thread function, including the function name and time, and the mouse moving on the timeline, which can display the information of the thread execution in the current time point; The analysis interface shows the function calls in threads, including CPU usage time. Number of calls.
Column Name |
Describe |
Name |
The name of the function called during the run of the thread. |
Incl Cpu time |
The CPU time that a function consumes, including the CPU time that the other functions are called internally. |
EXCL Cpu Time |
The CPU time that a function consumes, but does not contain the CPU time that is consumed by the internal call to other functions. |
Incl Real time |
The actual time, in milliseconds, that a function runs, containing the actual time taken to invoke other functions. |
EXCL Real Time |
The actual time, in milliseconds, that a function runs, without the real time it takes to invoke other functions. |
Call+recur Calls/total |
The number of times a function is called and the percentage of the total number of calls that the recursive call takes. |
Cpu Time/call |
The ratio of the CPU time to the number of invocations of a function call. equals the average execution time of the function. |
Real Time/call |
Similar to CPU time/call, except that statistical units are replaced by real time. |
Ii. points of concern
1, the use of long CPU time method: Select the CPU time/call column to sort in descending order to see the longest-consuming function, if the function is called once or the number of calls is very small, but time is very long, it is likely to be a potential problem.
2. Frequent calls: Select Call/recur calls/total to sort in descending order, to see how frequently the calls are made and how long the CPU takes, or a potential problem.
Third, the Lag test
If the application of a module to operate, obviously will feel stuck, then you can use TraceView to locate the reason for the lag, start Method profiling start TraceView data acquisition, operation of the Lag module, operating time as short as possible and cover the stutter operation, easy to find problems , stop data acquisition, and find a way to analyze the CPU time of the interface is likely to be the cause of the lag.
App Test Tool TraceView-Carlo inspection