Thanks to some new features available in Intel VTune Amplifier 2016 Update 1, it is now relatively easy to organize simultaneous analysis of the power consumption and performance of Android devices without the need for them to permanently connect to a computer via USB.
It is worth noting that, although you can connect an Android device to a computer using the “ADB over WiFi” scheme, and thus avoiding the need to use the analysis option of a disabled device, it is usually easier to connect the target device via USB. If you want to use WiFi instead, you can find instructions for configuring this scheme in the documentation for the Intel VTune Amplifier.
Step 1. Prepare for performance analysis
In the program window, on the Analysis Target tab (Analysis target), in the Advanced property group, you need to check the Analyze unplugged device checkbox. In addition, it is recommended to configure the Automatically stop collection after (sec) parameter (Automatically stop data collection after (seconds)) and specify the desired data collection time. Also, you need to specify the same time and to collect data on energy consumption.
Then select the Analysis Type, configure the parameters. After everything is ready, do not rush to click on the start analysis button (Start) in order to first prepare an energy analysis tool that will collect data together with the performance research tool.
')
Device Analysis SetupStep 2. Preparation of energy analysis
Using the command line, connect to the device via ADB and prepare it to collect data on power consumption. If this type of analysis is unfamiliar to you, take a look at
this guide.
Before starting the data collector, do not forget about the “nohup” command and the “&” parameter, which sets the background run of the analysis procedure. Do not press the Enter key yet to start the collection, since we still need to synchronize the performance analysis and power consumption subsystems so that these processes run simultaneously.
Here is an example of the above command to start collecting power consumption data from the Intel SoC Watch 1.5.4. If you are using SoC Watch version 2.0. or newer (2.1.1., for example), use the “-r vtune” key to enable the system to process the collected data to import it into the VTune Amplifier.
nohup ./socwatch -m -f sys -f wakelock -t 35 -o ./results/concurr_test &
Please note that the “&” at the end of the line is a standard Linux / Unix function for running a command as a background task. Using “nohup” at the beginning tells the system that the background task does not need to be tied to an existing terminal window. In other words, when the terminal closes (the ADB connection is broken when the USB cable is disconnected from the device), the system will not interrupt the execution of the command.
Step 3. Synchronize the start of data collectors
At this stage of work, return to the Intel VTune Amplifier window and click the Start button. At the same time, it will be possible to monitor the standard set of messages on the device, then new messages will appear that are related to the work in the "disabled" mode. As a result, you will see the following message: “Unplug the device please. Collection will start automatically ”(“ Please turn off the device. Data collection will start automatically ”).
At this point, return to the command line window in which you configured the Intel SoC Watch data collection, and run the command that is typed in it by pressing Enter. After that, unplug the USB cable.
On a disconnected device, launch, as usual, the application that will load the system. Please note that when the USB cable is disconnected, Amplifier will not stop this application automatically after the time has passed for it to collect data. Therefore, when the time allotted for data collection has expired, reconnect the device to the computer.
Step 4. Analysis of the results
When the data collection is completed and the device is again connected to the computer via USB, the collected performance data will be transferred to the computer, it will be automatically processed, just as if the device was not turned off.
After processing the results of the data collection and displaying them in the Intel VTune Amplifier window, return to the Intel SoC Watch command window and stop collecting the results. Now they can be imported into Intel VTune Amplifier for further analysis.
findings
Simultaneous analysis of the power consumption and performance of the device allows us to better understand the features of the functioning of both the hardware and the OS, and the application that creates the load. Through this analysis, you can look at the program from a new point of view, and therefore - to find "bottlenecks" and flaws that were previously invisible. As a result, the developer has more opportunities to create fast and cost-effective Android applications.