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.
  1. In a terminal window, navigate to the following folder in your Arm Mobile Studio installation directory, where the Python script lwi_me.py is located:
    cd <installation_directory>/performance_advisor/lwi/helpers/
  2. To run the script, simply type:
    python3 lwi_me.py

    Note: Do not move the script to another location, as it needs to be able to locate other files in your installation directory.

    Optionally, you can use a range of different options to control the capture. For example, if you want to capture screenshots from the game when the FPS drops below 30, add the option --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/SlowFrames
    The script assumes that you are profiling a 64-bit OpenGL ES application. For 32-bit apps, you need to specify the --32bit option. For Vulkan apps, you need to add the --lwi-api=vulkan option.

    For a full list of the available options, refer to the Performance Advisor user guide
  3. 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.

  4. Launch Streamline:
    1. On Windows, from the Start menu, navigate to Arm MS <version> and select Arm MS Streamline <version>.
    2. On macOS, go to the <install_directory>/streamline folder, and double-click the Streamline.app file.
    3. On Linux, navigate to the <install_directory>/streamline directory in a terminal, and run the Streamline file:
      cd <install_directory>/streamline 
      ./Streamline
  5. Use the Start tab in Streamline to select your device. Select Or, choose an existing target, then select your device from the list.
    Connect to your device in Streamline
  6. Open the Counter configuration dialog by selecting Configure Counters.
    Streamline's configure counters button
  7. Choose Add counters from a template Add counters from a template button 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.
  8. Save your selection.
  9. Optionally, select Advanced Settings, to set additional capture options, including the sample rate and the capture duration.
    Streamline's advanced settings button
    Refer to Capture options in the Arm Streamline User Guide for more details..
  10. Select Start Capture.
    Streamline start capture button
  11. 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.
  12. Start the application on the device and perform your test scenario.
  13. Unless you specified a capture duration, click Stop capture to end the capture . Streamline stores the capture file in the location you specified.
  14. IMPORTANT: Switch back to the terminal running the lwi_me.py script 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

Previous Next