Update documentation.
Fix the incorrect mention of when the zygote flag is set on a size.
Add information about how to use am dumpheap -n to dump the native
heap to a file.
Test: Documentation only change.
Change-Id: I82e810ee7ffffcf7506fb6fd9bcfdfb0465a48be
diff --git a/libc/malloc_debug/README.md b/libc/malloc_debug/README.md
index 984430b..59bd525 100644
--- a/libc/malloc_debug/README.md
+++ b/libc/malloc_debug/README.md
@@ -409,3 +409,15 @@
# setprop libc.debug.malloc.options backtrace
# export LIBC_DEBUG_MALLOC_ENABLE 1
# ls
+
+Enable malloc debug and dump the native allocation with backtraces to
+a file. This only works for zygote based java processes.
+
+ adb shell stop
+ adb shell setprop libc.debug.malloc.options backtrace
+ adb shell start
+ adb shell am dumpheap -n <PID_TO_DUMP> /data/local/tmp/heap.txt
+
+It is possible to use the backtrace\_enable\_on\_signal option as well,
+but it must be enabled through the signal before the file will contain
+any data.
diff --git a/libc/malloc_debug/README_api.md b/libc/malloc_debug/README_api.md
index 63ad42a..9d07cb3 100644
--- a/libc/malloc_debug/README_api.md
+++ b/libc/malloc_debug/README_api.md
@@ -50,5 +50,5 @@
*overall\_size* divided by *info\_size*.
Note, the size value in each allocation data structure will have bit 31 set
-if this allocation was created by the Zygote process. This helps to distinguish
-between native allocations created by the application.
+if this allocation was created in a process forked from the Zygote process.
+This helps to distinguish between native allocations created by the application.