26 Commits

Author SHA1 Message Date
Jeffrey Huang
1e4368aa43 Comment out Statsd tests
Added todos to make them ues the new schema.

Bug: 145923087
Test: m -j && bit statsd_test:*
Change-Id: I0749760eb3123407b78b9ace9a93967bac727bf5
2020-02-18 18:36:02 -08:00
Ruchir Rastogi
e449b0c185 Move statsd (and tests) to libbinder_ndk
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
2020-02-14 18:07:37 -08:00
Yiwei Zhang
b761c68119 GpuStats: migrate to new statsd native puller api
Bug: 148421389
Test: build, flash and boot
Change-Id: I3731bb1fb16931e0dc9e57d3e38355899364d2c4
2020-02-05 21:04:37 -08:00
Joe Onorato
758bc85bf7 Merge changes from topic "b_144187174"
* changes:
  Remove this TEST_MAPPING file until I can figure out what this error means
  Make libincident into a stable C API.
2020-02-06 03:09:52 +00:00
Joe Onorato
255ffff56d Make libincident into a stable C API.
Test: atest GtsIncidentConfirmationTestCases GtsIncidentManagerTestCases libincident_test
Bug: 144187174
Change-Id: I65b5a13cfb6a57aa56f738e25a76c5ecb8e7a1a8
2020-02-05 08:29:23 -08:00
Tej Singh
b26d044a75 Update libstatssocket/pull API council feedback
ALso, removes KeyValuePairs support from libstatssocket

Test: make
Test: atest libstatssocket_test
Test: atest statsd_test
Test: atest LibStatsPullTests
Test: statsd_testdrive 10068
Change-Id: I3a5d0e66f00cea5897e0db33cb769bf6ea67f320
2020-02-03 18:01:31 -08:00
Tej Singh
5b4951b6a1 Fix failing puller unit tests
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
2020-01-24 17:59:46 -08:00
Alec Mouri
9724a45515 [SfStats] Remove puller implementation from statsd
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
2020-01-09 09:25:41 -08:00
TreeHugger Robot
ebab3d10cb Merge "GpuStats: track whether the app creates ES1 context" 2020-01-03 23:51:00 +00:00
Yiwei Zhang
f02cf6b7d5 GpuStats: track whether the app creates ES1 context
Bug: 146661131
Test: atest statsd_test:GpuStatsPuller_test
Change-Id: If2acabfca38fad08d4245c2bac643ca5fc87c1d7
2019-12-20 14:51:07 -08:00
Muhammad Qureshi
c8e226610c Move statsd metadata from statslog to atoms_info
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
2019-12-17 12:59:01 -08:00
Tej Singh
89817631b5 Puller API: Unit tests.
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
2019-12-10 15:10:54 -08:00
Alec Mouri
1dc5f1ed1b [SfStats] Implement global atom puller for SfStats
Bug: 119885568
Bug: 136597024
Test: adb shell cmd stats pull-source 10062
Test: statsd_testdrive 10062
Test: atest statsd_test
Change-Id: Ib113066faf67f6abba6cd377aaf1fe17cf16d4d0
2019-09-24 17:15:09 -07:00
Yiwei Zhang
a763861452 GpuStats: track Vulkan apps not doing pre-rotation correctly
Bug: 135210726
Test: atest statsd_test:GpuStatsPuller_test
Change-Id: I9e44e95876dd6d09025e877f450736b6ea9d5da8
2019-07-03 17:34:12 -07:00
Yiwei Zhang
7c70930267 GpuStats: track CPU Vulkan implementation usage
Bug: 131927737
Test: atest GpuStatsPuller_test
Change-Id: I003f6a169886bf1acf131a7dd4811ebd48e4120e
2019-05-09 23:46:53 +00:00
Yiwei Zhang
a0f5fefb8f GpuStats: Track ANGLE usage info
Bug: 132285967
Test: atest GpuStatsPuller_test
Change-Id: I1763624fe705b6d3a3ccc3bdbddfa573362ddc27
2019-05-08 17:05:54 -07:00
Yiwei Zhang
63852d2a06 GpuStats: add render api versions to global stats
Bug: 131866357
Test: atest GpuStatsPuller_test
Change-Id: I7875c3dd7935297519d68cd1d16277928ab2e53b
2019-05-06 19:31:20 -07:00
Joe Onorato
99598ee6ee incidentd can now handle multiple callers asking it for incident reports
Test: bit incident_test:* GtsIncidentManagerTestCases:*
Bug: 123543706
Change-Id: I9f671dd5d8b2ad139f952a23e575c2be16120459
2019-03-26 11:20:48 -07:00
Yiwei Zhang
d476542338 Game Driver Metrics: add tests for GpuStatsPuller
Bug: 123529932
Test: atest GpuStatsPuller_test
Change-Id: I325f90d203539b51ee0a9deb2b048b8671e5e89a
2019-03-12 15:29:49 -07:00
Yao Chen
a8e78b9b88 Add receiver info to IncidentdDetails in statsd_config
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
2019-03-04 23:47:27 -08:00
Chenjie Yu
0bd73dbaac Puller refactor
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
2018-12-21 09:46:09 -08:00
Chenjie Yu
d7e3a228be Revert "Revert "support work chain in pulled atoms""
This reverts commit 9c7b1319962673658ee28a7845fc0a7cf840c61e.

Reason for revert: Fixed build failures due to merge

Change-Id: I7d7bfed3a3234b966f3fe3fd6e0cbc63d2bedf83
Test: unit test
2018-11-28 15:53:09 -08:00
Fabian Kozynski
9c7b131996 Revert "support work chain in pulled atoms"
This reverts commit ce8e4dce609541f90c444f27250a6a341b3f1d23.

Reason for revert: breaking multiple targets in master

Change-Id: I3ee74b314e06cb2c4d3d6da82ca116a91aad67d4
2018-11-28 20:13:22 +00:00
Chenjie Yu
ce8e4dce60 support work chain in pulled atoms
+ also rewrite map and merge isolated uid to host uid.

output:
Pull from 10014: { 1541137009000000000 10430748770707
(10014)0x2010101->1[I] 0x2010182->lala1[S] 0x2010201->2[I]
0x2018282->lala2[S] 0x20000->10430750[L]  }

Bug: 119043339
Bug: 117975376
Test: unit test
Change-Id: Ib6e3ea0f76594438ee1b3e12e965d85fefb405d7
2018-11-20 16:15:31 -08:00
Chenjie Yu
f248047d74 Refactor cpu stats pullers
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
2018-03-05 15:47:39 -08:00
Chenjie Yu
80f9112aec Pullers merge isolated process with host
Test: unit test
Change-Id: Idcb4d19e1f5182554b503c5a35fbde4da146835c
Fix: 72230210
2018-02-07 22:16:50 +00:00