# Simpleperf
Simpleperf is a native profiling tool for Android. It can be used to profile
both Android applications and native processes running on Android. It can
profile both Java and C++ code on Android. It can be used on Android L
and above.
Simpleperf is part of the Android Open Source Project. The source code is [here](https://android.googlesource.com/platform/system/extras/+/master/simpleperf/).
The latest document is [here](https://android.googlesource.com/platform/system/extras/+/master/simpleperf/doc/README.md).
## Table of Contents
- [Introduction](#introduction)
- [Tools in simpleperf](#tools-in-simpleperf)
- [Android application profiling](#android-application-profiling)
- [Prepare an Android application](#prepare-an-android-application)
- [Record and report profiling data](#record-and-report-profiling-data)
- [Record and report call graph](#record-and-report-call-graph)
- [Report in html interface](#report-in-html-interface)
- [Show flame graph](#show-flame-graph)
- [Record both on CPU time and off CPU time](#record-both-on-cpu-time-and-off-cpu-time)
- [Profile from launch](#profile-from-launch)
- [Parse profiling data manually](#parse-profiling-data-manually)
- [Android platform profiling](#android-platform-profiling)
- [Executable commands reference](#executable-commands-reference)
- [How simpleperf works](#how-simpleperf-works)
- [Commands](#commands)
- [The list command](#the-list-command)
- [The stat command](#the-stat-command)
- [Select events to stat](#select-events-to-stat)
- [Select target to stat](#select-target-to-stat)
- [Decide how long to stat](#decide-how-long-to-stat)
- [Decide the print interval](#decide-the-print-interval)
- [Display counters in systrace](#display-counters-in-systrace)
- [The record command](#the-record-command)
- [Select events to record](#select-events-to-record)
- [Select target to record](#select-target-to-record)
- [Set the frequency to record](#set-the-frequency-to-record)
- [Decide how long to record](#decide-how-long-to-record)
- [Set the path to store profiling data](#set-the-path-to-store-profiling-data)
- [Record call graphs](#record-call-graphs-in-record-cmd)
- [Record both on CPU time and off CPU time](#record-both-on-cpu-time-and-off-cpu-time-in-record-cmd)
- [The report command](#the-report-command)
- [Set the path to read profiling data](#set-the-path-to-read-profiling-data)
- [Set the path to find binaries](#set-the-path-to-find-binaries)
- [Filter samples](#filter-samples)
- [Group samples into sample entries](#group-samples-into-sample-entries)
- [Report call graphs](#report-call-graphs-in-report-cmd)
- [Scripts reference](#scripts-reference)
- [app_profiler.py](#app_profiler-py)
- [Profile from launch of an application](#profile-from-launch-of-an-application)
- [run_simpleperf_without_usb_connection.py](#run_simpleperf_without_usb_connection-py)
- [binary_cache_builder.py](#binary_cache_builder-py)
- [run_simpleperf_on_device.py](#run_simpleperf_on_device-py)
- [report.py](#report-py)
- [report_html.py](#report_html-py)
- [inferno](#inferno)
- [pprof_proto_generator.py](#pprof_proto_generator-py)
- [report_sample.py](#report_sample-py)
- [simpleperf_report_lib.py](#simpleperf_report_lib-py)
- [Answers to common issues](#answers-to-common-issues)
- [Why we suggest profiling on android >= N devices](#why-we-suggest-profiling-on-android-n-devices)
- [Suggestions about recording call graphs](#suggestions-about-recording-call-graphs)
- [How to solve missing symbols in report](#how-to-solve-missing-symbols-in-report)
- [Bugs and contribution](#bugs-and-contribution)
## Introduction
Simpleperf contains two parts: the simpleperf executable and Python scripts.
The simpleperf executable works similar to linux-tools-perf, but has some specific features for
the Android profiling environment:
1. It collects more info in profiling data. Since the common workflow is "record on the device, and
report on the host", simpleperf not only collects samples in profiling data, but also collects
needed symbols, device info and recording time.
2. It delivers new features for recording.
a. When recording dwarf based call graph, simpleperf unwinds the stack before writing a sample
to file. This is to save storage space on the device.
b. Support tracing both on CPU time and off CPU time with --trace-offcpu option.
c. Support recording callgraphs of JITed and interpreted Java code on Android >= P.
3. It relates closely to the Android platform.
a. Is aware of Android environment, like using system properties to enable profiling, using
run-as to profile in application's context.
b. Supports reading symbols and debug information from the .gnu_debugdata section, because
system libraries are built with .gnu_debugdata section starting from Android O.
c. Supports profiling shared libraries embedded in apk files.
d. It uses the standard Android stack unwinder, so its results are consistent with all other
Android tools.
4. It builds executables and shared libraries for different usages.
a. Builds static executables on the device. Since static executables don't rely on any library,
simpleperf executables can be pushed on any Android device and used to record profiling data.
b. Builds executables on different hosts: Linux, Mac and Windows. These executables can be used
to report on hosts.
c. Builds report shared libraries on different hosts. The report library is used by different
Python scripts to parse profiling data.
Detailed documentation for the simpleperf executable is [here](#executable-commands-reference).
Python scripts are split into three parts according to their functions:
1. Scripts used for recording, like app_profiler.py, run_simpleperf_without_usb_connection.py.
2. Scripts used for reporting, like report.py, report_html.py, inferno.
3. Scripts used for parsing profiling data, like simpleperf_report_lib.py.
Detailed documentation for the Python scripts is [here](#scripts-reference).
## Tools in simpleperf
The simpleperf executables and Python scripts are located in simpleperf/ in ndk releases, and in
system/extras/simpleperf/scripts/ in AOSP. Their functions are listed below.
bin/: contains executables and shared libraries.
bin/android/${arch}/simpleperf: static simpleperf executables used on the device.
bin/${host}/${arch}/simpleperf: simpleperf executables used on the host, only supports reporting.
bin/${host}/${arch}/libsimpleperf_report.${so/dylib/dll}: report shared libraries used on the host.
[app_profiler.py](#app_profiler-py): recording profiling data.
[run_simpleperf_without_usb_connection.py](#run_simpleperf_without_usb_connection-py):
recording profiling data while the USB cable isn't connected.
[binary_cache_builder.py](#binary_cache_builder-py): building binary cache for profiling data.
[report.py](#report-py): reporting in stdio interface.
[report_html.py](#report_html-py): reporting in html interface.
[inferno.sh](#inferno) (or inferno.bat on Windows): generating flamegraph in html interface.
inferno/: implementation of inferno. Used by inferno.sh.
[pprof_proto_generator.py](#pprof_proto_generator-py): converting profiling data to the format
used by [pprof](https://github.com/google/pprof).
[report_sample.py](#report_sample-py): converting profiling data to the format used by [FlameGraph](https://github.com/brendangregg/FlameGraph).
[simpleperf_report_lib.py](#simpleperf_report_lib-py): library for parsing profiling data.
## Android application profiling
This section shows how to profile an Android application.
Some examples are [Here](https://android.googlesource.com/platform/system/extras/+/master/simpleperf/demo/README.
没有合适的资源?快使用搜索试试~ 我知道了~
android-ndk-r20b-windows-x86_64.zip
共2000个文件
cpp:6514个
h:3545个
so:1497个
需积分: 50 36 下载量 34 浏览量
2020-03-19
22:03:01
上传
评论
收藏 793.91MB ZIP 举报
温馨提示
64位windows下ndk,方便直接使用。cygwin+ndk+FFmpeg配合使用,编译Android 动态库进行视频编辑。
资源推荐
资源详情
资源评论
收起资源包目录
android-ndk-r20b-windows-x86_64.zip (2000个子文件)
cpu-features.c 41KB
xxhash.c 29KB
gl3stub.c 20KB
android_native_app_glue.c 16KB
config.c 3KB
shaderc_c_smoke_test.c 2KB
test_demangle.pass.cpp 5.12MB
layer_validation_tests.cpp 1.52MB
put_long_double.pass.cpp 1.34MB
parameter_validation.cpp 1.09MB
put_double.pass.cpp 936KB
core_validation.cpp 856KB
vk_safe_struct.cpp 750KB
glslang_tab.cpp 466KB
Initialize.cpp 455KB
size_size_T_size_size.pass.cpp 431KB
size_size_string_size_size.pass.cpp 424KB
hlslParseHelper.cpp 414KB
size_size_T_size_size.pass.cpp 350KB
size_size_string_size_size.pass.cpp 342KB
object_tracker.cpp 334KB
ParseHelper.cpp 334KB
GlslangToSpv.cpp 315KB
buffer_validation.cpp 311KB
compare.size_size_sv_size_size.pass.cpp 309KB
parameter_validation_utils.cpp 238KB
descriptor_sets.cpp 136KB
doc.cpp 127KB
Intermediate.cpp 127KB
hlslGrammar.cpp 127KB
size_T_size_size.pass.cpp 119KB
size_string_size_size.pass.cpp 116KB
validate_builtins.cpp 108KB
cmath.pass.cpp 101KB
SpvBuilder.cpp 96KB
shader_validation.cpp 96KB
math_h.pass.cpp 93KB
dynamic_cast14.pass.cpp 90KB
hlslParseables.cpp 87KB
size_size_pointer_size.pass.cpp 86KB
object_tracker_utils.cpp 82KB
folding_rules.cpp 81KB
intermOut.cpp 79KB
validate_ext_inst.cpp 76KB
ShaderLang.cpp 74KB
vkrenderframework.cpp 70KB
size_size_pointer_size.pass.cpp 67KB
compare.size_size_sv_pointer_size.pass.cpp 65KB
iter_iter_pointer_size.pass.cpp 64KB
Scan.cpp 64KB
loop_dependence.cpp 64KB
linkValidate.cpp 62KB
unique_objects.cpp 62KB
iter_iter_iter_iter.pass.cpp 61KB
validate_image.cpp 61KB
awk.pass.cpp 60KB
extended.pass.cpp 59KB
vk_format_utils.cpp 59KB
basic.pass.cpp 58KB
cxa_personality.cpp 56KB
ecma.pass.cpp 56KB
private_typeinfo.cpp 54KB
vulkan_wrapper.cpp 54KB
SPVRemapper.cpp 52KB
extended.pass.cpp 51KB
dynamic_cast3.pass.cpp 51KB
awk.pass.cpp 51KB
basic.pass.cpp 51KB
Versions.cpp 49KB
ecma.pass.cpp 49KB
size_pointer_size.pass.cpp 47KB
Pp.cpp 47KB
PpScanner.cpp 46KB
Constant.cpp 45KB
dynamic_cast5.pass.cpp 43KB
is_heap_comp.pass.cpp 41KB
loop_unroller.cpp 40KB
propagateNoContraction.cpp 40KB
is_permutation_pred.pass.cpp 39KB
tree_remove.pass.cpp 39KB
loop_peeling.cpp 37KB
validate_decorations.cpp 36KB
tree_balance_after_insert.pass.cpp 36KB
reflection.cpp 36KB
hlslScanContext.cpp 35KB
loop_unswitch_pass.cpp 34KB
const_folding_rules.cpp 34KB
binary.cpp 33KB
scalar_analysis.cpp 33KB
type_manager.cpp 33KB
vktestframework.cpp 32KB
markv_decoder.cpp 32KB
loop_descriptor.cpp 32KB
get_long_double_fr_FR.pass.cpp 32KB
linker.cpp 32KB
cxa_exception.cpp 31KB
get_long_double_ru_RU.pass.cpp 31KB
is_heap.pass.cpp 31KB
get_string_en_US.pass.cpp 31KB
get_long_double_zh_CN.pass.cpp 31KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
黑马小杰
- 粉丝: 53
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- STM32单片机FPGA毕设电路原理论文报告位标器动平衡测试系统中相位测量的实现
- STM32单片机FPGA毕设电路原理论文报告卫星天线的单片机快速对星系统
- STM32单片机FPGA毕设电路原理论文报告微型机与单片机串行通信的实现
- 戴尔Windowshello驱动程序
- STM32单片机FPGA毕设电路原理论文报告微型机单片机两级温度控制系统
- STM32单片机FPGA毕设电路原理论文报告微型地图里程测量仪的研制
- STM32单片机FPGA毕设电路原理论文报告微弱生理信号在多通道数据采集系统中的研究与实现
- 易打标-专业版-条码标签打印软件
- STM32单片机FPGA毕设电路原理论文报告微机原理与单片机课程体系改革
- STM32单片机FPGA毕设电路原理论文报告微机控制晶闸管投切电容器无功补偿装置
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功