目录

使用counters_gather命令行

收集GPU Counter并写入Atrace/Hitrace中。

导入工具包counters_gather文件

使用系统内置counters_gather文件

仅HarmonyOS 5.0及以上版本设备支持系统内置counters_gather文件,且系统版本为2025年6月1日之后的版本才支持,无需导入即可直接使用

执行counters_gather文件

  1. 工具包counters_gather文件输入命令:

    adb shell # for HarmonyOS

    hdc shell # for HarmonyOS 5.0及以上版本

    cd /data/local/tmp

    chmod +x counters_gather_ecosystem

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

    ctrl+c #提前结束命令

    系统内置counters_gather文件输入命令:

    hdc shell

    counters_gather -s <u32> -p <u32>

    counters_gather -c stop #提前结束命令

  2. 同步启动任意可以收集Atrace/Hitrace的工具即可收集counter数据。
  3. 收集到的counter数据展示在counters_gather进程对应的track上。
  4. counters_gather执行时间到期之后自动结束。

可选选项