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
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
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
After erasing the statsd data, allow statsd to have an empty report, or
even a report with a non-empty metrics wrapper, as long as it doesn't
have any of the former count metrics in it.
Bug: 77909781
Test: make -j8 statsd_test && adb sync data && adb shell data/nativetest64/statsd_test/statsd_test
Change-Id: I525c61aea97a185df8916e4c1b4c4118493ed780
Keep track of app compaction meta data in statsd for
logging to westworld.
Test: Enable compaction and verified metric collection with statsd_testdrive
Bug: 119988524
Bug: 120600464
Change-Id: If8477019499cc0745b48193e781478f03b399159
Makes LocalDrive quit for devices running P or earlier; the
statsd of such devices lack the --keep_data flag and therefore will
fail anyway, so we may as well the user why and fail fast.
Test: Manual testing on userdebug and userbuild, P and Q
Change-Id: Ia26528383c9d35732ffd819ed2e2ac6f3bb41b34
"Field type 3 is not supported when writing bool val." is being created
as we are trying to log is_active bit as int64.
Bug: 121035918
Test: statsd_test
Change-Id: I3d6ad610411a45caa5b3b99a5b936c6769be3502
field number 13 in stats_log.proto conflicts with a copy in google3/
Bug: 121035918
Test: stats_test
Change-Id: Iadc3a5c227bb361553ba2bee2534cc767d34d7a3
Flip sys.rss_hwm_reset.on property to invoke the binary to reset RSS HWM
counters for all processes.
Test: m -j
Test: ProcessMemoryHighWaterMark pull
Bug: 119598534
Change-Id: I53d8c571b27ddee611193aa36fdbd3d4c88abebd
Test: unit test added
Bug: 120635548
Change-Id: I825b1ce526944a20fe65705508ad180ece37492c
Merged-In: I825b1ce526944a20fe65705508ad180ece37492c
(cherry picked from commit 8e6f9983009eadf32d05ad65e38906d3985bc9ba)
There are an increasing number of requests to log data in complex format to statsd, while the data
is not expected to be parsed or aggregated by statsd and only to be uploaded as events.
Instead of making an exception for each of these cases in a hard coded way, this CL add a feature to
annotate these field in atoms.proto and the stats-log-api-gen tool will produce byte array
interfaces for them.
Note that log_msg does not have byte array type, and only has string type, when statsd receives the
log, these fields are in string type. Only when the atom is written to proto, we will check if this
field should be bytes field and write it to protobuf in message format.
Change-Id: If53dd95c5826710c76d7fe982bf951a435dfc738
Merged-In: If53dd95c5826710c76d7fe982bf951a435dfc738
Fix: 118386797
Bug: 120635548
Test: unit test & manual test
(cherry picked from commit bbdd67d19f4912fbec00220b22e44c68eff5ab3f)
BatteryStats logs when Wifi is 'running' and 'on'.
It appears that 'on' is the Wifi on/off toggle, while 'running'
is Wifi actually working. Right now, only Client Mode is considered
running, which is probably wrong - Hotspot mode should probably be
included too.
'Running' is currently used by BatteryStats in its power blaming, so
statsd needs it too. Therefore it is added here, exactly as BatteryStats
uses it. In the future, this should be upgraded to be more accurate, but
that is beyond the scope of this cl.
Test: Manual only. Toggling 'Wifi On' via app is no longer allowed in Q.
Bug: 115639456
Change-Id: Icad7d1476bb6ff0788ffc690f0a27507d32cd4b8
Track the Wifi Multicast Lock tag.
Also moves some statsd Wifi logging calls out of BatteryStats in
preparation for more detailed statsd wifi logging.
Bug: 68943452
Test: cts-tradefed run cts-dev -m CtsStatsdHostTestCases -t android.cts.statsd.atom.UidAtomTests#testWifiMulticastLock
Test: cts-tradefed run cts-dev -m CtsStatsdHostTestCases -t android.cts.statsd.atom.UidAtomTests#testWifiScan
Change-Id: I13bd5f72393f6065bc3dfa1b72a1ca48a480a682
LocalDrive needs to handle the situation whereby the caller does 'adb
root' in between calls, and therefore runs everything as shell.
TestDrive is a single-call, so it can just run as the caller. That's
what it used to do, but a recent refactoring made some of its calls via
shell, causes an error. This fixes that.
Test: manual confirmation that it worked for both shell and root
Change-Id: I5e31cdd59d61290a480cb6fae107170616daabc0
statsd pulled event SubsystemSleepState will now use power.stats HAL if it
is available and supported. Otherwise it will fall back to the original
implementation of using the Power HAL.
Bug: 120551881
Test: adb shell cmd stats pull-source 10005
Test: Removed IPowerStats from manifest and ran above command. Verified
that it fell back to using IPower HAL
Test: Killed HAL services, waited for them to start back up, and
verified that statsd was still able to pull the SubsystemSleepState.
Change-Id: I852aa3386b2f2e77865ea6b4ff4cdc6e48cee77c
Adds a tool for local usage of statsd. The tool can:
-upload a config from a file
-get the report data from statsd
Both the config and the report can be either in binary or human-readable
format, as specified.
Usage:
make statsd_localdrive
./out/host/linux-x86/bin/statsd_localdrive
Also, adds the ability to specify whether dump-report should also erase
the data when it returns it. A test for this is added.
Test: make -j8 statsd_test && adb sync data && adb shell data/nativetest64/statsd_test/statsd_test
Test: make statsd_localdrive && ./out/host/linux-x86/bin/statsd_localdrive <commands>
Bug: 77909781
Change-Id: I9a38964988e90c4158a555f41879534267aadd32
UsbDeviceAttached is logged when the device has an audio interface.
Info such as VID, PID, whether the device has hid or mass storage
interface and the duration for which the usb device was connected
would be logged as well.
Bug: 118783261
Test: Manually tested by running: adb shell cmd stats print-logs,
adb logcat | grep statsd | grep \(77\)
Change-Id: I57bbfd22ef377553daa113968fe53c4fe0f8e4d2
This is to normalize the metric when applying cross-device aggregation.
Test: statsd test
BUG: b/118203108
Change-Id: I644a6a4163e2d2ad8f70e0c4e002dd4f542248af