2.5.4 Capture the Chrome application on Chrome OS

Graphics Analyzer supports capturing Chrome applications in Chrome OS, which is useful for debugging websites, web apps, and Chrome applications.

The method is similar to capturing a Linux application on Chrome OS, with a few differences.

Note:

  • You must set up SSH access to your Chrome OS device before you can capture Chrome with Graphics Analyzer. For details, see Setting up SSH Access to your test device.

  • Chrome OS tries to reboot when you attempt to stop the UI. To prevent this reboot, you must modify the file /usr/share/cros/init/ui-post-stop by commenting out the following lines:

    while ! sudo -u chronos kill -9 -- -1 ; do
     sleep .1
    done
    
    # Check for still-living chronos processes and log their status.
    ps -u chronos --no-headers -o pid,stat,args |
     logger -i -t "${JOB}-unkillable" -p crit

After you have SSH access and the ability to stop the UI, install Graphics Analyzer on your device:

  1. Follow the Graphics Analyzer daemon and interceptor installation instructions in 2.5.3 Capture a Linux application on Chrome OS.
  2. Set up a password for the chronos user by starting an SSH session as root and using:
    passwd chronos
  3. Start a new SSH session, this time using the chronos user:
    ssh chronos@(IP address)
  4. From your root user SSH session, launch aga-daemon. You might need to restart the root session after starting an SSH session as chronos.
  5. Connect to your Chrome OS device from Graphics Analyzer.
  6. From your chronos SSH session, suspend the Chrome OS UI using the command:
    sudo stop ui
  7. You must preload the interceptor library and launch Chrome from the chronos user SSH session. For example:
    LD_PRELOAD=/usr/bin/aga/libinterceptor.so /opt/google/chrome/chrome \
    --ozone-platform=gbm --ozone-use-surfaceless \
    --user-data-dir=/home/chronos/ --bwsi \
    --login-user='$guest' --login-profile=user

    Note:

    If you are unable to use LD_PRELOAD on your system, see 6.1 Intercepting without using LD_PRELOAD for an alternative method.

As a result, capture data starts appearing in the desktop Graphics Analyzer client.

Note:

On some devices, Chrome might not launch correctly while the desktop Graphics Analyzer client is connected, and might launch numerous subprocesses. If Chrome does not launch correctly, disconnect the Graphics Analyzer client and launch Chrome again. After it has launched, connect Graphics Analyzer and capture Chrome.
Non-Confidential - RELPDF file icon PDF version101545__00_en
Copyright © 2020–2022, 2024 Arm Limited or its affiliates. All rights reserved.