diff options
author | Mark Salyzyn <salyzyn@google.com> | 2016-12-13 10:31:29 -0800 |
---|---|---|
committer | Mark Salyzyn <salyzyn@google.com> | 2016-12-15 16:31:51 -0800 |
commit | a2c022257c5bed56fbc47de25c5d909bbe880f7b (patch) | |
tree | 942f74b4d39c69404de7bb089c38a0cf5ff861f1 /logd/LogBufferElement.h | |
parent | bb612a356a7fce97c29558d41f8fce1944313d30 (diff) | |
download | core-a2c022257c5bed56fbc47de25c5d909bbe880f7b.tar.gz core-a2c022257c5bed56fbc47de25c5d909bbe880f7b.tar.bz2 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.h | 2 |
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: LogBufferElement(log_id_t log_id, log_time realtime, uid_t uid, pid_t pid, pid_t tid, const char *msg, unsigned short len); + LogBufferElement(const LogBufferElement &elem); virtual ~LogBufferElement(); bool isBinary(void) const { @@ -79,6 +80,7 @@ public: return mDropped = value; } unsigned short getMsgLen() const { return mMsg ? mMsgLen : 0; } + const char* getMsg() const { return mMsg; } uint64_t getSequence(void) const { return mSequence; } static uint64_t getCurrentSequence(void) { return sequence.load(memory_order_relaxed); } log_time getRealTime(void) const { return mRealTime; } |