summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Salyzyn2016-12-13 12:31:29 -0600
committerMark Salyzyn2016-12-15 18:31:51 -0600
commita2c022257c5bed56fbc47de25c5d909bbe880f7b (patch)
tree942f74b4d39c69404de7bb089c38a0cf5ff861f1 /logd/LogBufferElement.h
parentbb612a356a7fce97c29558d41f8fce1944313d30 (diff)
downloadplatform-system-core-a2c022257c5bed56fbc47de25c5d909bbe880f7b.tar.gz
platform-system-core-a2c022257c5bed56fbc47de25c5d909bbe880f7b.tar.xz
platform-system-core-a2c022257c5bed56fbc47de25c5d909bbe880f7b.zip
logd: record multiple duplicate messages as chatty
If a series of messages arrive from a single source with identical message content payload, then suppress them and generate a chatty report. The checking is done on a per log id basis. This alters the assumption that chatty messages are always at the oldest entries, they now show up in the middle too. To address this change in behavior we print the first line, a chatty reference which internally takes little space, then the last line in the series. This does not conserve processing time in logd, and certainly has no impact on the long path of formatting and submitting log messages from from the source, but it may contribute to memory space and signal to noise savings under heavy spammy loads. Test: gTest liblog-unit-tests, logd-unit-tests & logcat-unit-tests Bug: 33535908 Change-Id: I3160c36d4f4e2f8216f528605a1b3993173f4dec
Diffstat (limited to 'logd/LogBufferElement.h')
-rw-r--r--logd/LogBufferElement.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/logd/LogBufferElement.h b/logd/LogBufferElement.h
index fb7fbed5c..f8ffacd7e 100644
--- a/logd/LogBufferElement.h
+++ b/logd/LogBufferElement.h
@@ -59,6 +59,7 @@ public:
59 LogBufferElement(log_id_t log_id, log_time realtime, 59 LogBufferElement(log_id_t log_id, log_time realtime,
60 uid_t uid, pid_t pid, pid_t tid, 60 uid_t uid, pid_t pid, pid_t tid,
61 const char *msg, unsigned short len); 61 const char *msg, unsigned short len);
62 LogBufferElement(const LogBufferElement &elem);
62 virtual ~LogBufferElement(); 63 virtual ~LogBufferElement();
63 64
64 bool isBinary(void) const { 65 bool isBinary(void) const {
@@ -79,6 +80,7 @@ public:
79 return mDropped = value; 80 return mDropped = value;
80 } 81 }
81 unsigned short getMsgLen() const { return mMsg ? mMsgLen : 0; } 82 unsigned short getMsgLen() const { return mMsg ? mMsgLen : 0; }
83 const char* getMsg() const { return mMsg; }
82 uint64_t getSequence(void) const { return mSequence; } 84 uint64_t getSequence(void) const { return mSequence; }
83 static uint64_t getCurrentSequence(void) { return sequence.load(memory_order_relaxed); } 85 static uint64_t getCurrentSequence(void) { return sequence.load(memory_order_relaxed); }
84 log_time getRealTime(void) const { return mRealTime; } 86 log_time getRealTime(void) const { return mRealTime; }