Android Studio Profiler(CPU : Sample C/C++ Functions)

发布时间:2022-06-25 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了Android Studio Profiler(CPU : Sample C/C++ Functions)脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。

 Android Studio ProfilerCPU Profiler下的Sample C/C++ Functions功能(注:为命令行工具simpleperf的GUI版本),来跟踪各个线程的C/C++函数使用CPU的情况。

根据Profile信息来确定哪些C/C++函数在被频繁地调用,以优化相应代码来降低线程对CPU的占用。下文使用Android Studio 4.2.1来说明该功能。

 

实时显示App及各线程上的CPU占用

Android Studio Profiler(CPU : Sample C/C++ Functions)

注:可拖动线程名前的四条杠图标

Android Studio Profiler(CPU : Sample C/C++ Functions)

来将关注的线程放置在一起观察 

 

录制一段C/C++ Function Recording

Android Studio Profiler(CPU : Sample C/C++ Functions)

右上角工具栏说明:

Android Studio Profiler(CPU : Sample C/C++ Functions)

 

Android Studio Profiler(CPU : Sample C/C++ Functions)

:扩大CPU Usage轴上的选中范围

Android Studio Profiler(CPU : Sample C/C++ Functions)

:缩小CPU Usage轴上的选中范围

Android Studio Profiler(CPU : Sample C/C++ Functions)

:选择整个CPU Usage轴

当选中某个线程或event时,会出现“Clear thread/event selection”的点击按钮

 

选中线程

选中线程的选中区域的Summary

Android Studio Profiler(CPU : Sample C/C++ Functions)

 

选中线程的选中区域的Top Down

Android Studio Profiler(CPU : Sample C/C++ Functions)

 

选中线程的选中区域的Flame Chart

Android Studio Profiler(CPU : Sample C/C++ Functions)

注:Flame Chart即火焰图,会对同名的栈帧进行合并显示

 

选中线程的选中区域的Bottom Up

Android Studio Profiler(CPU : Sample C/C++ Functions)

 

选中线程的Events

Android Studio Profiler(CPU : Sample C/C++ Functions)

 

All Threads

所有线程的选中区域的Summary

Android Studio Profiler(CPU : Sample C/C++ Functions)

 

所有线程的选中区域的Top Down

Android Studio Profiler(CPU : Sample C/C++ Functions)

 

所有线程的选中区域的Flame Chart

Android Studio Profiler(CPU : Sample C/C++ Functions)

注:Flame Chart即火焰图,会对同名的栈帧进行合并显示

 

所有线程的选中区域的Bottom Up

Android Studio Profiler(CPU : Sample C/C++ Functions)

 

脚本宝典总结

以上是脚本宝典为你收集整理的Android Studio Profiler(CPU : Sample C/C++ Functions)全部内容,希望文章能够帮你解决Android Studio Profiler(CPU : Sample C/C++ Functions)所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: