Major changes include:
- Removing unused permission checks within StatsService. These
include ENFORCE_DUMP_AND_USAGE_STATS, checkDumpAndUsageStats,
kOpUsage, and kPermissionUsage.
- Converting from sp to shared_ptr
- Using libbinder_ndk functions instead of libbinder functions
(e.g. for installing death recipients, getting calling uids, etc.)
- New death recipients were added in StatsService,
ConfigManager, and SubscriberReporter.
- Using a unique token (timestamp) to identify shell subscribers
instead of IResultReceiver because IResultReceiver is not exposed by
libbinder_ndk. Currently, statsd cannot detect if perfd dies; we
will fix that later.
Bug: 145232107
Bug: 148609603
Test: m statsd
Test: m statsd_test
Test: bit stastd_test:*
Test: atest GtsStatsdHostTestCases
Change-Id: Ia1fda7280c22320bc4ebc8371acaadbe8eabcbd2
The unit tests relied on kPullAllAtomInfo containing the correct
information.
This static map is no longer correct, since pullers are registered, but
will not be registered in the test environment. This cl changes the map
to not be static, and for the pullers to contain their own metadata.
Test: bit statsd_test:*
Test: adb shell cmd stats pull-source (various atoms)
Test: atest GtsStatsdHostTestCases
Change-Id: I0555a5ab1b4d15a6cd0b0dbcd49d856c93de7aa6
Now that we're using statsd's C api, we can define the puller callback
in the surfaceflinger process directly.
Bug: 119885568
Test: builds
Change-Id: Ieb6a843c26cf7f19142e05cc170beedbd1af14d9
Clients don't need to know about statsd metadata. Extract out metadata
from statslog.h/cpp into atoms_info.h/cpp which is only used by statsd.
Generated atoms_info.h: https://paste.googleplex.com/6303016724463616
Generated atoms_info.cpp: https://paste.googleplex.com/5717940978581504
Test: m -j
Test: old metadata in statslog matches the metadata in
atoms_info
Test: Flashes successfully
Test: adb logcat "*:S statsd:*"
Change-Id: I56ef3cc4ea1fbd2cd0130d4e9576b242efb9f627
Tests 4 key things: A successful pull, a failed pull and two timeout
cases.
Timeout case 1: StatsPullerCallback should stop early and return true.
Timeout case 2: StatsCallback should note that the pull timed out,
notify statsd stats, and return false.
Test: bit statsd_test:*
Bug: 145310627
Change-Id: Id87089f04e1cf54a622b3f15585341ecdcd21f7f
This can be used for sending a broadcast to an app which incidentd
would share the incident report with.
Test: added unit test in statsd_test
Change-Id: Ieaf5b3b4d67168e2a99ff54e6392c77d8372ed4e
1) Refactor pullers and add tests.
2) Add timeout to a puller.
mPullTimeoutNs is intrinsic to puller. A pull taking longer than this is
deemed failed and the data discarded.
A metric or StatsPullerManager requesting a pull should monitor the pull
and have deadlineNs. A successful pull may come later than desired due
to statsd processing delays.
3) Add unit tests to puller now that the base puller is more
complicated.
Bug: 118756964
Test: unit test
Change-Id: I0e5d47e2527391f7beef4b2d06bfd5c2f82f1179
This reverts commit 9c7b1319962673658ee28a7845fc0a7cf840c61e.
Reason for revert: Fixed build failures due to merge
Change-Id: I7d7bfed3a3234b966f3fe3fd6e0cbc63d2bedf83
Test: unit test
This reverts commit ce8e4dce609541f90c444f27250a6a341b3f1d23.
Reason for revert: breaking multiple targets in master
Change-Id: I3ee74b314e06cb2c4d3d6da82ca116a91aad67d4
use same cpu stats readers with BatteryStats so that
1) both throttle to avoid too frequent pulls
2) cached value is served within throttle interval to avoid double
pulling by both statsd and BatteryStats
To run unit tests:
bit FrameworksCoreTests:com.android.internal.os.KernelUidCpuFreqTimeReaderTest
bit FrameworksCoreTests:com.android.internal.os.KernelUidCpuClusterTimeReaderTest
bit FrameworksCoreTests:com.android.internal.os.KernelUidCpuActiveTimeReaderTest
make -j56 statsd_test && adb sync data && adb shell /data/nativetest64/statsd_test/statsd_test
Test: cts test, unit test
Fix: 73745189
Fix: 73780619
Fix: 73360959
Change-Id: I10a9bc91ca67fa812f4cd71c4fbd73c1a5ba580e