当前位置: 首页 > news >正文

ARM 性能分析工具:Streamline

文章目录

  • 1. 前言
  • 2. 安装
    • 2.1 在 Host 安装 `Arm Performance Studio`
    • 2.2 在 ARM 目标平台安装 `gatord`
  • 3. 使用
    • 3.1 离线方式
    • 3.2 在线方式
    • 3.3 添加符号表
  • 4. 参考资料

1. 前言

限于作者能力水平,本文可能存在谬误,因此而给读者带来的损失,作者不做任何承诺。

2. 安装

Streamline 分为两大部分:

  • gatord
  • Arm Performance Studio

gatord 运行于目标 ARM 平台,负责性能数据采样;而 Arm Performance Studio 运行于 Host (如 Windows/Linux/MacOS 等),负责性能采样数据分析

本文以【运行于 Windows 主机 Arm Performance Studio + 运行于 ARMv8 平台的 gatord 】组合为例进行说明。

2.1 在 Host 安装 Arm Performance Studio

到 https://developer.arm.com/Tools%20and%20Software/Arm%20Performance%20Studio#Downloads 处下载 Arm Performance StudioWindows 版本进行安装:

在这里插入图片描述

当然,读者也完全可以下载 LinuxmacOS 版本进行安装,只是笔者用 Windows 版本进行演示。

2.2 在 ARM 目标平台安装 gatord

按 Set up your target 完成 gatord 运行环境的检验和安装。

首先检验 gatord 运行环境,Linux 需开启 CONFIG_PROFILING 配置:

# zcat /proc/config.gz | grep CONFIG_PROFILING
CONFIG_PROFILING=y

Arm Performance Studio 安装完成后,在路径 <install_directory>\streamline\bin\linux 包含有预编译的 gatord 程序,其源码在路径 <install_directory>\streamline\gator\daemon 下。将 gatord 程序拷贝到目标 ARM 平台,并增加可执行权限

# chmod +x gatord
# ./gatord -h
Streamline Data Recorder v9.5.1 (Build d0e2706)
Copyright (c) 2010-2025 Arm Limited. All rights reserved.


Streamline has 2 modes of operation. Daemon mode (the default), and local
capture mode, which will capture to disk and then exit. To enable local capture
mode specify an output directory with --output.

* Arguments available to all modes:
  -h|--help                             This help page
  -c|--config-xml <config_xml>          Specify path and filename of the
                                        configuration XML. In daemon mode the
                                        list of counters will be written to
                                        this file. In local capture mode the
                                        list of counters will be read from this
                                        file.
  -e|--events-xml <events_xml>          Specify path and filename of the events
                                        XML to use
......

如果预编译gatord 无法在目标 ARM 平台上运行,可到 gatord 处下载源码自行编译。

3. 使用

Streamline 的使用可以有两种方式:

1. 离线方式
2. 在线方式

离线方式gatord 进行性能数据采样,并将采样数据存放在 ARM 目标机器本地存储上,结束采样后再将性能数据采样文件拷贝到 Host (Windows/Linux/macOS),然后导入到 Arm Performance Studio 进行分析。

在线方式也是 gatord 进行性能数据采样,但不同于离线方式的是,性能数据采样实时的通过 ADB网络传递给 Host (Windows/Linux/macOS) 一侧的 Arm Performance Studio 并存放,结束采样后 Arm Performance Studio 再进行分析。

接下来分别对离线在线两种方式加以说明。不管是离线还是在线方式,都要先准备一个测试程序。按 Compile your application 编译一个应用程序,拷贝到目标 ARM 机器,并添加可执行权限

3.1 离线方式

首先在目标 ARM 机器启动 gatord 和 应用测试程序:

# ./gatord -o profile.apc &
# ./test_app &

一段时间后,停止应用程序和 gatord

# killall test_app
# killall gatord

将采样数据文件夹 profile.apc 拷贝到 WindowsArm Performance Studio 的指定目录下:

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

然后启动 Arm Performance Studio,并导入数据:

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

然后启动分析,这需要一点时间:

在这里插入图片描述
在这里插入图片描述

分析完成如下图:

在这里插入图片描述

可以标签栏 Timeline,Call Paths,Functions 等查看不同的分析数据,也可以选择指定进程的分析数据。

3.2 在线方式

# ./gatord &
[1] 2584
Streamline Data Recorder v9.5.1 (Build d0e2706)
Copyright (c) 2010-2025 Arm Limited. All rights reserved.

Gator ready
# ./test_app &

WindowsArm Performance Studio,选择 TCP 方式:

在这里插入图片描述

并点击 Start capture 按钮开始捕捉,出现如下画面:

在这里插入图片描述

停止测试应用程序和 gatord

# killall test_app
# killall gatord

在这里插入图片描述

Arm Performance Studio 将自动停止捕捉并开始分析数据,分析完后的画面如下:

在这里插入图片描述

3.3 添加符号表

默认解析是看不到任何符号信息的,要按需导入。在采样数据上点击右键:

在这里插入图片描述
在这里插入图片描述

点击按钮 在这里插入图片描述 添加需要的符号文件,如上图中的 vmlinux 等,然后点击 Analyze 按钮,分析后的数据就可以看到符号信息了:

在这里插入图片描述

Streamline 功能很多很强大,更多关于 Streamline 的用法,可参考 ARM 官方文档 。

4. 参考资料

[1] Arm Streamline Target Setup Guide for Linux
R

http://www.dtcms.com/a/106757.html

相关文章:

  • 高并发内存池(二):Central Cache的实现
  • Java 进化之路:从 Java 8 到 Java 21 的重要新特性
  • 【爬虫基础】第三部分 爬虫请求库 1/4
  • Android 防抖和节流
  • 【Kafka基础】Kafka工作原理解析
  • 英语口语 -- 常用 1368 词汇
  • 206. 反转链表 92. 反转链表 II 25. K 个一组翻转链表
  • 店铺状态设置-03.功能测试
  • Kotlin问题汇总
  • AI:机器学习-线性回归
  • 边缘计算赋能淘宝API:分布式节点缓存降低高并发延迟
  • 风电行业预测性维护解决方案:AIoT驱动下的风机健康管理革命
  • 多模态RAG实践:如何高效对齐不同模态的Embedding空间?
  • arcgis10.8 Toolbox中的conversion tools没有to coverage工具?
  • 4. 理解Prompt Engineering:如何让模型听懂你的需求
  • 【Kafka基础】基础概念解析与消息队列对比
  • Redis如何在windows中简单安装?
  • 线性DP总结
  • Centos 8 安装教程(新手版)
  • element-ui自制树形穿梭框
  • python操作es
  • 机器学习的一百个概念(8)插补法
  • LeetCode hot 100—最长递增子序列
  • PyQt5界面设计
  • 现代几何风格网页标牌标识logo海报标题设计psai英文字体安装包 Myfonts – Gilroy Font Family
  • React安装使用教程
  • vue3源码分析 -- runtime
  • ES6中增强对象
  • 虚幻引擎控制角色跟随移动方向旋转的方法
  • NLP高频面试题(三十二)——介绍一下CLIP和CLIP2