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
For pulled atoms, if use_zero_default_base is set to true, and if use_diff, the first data
piece will assume 0 value as base.
This requires a successful previous pull to set mHasGlobalBase.
mHasGlobalBase is reset when condition changes to false or we skip more
than 1 bucket.
Bug: 120476027
Bug: 120129928
Test: unit test
Change-Id: Id01a7bf8796394777f02ba2c9bfdc860f528b98f
last_connect_duration_millis will be set to 0 for a connect event.
last_connect_duration_millis will be set to the amount of time the port
was left connected for a disconnect event.
Bug: 118783261
Test: Manually tested by running: adb shell cmd stats print-logs,
adb logcat | grep statsd | grep \(70\)
Change-Id: Ifd1df55fb6317e789a2b04236ce0a6e4665e3664
The following would the logged:
1. Status of the connection - connected/disconnected.
2. Port id as a device could have multiple ports.
Bug: 118783261
Test: Manually tested by running: adb shell cmd stats print-logs,
adb logcat | grep statsd | grep \(70\)
Change-Id: Ideea36c7745293f5b6ec9cc35fd5f709f5175d5a
* changes:
Change CpuTimePerThreadFreq to contain all frequencies in one atom
Remove filtering out frequencies with zero usage for CpuTimePerThreadFreq
Reading RSS high-water mark was moved to a separate atom.
Bug: 119598534
Test: atest UidAtomTests#testProcessMemoryState
Test: atest UidAtomTests#testNativeProcessMemoryState
Test: atest MemoryStatUtilTest
Change-Id: I18424ea3f0ab1555febe62df1be97b174e93a55c
The recent changes to use all the dimensions as a key instead of having
multiple atoms per bucket means we now hit the maximum threshold
(although the data size is similar to what we had before).
Test: tested locally
Change-Id: I59261c273c71ce7932ee11b77bb429cec91780d7
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
+ Current guardrail for memory usage is too conservative, resulting lots of voluntary data drops
in statsd without trying to send broadcast.
+ Actual data upload size is smaller than the in memory data size. So keep the threshold to send
broadcast but lift the memory usage guardrail to give a chance to send broadcast.
+ Also, make byteSize() estimation less frequent.
Bug: 119773948
Test: statsd_test passes
Change-Id: Ia4c660eb47e6d442c0952628e910b494174279d0
KernelUidCpuTimeReader reads microseconds, but they are written to a
millisecond field in atoms.proto. Introduced in ag/3693225.
See google3 change: cl/222044203
Test: build
Bug: 119853118
Change-Id: I170e996aa852e28a246a98226677907bb3560371