1152 Commits

Author SHA1 Message Date
Hyunyoung Song
cc651c118e Add launcher.proto to atoms.proto
Test: blank
Bug: 113043444
Bug: 120635548
Change-Id: I7e0e72cdf68dcf195188dbab8fe2567fcbd5964e
Merged-In: I7e0e72cdf68dcf195188dbab8fe2567fcbd5964e
(cherry picked from commit c6d6b77ddc805d6e8f70ed16f0c73177840791e7)
2018-12-15 13:51:39 -08:00
Yao Chen
8b71c74894 Allow atoms to log fields in bytes format.
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)
2018-12-15 13:51:08 -08:00
TreeHugger Robot
09c161fedb Merge "Fix style error" 2018-12-15 01:31:16 +00:00
Badhri Jagan Sridharan
c2c54a228f Fix style error
Bug: 118783261
Test: Manually tested by running: adb shell cmd stats print-logs,
    adb logcat | grep statsd | grep \(77\)

Change-Id: I149006f9e625e609ffe3bbd713a2d30a2c69dafe
2018-12-14 14:41:26 -08:00
Bookatz
da1798c8de Statsd atom: Wifi on (enabled) and running
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
2018-12-13 14:27:11 -08:00
TreeHugger Robot
ca72a20238 Merge "Allow statsd_testdrive to work in root" 2018-12-13 21:15:11 +00:00
Rafal Slawik
00b10effe8 Merge "Update documentation for memory atoms." 2018-12-13 20:31:32 +00:00
Bookatz
819ea835d7 Statsd logs directly from Wifi & add Multicast tag
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
2018-12-13 12:18:41 -08:00
Bookatz
17fe8de6b3 Allow statsd_testdrive to work in root
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
2018-12-13 11:13:24 -08:00
Rafal Slawik
da51b93a61 Update documentation for memory atoms.
Test: m -j
Change-Id: Iec6fbaa330be3abf12f839fdfcd74da0015934bc
2018-12-13 17:29:58 +00:00
Benjamin Schwartz
0126da8af1 Merge "statsd: Migrate statsd SubsystemSleepState to use power.stats HAL" 2018-12-13 17:09:37 +00:00
TreeHugger Robot
183bdcf1d3 Merge "statsd local tool" 2018-12-13 00:44:27 +00:00
Benjamin Schwartz
51329b72e6 statsd: Migrate statsd SubsystemSleepState to use power.stats HAL
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
2018-12-12 15:29:53 -08:00
Bookatz
3e90658294 statsd local tool
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
2018-12-12 11:42:39 -08:00
TreeHugger Robot
9943de9fb9 Merge "trim ValueMetric dimension key" 2018-12-11 18:03:49 +00:00
Badhri Jagan Sridharan
06353c6eb5 Merge "Log UsbDeviceAttached events for Audio devices" 2018-12-11 16:40:37 +00:00
Badhri Jagan Sridharan
5b0bc1f7f0 Merge changes from topic "118783261"
* changes:
  Log connection duration.
  Log UsbConnectorStateChanged events
2018-12-11 16:40:01 +00:00
Chenjie Yu
dbe5c50c15 trim ValueMetric dimension key
Bug: 120129929
Test: unit test
Change-Id: I26446f8eabbfbb20e1c715058d2e6b4bd5793a43
2018-12-10 18:35:30 -08:00
Badhri Jagan Sridharan
5ec629f020 Log UsbDeviceAttached events for Audio devices
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
2018-12-10 17:37:27 -08:00
TreeHugger Robot
eb12479a07 Merge "Always report the metric id even if the metric has no data to upload." 2018-12-10 19:04:34 +00:00
Chenjie Yu
88d90e987b Merge "optional default base for ValueMetric" 2018-12-10 18:58:24 +00:00
Shawn Lin
029e4efc6b Merge "Migrate docsui tron metrics to westworld" 2018-12-10 08:10:54 +00:00
Yang Lu
b472291224 Always report the metric id even if the metric has no data to upload.
This is to normalize the metric when applying cross-device aggregation.

Test: statsd test
BUG: b/118203108

Change-Id: I644a6a4163e2d2ad8f70e0c4e002dd4f542248af
2018-12-07 22:18:45 +00:00
Fan Zhang
ff2332bc3a Fix lint errors for SettingsUIChanged atom event.
Bug: 119780708
Test: rebuild
Change-Id: I21d22734cb037e9702cab527a8bb827cc2ee241e
2018-12-06 15:18:58 -08:00
shawnlin
ea5b66be7b Migrate docsui tron metrics to westworld
add docsui atoms

Test: manual
Bug: 111552654
Change-Id: I232be950281423a38763b6be1b70f70090d4e61b
2018-12-06 15:15:19 +08:00
Chenjie Yu
f275f612fa optional default base for ValueMetric
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
2018-12-05 09:42:53 -08:00
Badhri Jagan Sridharan
faf6207163 Log connection duration.
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
2018-12-04 12:14:12 -08:00
Badhri Jagan Sridharan
223b3c7999 Log UsbConnectorStateChanged events
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
2018-12-04 10:14:14 -08:00
Olivier Gaillard
76642a6cba Merge "Increase the cardinality limit for looper stats." 2018-12-03 17:27:54 +00:00
Jim Blackler
f8f70e10ef Merge "Add start time to LmkKillOccurred" 2018-11-30 19:36:11 +00:00
Misha Wagner
e4babcf3cb Merge changes I56de3aec,Iba86e8e3
* changes:
  Change CpuTimePerThreadFreq to contain all frequencies in one atom
  Remove filtering out frequencies with zero usage for CpuTimePerThreadFreq
2018-11-30 17:52:43 +00:00
Misha Wagner
fde6958b8b Change CpuTimePerThreadFreq to contain all frequencies in one atom
Test: make, flash, inspect pull-source output
Bug: 120016054
Change-Id: I56de3aec85d5f82339eb4eb876a1349d66698a63
2018-11-30 16:29:36 +00:00
Rafal Slawik
d03ae420b0 Delete rss_high_watermark_in_bytes field
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
2018-11-30 13:35:46 +00:00
Olivier Gaillard
c840ed9bfe Increase the cardinality limit for looper stats.
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
2018-11-30 13:12:10 +00:00
TreeHugger Robot
f69ca4e970 Merge "Skip writing message field in an atom if it's empty" 2018-11-29 22:52:57 +00:00
Jim Blackler
8593d1f605 Add start time to LmkKillOccurred
To accompany Piper cl/222070329 and https://googleplex-android-review.git.corp.google.com/c/platform/system/core/+/5578724

Bug: 119854389
Test: Manual
Change-Id: Ib2af1b66d4649279fdcb97e7cdf8cdb92e361765
2018-11-29 22:21:19 +00:00
Yao Chen
8e6f998300 Skip writing message field in an atom if it's empty
Test: unit test added
Change-Id: I825b1ce526944a20fe65705508ad180ece37492c
2018-11-29 10:59:57 -08:00
Maggie White
9ab9d46a86 Merge "statsd: Increase number of available charge cycle buckets" 2018-11-29 05:18:35 +00: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
e3b92ab6ba Merge "Revert "support work chain in pulled atoms"" 2018-11-28 20:32:50 +00: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
fbc5842d16 Merge "support work chain in pulled atoms" 2018-11-28 19:10:30 +00:00
TreeHugger Robot
82b6b06fab Merge "Add generic atom definition for device policy events." 2018-11-28 15:13:57 +00:00
Bookatz
366a4430a3 Statsd atom: pull Build information
Pulls Build information, such as Build.ID.

Test: cts-tradefed run cts-dev -m CtsStatsdHostTestCases -t android.cts.statsd.atom.HostAtomTests#testBuildInformation
Bug: 114443697
Change-Id: If1d573dbdc49543d4268f4d62e02b3ea360e75d5
2018-11-27 11:36:07 -08:00
TreeHugger Robot
32ac121d68 Merge "Increase the guardrail limit for memory usage per config" 2018-11-27 18:37:44 +00:00
arangelov
4e9940608d Add generic atom definition for device policy events.
Bug: 119492678
Test: None
Change-Id: Ic6bee84b0c2ec0028c5078da74a7b32db1881638
2018-11-27 17:25:49 +00:00
Misha Wagner
3673e7ff91 Merge "Fix issue in CpuTimePerUid where microseconds are used as milliseconds" am: 4314aef811 am: f7905eb419
am: 85980756b4

Change-Id: If1338ca0d87160a79eea251e8c2c87b5b55df980
2018-11-27 06:59:11 -08:00
Misha Wagner
85980756b4 Merge "Fix issue in CpuTimePerUid where microseconds are used as milliseconds" am: 4314aef811
am: f7905eb419

Change-Id: I78470d6cc8e6e42adc50407f04b0294b9b1e159a
2018-11-27 06:42:53 -08:00
Yao Chen
bd88bde97c Increase the guardrail limit for memory usage per config
+ 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
2018-11-26 15:48:20 -08:00
Misha Wagner
6bc6c91584 Fix issue in CpuTimePerUid where microseconds are used as milliseconds
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
2018-11-21 11:13:01 +00:00