Implement stats logging in LMKD.
It implements logging of following atoms:
-- LMK_STATE_CHANGED
-- LMK_KILL_OCCURRED
We would like to gather memory metrics of the process killed by LMKD
because by gathering this info we would be able to analyze and improve
system health by potentially reducing memory footprint of the process.
This feature would be available on production builds.
To know more about this see: http://go/android-p-memory-metrics
Bug: 65738734
Test: Tested manually
Change-Id: I064e0cdcb47c3b4c95d8b8d5654050c9812008d8
diff --git a/lmkd/statslog.h b/lmkd/statslog.h
index ea05fa6..6a27030 100644
--- a/lmkd/statslog.h
+++ b/lmkd/statslog.h
@@ -19,6 +19,12 @@
#include <sys/cdefs.h>
__BEGIN_DECLS
+/*
+ * The single event tag id for all stats logs.
+ * Keep this in sync with system/core/logcat/event.logtags
+ */
+const static int kStatsEventTag = 1937006964;
+
/**
* Logs the change in LMKD state which is used as start/stop boundaries for logging
* LMK_KILL_OCCURRED event.