From 51a29c8dc445e4fb89860561933e54a231e6ffb4 Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Thu, 6 Feb 2014 14:48:50 -0800 Subject: logd: liblog: logcat: Add Statistics - logd add statistical collection and formatting - liblog add android_logger_get_statistics call - logcat add -S flag - logcat add -b all Change-Id: I521753b1969ecd4590c956aeeb1557d101059d67 --- logd/LogBuffer.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'logd/LogBuffer.h') diff --git a/logd/LogBuffer.h b/logd/LogBuffer.h index 1b50a8f..92dd107 100644 --- a/logd/LogBuffer.h +++ b/logd/LogBuffer.h @@ -25,6 +25,7 @@ #include "LogBufferElement.h" #include "LogTimes.h" +#include "LogStatistics.h" typedef android::List LogBufferElementCollection; @@ -32,8 +33,7 @@ class LogBuffer { LogBufferElementCollection mLogElements; pthread_mutex_t mLogElementsLock; - unsigned long mSizes[LOG_ID_MAX]; - unsigned long mElements[LOG_ID_MAX]; + LogStatistics stats; public: LastLogTimes &mTimes; @@ -50,6 +50,8 @@ public: void clear(log_id_t id); unsigned long getSize(log_id_t id); unsigned long getSizeUsed(log_id_t id); + // *strp uses malloc, use free to release. + size_t formatStatistics(char **strp, uid_t uid, unsigned int logMask); private: void maybePrune(log_id_t id); @@ -57,4 +59,4 @@ private: }; -#endif +#endif // _LOGD_LOG_BUFFER_H__ -- cgit v1.1