Commit 9e332a7
committed
Add kernel memory allocations to bugreport
Add the contents of /proc/allocinfo to the bugreport.
This file shows the current snapshot of all the memory allocated and the
number of allocations associated with kernel code locations.
The collection and processing of /proc/allocinfo is done by calling the
alloctop tool, to return the top entries that allocated most memory.
The kernel memory allocations entry is added to the bugreport only if
the /proc/allocinfo file exists.
As shown below, a rough measurement of the execution time of this
command on Cuttlefish shows an average of ~43 ms.
On the same device, the total number of characters generated by the
command is 6704, so ~6.6 KiB uncompressed.
```
vsoc_x86_64:/ # time for i in $(seq 1 1000); do
alloctop --once --sort s --min 1 --lines 100 > /dev/null
done
0m42.25s real 0m00.17s user 0m03.63s system
vsoc_x86_64:/ # alloctop --once --sort s --min 1 --lines 100 | wc -c
6704
```
Bug: 384777823
Test: adb shell dumpstate
Change-Id: Ib8f7eeebe5ad88fc608e2d84582ad32e1b069985
Signed-off-by: Alessio Balsini <balsini@google.com>1 parent f408a47 commit 9e332a7
2 files changed
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| 131 | + | |
131 | 132 | | |
132 | 133 | | |
133 | 134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1257 | 1257 | | |
1258 | 1258 | | |
1259 | 1259 | | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
1260 | 1269 | | |
1261 | 1270 | | |
1262 | 1271 | | |
| |||
1766 | 1775 | | |
1767 | 1776 | | |
1768 | 1777 | | |
| 1778 | + | |
| 1779 | + | |
1769 | 1780 | | |
1770 | 1781 | | |
1771 | 1782 | | |
| |||
0 commit comments