> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs.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 的性能仪表板和测量流程，请参见相应的附录。以下指南提供补充信息，且这些指南面向具有授权访问权限的许可用户：

* [Qualcomm Linux Performance Guide - Addendum for Qualcomm Dragonwing IQ-9075](https://docs.qualcomm.com/bundle/resource/topics/80-80020-10A/overview.html)
* [Qualcomm Linux Performance Guide - Addendum for Qualcomm Dragonwing IQ-8275](https://docs.qualcomm.com/bundle/resource/topics/80-80020-10B/overview.html)

<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 表示下游软件包集，其中包括叠加在上游镜像之上的专有多媒体组件、增强功能和供应商特定的附加内容。

    有关测量流程的信息，请参见[测量启动时间](#测量启动时间)。

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

    本节概述如何使用一组标准基准测试来测量系统性能。下表列出了 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.19    |
    | 内存带宽（MB/秒） | 4452.23 |
    | 线程总时间（秒）   | 3.44    |
    | 互斥锁总时间（秒）  | 0.0045  |

    有关测量流程的信息，请参见[测量系统基准测试](#测量系统基准测试)。

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

    ## **内存映射**

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

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

    有关测量流程的信息，请参见[测量内存映射](#测量内存映射)。

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

    ## **用例 KPI**

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

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

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

    有关测量流程的信息，请参见[测量摄像头录制/快照延迟](#测量摄像头录制快照延迟)。
  </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 表示下游软件包集，其中包括叠加在上游镜像之上的专有多媒体组件、增强功能和供应商特定的附加内容。

    有关测量流程的信息，请参见[测量启动时间](#测量启动时间)。

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

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

    **Geekbench**

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

    有关测量流程的信息，请参见[测量系统基准测试](#测量系统基准测试)。

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

    ## **内存映射**

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

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

    有关测量流程的信息，请参见[测量内存映射](#测量内存映射)。

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

    ## **用例 KPI**

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

    有关测量流程的信息，请参见[测量摄像头录制/快照延迟](#测量摄像头录制快照延迟)。
  </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 表示下游软件包集，其中包括叠加在上游镜像之上的专有多媒体组件、增强功能和供应商特定的附加内容。

    有关测量流程的信息，请参见[测量启动时间](#测量启动时间)。

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

    本节概述如何使用一组标准基准测试来测量系统性能。下表列出了 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 |

    有关测量流程的信息，请参见[测量系统基准测试](#测量系统基准测试)。

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

    ## **内存映射**

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

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

    有关测量流程的信息，请参见[测量内存映射](#测量内存映射)。

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

    ## **用例 KPI**

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

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

    <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. 将设备断电再上电。

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

```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
```

预期输出：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
```

预期输出：\[    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
```

预期输出：\[    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
```

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

```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. 参见下面的参考表来测量录制延迟。

**首次快照延迟**

1. 启动设备。
2. 设备稳定后，在一个 shell 中运行以下命令：
   ```text theme={null}
   cat /sys/kernel/debug/tracing/trace_pipe > trace.log
   ```
3. 在另一个 shell 中运行用例。
4. 停止跟踪日志。
5. 参见下面的参考表来测量快照延迟。

**测量参考表**

| **用例** | **日志标记**                                                                                                                                                                                                                                                                           | **计算方式**                                                                                                                                                                                                                                                                                   |
| ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| 录制延迟   | `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                                                                                                                                                                                                                                                              |
