diff options
author | Xin Li <delphij@google.com> | 2024-03-06 09:30:17 -0800 |
---|---|---|
committer | Xin Li <delphij@google.com> | 2024-03-06 09:30:17 -0800 |
commit | e91bcfd8f086ce655829a5525a0cf343a997f79e (patch) | |
tree | 6641cd453aa9c53c2bc7f1a69a26923117a9e9ef | |
parent | beedacbfa3585241b9b692796de56af9bb7ccb0a (diff) | |
parent | 75336bb0924f6ccbe8400c19b74e53a5be3e3862 (diff) | |
download | logging-e91bcfd8f086ce655829a5525a0cf343a997f79e.tar.gz |
Merge Android 14 QPR2 to AOSP main
Bug: 319669529
Merged-In: If6b6f432788557a109b10fb255c6ee49705b8bfd
Change-Id: Ie620cd6e1d01ba9b1c3b8f9497b9773ba342dcdc
-rw-r--r-- | logd/LogStatistics.cpp | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/logd/LogStatistics.cpp b/logd/LogStatistics.cpp index 52954958..173b7330 100644 --- a/logd/LogStatistics.cpp +++ b/logd/LogStatistics.cpp @@ -111,21 +111,14 @@ char* pidToName(pid_t pid) { } void LogStatistics::AddTotal(log_id_t log_id, uint16_t size) { - if (!enable) { - return; - } - auto lock = std::lock_guard{lock_}; + mSizesTotal[log_id] += size; SizesTotal += size; ++mElementsTotal[log_id]; } void LogStatistics::Add(LogStatisticsElement element) { - if (!enable) { - return; - } - auto lock = std::lock_guard{lock_}; if (!track_total_size_) { @@ -188,10 +181,6 @@ void LogStatistics::Add(LogStatisticsElement element) { } void LogStatistics::Subtract(LogStatisticsElement element) { - if (!enable) { - return; - } - auto lock = std::lock_guard{lock_}; if (!track_total_size_) { @@ -242,10 +231,6 @@ const char* LogStatistics::UidToName(uid_t uid) const { // caller must own and free character string const char* LogStatistics::UidToNameLocked(uid_t uid) const { - if (!enable) { - return strdup("logd"); - } - // Local hard coded favourites if (uid == AID_LOGD) { return strdup("auditd"); @@ -587,10 +572,6 @@ std::string LogStatistics::FormatTable(const LogHashtable<TKey, TEntry>& table, } std::string LogStatistics::ReportInteresting() const { - if (!enable) { - return std::string(""); - } - auto lock = std::lock_guard{lock_}; std::vector<std::string> items; @@ -616,10 +597,6 @@ std::string LogStatistics::ReportInteresting() const { } std::string LogStatistics::Format(uid_t uid, pid_t pid, unsigned int logMask) const { - if (!enable) { - return std::string(""); - } - auto lock = std::lock_guard{lock_}; static const uint16_t spaces_total = 19; |