OSDN Git Service

dumpstate: Add historical ANRs as separate entries in the zip file.
authorNarayan Kamath <narayan@google.com>
Thu, 27 Jul 2017 10:21:07 +0000 (11:21 +0100)
committerNarayan Kamath <narayan@google.com>
Thu, 27 Jul 2017 10:57:41 +0000 (11:57 +0100)
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

Change-Id: Ibcde7bd35cab1d81e26c72e9247d63cf7bce1504

cmds/dumpstate/dumpstate.cpp

index 4161bd7..1e0943f 100644 (file)
@@ -930,8 +930,10 @@ static void AddAnrTraceDir(const bool add_to_zip, const std::string& anr_traces_
                  "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());