summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Salyzyn2014-10-13 11:59:37 -0500
committerMark Salyzyn2014-12-05 14:56:44 -0600
commiteb06de716b4f33e9fdb1c41f0cce61084545bfd5 (patch)
treea27f67c9f70ef4c694216f5f7b503e738dc7d456 /logd/LogAudit.h
parente0a5ab5d56a3488377262e8fd14d3a90b7d74696 (diff)
downloadplatform-system-core-eb06de716b4f33e9fdb1c41f0cce61084545bfd5.tar.gz
platform-system-core-eb06de716b4f33e9fdb1c41f0cce61084545bfd5.tar.xz
platform-system-core-eb06de716b4f33e9fdb1c41f0cce61084545bfd5.zip
logd: auditd remove logDmesg method
- logDmesg method consumes considerable memory resources (typically 128KB depending on kernel) - In the future (eg: klogd, syslogd) there may be need to feed multiple logs or threads with the retrieved data. - By moving the actions of logDmesg into the mainline that instantiates the thread objects, we can leverage a single allocation of the the kernel log allocation. - logDmesg (private) is replaced with log (public) which has a more useful and descriptive purpose for the class. Change-Id: Ie2dd0370661493c1e596a7e486904a0e8caab9ff
Diffstat (limited to 'logd/LogAudit.h')
-rw-r--r--logd/LogAudit.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/logd/LogAudit.h b/logd/LogAudit.h
index 111030a89..f977be983 100644
--- a/logd/LogAudit.h
+++ b/logd/LogAudit.h
@@ -24,16 +24,17 @@ class LogAudit : public SocketListener {
24 LogBuffer *logbuf; 24 LogBuffer *logbuf;
25 LogReader *reader; 25 LogReader *reader;
26 int fdDmesg; 26 int fdDmesg;
27 bool initialized;
27 28
28public: 29public:
29 LogAudit(LogBuffer *buf, LogReader *reader, int fdDmesg); 30 LogAudit(LogBuffer *buf, LogReader *reader, int fdDmesg);
31 int log(char *buf);
30 32
31protected: 33protected:
32 virtual bool onDataAvailable(SocketClient *cli); 34 virtual bool onDataAvailable(SocketClient *cli);
33 35
34private: 36private:
35 static int getLogSocket(); 37 static int getLogSocket();
36 void logDmesg();
37 int logPrint(const char *fmt, ...) 38 int logPrint(const char *fmt, ...)
38 __attribute__ ((__format__ (__printf__, 2, 3))); 39 __attribute__ ((__format__ (__printf__, 2, 3)));
39}; 40};