summaryrefslogtreecommitdiff
path: root/simpleperf/doc/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'simpleperf/doc/README.md')
-rw-r--r--simpleperf/doc/README.md19
1 files changed, 16 insertions, 3 deletions
diff --git a/simpleperf/doc/README.md b/simpleperf/doc/README.md
index f0cddd2a..2f3b0854 100644
--- a/simpleperf/doc/README.md
+++ b/simpleperf/doc/README.md
@@ -20,8 +20,9 @@ The latest document is [here](https://android.googlesource.com/platform/system/e
- [Executable commands reference](#executable-commands-reference)
- [Scripts reference](#scripts-reference)
- [Answers to common issues](#answers-to-common-issues)
- - [Why we suggest profiling on Android >= N devices?](#why-we-suggest-profiling-on-android-gt-n-devices)
+ - [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)
+ - [Why we can't always get complete DWARF-based call graphs](#why-we-cant-always-get-complete-dwarf-based-call-graphs)
- [How to solve missing symbols in report?](#how-to-solve-missing-symbols-in-report)
- [Fix broken callchain stopped at C functions](#fix-broken-callchain-stopped-at-c-functions)
- [Show annotated source code and disassembly](#show-annotated-source-code-and-disassembly)
@@ -88,7 +89,7 @@ bin/${host}/${arch}/simpleperf: simpleperf executables used on the host, only su
bin/${host}/${arch}/libsimpleperf_report.${so/dylib/dll}: report shared libraries used on the host.
-*.py, inferno: Python scripts used for recording and reporting.
+*.py, inferno, purgatorio: Python scripts used for recording and reporting. Details are in [scripts_reference.md](scripts_reference.md).
## Android application profiling
@@ -159,6 +160,18 @@ graphs. It can be supported in two ways:
1. Use unstripped native binaries when building the apk, as [here](https://android.googlesource.com/platform/system/extras/+/master/simpleperf/demo/SimpleperfExampleWithNative/app/profiling.gradle).
2. Download unstripped native libraries on device, as [here](#fix-broken-callchain-stopped-at-c-functions).
+### Why we can't always get complete DWARF-based call graphs?
+
+DWARF-based call graphs are generated by unwinding thread stacks. When a sample is generated, up to
+64KB stack data is dumped by the kernel. By unwinding the stack based on dwarf information, we get
+a callchain. But the thread stack can be much longer than 64KB. In that case, we can't unwind to
+the thread start point.
+
+To alleviate the problem, simpleperf joins callchains after recording them. If two callchains of
+a thread have an entry containing the same ip and sp address, then simpleperf tries to join them to
+make the callchains longer. In that case, the longer we run, the more samples we get. This makes it
+more likely to get complete callchains, but it's still not guaranteed to get complete call graphs.
+
### How to solve missing symbols in report?
The simpleperf record command collects symbols on device in perf.data. But if the native libraries
@@ -233,7 +246,7 @@ Patches can be uploaded to android-review.googlesource.com as [here](https://sou
or sent to email addresses listed [here](https://android.googlesource.com/platform/system/extras/+/master/simpleperf/OWNERS).
If you want to compile simpleperf C++ source code, follow below steps:
-1. Download AOSP master branch as [here](https://source.android.com/setup/build/requirements).
+1. Download AOSP main branch as [here](https://source.android.com/setup/build/requirements).
2. Build simpleperf.
```sh
$ . build/envsetup.sh