From eb06de716b4f33e9fdb1c41f0cce61084545bfd5 Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Mon, 13 Oct 2014 09:59:37 -0700 Subject: 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 --- logd/LogAudit.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'logd/LogAudit.h') diff --git a/logd/LogAudit.h b/logd/LogAudit.h index 111030a..f977be9 100644 --- a/logd/LogAudit.h +++ b/logd/LogAudit.h @@ -24,16 +24,17 @@ class LogAudit : public SocketListener { LogBuffer *logbuf; LogReader *reader; int fdDmesg; + bool initialized; public: LogAudit(LogBuffer *buf, LogReader *reader, int fdDmesg); + int log(char *buf); protected: virtual bool onDataAvailable(SocketClient *cli); private: static int getLogSocket(); - void logDmesg(); int logPrint(const char *fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3))); }; -- cgit v1.1