logd: object layer format statistics
Simplify table generation by placing the line and header formatting
into each type's (UID, PID, TID) object. Switch to const return
values for the ownership passing functions (*ToName() functions
and methods). Use longer variable names to reduce confusion.
Switch from LINES To NUM for pruned column as that more accurately
reflects what is dropped since one entry can contain several lines.
Bug: 22855208
Change-Id: Ib110dce98a68cf5f844eb30f8a192a1f691eeba2
diff --git a/logd/LogBuffer.h b/logd/LogBuffer.h
index de76693..ac18994 100644
--- a/logd/LogBuffer.h
+++ b/logd/LogBuffer.h
@@ -78,9 +78,9 @@
std::string formatPrune() { return mPrune.format(); }
// helper must be protected directly or implicitly by lock()/unlock()
- char *pidToName(pid_t pid) { return stats.pidToName(pid); }
+ const char *pidToName(pid_t pid) { return stats.pidToName(pid); }
uid_t pidToUid(pid_t pid) { return stats.pidToUid(pid); }
- char *uidToName(uid_t uid) { return stats.uidToName(uid); }
+ const char *uidToName(uid_t uid) { return stats.uidToName(uid); }
void lock() { pthread_mutex_lock(&mLogElementsLock); }
void unlock() { pthread_mutex_unlock(&mLogElementsLock); }