8 Commits

Author SHA1 Message Date
Yao Chen
cf3829a696 Disable statsd and make StatsLog no-op if ro.statsd.enable=false
Bug: 79324611
Test: manually tested on marlin_svelte
Change-Id: Ic7fbf86d7c295cb6b2f20e7f9a957d1ed74c42c0
2018-06-06 17:25:08 -07:00
Yao Chen
f7bc6ab7fa Allow StatsLog to directly write to statsd's socket.
+ Reuse the log_event_list from liblog. StatsLog's binary format remains unchanged
+ Copied socket write code from liblog, including the retry logic.
+ Added build flags to control the StatsLog channel (logd, statsd, or both for debugging)

Bug: 78239479
Test: locally tested and saw logs being written to statsd

Change-Id: I7b1f0069ead00bbf3c29e4bd5b7f363a7ce26abe
2018-04-20 14:52:01 -07:00
yro
e26c97b565 Remove bad configs by counting the number of statsd deaths
Bug: 75968642
Test: manual testing, statsd_test, cts test
Change-Id: Ie23e9003163b8dc554bcdc9811850091cd894000
2018-03-29 21:44:55 -07:00
Yao Chen
2346a22e78 Put statsd on system-background cpu set.
Bug: 72176997
Test: manual
Change-Id: Ic160dc8ffea8fd349185ad8b583e6c02dc7defa6
2018-01-18 16:37:10 -08:00
yro
079cea9a7e Create /data/misc/stats-data/ and /data/misc/stats-service/ in statsd.rc
rather than during the runtime of statsd

The purpose of this change is to prevent causing selinux violation by
trying to mkdir to /data/misc/ directory when statsd doesn't have
permission to do so.

Bug: 71537285
Test: manually tested to make sure that there's no sepolicy violation

Change-Id: I9c4ccecc416f41923c9b24dd44a388d135fecc07
2018-01-12 13:51:48 -08:00
Yao Chen
0f2171041e make statsd run in its own uid
+ Assign permission android.permission.STATSCOMPANION to statsd
+ Fixes in StatsCompanionService to allow statsd to get uid mapping

Test: manual
Change-Id: I3e6ca79eefed7f93a4588578c156321c4c278fd3
2018-01-11 11:58:10 -08:00
yro
b19dc2467b Update statsd's user/group from root to system to avoid selinux policy
violation

Bug: 71537285
Bug: 69853944
Test: manual verification to check there's no sepolicy violation

Change-Id: I639cf5c9f4ac6c434c3122c4f42fdf8bdac721f6
2018-01-10 22:26:30 -08:00
Joe Onorato
5dcbc6c015 Add statsd.
It doesn't start yet by default. When you start it manually, it sets
itself up as a binder system service and starts a thread to read the
event log.

Test: Run statsd, observe output. also run stats_test
Change-Id: If435d6a80fef3c1d957aedb61699bf5e9aae7e56
2017-08-30 12:36:31 -07:00