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

Commit 748a568a authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add storage state and installation ts to dump." into sc-dev

parents 4cadfe8c f2af4d88
Loading
Loading
Loading
Loading
+12 −5
Original line number Diff line number Diff line
@@ -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 {
@@ -1766,11 +1778,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);