Merge "profiling: Update README."
diff --git a/src/profiling/memory/README.md b/src/profiling/memory/README.md
index a9a5b9c..602fa1d 100644
--- a/src/profiling/memory/README.md
+++ b/src/profiling/memory/README.md
@@ -14,24 +14,33 @@
```bash
INTERVAL=128000
-adb root
-adb shell setenforce 0
-adb shell heapprofd -s -i ${INTERVAL} &
-adb shell kill -36 ${PID} # Start profiling the process.
+adb shell su root setenforce 0
+adb shell su root start heapprofd
+
+echo '
+buffers {
+ size_kb: 100024
+}
+
+data_sources {
+ config {
+ name: "android.heapprofd"
+ target_buffer: 0
+ heapprofd_config {
+ sampling_interval_bytes: '${INTERVAL}'
+ pid: '${PID}'
+ continuous_dump_config {
+ dump_phase_ms: 10000
+ dump_interval_ms: 1000
+ }
+ }
+ }
+}
+
+duration_ms: 20000
+' | adb shell perfetto -t -c - -o /data/misc/perfetto-traces/trace
+
+adb pull /data/misc/perfetto-traces/trace /tmp/trace
```
-To obtain heap dumps for all profiled processes, send `SIGUSR1` to heapprofd
-which produces heap dumps in /data/local/tmp.
-
-```bash
-adb shell killall -USR1 heapprofd
-adb pull /data/local/tmp/heap_dump.${PID}
-```
-
-This file can then be converted to a flamegraph using Brendan Gregg's
-[`flamegraph.pl`](
- https://github.com/brendangregg/FlameGraph/blob/master/flamegraph.pl).
-
-```bash
-flamegraph.pl heap_dump.${PID} > heap_dump.${PID}.svg
-```
+TODO(fmayer): Add instructions how to visualize the trace.