1121 Commits

Author SHA1 Message Date
Maggie White
8735b85958 statsd: Add BatteryCycleCount atom
The health HAL specifies a charge cycles path that currently has no
atoms allocated to it. This change will allow statsd to collect this
information. I also ran 'clang-format -i --style=file' on this file.

Bug: 120680509
Test: cts-tradefed run singleCommand cts-dev -m CtsStatsdHostTestCases \
      -t android.cts.statsd.atom.HostAtomTests#testBatteryCycleCount
Test: adb shell cmd stats pull-source 10045
Change-Id: I796b275c5d6880e9d7ec5bc468b55d7dc421ac78
Signed-off-by: Maggie White <maggiewhite@google.com>
2019-01-18 17:24:15 -08:00
Maggie White
fc1aa59dff statsd implementation of USB port overheat event reporting
Bug: 119200347
Test: su 0 ./stats_client -u
Test: Observed USB port overheat event in statsd logs
Change-Id: Ic8801417c54c118e10bb9b631d8e77d68a65c799
Signed-off-by: Maggie White <maggiewhite@google.com>
2019-01-18 16:00:48 -08:00
TreeHugger Robot
837f453cfb Merge "Add GnssNfwNotificationReported and GnssConfigurationReported" 2019-01-18 22:09:29 +00:00
TreeHugger Robot
73dd7c9104 Merge "allow disable partial bucket on app upgrade" 2019-01-18 19:26:40 +00:00
Chenjie Yu
cd1b797c8c allow disable partial bucket on app upgrade
Bug: 112630210
Test: unit test
Change-Id: I2de38d35f14b813d2837455a322acc2e00813e3b
2019-01-18 09:38:39 -08:00
Yu-Han Yang
14d5fb45d4 Add GnssNfwNotificationReported and GnssConfigurationReported
Bug: 122091220
Test: on device using statsd_testdrive
Change-Id: I888ce76ce585589e27dae9bace9da842eb21437f
2019-01-18 08:52:34 -08:00
Felix Lopez Luis
25b35daba8 Merge "Add new atoms to log Downgraded Apps and Low Storage" 2019-01-18 10:30:04 +00:00
Chenjie Yu
b2ecc793af add page fragmentation info into procstats
Bug: 123021121
Test: atest
CtsStatsdHostTestCases:android.cts.statsd.validation.ProcStatsValidationTests#testProcStatsPkgProcStats
Change-Id: Icd60aa6fb3e2787fd0f628edeeab0d5872d2c497
2019-01-17 14:49:19 -08:00
Felix Lopez Luis
d95346a3c6 Add new atoms to log Downgraded Apps and Low Storage
Change-Id: I211696c836cb9c8a7b72e3693ecba3061ca599bf
Bug-Id: b/120911106
Test: refactoring CL. Existing unit tests still pass.
2019-01-17 14:52:02 +00:00
Jack He
d9837c8a9e Atom: Update BluetoothConnectionStateChanged atom
* Use salted hashed Bluetooth device identifier and deprecate old
  ofuscted_id
* Add BluetoothAclConnectionStateChanged and BluetoothScoConnectionStateChanged
  to track ACL and SCO connections

Bug: 112969790
Test: Bluetooth unit test, test drive with statsd
Change-Id: I5398e4caae751e1fe1d6a95fa3bc56d062eb6172
2019-01-16 01:09:12 -08:00
Jack He
ab86dbd20c Atom: Add BluetoothLinkLayerConnectionEvent atom
* Add this atom to report events related to Bluetooth link layer
  connection, including:
  - Obfuscated ID of remote device
  - Connection handle
  - Direction of the connection
  - Type of the connection
  - Associated HCI command and/or event
  - Status code associated with HCI command and/or event
  - Reason code associated with HCI command and/or event
* Add enum definitions for HCI commands and events as defined in the
  Bluetooth 5.0 specification
* Add enum definitions for link type and direction

Bug: 112969790
Test: make, test drive with statsd
Change-Id: I0fdc59274d49ad503e9ba9cf8f49c9d8872a4131
2019-01-15 20:07:32 -08:00
Yu-Han Yang
8a1b51dcc5 Add GnssNiEvent logging
Bug: 122091220
Test: tested locally on device using statsd_testdrive

Change-Id: I45ab9a7b12e6e674f31bc2398d74fa827d6f8f61
2019-01-15 10:38:59 -08:00
TreeHugger Robot
3a13a85fd4 Merge "Log the fact that we don't have a prod key." 2019-01-15 17:42:10 +00:00
Mathew Inwood
610d096754 Log the fact that we don't have a prod key.
Hopefully this will never happen, but better to know if it does.

Test: atest SignedConfigHostTest
Bug: 122579497
Change-Id: I4ecdf94f7963728aecf17a448c7bfbc7dbd5f39e
2019-01-15 11:54:18 +00:00
Lalit Maganti
71d560440d Merge "statsd: add subscription id to Perfetto command line and fix printf bug" 2019-01-15 10:48:42 +00:00
Mathew Inwood
b375be5545 Add westworld logging to signed config.
This will allow verification of how well the feature works in prod, as
well as tracking real time usage once Q is released.

Test: atest CtsSignedConfigHostTests
Test: ./out/host/linux-x86/bin/statsd_testdrive 123

Bug: 110509075
Bug: 122350327
Change-Id: Ibada9490e18cbeee74e18aaa93ba9d0d7d03845e
2019-01-15 08:37:05 +00:00
Frank Li
423b715d48 Merge "correct enum_default_value_name on atoms.proto" 2019-01-15 03:18:58 +00:00
lifr
357b7cfc2d correct enum_default_value_name on atoms.proto
Test: run runtests.sh, make sure no missing test and get all pass
      run /out/host/linux-x86/bin/statsd_testdrive 103
      Got following metric data dump:pass for local test
Bug: 119862317

Change-Id: I4588cec0dea8a4c5a19847a32a6d53bfc5953be7
2019-01-15 02:05:45 +08:00
Lalit Maganti
e5755008ec statsd: add subscription id to Perfetto command line and fix printf bug
This CL adds the id of the subscription triggering Perfetto to the
command line invocation of Perfetto. This is useful to allow for
distinguishing between experiments in post-processing (since the same
alert can be attached to multiple subscriptions).

This also fixes a bug in the same place where the last character of ids
could be cut off if any of the ids are large negative numbers i.e. the
smallest possible int64 is 20 chars long (including the minus sign).
However there were only 19 available digits in the string buffers which
these ids were printed into (the 20th would be the null terminator).
Increase the buffer size by 5 characters to allow for some headroom just
incase we need some in the future.

Bug: 122822046
Change-Id: I9c3ac8cb8b203fd464eee2c72b1228f1a50448b1
2019-01-14 18:01:18 +00:00
Frank Li
2792f56b90 Merge "Correct the atoms.proto name" 2019-01-14 17:34:33 +00:00
Christian Brunschen
f86039e16e Adds Westworld logging of RescueParty reset events.
Adds the RescuePartyResetReported Atom, and uses it in RescueParty.java
to log when a reset is done.
Also adds a small test program that can be built and run manually in
order to test the flow of new log events.

Test: Ran the test program and verified that the events flow through a
local statsd.

Change-Id: I0202dd8c00441d0544aed7de1d6027160b4d9a2b
Bug: 121121998
2019-01-14 11:29:11 +00:00
Chiachang Wang
6ec5ba9a6c Merge "Add data_stall_event.proto to atom.proto" 2019-01-14 07:56:15 +00:00
lifr
030d23aa77 Correct the atoms.proto name
Test: run runtests.sh, make sure no missing test and get all pass
      run /out/host/linux-x86/bin/statsd_testdrive 103
      Got following metric data dump:pass for local test
Bug: 119862317

Change-Id: I4e003a0e392e15b71fb3ee3adf7de669ccf25d76
2019-01-14 15:44:33 +08:00
Chiachang Wang
f6bedc23ae Add data_stall_event.proto to atom.proto
Test: Build pass
Bug: 120452078
Bug: 121185319
Change-Id: I96f74d938663d579e4fea1eee6a4a250d7e21b3a
2019-01-14 11:54:32 +08:00
Chenjie Yu
f910b78004 Move procstats_pkg_proc into its own wrapper
We rely on atom messages having different types to make configs.

Test: manual
Change-Id: I40a7962f4a63e8b6c5c42f5ffec944e822408f03
2019-01-11 16:08:20 -08:00
shawnlin
a75e82d709 Add phase 2 atoms for documentsui
Test: manual
Bug: 111552654

Change-Id: Iabf5e64871aafe885bf2b304a7a0c6e61c8c08da
2019-01-09 09:18:50 +08:00
Yao Chen
5c5513f2c7 Merge "Add a timeout option in shell subscriber." 2019-01-04 17:51:45 +00:00
arangelov
fd9cdcbdee Add ManagedProvisioning to allowed log sources in statsd_testdrive.
Test: manual
Bug: 122346015
Change-Id: I3f4ec145bb331493efb850574a18a50bd893954c
2019-01-04 12:25:43 +00:00
Yao Chen
35cb8d6537 Add a timeout option in shell subscriber.
Test: cts added
Change-Id: I0fe854fcfd5535ed03e502a4cad3f57079b45381
2019-01-03 17:00:39 -08:00
Tej Singh
06ba0a7db0 Merge "Migrate statsd to thermal hal v2" 2019-01-03 22:55:41 +00:00
Adam Bookatz
89e8be4121 Merge "Statsd logs directly from Wifi & add Multicast tag" 2018-12-23 16:40:13 +00:00
TreeHugger Robot
3a26797631 Merge "Statsd: change power units from double to int64" 2018-12-22 02:20:20 +00:00
Bookatz
3dbc13a98b Statsd: change power units from double to int64
Changes the units for the following atoms from mAh to nAs:

DeviceCalculatedPowerUse
DeviceCalculatedPowerBlameUid
DeviceCalculatedPowerBlameOther

and changes them from floats to int64s.

int64 is better supported in statsd. In particular, Anomaly Detection
currently works only for int64, not floats.

The loss in precision here should be minimal or none. These numbers come
from BatteryStats, which calculates them as follows:

BatteryStats reports time in microseconds (us) as a long.
PowerProfile reports current in mA as a double.
  On the power_profile.xml files I have seen, they only have three
  decimal places of precision. So uA precision should suffice.

Thus, the absolute smallest unit of charge BatteryStats can therefore
measure (assuming three digits in the PowerProfile) is nAs. Given that our
measurements are over much longer periods of time than a microsecond, we
should be very safe.

In terms of max value: a phone battery is typically around
4000mAh  ~ 10^13 nAs << max_int64 by many orders of magnitude.

Bug: 119111972

Test: cts-tradefed run cts-dev -m CtsStatsdHostTestCases -t android.cts.statsd.atom.UidAtomTests#testDeviceCalculatedPowerUse
Test: cts-tradefed run cts-dev -m CtsStatsdHostTestCases -t android.cts.statsd.atom.UidAtomTests#testDeviceCalculatedPowerBlameUid

Test: cts-tradefed run cts-dev -m CtsStatsdHostTestCases -t android.cts.statsd.validation.BatteryStatsValidationTests#testPowerUse
Test: cts-tradefed run cts-dev -m CtsStatsdHostTestCases -t android.cts.statsd.validation.BatteryStatsValidationTests#testPowerBlameUid

Change-Id: I1cfd0a05717d7d357b43dd2408c85096599516c7
2018-12-21 12:38:18 -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
Chih-hung Hsieh
93a828adb6 Merge "Fix/suppress statsd google-explicit-constructor warnings" am: 699692402a am: 32dc82a63a
am: b51d2df568

Change-Id: Ia694c1a5824eaecd984f9710926ea9cad4809354
2018-12-21 09:31:14 -08:00
Chih-hung Hsieh
b51d2df568 Merge "Fix/suppress statsd google-explicit-constructor warnings" am: 699692402a
am: 32dc82a63a

Change-Id: I0dbf5428746a8e2bcf3413f65f8eefc2069741e6
2018-12-21 09:15:42 -08:00
Chih-Hung Hsieh
3227aabea6 Fix/suppress statsd google-explicit-constructor warnings
* Add explicit to conversion constructors/operators
* Remove redundant explicit of copy constructors

Bug: 28341362
Test: make with WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=-*,google-explicit-constructor
Change-Id: Ifd0ca9a1afe4a2cb0456a36c69bee1633af5a93a
2018-12-20 15:17:33 -08:00
Ben Murdoch
7b58df821a Refactor statsd_testdrive to support recording N atoms at the same time.
Found this useful in my testing.

Test: make and run statsd_testdrive

Change-Id: I3a9ff22119e79e89890c59be514f9f778aaced73
2018-12-20 19:06:12 +00:00
TreeHugger Robot
534cd89ea8 Merge "Allow events from AID_LMKD in statsd_testdrive." 2018-12-20 17:34:12 +00:00
Ben Murdoch
d36cbf9548 Allow events from AID_LMKD in statsd_testdrive.
Test: ran statsd_testdrive for atom 51 (lmk_kill_occurred), saw events
Change-Id: I2b9c9817813dcf4c0c7fd69a984726c6ef24db20
2018-12-20 11:45:15 +00:00
lifr
157fc55403 Define DNS statistic data atom in atoms.proto file
Test: run runtests.sh, make sure no missing test and get all pass
      run /out/host/linux-x86/bin/statsd_testdrive 103
      Got following metric data dump:pass for local test
Bug: 119862317

Change-Id: I691e46ffe4cb30696d35018032d4a7f7628045d9
2018-12-20 11:09:02 +08:00
Tej Singh
b6070b9c1c Migrate statsd to thermal hal v2
Part 1 of 2 in migrating statsd to thermal hal v2. Updates the
temperature puller to use thermal hal v2.

Bug: 119228310
Test: adb shell cmd stats pull-source 10021 on blueline. Received 8 cpu
temps, 2 gpu, 1 skin, 1 battery, 1 usb, and 1 npu. Did not receive any
bcl or power amplifier

Change-Id: I8804e282ea928c1815c2a29e72728edf9a053988
2018-12-19 19:05:51 -08:00
TreeHugger Robot
90761169e8 Merge "Fix some AppCompacted proto nits post google3 review." 2018-12-20 00:01:42 +00:00
TreeHugger Robot
fcfa0ee9bd Merge "Statsd dumpsys handles multiple and saved configs" 2018-12-19 23:47:29 +00:00
TreeHugger Robot
a034692c81 Merge "StatsService allows uids to impersonate themselves" 2018-12-19 21:20:57 +00:00
Bookatz
c71d901dde Statsd dumpsys handles multiple and saved configs
Statsd dumpsys wasn't handling multiple configs properly. Also, doing a
dump would delete the data that had been saved to disk. This cl fixes
both those issues.

Test: run cts-dev -m CtsStatsdHostTestCases -t android.cts.statsd.atom.HostAtomTests#testDumpsysStats
Change-Id: I5f2f86c70fbcbc1407aae1b1ffeb7fbdb9f67d0e
2018-12-19 12:35:52 -08:00
Ben Murdoch
01720b82cf Fix some AppCompacted proto nits post google3 review.
Clarify some comments and tweak the names of some fields. Binary
structure of the proto remains intact.

Bug: 119988524
Bug: 120600464

Test: verified that statsd_testdrive still works with this atom
Change-Id: I90d8eb522fc23b2ff604bc1e69e4068dc2c4b73a
2018-12-19 18:03:44 +00:00
TreeHugger Robot
7a17e757fb Merge "Fix statsd_test TestOnDumpReportEraseData" 2018-12-18 22:59:45 +00:00
Bookatz
d238657d69 StatsService allows uids to impersonate themselves
Previously, most StatsService calls only allow the caller to specify the
uid if it is Userdebug/EngBuild. This applied even if the caller was
just specifying its own UID; this cl allows such a case. It also allows
ROOT to impersonate SHELL.

Test: Manual testing on userdebug and userbuild devices.
Test: make statsd_test && adb sync data && adb shell data/nativetest64/statsd_test/statsd_test

Change-Id: I2685d13a8dc24d40b5dab8be9842f53be6888ba3
2018-12-18 14:51:08 -08:00
Ben Murdoch
9507158846 Merge "App Compaction: Add westworld atom & statsd logging." 2018-12-18 22:34:22 +00:00