summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYao Chen2017-12-01 17:48:19 -0600
committerYao Chen2017-12-04 12:07:12 -0600
commit025f05a2256f01edc49ab6ae158a7f2f170bcf67 (patch)
treed1a71e4807496e5450d0ed0900e4e844b1229da8
parent5470a12513b423be2b23a94e7214f2a5bd950ad9 (diff)
downloadplatform-system-core-025f05a2256f01edc49ab6ae158a7f2f170bcf67.tar.gz
platform-system-core-025f05a2256f01edc49ab6ae158a7f2f170bcf67.tar.xz
platform-system-core-025f05a2256f01edc49ab6ae158a7f2f170bcf67.zip
make log.tag.stats_log work for stats buffer.
Test: adb shell setprop log.tag.stats_log S And saw the stats logs are silent. Change-Id: I7a9313f5f12029f9b8a8f070de1e1db659675525
-rw-r--r--liblog/logger_write.c2
-rw-r--r--logd/LogBuffer.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/liblog/logger_write.c b/liblog/logger_write.c
index 589ce8429..d03a2b674 100644
--- a/liblog/logger_write.c
+++ b/liblog/logger_write.c
@@ -270,7 +270,7 @@ static int __write_to_log_daemon(log_id_t log_id, struct iovec* vec, size_t nr)
270 /* If only we could reset downstream logd counter */ 270 /* If only we could reset downstream logd counter */
271 return -EPERM; 271 return -EPERM;
272 } 272 }
273 } else if (log_id == LOG_ID_EVENTS) { 273 } else if (log_id == LOG_ID_EVENTS || log_id == LOG_ID_STATS) {
274 const char* tag; 274 const char* tag;
275 size_t len; 275 size_t len;
276 EventTagMap *m, *f; 276 EventTagMap *m, *f;
diff --git a/logd/LogBuffer.cpp b/logd/LogBuffer.cpp
index 43362fb5a..560f490cf 100644
--- a/logd/LogBuffer.cpp
+++ b/logd/LogBuffer.cpp
@@ -213,7 +213,7 @@ int LogBuffer::log(log_id_t log_id, log_time realtime, uid_t uid, pid_t pid,
213 int prio = ANDROID_LOG_INFO; 213 int prio = ANDROID_LOG_INFO;
214 const char* tag = nullptr; 214 const char* tag = nullptr;
215 size_t tag_len = 0; 215 size_t tag_len = 0;
216 if (log_id == LOG_ID_EVENTS) { 216 if (log_id == LOG_ID_EVENTS || log_id == LOG_ID_STATS) {
217 tag = tagToName(elem->getTag()); 217 tag = tagToName(elem->getTag());
218 if (tag) { 218 if (tag) {
219 tag_len = strlen(tag); 219 tag_len = strlen(tag);