我最近在尝试用Streamline分析汇编代码在Android手机上的执行流水线,看了很多博客以后,逐渐理清楚思路,不知道我理解的对不对?
1. 拉取Linux kernel代码,打开CONFIG_HW_PERF_EVENTS等等
2. 在Linux kernel编译目录下拷贝gator driver源码
3. 修改Makefile
4. 重新编译内核,再编译gator.ko
我在Android手机上使用zcat config.zip | grep 'CONFIG_HW_PERF_EVENTS'等查询现有的内核编译时是否开启了相关配置,Android手机上的内核确实是开启了CONFIG_HW_PERF_EVENTS等,但是没有gator.ko,会导致Streamline连接手机以后,出现下面的warnning提示
Hi Isy2025,
Recent releases of Streamline (since 2019) no longer support gator.ko; we entirely pull data from user-space via the standard Perf data channel.
If you are profiling applications on Android please try out Arm Mobile Studio (developer.arm.com/mobile-studio) - for application profiling it's free of charge and should work on release build Android phones. The only requirement for profiling is that the application is debuggable, allowing us to automatically run gator as the application user, which is needed to collect PMU counters.
Kind regards, Pete
Thanks for your reply ! However, when I tried to use Streamline from Arm Mobile Studio for profiling debuggable Application, I got none instruction sample like below
When I configure counters, it also remind me a warning
Should I care about it and How could I get instruction sample ?
Dear lsy2025,
PMU support must be added to the kernel for the board you're using.The documentation : https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/Documentation/devicetree/bindings/arm/pmu.yaml
A random example for Tegra194 : https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/arch?id=9e79e58f330ea4860f2ced65a8a35dfb05fc03c1
The interrupts are specific for each board model. There are some more patches on the topic : https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/log/arch?qt=grep&q=add+PMU
If support for the board you're using is not already there, you should contact the specific vendor of that board.
Best Regards,Willy
You kernel needs to be configured to enable Perf and Ftrace. Please see:
developer.arm.com/.../Kernel-configuration-menu-options