Run the script and capture a Streamline profile
Performance Advisor runs on a Streamline capture file, so the first step is to take a capture with Streamline. In order to enable Streamline to capture the extra frame data from the device that Performance Advisor needs, you must run the provided Python script,
lwi_me.py. This script does the following:
- Connects Streamline to your device and directs you to take a capture.
- Temporarily installs a daemon application on your device, called
gatord, which Streamline uses to collect counter data.
- Temporarily installs the OpenGL ES or Vulkan layer library file on your device, which is needed to collect frame data.
- Enables you to specify options for the capture, such as whether to capture screenshots when the FPS drops below a certain threshold.
- In a terminal window, navigate to the following folder in your Arm Mobile Studio installation directory, where the Python script
- To run the script, simply type:
Note: Do not move the script to another location, as it needs to be able to locate other files in your installation directory.
--lwi-mode capture. You can specify a different threshold with
--lwi-fps-threshold=<val>. You can also specify an output directory for the images with
--lwi-out-dir. If you don't specify a directory, Performance Advisor will create one in the current location.
python3 lwi_me.py --lwi-mode=capture --lwi-fps-threshold=50 --lwi-out-dir=$HOME/Documents/MyGameProfile/SlowFramesThe script assumes that you are profiling a 64-bit OpenGL ES application. For 32-bit apps, you need to specify the
--32bitoption. For Vulkan apps, you need to add the
For a full list of the available options, refer to the Performance Advisor user guide.
The script returns a numbered list of the Android package names for the debuggable applications that are installed on your device. Enter the number of the application you want to profile.
The script identifies the GPU in the device, installs the daemon application, and waits for you to complete the capture in Streamline. Leave the terminal window open, as you will need to come back to it later to terminate the script.
- Launch Streamline:
- On Windows, from the Start menu, navigate to Arm MS <version> and select Arm MS Streamline <version>.
- On macOS, go to the
<install_directory>/streamlinefolder, and double-click the
- On Linux, navigate to the
<install_directory>/streamlinedirectory in a terminal, and run the Streamline file:
- Use the Start tab in Streamline to select your device. Select Or, choose an existing target, then select your device from the list.
- Open the Counter configuration dialog by selecting Configure Counters.
- Choose Add counters from a template and select an appropriate counter template for the GPU in your device.
The number of counters in the template that your target device supports is shown next to each template. For example, here, 34 of the 38 available counters in the Mali Midgard template are supported in the connected device.
- Save your selection.
- Optionally, select Advanced Settings, to set additional capture options, including the sample rate and the capture duration.
Refer to Capture options in the Arm Streamline User Guide for more details..
- Select Start Capture.
- Specify the name and location of the capture file that Streamline will create when the capture is complete. Streamline then switches to Live view and waits for you to start the application on the device.
- Start the application on the device and perform your test scenario.
- Unless you specified a capture duration, click Stop capture to end the capture . Streamline stores the capture file in the location you specified.
- IMPORTANT: Switch back to the terminal running the
lwi_me.pyscript and press any key to terminate it. The script kills all processes that it started and remove the daemon application from the device.
Now that you have a Streamline capture, run Performance Advisor on it, to generate a performance report