summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2021-04-09 16:41:09 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2021-04-09 16:41:09 +0000
commit748a568a4b33defbfb8ff93c8ade9da16569db94 (patch)
treed038e6c70157dd7002d0ab1b600bb6ee325ec5c3
parent4cadfe8cc0f306101f25d5614a40560913a9173b (diff)
parentf2af4d880662b791e0457d9b8727fd8399722bc7 (diff)
Merge "Add storage state and installation ts to dump." into sc-dev
-rw-r--r--services/incremental/IncrementalService.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/services/incremental/IncrementalService.cpp b/services/incremental/IncrementalService.cpp
index 388f9329829d..11a700c8ef9f 100644
--- a/services/incremental/IncrementalService.cpp
+++ b/services/incremental/IncrementalService.cpp
@@ -390,6 +390,11 @@ static const char* toString(IncrementalService::BindKind kind) {
}
}
+template <class Duration>
+static long elapsedMcs(Duration start, Duration end) {
+ return std::chrono::duration_cast<std::chrono::microseconds>(end - start).count();
+}
+
void IncrementalService::onDump(int fd) {
dprintf(fd, "Incremental is %s\n", incfs::enabled() ? "ENABLED" : "DISABLED");
dprintf(fd, "Incremental dir: %s\n", mIncrementalDir.c_str());
@@ -407,6 +412,13 @@ void IncrementalService::onDump(int fd) {
dprintf(fd, " mountId: %d\n", mnt.mountId);
dprintf(fd, " root: %s\n", mnt.root.c_str());
dprintf(fd, " nextStorageDirNo: %d\n", mnt.nextStorageDirNo.load());
+ dprintf(fd, " flags: %d\n", int(mnt.flags));
+ if (mnt.startLoadingTs.time_since_epoch() == Clock::duration::zero()) {
+ dprintf(fd, " not loading\n");
+ } else {
+ dprintf(fd, " startLoading: %llds\n",
+ (long long)(elapsedMcs(mnt.startLoadingTs, Clock::now()) / 1000000));
+ }
if (mnt.dataLoaderStub) {
mnt.dataLoaderStub->onDump(fd);
} else {
@@ -1767,11 +1779,6 @@ void IncrementalService::prepareDataLoaderLocked(IncFsMount& ifs, DataLoaderPara
}
template <class Duration>
-static long elapsedMcs(Duration start, Duration end) {
- return std::chrono::duration_cast<std::chrono::microseconds>(end - start).count();
-}
-
-template <class Duration>
static constexpr auto castToMs(Duration d) {
return std::chrono::duration_cast<std::chrono::milliseconds>(d);
}