logd: improve details on chatty records
- Report applications UID, TID/PID by name.
- change wording to have an accurate connotation
- drop privilege check since filtered upstream
Bug: 19608965
Bug: 20334069
Bug: 20370119
Change-Id: I2b1c26580b4c2de293874214ff5ae745546f3cca
diff --git a/logd/LogBufferElement.h b/logd/LogBufferElement.h
index 7b6456d..059c031 100644
--- a/logd/LogBufferElement.h
+++ b/logd/LogBufferElement.h
@@ -28,15 +28,19 @@
namespace android {
// Furnished in main.cpp. Caller must own and free returned value
-// This function is designed for a single caller and is NOT thread-safe
char *uidToName(uid_t uid);
+// Furnished in LogStatistics.cpp. Caller must own and free returned value
+char *pidToName(pid_t pid);
+
}
static inline bool worstUidEnabledForLogid(log_id_t id) {
return (id != LOG_ID_CRASH) && (id != LOG_ID_EVENTS);
}
+class LogBuffer;
+
class LogBufferElement {
const log_id_t mLogId;
const uid_t mUid;
@@ -52,7 +56,8 @@
static atomic_int_fast64_t sequence;
// assumption: mMsg == NULL
- size_t populateDroppedMessage(char *&buffer, bool privileged);
+ size_t populateDroppedMessage(char *&buffer,
+ LogBuffer *parent);
public:
LogBufferElement(log_id_t log_id, log_time realtime,
@@ -78,7 +83,7 @@
log_time getRealTime(void) const { return mRealTime; }
static const uint64_t FLUSH_ERROR;
- uint64_t flushTo(SocketClient *writer);
+ uint64_t flushTo(SocketClient *writer, LogBuffer *parent);
};
#endif