Create bugreport_procdump
This change creates a bugreport_procdump tool that collects the combined
output of showmap-of-all-processes, procrank, and librank for bug
reports (with a single read of smaps). Besides -q for showmap, these
tools are run with their default parameters.
This change includes some necessary changes to the existing tools:
- showmap, procrank, and librank now read from passed-in ProcessRecords
when possible.
- ProcessRecords' cmdline field is populated by /proc/<pid>/comm if
/proc/<pid>/cmdline is empty (for kernel threads).
- showmap::vmas is cleared in run_showmap() to account for consecutive
calls.
Lastly, this change adds an include statement that was previously
omitted in smapinfo.h.
Over 3 trials on aosp_redfin-userdebug, the time spent collecting memory
info during a bug report was reduced by ~88% (11.954s -> 1.393s).
With a high outlier removed from the 'before' trials and a low outlier
removed from the 'after' trials, the reduction in overall bug report
time was measured at ~13.5% (50.639s -> 43.784s).
Test: - Check that bugreport_procdump outputs the expected information.
- Check that ABT still parses the showmap, procrank, and librank
sections of bug reports with bugreport_procdump in the same way.
Bug: 229147699
Change-Id: I61262983daffcd31ca3b08fd8005f5ed1a653503
7 files changed