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

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

Merge "Add command to clear puller cache"

parents e800fd8e e72252b6
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -41,6 +41,8 @@ statsd_common_src := \
    src/external/ResourceHealthManagerPuller.cpp \
    src/external/CpuTimePerUidPuller.cpp \
    src/external/CpuTimePerUidFreqPuller.cpp \
    src/external/KernelUidCpuActiveTimeReader.cpp \
    src/external/KernelUidCpuClusterTimeReader.cpp \
    src/external/StatsPullerManagerImpl.cpp \
    src/logd/LogEvent.cpp \
    src/logd/LogListener.cpp \
+6 −0
Original line number Diff line number Diff line
@@ -551,6 +551,12 @@ status_t StatsService::cmd_dump_memory_info(FILE* out) {
    return NO_ERROR;
}

status_t StatsService::cmd_clear_puller_cache(FILE* out) {
    mStatsPullerManager.ClearPullerCache();
    fprintf(out, "Puller cached data removed!\n");
    return NO_ERROR;
}

Status StatsService::informAllUidData(const vector<int32_t>& uid, const vector<int64_t>& version,
                                      const vector<String16>& app) {
    VLOG("StatsService::informAllUidData was called");
+5 −0
Original line number Diff line number Diff line
@@ -197,6 +197,11 @@ private:
     */
    status_t cmd_dump_memory_info(FILE* out);

  /*
     * Clear all puller cached data
     */
  status_t cmd_clear_puller_cache(FILE* out);

    /**
     * Update a configuration.
     */
+5 −0
Original line number Diff line number Diff line
@@ -59,6 +59,11 @@ bool StatsPuller::Pull(std::vector<std::shared_ptr<LogEvent>>* data) {
    return ret;
}

void StatsPuller::ClearCache() {
    lock_guard<std::mutex> lock(mLock);
    mCachedData.clear();
}

}  // namespace statsd
}  // namespace os
}  // namespace android
+2 −0
Original line number Diff line number Diff line
@@ -38,6 +38,8 @@ public:

    bool Pull(std::vector<std::shared_ptr<LogEvent>>* data);

    void ClearCache();

protected:
    // The atom tag id this puller pulls
    const int mTagId;
Loading