Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 628f0c2a authored by Kevin Rocard's avatar Kevin Rocard Committed by android-build-merger
Browse files

Merge "Add dumpsys finish timestamp" into oc-mr1-dev

am: 3b11ed3f

Change-Id: I8e9c07c8f1e62e43561c9b1ea4d4b4c9f9e654b9
parents 8aa3aaec 3b11ed3f
Loading
Loading
Loading
Loading
+9 −1
Original line number Original line Diff line number Diff line
@@ -16,6 +16,7 @@


#include <algorithm>
#include <algorithm>
#include <chrono>
#include <chrono>
#include <iomanip>
#include <thread>
#include <thread>


#include <android-base/file.h>
#include <android-base/file.h>
@@ -282,7 +283,14 @@ int Dumpsys::main(int argc, char* const argv[]) {
              std::chrono::duration<double> elapsed_seconds =
              std::chrono::duration<double> elapsed_seconds =
                  std::chrono::steady_clock::now() - start;
                  std::chrono::steady_clock::now() - start;
              aout << StringPrintf("--------- %.3fs ", elapsed_seconds.count()).c_str()
              aout << StringPrintf("--------- %.3fs ", elapsed_seconds.count()).c_str()
                   << "was the duration of dumpsys " << service_name << endl;
                   << "was the duration of dumpsys " << service_name;

              using std::chrono::system_clock;
              const auto finish = system_clock::to_time_t(system_clock::now());
              std::tm finish_tm;
              localtime_r(&finish, &finish_tm);
              aout << ", ending at: " << std::put_time(&finish_tm, "%Y-%m-%d %H:%M:%S")
                   << endl;
            }
            }
        } else {
        } else {
            aerr << "Can't find service: " << service_name << endl;
            aerr << "Can't find service: " << service_name << endl;