dumpstate: Add historical ANRs as separate entries in the zip file.
ANRs now show up as separate entries in the bugreport zip file, like so:
-rw---- 0.0 fat 516946 bl 48779 defN 17-Jul-27 10:47 FS/data/anr/anr_2017-07-27-10-47-45-798
-rw---- 0.0 fat 520627 bl 48995 defN 17-Jul-27 10:47 FS/data/anr/anr_2017-07-27-10-47-30-328
Bug: 32470528
Test: adb bugreport ./bugreport.zip; zipinfo -l ./bugreport.zip | grep anr
(cherry picked from commit 8cbab7c3c93c1bc9364a81726f02eeacc4a9356b)
Change-Id: Ia3a2fc12fb7de8e503b90f849dd4c7927d109581
diff --git a/cmds/dumpstate/dumpstate.cpp b/cmds/dumpstate/dumpstate.cpp
index d4d787a..1ecbb03 100644
--- a/cmds/dumpstate/dumpstate.cpp
+++ b/cmds/dumpstate/dumpstate.cpp
@@ -930,8 +930,10 @@
"VM TRACES AT LAST ANR", add_to_zip);
if (anr_data->size() > 1) {
+ // NOTE: Historical ANRs are always added as separate entries in the
+ // bugreport zip file.
AddDumps(anr_data->begin() + 1, anr_data->end(),
- "HISTORICAL ANR", add_to_zip);
+ "HISTORICAL ANR", true /* add_to_zip */);
}
} else {
printf("*** NO ANRs to dump in %s\n\n", ANR_DIR.c_str());