816 Commits

Author SHA1 Message Date
Chenjie Yu
f17bf62f2f Add fileds to AppCrash and ANR atoms
Bug: 77487218
Change-Id: I13fe87c9811e248ed0ee87c64d482c9463d6b9a1
Fix: 77487218
Test: cts test
2018-04-02 15:30:47 -07:00
TreeHugger Robot
46eef8d049 Merge "E2e test for periodic alarm." into pi-dev 2018-03-31 03:04:59 +00:00
TreeHugger Robot
2f6f33fa79 Merge "Null pointer check for Bluetooth traffic" into pi-dev 2018-03-31 01:18:34 +00:00
TreeHugger Robot
3b826c6075 Merge "Statsd MAX now obeys refractory periods too" into pi-dev 2018-03-31 01:10:57 +00:00
Chenjie Yu
9e59f93a21 Null pointer check for Bluetooth traffic
Bug: 77340376
Change-Id: I558c020636564437e040097a2d0f86519c343c4a
Fix: 77340376
Test: manual test
2018-03-30 16:45:33 -07:00
Bookatz
0dbc7a4343 Statsd MAX now obeys refractory periods too
The logic of where refractory period enforcement was moved out of the
anomaly tracker and into the metric's predictAnomalyTimestamp. It was
done for ORING, but not for MAX. This fixes MAX.

Bug: 74446029
Test: adb sync data && adb shell data/nativetest64/statsd_test/statsd_test
Change-Id: I51e43c7c132f424af8fe20a37f2ad10cc55b5989
2018-03-30 16:21:17 -07:00
TreeHugger Robot
014432cb67 Merge "Guardrail for dimension in condition in duration tracker." into pi-dev 2018-03-30 21:27:11 +00:00
Howard Ro
ea16812ad2 Merge "Remove bad configs by counting the number of statsd deaths" into pi-dev 2018-03-30 20:58:51 +00:00
TreeHugger Robot
9fef2594f3 Merge "Clean up atoms.proto" into pi-dev 2018-03-30 20:48:09 +00:00
Chenjie Yu
5caaa9d854 Clean up atoms.proto
changes are:
1) for pushed atoms, use attribution node in place of uid when
appropriate
2) name changes to be more consistent

Bug: 73823969
Test: manual test
Change-Id: Iacf7186dbd7a2282f7fe481f43dbbf92e1165b47
2018-03-30 10:11:03 -07:00
Chenjie Yu
6d370f40fe Add unit test ValueMetricProducer on boundary
Mostly to add test to assure the corner cases are covered.
One minor logic change is if two true conditions happen, in the case
when following happen:
(bucket boundary1) -> (condition false) -> (condition true) -> (pull
triggered for the boundary1)
Previously we take the latest. Now we skip the late boundary pull.

Bug: 76384731
Test: unit test
Change-Id: I345c2210a58bf03eb91d65742573073d2668358b
2018-03-29 21:54:54 -07:00
yro
e26c97b565 Remove bad configs by counting the number of statsd deaths
Bug: 75968642
Test: manual testing, statsd_test, cts test
Change-Id: Ie23e9003163b8dc554bcdc9811850091cd894000
2018-03-29 21:44:55 -07:00
TreeHugger Robot
d82ece9ec8 Merge "Update BleScanStateChanged comment" into pi-dev 2018-03-29 19:05:19 +00:00
TreeHugger Robot
925a04b775 Merge "Fix StatsCompanionService pull on bucket ends" into pi-dev 2018-03-29 17:00:25 +00:00
Yangster-mac
306ccc2d6b Guardrail for dimension in condition in duration tracker.
Test: statsd test

BUG: b/74437017
Change-Id: I349528e419ede817904f1e3884260c06651c6d0b
2018-03-29 09:21:27 -07:00
Chenjie Yu
1a0a941c20 Fix StatsCompanionService pull on bucket ends
+ change StatsPullerManager internal time units to be consistent
+ use series of alarms for pullers, instead of use setRepeating

Bug: 76223345
Bug: 75970648
Test: cts test
Change-Id: I9e6ac0ce06541f5ceabd2a8fa444e13d40e36983
2018-03-29 00:11:13 -07:00
Bookatz
17a879db4f Update BleScanStateChanged comment
Bug: 71607284
Test: none; it's just a comment
Change-Id: Ie290bef146bf326cc6965b32fe74076761a10bd7
2018-03-28 15:05:28 -07:00
Adam Bookatz
f50e78d8f7 Merge "Fix statsd ble scan logging" into pi-dev 2018-03-28 21:49:29 +00:00
TreeHugger Robot
dedfd8fec7 Merge "Convert compilation reason and filter to int-enum before logging" into pi-dev 2018-03-28 20:35:37 +00:00
Tej Singh
31c807c987 Merge "Temperature atom: Use int instead of float." into pi-dev 2018-03-28 20:33:44 +00:00
TreeHugger Robot
66cb4e2871 Merge "statsd: Pass alert and config id to Perfetto" into pi-dev 2018-03-28 20:29:31 +00:00
TreeHugger Robot
55b486eb6e Merge "Update Guardrail." into pi-dev 2018-03-27 23:44:23 +00:00
Bookatz
e5ec0b4433 Fix statsd ble scan logging
Ble scan logging in statsd has a few problems:

1. We want finer-grained detailed than just 'unoptimized'. What defines
unoptimized should be done at the config level, not be hard-coded.

2. The current mechanism is actually incorrect. When reset is called,
each ble scan is only told *once* that it stopped, but if the nesting
level is higher than that, statsd will think it is still nonetheless
running.

Test: cts-tradefed run cts-dev -m CtsStatsdHostTestCases -t android.cts.statsd.atom.UidAtomTests#testBleUnoptimizedScan
Test: cts-tradefed run cts-dev -m CtsStatsdHostTestCases -t android.cts.statsd.atom.UidAtomTests#testBleScan
Fixes: 71607284
Fixes: 69478888

Change-Id: Ied44f79aa569daab2acc85e90627a9736d0689a3
2018-03-27 15:14:23 -07:00
TreeHugger Robot
dda147e179 Merge "Fix statsd logging in BatteryStats (nesting prob.)" into pi-dev 2018-03-27 21:45:46 +00:00
Andrew Chant
b8d8ccf9e4 Merge "Add UsbDeviceAdded and update PhysicalDropDetected" into pi-dev 2018-03-27 20:44:53 +00:00
Calin Juravle
a86783b87d Convert compilation reason and filter to int-enum before logging
Test: adb logcat -b events | grep sysui_multi_action
Bug: 73102540
Change-Id: I052df3d4e65ef16b43190c14a236421945c86e21
(cherry picked from commit c7a44be7b3faef307f47db479bd6b06846201cf9)
2018-03-27 20:28:11 +00:00
Yangster-mac
684d195227 E2e test for periodic alarm.
Test: new test

BUG: b/76281156
Change-Id: I60cb28baaeec6996e946a7cb3358ec8e0aca80e5
2018-03-27 13:26:20 -07:00
Yao Chen
52b478b56a Update Guardrail.
+ Config count is 10 per uid
+ Update the limit for metrics, matchers, conditions, etc.

Test: statsd_test

Bug: 73122377

Change-Id: I3e1adfe318d1354a7c9d1bf484855661aa3a1fc8
2018-03-27 11:29:50 -07:00
TreeHugger Robot
d9afdee26f Merge "Support sliced condition change in GaugeMetric" into pi-dev 2018-03-27 18:27:27 +00:00
Andrew Chant
b56388b816 Add UsbDeviceAdded and update PhysicalDropDetected
Add UsbDeviceAdded to log VID, PID, and interface
types of USB devices added to the system.

Add a fall duration to physical drop detected.

Bug: 74260509
Bug: 74261750

Test: Built and booted Walleye

Change-Id: I2b38697ba52869bc448fac2cc4b8bdb3fa75fa64
2018-03-27 11:22:50 -07:00
Sami Kyostila
d0dd6c7cef statsd: Pass alert and config id to Perfetto
When triggering a Perfetto trace, pass the alert and config id to the
perfetto command line tool to record them into the trace. This lets us
correlate Perfetto traces with statsd alerts.

Bug: 73627502
Test: Manual
Change-Id: I301ee5e5e8bdb83d08e8d55b994c15a6541a92f2
Merged-In: I301ee5e5e8bdb83d08e8d55b994c15a6541a92f2
(cherry picked from commit 209a5915dcfe030912dda57df4fb6390385c7de3)
2018-03-27 17:25:20 +00:00
Bookatz
235343daec Fix statsd logging in BatteryStats (nesting prob.)
Several statsd atoms are not logged correctly from batterystats, due to
possible nesting issues (batterystats only reports a single stop at the
end, whereas statsd expects each stop, resulting in statsd thinking that
the event is still continuing). This cl fixes those.

Bug: 69478888
Test: current ones still pass
Change-Id: I3ae8d7cc3d2eec7d4ab2721c83d208384adbf690
2018-03-27 09:32:18 -07:00
Yao Chen
427d372552 Support sliced condition change in GaugeMetric
TODO: We need CTS to verify the behavior.

Bug: 73958484
Test: statsd_test
Change-Id: I56406983ddede12bc6a2e12188693a0c51ccae5c
2018-03-27 09:21:19 -07:00
TreeHugger Robot
cdc9d9008b Merge "Flush the past buckets in anomaly tracker when time jumps forward" into pi-dev 2018-03-27 07:21:21 +00:00
Yangster-mac
be10ddfe46 Flush the past buckets in anomaly tracker when time jumps forward
E2e test for count/duration anomaly trackers.

Test: new statsd tests.

BUG: b/74446029

Change-Id: Ia9be0240ba5021d44c1e1f096d67563e9138bb59
2018-03-26 18:44:01 -07:00
TreeHugger Robot
dafbeecaf7 Merge "Up the dimension key limit for CpuTimePerUidFreq" into pi-dev 2018-03-26 23:28:30 +00:00
TreeHugger Robot
d41fad71a6 Merge "Fix uidmap in statsd." into pi-dev 2018-03-26 22:38:25 +00:00
Tej Singh
d89137ed24 Temperature atom: Use int instead of float.
Changes the temperature atom to use an int instead of a float because
metrics and anomaly detection assume the data will be an int or a long.

Bug: b/74011562
Test: statsd temperature CTS test
Change-Id: I6e5845a40c28aefd30c2be9709c6f9de1783cf02
2018-03-26 14:51:40 -07:00
Chenjie Yu
c58750578f Up the dimension key limit for CpuTimePerUidFreq
This atom logs time spent on cpu per frequency per uid.
On marlin, there are 27 frequency steps per uid (should be 50+ if
flatten to both cores)
On walleye, there are 52 frequency steps per uid.
So it easily goes to 6k data.

Soft limit set to 6k now.
Hard limit set to 10k to accommodate future processors

Memory impact: on marlin, start memory no config is 2,346K
after using this atom in one guage metric, it is 3,067K

Bug: 72505991
Test: cts test
Change-Id: I067a32e54e4a457fdf9a25911aa16030e893ef4d
2018-03-26 10:29:38 -07:00
David Chen
35045cbc34 Fix uidmap in statsd.
Previously tried an optimization that results in corrupted proto
output. This changes to a safer approach of storing the snapshot data
in memory and only converting to proto output when the
ProtoOutputStream is provided.

Also fixes a security issue when trying to invoke triggerUidSnapshot
since we forgot to use SCS' permissions.

Test: Added a unit-test to verify output of StatsLogProcessor.
Bug: 76231867
Change-Id: Id410ce3505fda9d71caa71942ef3068b55872c66
2018-03-24 15:01:04 -07:00
TreeHugger Robot
c8ab224b2a Merge "Fix StatsCompanionService sometimes can be null" into pi-dev 2018-03-24 16:28:01 +00:00
Chenjie Yu
aa5b201015 Fix StatsCompanionService sometimes can be null
Bug: 75970648
Test: will add cts test for puller alarms
Change-Id: I51b7d13f855d3c8ded8325d7cf0f614531eceea5
2018-03-23 14:33:58 -07:00
TreeHugger Robot
3991138f3a Merge "rename neq_all_string to neq_any_string in statsd_config" into pi-dev 2018-03-23 21:15:02 +00:00
Yao Chen
d50f2ae487 rename neq_all_string to neq_any_string in statsd_config
Bug: 73897465
Test: statsd_test
Change-Id: I1d020de873fc26fbb502f0b3487b85fdb3896753
2018-03-23 11:10:13 -07:00
TreeHugger Robot
dc2dda5c49 Merge "Fix statsd dropping metrics data." into pi-dev 2018-03-23 17:40:18 +00:00
David Chen
4c6d97a1e4 Fix statsd dropping metrics data.
We can increase the buffer of metrics we store in statsd memory, but
we still request the clients to call getData when the metrics memory
exceeds 128 KB (previously was 90% of 128 KB).

Bug: 76171061
Test: Test that unit-tests still pass.
Change-Id: I901545b364ed313af8c033ce9b40d3cfadb93213
2018-03-22 16:46:54 -07:00
Yao Chen
5f8939eecd Merge "Fix StorageManager stack use after scope." into pi-dev 2018-03-22 23:19:21 +00:00
TreeHugger Robot
e8582d0ca7 Merge "Fix the heap-after-use in DurationAnomalyTracker" into pi-dev 2018-03-22 21:41:35 +00:00
TreeHugger Robot
23ceeb3a44 Merge "Fix UidMap proto output error. And fix a bug in MaxDurationTracker." into pi-dev 2018-03-22 21:36:50 +00:00
Yao Chen
c219348186 Merge "Remove unsigned-integer-overflow signed-integer-overflow from sanitizer." into pi-dev 2018-03-22 20:24:41 +00:00