summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Felipe Leme <felipeal@google.com> 2017-12-05 09:30:09 -0800
committer Felipe Leme <felipeal@google.com> 2017-12-05 09:32:13 -0800
commit7709f8a5e62a67c6df06f68bddcc2a1036bd62bb (patch)
tree3e481e9d1df30f76f61ea0f0e28935231f58205d
parent13dd603c8e138d670bd2ef5a02bda0b059f6eb67 (diff)
Added -p to uptime command on header (and changed it to run always)
Test: manual verification Test: mmm -j32 frameworks/native/cmds/dumpstate/ && adb sync && \ adb shell /data/nativetest/dumpstate_test/dumpstate_test && \ adb shell /data/nativetest64/dumpstate_test/dumpstate_test && \ printf "\n\n#### GOOD NEWS, EVERYONE: ALL TESTS PASSED! ####\n" Bug: 65205261 Change-Id: Ide1aa2dc9f3446f9597433867445dd07731ae563
-rw-r--r--cmds/dumpstate/dumpstate.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/cmds/dumpstate/dumpstate.cpp b/cmds/dumpstate/dumpstate.cpp
index 4b67d8f1a0..2e3e3caeb0 100644
--- a/cmds/dumpstate/dumpstate.cpp
+++ b/cmds/dumpstate/dumpstate.cpp
@@ -691,7 +691,9 @@ void Dumpstate::PrintHeader() const {
printf("Kernel: ");
DumpFileToFd(STDOUT_FILENO, "", "/proc/version");
printf("Command line: %s\n", strtok(cmdline_buf, "\n"));
- ds.RunCommand("UPTIME", {"uptime"}, CommandOptions::DEFAULT);
+ printf("Uptime: ");
+ RunCommandToFd(STDOUT_FILENO, "", {"uptime", "-p"},
+ CommandOptions::WithTimeout(1).Always().Build());
printf("Bugreport format version: %s\n", version_.c_str());
printf("Dumpstate info: id=%d pid=%d dry_run=%d args=%s extra_options=%s\n", id_, pid_,
PropertiesHelper::IsDryRun(), args_.c_str(), extra_options_.c_str());
@@ -1093,7 +1095,6 @@ static void dumpstate() {
DurationReporter duration_reporter("DUMPSTATE");
dump_dev_files("TRUSTY VERSION", "/sys/bus/platform/drivers/trusty", "trusty_version");
- /* TODO: Remove duplicate uptime call when tools use it from header */
RunCommand("UPTIME", {"uptime"});
DumpBlockStatFiles();
dump_emmc_ecsd("/d/mmc0/mmc0:0001/ext_csd");