diff options
| author | 2018-09-14 16:57:00 +0100 | |
|---|---|---|
| committer | 2018-09-27 08:47:33 +0000 | |
| commit | ecf80f31772ba8ab6006b08c0c5d79b2619f10b5 (patch) | |
| tree | 94356207343e82776e00db8bf67615a178a82b80 | |
| parent | f3cf54a2f57154035eed4c8506e34ab9b9f75064 (diff) | |
Remove dumping raft logs
Raft has been replaced by logpersistd per b/28633932.
Remove code to handle raft logs.
BUG: 28633932
Test: adb shell /data/nativetest64/dumpstate_test/dumpstate_test
Test: adb bugreport ~/br.zip
Merged-In: I5380ed1367c4dc39a1531a9b3c61a3965fe56981
Change-Id: I5380ed1367c4dc39a1531a9b3c61a3965fe56981
(cherry picked from commit e9a0703322ec261adb50592a05bf0ea9a953cf05)
| -rw-r--r-- | cmds/dumpstate/dumpstate.cpp | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/cmds/dumpstate/dumpstate.cpp b/cmds/dumpstate/dumpstate.cpp index 6cfdb2bf37..618a91f5b1 100644 --- a/cmds/dumpstate/dumpstate.cpp +++ b/cmds/dumpstate/dumpstate.cpp @@ -101,7 +101,6 @@ void add_mountinfo(); #define ALT_PSTORE_LAST_KMSG "/sys/fs/pstore/console-ramoops-0" #define BLK_DEV_SYS_DIR "/sys/block" -#define RAFT_DIR "/data/misc/raft" #define RECOVERY_DIR "/cache/recovery" #define RECOVERY_DATA_DIR "/data/misc/recovery" #define UPDATE_ENGINE_LOG_DIR "/data/misc/update_engine_log" @@ -455,40 +454,6 @@ static void dump_systrace() { } } -static void dump_raft() { - if (PropertiesHelper::IsUserBuild()) { - return; - } - - std::string raft_path = ds.GetPath("-raft_log.txt"); - if (raft_path.empty()) { - MYLOGD("raft_path is empty\n"); - return; - } - - struct stat s; - if (stat(RAFT_DIR, &s) != 0 || !S_ISDIR(s.st_mode)) { - MYLOGD("%s does not exist or is not a directory\n", RAFT_DIR); - return; - } - - CommandOptions options = CommandOptions::WithTimeout(600).Build(); - if (!ds.IsZipping()) { - // Write compressed and encoded raft logs to stdout if it's not a zipped bugreport. - RunCommand("RAFT LOGS", {"logcompressor", "-r", RAFT_DIR}, options); - return; - } - - RunCommand("RAFT LOGS", {"logcompressor", "-n", "-r", RAFT_DIR, "-o", raft_path}, options); - if (!ds.AddZipEntry("raft_log.txt", raft_path)) { - MYLOGE("Unable to add raft log %s to zip file\n", raft_path.c_str()); - } else { - if (remove(raft_path.c_str())) { - MYLOGE("Error removing raft file %s: %s\n", raft_path.c_str(), strerror(errno)); - } - } -} - static bool skip_not_stat(const char *path) { static const char stat[] = "/stat"; size_t len = strlen(path); @@ -2079,9 +2044,6 @@ int run_main(int argc, char* argv[]) { // keep the system stats as close to its initial state as possible. RunDumpsysCritical(); - // TODO: Drop root user and move into dumpstate() once b/28633932 is fixed. - dump_raft(); - /* collect stack traces from Dalvik and native processes (needs root) */ dump_traces_path = dump_traces(); |