> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs-staging.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 性能仪表板

您可以在 Qualcomm<sup>®</sup> Linux<sup>®</sup> 参考设备上访问引导时间、系统基准测试、内存映射和产品细分关键性能指标（KPI）的性能仪表板。以下小节介绍了 QCS6490、QCS5430、Qualcomm Dragonwing<sup>™</sup> IQ-615、Qualcomm Dragonwing<sup>™</sup> IQ-9075 和 Qualcomm Dragonwing<sup>™</sup> IQ-8275 的性能仪表板和测量方法。

<Tabs>
  <Tab title="QCS6490">
    ## **引导时间**

    以下引导时间 KPI 指示系统在不同阶段的就绪状态：

    * `Init/systemd process`：从上电到系统第一个用户空间进程（PID 1，通常是 systemd）开始执行所经过的时间。这包括固件、引导加载程序和内核+InitramFS 所花费的时间。
    * `Camera driver init finish`：表示摄像头硬件已完成初始化并可以使用。
    * `Sysinit.target`：从上电到达到 sysinit.target 的时间 — 即所有基本系统初始化服务（文件系统已挂载、内核模块已加载、基本硬件已配置）完成的时间点。

    下表列出了在 QCS6490（刷写 UEFI 固件）上测得的引导时间（单位为秒）。

    | **用例**                                     | **得分** |
    | ------------------------------------------ | ------ |
    | `Boot time till Init/systemd process`      | 3.98   |
    | `Boot time till Camera driver init finish` | 7.20   |
    | `Boot time till Sysinit.target`            | 8.12   |

    <Note>
      引导时间得分越低越好。
    </Note>

    **配置 1（qcom-multimedia-image）**
    配置 1 代表上游软件包集，包括作为标准 Qualcomm 多媒体镜像一部分提供的开源和基线多媒体组件。

    **配置 2（qcom-multimedia-proprietary-image）**
    配置 2 代表下游软件包集，包括在上游镜像基础上叠加的专有多媒体组件、增强功能和供应商特定的附加内容。

    有关测量方法的信息，请参阅[测量引导时间](#measure-boot-time)。

    ## **系统基准测试**

    本节概述了如何使用一组标准基准测试来测量系统性能。下表列出了 QCS6490 上的 CPU、内存、存储和图形基准测试得分。

    **Geekbench**

    |   **基准测试**   | **版本** | **基准测试得分** |
    | :----------: | :----: | :--------: |
    | Geekbench ST |  6.1.0 |    1184    |
    | Geekbench MT |  6.1.0 |    3025    |

    **CoreMark**

    | **基准测试** | **得分（迭代次数/秒）** |
    | -------- | -------------- |
    | CoreMark | 26202.02       |

    **Tiotest**

    | **测试** | **配置**                     | **得分** |
    | ------ | -------------------------- | ------ |
    | 顺序写入   | 每线程 256 MB，512 KiB 块（MB/秒） | 497.29 |
    | 顺序读取   | 每线程 256 MB，512 KiB 块（MB/秒） | 973.18 |
    | 随机写入   | 每线程 64 MB，4 KiB 块（IOPS）    | 58468  |
    | 随机读取   | 每线程 64 MB，4 KiB 块（IOPS）    | 58675  |

    **GLmark2**

    | **基准测试**               | **得分** |
    | ---------------------- | ------ |
    | GLmark2                | 2249   |
    | GLmark2 1920 × 1080    | 1491   |
    | GLmark2 离屏             | 580    |
    | GLmark2 离屏 1920 × 1080 | 439    |

    **Sysbench**

    | **基准测试**   | **得分**  |
    | ---------- | ------- |
    | CPU 总时间（秒） | 3.1949  |
    | 内存带宽（MB/秒） | 4452.23 |
    | 线程总时间（秒）   | 3.44    |
    | 互斥锁总时间（秒）  | 0.0045  |

    |  **基准测试** |  **测试**  | **得分** |
    | :-------: | :------: | :----: |
    | UnixBench | 1x/单并行副本 |  988.7 |
    |  8x/八并行副本 |  5116.9  |        |

    有关测量方法的信息，请参阅[测量系统基准测试](#measure-system-benchmarks)。

    <Note>
      系统基准测试得分越高越好，但 CPU 总时间、线程总时间和互斥锁总时间除外，这些值越低越好。
    </Note>

    ## **内存映射**

    下表列出了每个分区（例如非 Linux、内核静态和应用程序）的内存消耗（单位为 MB）。它还列出了设备引导后以及在诸如 4k 分辨率 30 fps 编码等用例期间系统可用的总空闲内存。

    | **内存分区**  | **引导后** |
    | --------- | ------- |
    | 总 RAM     | 6144    |
    | 非 Linux   | 624     |
    | 内核静态      | 214     |
    | 应用程序 + 框架 | 509     |
    | 总空闲内存     | 4797    |

    有关测量方法的信息，请参阅[测量内存映射](#measure-memory-map)。

    <Note>
      总空闲内存值越高，系统性能越好。
    </Note>

    ## **用例 KPI**

    下表列出了各种 QCS6490 摄像头用例的摄像头延迟测量数据（单位为秒）：

    | **用例**    | **延迟定义**             | **延迟** |
    | --------- | -------------------- | ------ |
    | 4K 首次快照延迟 | 引导后首次从捕获图像到创建快照所需的时间 | 0.34   |

    <Note>
      摄像头延迟值越低越好。
    </Note>

    有关测量方法的信息，请参阅[测量摄像头录制和快照延迟](#measure-camera-recording-and-snapshot-latency)。
  </Tab>

  <Tab title="QCS5430">
    ## **引导时间**

    以下引导时间 KPI 指示系统在不同阶段的就绪状态：

    * `Init/systemd process`：从上电到系统第一个用户空间进程（PID 1，通常是 systemd）开始执行所经过的时间。这包括固件、引导加载程序和内核+InitramFS 所花费的时间。
    * `Sysinit.target`：从上电到达到 sysinit.target 的时间 — 即所有基本系统初始化服务（文件系统已挂载、内核模块已加载、基本硬件已配置）完成的时间点。

    下表列出了在 QCS5430（刷写 UEFI 固件）上测得的引导时间（单位为秒）。

    | **用例**                                | **得分** |
    | ------------------------------------- | ------ |
    | `Boot time till Init/systemd process` | 6.45   |
    | `Boot time till Sysinit.target`       | 10.68  |

    <Note>
      引导时间得分越低越好。
    </Note>

    **配置 1（qcom-multimedia-image）**
    配置 1 代表上游软件包集，包括作为标准 Qualcomm 多媒体镜像一部分提供的开源和基线多媒体组件。

    **配置 2（qcom-multimedia-proprietary-image）**
    配置 2 代表下游软件包集，包括在上游镜像基础上叠加的专有多媒体组件、增强功能和供应商特定的附加内容。

    有关测量方法的信息，请参阅[测量引导时间](#measure-boot-time)。

    ## **系统基准测试**

    本节概述了如何使用一组标准基准测试来测量系统性能。下表列出了 QCS5430 上的 CPU、内存、存储和图形基准测试得分。

    **Geekbench**

    以下 Geekbench 得分在 QCS5430 FP1 上测得。

    |   **基准测试**   | **版本** | **基准测试得分** |
    | :----------: | :----: | :--------: |
    | Geekbench ST |  6.1.0 |     930    |
    | Geekbench MT |  6.1.0 |    2106    |

    有关测量方法的信息，请参阅[测量系统基准测试](#measure-system-benchmarks)。

    <Note>
      系统基准测试得分越高越好，但 CPU 总时间、线程总时间和互斥锁总时间除外，这些值越低越好。
    </Note>

    ## **内存映射**

    下表列出了每个分区（例如非 Linux、内核静态和应用程序）的内存消耗（单位为 MB）。它还列出了设备引导后以及在诸如 4k 分辨率 30 fps 编码等用例期间系统可用的总空闲内存。

    | **内存分区**  | **引导后** |
    | --------- | ------- |
    | 总 RAM     | 6144    |
    | 非 Linux   | 594     |
    | 内核静态      | 214     |
    | 应用程序 + 框架 | 520     |
    | 总空闲内存     | 4814    |

    有关测量方法的信息，请参阅[测量内存映射](#measure-memory-map)。

    <Note>
      总空闲内存值越高，系统性能越好。
    </Note>

    ## **用例 KPI**

    各种 QCS5430 摄像头用例的摄像头延迟测量数据 KPI 将在未来版本中提供。

    有关测量方法的信息，请参阅[测量摄像头录制和快照延迟](#measure-camera-recording-and-snapshot-latency)。
  </Tab>

  <Tab title="Qualcomm Dragonwing IQ-615">
    ## **引导时间**

    以下引导时间 KPI 指示系统在不同阶段的就绪状态：

    * `Init/systemd process`：从上电到系统第一个用户空间进程（PID 1，通常是 systemd）开始执行所经过的时间。这包括固件、引导加载程序和内核+InitramFS 所花费的时间。
    * `Camera driver init finish`：表示摄像头硬件已完成初始化并可以使用。
    * `Sysinit.target`：从上电到达到 sysinit.target 的时间 — 即所有基本系统初始化服务（文件系统已挂载、内核模块已加载、基本硬件已配置）完成的时间点。

    下表列出了在 Dragonwing IQ-615（刷写 UEFI 固件）上测得的引导时间（单位为秒）。

    | **用例**                                     | **得分** |
    | ------------------------------------------ | ------ |
    | `Boot time till Init/systemd process`      | 3.89   |
    | `Boot time till Camera driver init finish` | 6.32   |
    | `Boot time till Sysinit.target`            | 6.86   |

    <Note>
      引导时间得分越低越好。
    </Note>

    **配置 1（qcom-multimedia-image）**
    配置 1 代表上游软件包集，包括作为标准 Qualcomm 多媒体镜像一部分提供的开源和基线多媒体组件。

    **配置 2（qcom-multimedia-proprietary-image）**
    配置 2 代表下游软件包集，包括在上游镜像基础上叠加的专有多媒体组件、增强功能和供应商特定的附加内容。

    有关测量方法的信息，请参阅[测量引导时间](#measure-boot-time)。

    ## **系统基准测试**

    本节概述了如何使用一组标准基准测试来测量系统性能。下表列出了 Dragonwing IQ-615 上的 CPU、内存、存储和图形基准测试得分。

    **Geekbench**

    |   **基准测试**   | **版本** | **基准测试得分** |
    | :----------: | :----: | :--------: |
    | Geekbench ST |  6.1.0 |     635    |
    | Geekbench MT |  6.1.0 |    1618    |

    **CoreMark**

    | **基准测试** | **得分（迭代次数/秒）** |
    | -------- | -------------- |
    | CoreMark | 15024          |

    **Tiotest**

    | **测试** | **配置**                     | **得分** |
    | ------ | -------------------------- | ------ |
    | 顺序写入   | 每线程 256 MB，512 KiB 块（MB/秒） | 292    |
    | 顺序读取   | 每线程 256 MB，512 KiB 块（MB/秒） | 203    |
    | 随机写入   | 每线程 64 MB，4 KiB 块（IOPS）    | 11982  |
    | 随机读取   | 每线程 64 MB，4 KiB 块（IOPS）    | 23429  |

    **Sysbench**

    | **基准测试**   | **得分** |
    | ---------- | ------ |
    | CPU 总时间（秒） | 4.77   |
    | 内存带宽（MB/秒） | 2924   |
    | 线程总时间（秒）   | 5.1    |
    | 互斥锁总时间（秒）  | 0.0135 |

    有关测量方法的信息，请参阅[测量系统基准测试](#measure-system-benchmarks)。

    <Note>
      系统基准测试得分越高越好，但 CPU 总时间、线程总时间和互斥锁总时间除外，这些值越低越好。
    </Note>

    ## **内存映射**

    下表列出了每个分区（例如非 Linux、内核静态和应用程序）的内存消耗（单位为 MB）。它还列出了设备引导后以及在诸如 4k 分辨率 30 fps 编码等用例期间系统可用的总空闲内存。

    | **内存分区**  | **引导后** |
    | --------- | ------- |
    | 总 RAM     | 4096    |
    | 非 Linux   | 377     |
    | 内核静态      | 174     |
    | 应用程序 + 框架 | 619     |
    | 总空闲内存     | 2926    |

    有关测量方法的信息，请参阅[测量内存映射](#measure-memory-map)。

    <Note>
      总空闲内存值越高，系统性能越好。
    </Note>

    ## **用例 KPI**

    下表列出了各种 Dragonwing IQ-615 摄像头用例的摄像头延迟测量数据（单位为秒）：

    | **用例**              | **延迟定义**                           | **延迟** |
    | ------------------- | ---------------------------------- | ------ |
    | 720p30 编码 – 首次摄像头延迟 | 引导后首次从 GStreamer 连接到第一个编码视频帧所需的时间。 | 0.442  |

    <Note>
      摄像头延迟值越低越好。
    </Note>

    有关测量方法的信息，请参阅[测量摄像头录制和快照延迟](#measure-camera-recording-and-snapshot-latency)。
  </Tab>

  <Tab title="Qualcomm Dragonwing IQ-8275">
    ## **引导时间**

    以下引导时间 KPI 指示系统在不同阶段的就绪状态：

    * `Init/systemd process`：从上电到系统第一个用户空间进程（PID 1，通常是 systemd）开始执行所经过的时间。此时长包括固件初始化、引导加载程序执行以及内核加 initramfs 加载。
    * `Camera driver init finish`：表示摄像头硬件已完成初始化并可以使用。
    * `Sysinit.target`：从上电到系统达到 sysinit.target 所经过的时间，标志着基本系统初始化服务（包括文件系统挂载、内核模块加载和基本硬件配置）的完成。

    **配置 1（qcom-multimedia-image）**

    配置 1 代表上游软件包集，包括作为标准 Qualcomm 多媒体镜像一部分提供的开源和基线多媒体组件。

    **配置 2（qcom-multimedia-proprietary-image）**

    配置 2 代表下游软件包集，包括在上游镜像基础上叠加的专有多媒体组件、增强功能和供应商特定的附加内容。

    下表列出了在 Dragonwing IQ-8275 上测得的引导时间（单位为秒）：

    |                   **用例**                   | **得分** |
    | :----------------------------------------: | :----: |
    |    Boot time till `Init/systemd process`   |  4.68  |
    | Boot time till `Camera driver init finish` |   7.6  |
    |       Boot time till `Sysinit.target`      |  8.08  |

    <Note>
      **注意**

      表中指定的引导时间值是在配置 2 上测得的。不过，配置 1 的结果相当，偏差小于 5%。
    </Note>

    <Note>
      **注意**

      引导时间得分越低越好。
    </Note>

    有关测量方法的信息，请参阅[测量引导时间](System/Performance/Addendum-iq8275/Performance-dashboard#measure-boot-time)。

    ## **系统基准测试**

    本节概述了如何使用一组标准基准测试来测量系统性能。这些结果可提供关于处理效率、浮点能力、内存行为以及系统对线程和进程的处理情况的洞察。

    **Geekbench**

    |   **基准测试**   | **版本** | **基准测试得分** |
    | :----------: | :----: | :--------: |
    | Geekbench ST |  6.1.0 |    1065    |
    | Geekbench MT |  6.1.0 |    3262    |

    **CoreMark**

    | **基准测试** | **版本** | **基准测试得分** |
    | :------: | :----: | :--------: |
    | CoreMark |   不适用  |  22844.96  |

    **Tiotest**

    | **测试** | **配置**                             | **得分**  |
    | ------ | ---------------------------------- | ------- |
    | 顺序写入   | 每线程 256 MB，512 KiB 块（MB/s）         | 530.545 |
    | 顺序读取   | 每线程 256 MB，512 KiB 块（MB/s）         | 981.079 |
    | 随机读取   | 每线程 64 MB，4 KiB 块，每秒输入/输出操作数（IOPS） | 52939   |
    | 随机写入   | 每线程 64 MB，4 KiB 块（IOPS）            | 85663   |

    **GLmark2**

    | **基准测试**               | **得分** |
    | ---------------------- | ------ |
    | glmark2                | 532    |
    | glmark2 1920 × 1080    | 493    |
    | glmark2 离屏             | 337    |
    | glmark2 离屏 1920 × 1080 | 284    |

    **Sysbench**

    | **基准测试**           | **得分**  |
    | ------------------ | ------- |
    | CPU 总时间（秒）（越低越好）   | 3.6671  |
    | 内存传输速率（MB/s）（越高越好） | 3908.21 |
    | 线程总时间（秒）（越低越好）     | 3.91213 |
    | 互斥锁总时间（秒）（越低越好）    | 0.0057  |

    |  **基准测试** |  **测试**  | **得分** |
    | :-------: | :------: | :----: |
    | UnixBench | 1x/单并行副本 |  907.8 |
    |  8x/八并行副本 |  5337.60 |        |
  </Tab>

  <Tab title="Qualcomm Dragonwing IQ-9075">
    ## **引导时间**

    以下引导时间 KPI 指示系统在不同阶段的就绪状态：

    * `Init/systemd process`：从上电到系统第一个用户空间进程（PID 1，通常是 systemd）开始执行所经过的时间。此时长包括固件初始化、引导加载程序执行以及内核加 initramfs 加载。
    * `Camera driver init finish`：表示摄像头硬件已完成初始化并可以使用。
    * `Sysinit.target`：从上电到系统达到 sysinit.target 所经过的时间，标志着基本系统初始化服务（包括文件系统挂载、内核模块加载和基本硬件配置）的完成。

    **配置 1（qcom-multimedia-image）**

    配置 1 代表上游软件包集，包括作为标准 Qualcomm 多媒体镜像一部分提供的开源和基线多媒体组件。

    **配置 2（qcom-multimedia-proprietary-image）**

    配置 2 代表下游软件包集，包括在上游镜像基础上叠加的专有多媒体组件、增强功能和供应商特定的附加内容。

    下表列出了在 Dragonwing IQ-9075 上测得的引导时间（单位为秒）：

    |                   **用例**                   | **得分** |
    | :----------------------------------------: | :----: |
    |    Boot time till `Init/systemd process`   |  3.54  |
    | Boot time till `Camera driver init finish` |  5.50  |
    |       Boot time till `Sysinit.target`      |  5.99  |

    <Note>
      注意

      表中指定的引导时间值是在配置 2 上测得的。不过，配置 1 的结果相当，偏差小于 5%。
    </Note>

    <Note>
      注意

      引导时间得分越低越好。

      有关测量方法的信息，请参阅[测量引导时间](System/Performance/Addendum-iq9075/Performance-dashboard#measure-boot-time)。
    </Note>

    ## **系统基准测试**

    本节概述了如何使用一组标准基准测试来测量系统性能。这些结果可提供关于处理效率、浮点能力、内存行为以及系统对线程和进程的处理情况的洞察。

    |   **基准测试**   | **版本** | **基准测试得分** |
    | :----------: | :----: | :--------: |
    | Geekbench ST |  6.1.0 |    1138    |
    | Geekbench MT |  6.1.0 |    5797    |

    <Note>
      注意

      系统基准测试得分越高越好。
    </Note>

    | **基准测试** | **版本** | **基准测试得分** |
    | :------: | :----: | :--------: |
    | CoreMark |   不适用  |  22834.53  |

    | **基准测试** |           **测试**           | **配置** | **得分** |
    | :------: | :------------------------: | :----: | :----: |
    |   顺序写入   | 每线程 256 MB，512 KiB 块（MB/s） | 1474.2 |        |
    |   顺序读取   | 每线程 256 MB，512 KiB 块（MB/s） |  423.9 |        |
    |   随机写入   |   每线程 64 MB，4 KiB 块（IOPS）  |  75463 |        |
    |   随机读取   |   每线程 64 MB，4 KiB 块（IOPS）  |  74851 |        |

    |        **基准测试**        |  **测试** | **得分** |
    | :--------------------: | :-----: | :----: |
    |         glmark2        | glmark2 |  4621  |
    |   GLmark2 1920 × 1080  |   3432  |        |
    |       GLmark2 离屏       |   1690  |        |
    | GLmark2 离屏 1920 × 1080 |   913   |        |

    |      **基准测试**      |     **测试**    | **得分** |
    | :----------------: | :-----------: | :----: |
    |      Sysbench      | CPU 总时间（越低越好） | 3.6578 |
    | 内存传输速率（MB/s）（越高越好） |    3902.76    |        |
    |   线程总时间（秒）（越低越好）   |     4.1635    |        |
    |   互斥锁总时间（秒）（越低越好）  |     0.0044    |        |

    |  **基准测试** |  **测试**  | **得分** |
    | :-------: | :------: | :----: |
    | UnixBench | 1x/单并行副本 |  1234  |
    |  8x/八并行副本 |  8389.7  |        |

    有关测量方法的信息，请参阅[测量系统基准测试](#measure-system-benchmarks)。

    <Note>
      总空闲内存值越高，系统性能越好。
    </Note>
  </Tab>
</Tabs>

## **测量方法**

测量方法包括 KPI，例如引导时间、系统基准测试、录制延迟和快照延迟。

### **测量引导时间**

要测量引导时间，请执行以下操作：

1. 刷写构建版本。请参阅[刷写软件镜像](https://dragonwingdocs.qualcomm.com/Key-Documents/Flash-Guide/flash-with-qdl)以引导设备。

2. 设备启动后，重启设备。

3. 使用串行电缆连接到设备控制台。

   a. 在设备与 Linux 主机 PC 之间连接串行电缆。

   b. 使用凭据（用户：root，密码：oelinux123）连接到 UART 终端。请参阅[连接到 UART shell](https://dragonwingdocs.qualcomm.com/Key-Documents/Flash-Guide/how-to-trigger-edl-with-uart#connect-to-a-uart-shell)。

   c. 关闭并重新开启设备电源。

在设备引导并稳定后，可通过捕获 systemd-analyze 和 journalctl 日志来测量引导时间 KPI。

```text theme={null}
systemd-analyze > /var/lib/systemd-analyze.txt
```

```text theme={null}
journalctl --output=short-monotonic -b --no-pager -l > /var/lib/journalctl.txt
```

```text theme={null}
grep Startup /var/lib/systemd-analyze.txt
```

预期输出：

```text theme={null}
Startup finished in 1.697s (firmware) + 402ms (loader) + 1.693s (kernel) + 15.887s (userspace) = 19.681s 
```

```text theme={null}
grep "camera driver initialized rc : 0" var/lib/journalctl.txt
```

预期输出：

```text theme={null}
[    4.220245] iq-615-evk kernel: CAM_INFO: CAM-UTIL: cam_main_probe: 336: Spectra camera driver initialized rc : 0
```

```text theme={null}
grep "Reached target System Initialization." /var/lib/journalctl.txt
```

预期输出：

```text theme={null}
[    4.757850] iq-615-evk systemd[1]: Reached target System Initialization.
```

```text theme={null}
Boot time till Init/systemd process = Firmware + Loader + Kernel = 1.697 + 0.402 + 1.693 = __3.892s__ 
```

```text theme={null}
Boot time till Camera driver init finish =  Firmware + Loader + journalctl timestamp of "camera driver initialized" = 1.697 + 0.402 + 4.220 = __6.319s__
```

```text theme={null}
Boot time till Sysinit.target = Firmware + Loader + journalctl timestamp of "Reached target System Initialization" = 1.697 + 0.402 + 4.757 = __6.856s__
```

<Note>
  固件和引导加载程序时间取自 systemd-analyze 输出（1.697s + 0.402s）。journalctl 中的内核时间戳相对于内核启动，因此需要加上固件 + 引导加载程序时间才能得到从上电开始的绝对引导时间。
</Note>

### **测量系统基准测试**

这些基准测试测量各子系统的性能，例如 CPU 吞吐量、内存带宽、内存延迟和 I/O 性能。

**前提条件**

在运行任何基准测试之前，请完成以下设置：

<Note>
  设备上默认未启用 ADB。要在运行这些基准测试之前启用 ADB，请参阅[启用 ADB](./troubleshoot-performance-issues#build-procrank-from-source-code)。
</Note>

1. 刷写构建版本。
2. 运行以下命令获取 root 访问权限：
   ```text theme={null}
   adb root
   ```
3. 在设备上打开 shell：
   ```text theme={null}
   adb shell
   ```
4. 导航到推送二进制文件的目录：
   ```text theme={null}
   cd /usr/bin
   ```
5. 为二进制文件设置执行权限：
   ```text theme={null}
   chmod 777 <binary>
   ```

**Geekbench**

Geekbench 是一款用于根据既定基准测量系统性能的工具。

要使用 Geekbench 测量系统性能，请执行以下操作：

1. 要从上游的 Linux/ARM 部分下载 Geekbench，请参阅 [Geekbench](https://www.geekbench.com/preview/)。

<Note>
  适用于 Linux/AArch64 的 Geekbench 6 是预览版。Geekbench 版本可能会更改，本节中提到的步骤仅供参考。预览版需要有效的互联网连接，并会自动将基准测试结果上传到 Geekbench 浏览器。
</Note>

2. 要使用 Geekbench 测量 CPU 基准，请执行以下操作：
   1. 解压 Geekbench 文件并使用 adb 工具从主机推送。以下是示例命令：
      ```text theme={null}
      adb push Geekbench-6.3.0-LinuxARMPreview /var/cache/
      ```
      ```text theme={null}
      cd /var/cache
      ```
      ```text theme={null}
      chmod 777 Geekbench-6.3.0-LinuxARMPreview/*
      ```
   2. 要运行 Geekbench，请在设备上运行以下命令：
      ```text theme={null}
      cd Geekbench-6.3.0-LinuxARMPreview
      ```
      ```text theme={null}
      ./geekbench_aarch64
      ```

**Sysbench**

Sysbench 测量 CPU、内存、线程、互斥锁和文件 I/O 性能。

要运行 Sysbench 测试，请在设备上运行以下命令：

```text theme={null}
./sysbench --test=cpu run
./sysbench --test=memory run
./sysbench --test=threads run
./sysbench --test=mutex run
./sysbench --test=fileio --file-test-mode=seqwr run
./sysbench --test=fileio --file-test-mode=seqrd run
./sysbench --test=fileio --file-test-mode=rndrd run
./sysbench --test=fileio --file-test-mode=rndwr run
```

要使用 taskset 运行：

```text theme={null}
taskset <taskset> ./sysbench --test=<test_name> run
```

**Tiotest**

Tiotest 测量存储 I/O 性能。

要运行 Tiotest，请执行以下操作：

1. 运行顺序 I/O 测试：
   ```text theme={null}
   /data/tio/tiotest -t 8 -d /data/tio -f 256 -b 524288 -k3 -k1 --direct-io sync=1
   ```
2. 运行随机 I/O 测试：
   ```text theme={null}
   /data/tio/tiotest -t 8 -d /data/tio -f 64 -b 4096 -k2 -k0 2012 -r 12500 20 --direct-io sync=1
   ```
3. 在迭代之间清除缓存：
   ```text theme={null}
   echo 3 > /proc/sys/vm/drop_caches
   ```

**CoreMark**

CoreMark 测量嵌入式处理器性能。

要运行 CoreMark，请在设备上运行以下命令：

```text theme={null}
./coremark.exe
```

以下是示例输出：

```text theme={null}
2K performance run parameters for coremark.
CoreMark Size    : 666
Total ticks      : 15268
Total time (secs): 15.268000
Iterations/Sec   : 26198.585276
Iterations       : 400000
Compiler version : GCC11.4.0
Compiler flags   : -O2 -DPERFORMANCE_RUN=1  -lrt
seedcrc          : 0xe9f5
[0]crclist       : 0xe714
[0]crcmatrix     : 0x1fd7
[0]crcstate      : 0x8e3a
[0]crcfinal      : 0x65c5
```

**Glmark2**

Glmark2 测量 GPU 渲染和图形性能。

要运行 Glmark2，请执行以下操作：

1. 配置 Wayland 运行时环境：

```text theme={null}
export XDG_RUNTIME_DIR=/dev/socket/weston
mkdir --parents $XDG_RUNTIME_DIR
chmod 0700 $XDG_RUNTIME_DIR
export WAYLAND_DISPLAY=wayland-1
```

2. 以默认分辨率运行离屏测试：

```text theme={null}
./glmark2-es2-wayland --off-screen --data-path /usr/share/glmark2
```

3. 以 1920x1080 分辨率运行离屏测试：

```text theme={null}
./glmark2-es2-wayland --off-screen -s 1920x1080 --data-path /usr/share/glmark2
```

4. 以默认分辨率运行屏上测试：

```text theme={null}
./glmark2-es2-wayland --data-path /usr/share/glmark2
```

5. 以 1920x1080 分辨率运行屏上测试：

```text theme={null}
./glmark2-es2-wayland -s 1920x1080 --data-path /usr/share/glmark2
```

### **测量内存映射**

内存映射提供有关如何为不同进程分配内存的信息。通过内存映射测量，您可以监控映射的进程并排查任何内存问题。

要计算内存映射，请引导设备并使其稳定。然后，运行以下命令从设备收集日志：

```text theme={null}
cat /proc/meminfo
```

```text theme={null}
cat /proc/iomem
```

```text theme={null}
cat /proc/vmstat
```

**非 Linux 内存**

使用以下公式计算非 Linux 内存：

非 Linux = 总 RAM 大小 − Linux 总量

运行以下命令计算总 RAM 大小：

```text theme={null}
cat /proc/meminfo | grep -i "MemTotal"
```

要从 `iomem` 计算 Linux 内存总量，请运行以下命令：

```text theme={null}
cat /proc/iomem | grep System
```

**内核静态**

使用以下公式计算内核静态内存：

内核静态 = Linux 总量 − MemTotal

**应用程序 + 框架内存计算**

使用以下公式计算应用程序和框架使用的内存：

应用程序 + 框架 = MemTotal − 空闲内存

**空闲内存计算**

使用以下公式计算空闲内存：

空闲内存 = MemFree + (Cached − shmem) + buffer + ION 缓存

要获取空闲内存详细信息，请运行以下命令：

```text theme={null}
cat /proc/meminfo
```

要检查 ION 缓存的 vmstat 日志，请运行以下命令：

```text theme={null}
cat /proc/vmstat
```

### **测量摄像头录制和快照延迟**

本主题介绍摄像头录制和快照延迟的测量方法。

要在每次重启时完成前提条件，请在设备上运行以下命令：

```text theme={null}
mount -t debugfs none /sys/kernel/debug
```

```text theme={null}
setprop persist.qmmf.kpi.debug 2
```

**首次录制延迟**

要捕获日志，请按照以下步骤操作：

1. 引导设备并等待其稳定。
2. 在一个 shell 中，运行以下命令：
   ```text theme={null}
   cat /sys/kernel/debug/tracing/trace_pipe > trace.log
   ```
3. 在另一个 shell 中，运行用例。
4. 停止跟踪日志。
5. 参阅下方[参考表](#reference-table-for-measurement)以测量录制延迟。

**首次快照延迟**

1. 引导设备。
2. 设备稳定后，在一个 shell 中运行以下命令：
   ```text theme={null}
   cat /sys/kernel/debug/tracing/trace_pipe > trace.log
   ```
3. 在另一个 shell 中，运行用例。
4. 停止跟踪日志。
5. 参阅下方[参考表](#reference-table-for-measurement)以测量快照延迟。

<a id="reference-table-for-measurement" />

**测量参考表**

| **用例** | **日志标记**                                                                                                                                                                                                                                                                           | **计算方法**                                                                                                                                                                                                                                                                                   |
| ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| 录制延迟   | `273.082629: tracing_mark_write: B\|Connect`<br />`273.119992: tracing_mark_write: B\|StartCamera`<br />`276.722946: tracing_mark_write: B\|CreateVideoTrack`<br />`276.731158: tracing_mark_write: B\|StartVideoTrack`<br />`277.306283: tracing_mark_write: E\|FirstVidFrame\|1` | Connect 到 Start Camera = StartCamera − Connect<br />StartCamera 到 CreateVideoTrack = CreateVideoTrack − StartCamera<br />CreateVideoTrack 到 StartVideoTrack = StartVideoTrack − CreateVideoTrack<br />StartVideoTrack 到 FirstVidFrame = FirstVidFrame − StartVideoTrack<br />录制延迟 = 以上所有之和 |
| 快照延迟   | `303.975067: tracing_mark_write: S\|FirstCapImg\|0`<br />`304.544265: tracing_mark_write: S\|SnapShot-Shot\|0`                                                                                                                                                                     | 快照延迟 = snapshot − FirstCapimg                                                                                                                                                                                                                                                              |
