目录

Using the counters_gather Command Line

Captures GPU counters and writes them to Atrace/Hitrace.

Importing the counters_gather File in the Tool Package

Using the Built-in System File counters_gather

Only devices running HarmonyOS NEXT released after June 1st, 2025 support the built-in counters_gather file. The file can be used directly without import.

Executing the counters_gather File

  1. Run the following commands if the counters_gather file in the tool package is used:

    adb shell # for HarmonyOS

    hdc shell # for HarmonyOS NEXT

    cd /data/local/tmp

    chmod +x counters_gather_ecosystem

    ./counters_gather_ecosystem -s <u32> -p <u32>

    ctrl+c # Forcibly terminate the counters_gather_ecosystem command execution.

    Run the following commands if the built-in counters_gather file is used:

    hdc shell

    counters_gather -s <u32> -p <u32>

    counters_gather -c stop # Forcibly terminate the counters_gather command execution.

  2. Start any tool that can collect Atrace/Hitrace data to capture counters.
  3. The captured counters are displayed on the track corresponding to the counters_gather process.
  4. The counters_gather command automatically terminates after the execution time expires.

Options