Commit Graph

2985 Commits

Author SHA1 Message Date
TreeHugger Robot
55b486eb6e Merge "Update Guardrail." into pi-dev 2018-03-27 23:44:23 +00: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
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
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
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
Yi Jin
a9635e442b Fix apct test.
Bug: 76208934
Test: atest incidentd_test
Change-Id: Ibc101aa3c523398b1e9dd6cff3d6735b4d704667
2018-03-23 12:05:32 -07: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
Yao Chen
59cc0a2237 Fix UidMap proto output error. And fix a bug in MaxDurationTracker.
Bug: 76118312
Bug: 76145379

Test: adb shell cmd stats dump-report
      statsd_test
Change-Id: I9a987525df5b37fcefd5f28700bfa1c3952f6692
2018-03-22 09:07:03 -07:00
TreeHugger Robot
dcccfd9742 Merge "ScheduledJobStateChanged: add stop reason" into pi-dev 2018-03-22 01:30:52 +00:00
Yao Chen
1aa00024fa Fix the heap-after-use in DurationAnomalyTracker
Bug: 74531081
Test: cts
Change-Id: I21a50944a119b7576c76fd25fae23b9c2d8d96ab
2018-03-21 17:04:34 -07:00
Yao Chen
461a75f269 Remove unsigned-integer-overflow signed-integer-overflow from sanitizer.
Sanitizer is picking on the protobuf generated code. Need to figure out why
Disable them to unblock development first.

Bug: 76117312
Test: manual
Change-Id: I3f3a39dfe933f4c1b1cf4063d621392b66f0adea
2018-03-21 16:38:26 -07:00
Yao Chen
fef48cb64c Fix StorageManager stack use after scope.
Bug: 75968524
Test: CTS
Change-Id: I2fd81a21452b26d8c9239d7aeddd4907b9618179
2018-03-21 14:44:34 -07:00
TreeHugger Robot
dc5677336c Merge "Enable sanitizer on statsd eng build." into pi-dev 2018-03-21 20:09:10 +00:00
Yao Chen
cd7f90053d Enable sanitizer on statsd eng build.
Bug: 74946342

Test: manual
Change-Id: I287def435d077670814db50e4d8398ecee539b74
2018-03-21 11:04:37 -07:00
TreeHugger Robot
8512630f8b Merge "Allow statsd to be given empty config." into pi-dev 2018-03-21 05:34:16 +00:00
Howard Ro
e51af37475 Merge "Fix recovery of stats data from previous input while using ProtoOutputStream" into pi-dev 2018-03-21 00:31:23 +00:00
TreeHugger Robot
0421c2cf8f Merge "Fix pulling interval may become 0 in cts" into pi-dev 2018-03-20 23:31:24 +00:00
David Chen
9fdd40302e Allow statsd to be given empty config.
Statsd clients may want to set an empty config temporarily, so it's
more convenient to allow them to set an empty config instead of
having to use the removeConfig and then having to remember to call
StatsManager#setDataFetchOperation.

Test: Added unit-tests and check they pass on marlin-eng.
Bug: 74997752
Change-Id: I2e762e5ec01e5a2c9a3469fb330b53fefbd734d6
2018-03-20 15:56:11 -07:00
yro
4beccbe3de Fix recovery of stats data from previous input while using
ProtoOutputStream

- Specify the length of message to avoid libprotoutil from thinking that
we are trying to write bool
- We only attach the previous dump file to the upload file where config
key matches
- Store ConfigMetricsReport (instead of ConfigMetricsReportList) onto
disk
- Stop use stack after scope in StorageManager
- Migrate UidMap to use ProtoOutputStream and renaming variables to
prevent confusion

Bug: 74021554
Bug: 75968524
Test: manual test, statsd_test, CTS tests
Change-Id: Iedf52633d7f5b985f5a934a3fb5a0c3c3b2e7fd1
2018-03-20 15:00:59 -07:00
TreeHugger Robot
039deb4390 Merge "Moves the settings changed logging for statsd." into pi-dev 2018-03-20 20:30:31 +00:00
Tej Singh
33a412b52d ScheduledJobStateChanged: add stop reason
Adds stop reason to scheduled job state changed

Bug: b/71755130
Test: cts-tradefed run cts-dev -m CtsStatsdHostTestCases -t android.cts.statsd.atom.UidAtomTests#testScheduledJobState
Test: cts-tradefed run cts-dev -m CtsIncidentHostTestCases -t com.android.server.cts.JobSchedulerIncidentTest
Change-Id: Ic29a5e9160ac258140a52d31bc6210300949545d
2018-03-20 11:20:58 -07:00
TreeHugger Robot
aed0fed078 Merge "Add uid field annotation in atoms.proto and statd memory usage optimization." into pi-dev 2018-03-20 17:12:25 +00:00
David Chen
bd78991bc6 Moves the settings changed logging for statsd.
Previously, we wrote a log entry regardless of permission checks, so
the logging could be misleading. Now we only send the log to statsd
after verifying that this setting mutation is valid.

Test: Flashed onto marlin-eng and verified stats-log as expected.
Bug: 73493944
Change-Id: I2a8b052aa8c380ffc5d15caec089fffcdc5823f4
2018-03-19 17:11:03 -07:00
TreeHugger Robot
9859c29a8f Merge "Fix a UidMap crash." into pi-dev 2018-03-19 23:07:06 +00:00
TreeHugger Robot
dba47fcd09 Merge "Atoms: Mobile Connection" into pi-dev 2018-03-19 20:45:55 +00:00
Yao Chen
34900c3b4d Fix a UidMap crash.
Bug: 75968717

Test: CTS with sanitizer
Change-Id: I9516d3b59f72816159c9fc1fe75ca64bfe21d799
2018-03-19 13:43:29 -07:00
TreeHugger Robot
ea9c59b469 Merge "Fix the test failure of LogSection, don't consider read log msg error as a failure since it is used to signal EOF." into pi-dev 2018-03-19 20:29:59 +00:00
TreeHugger Robot
f5de606f51 Merge "Deletes default allowed_log_sources in statsd." into pi-dev 2018-03-19 18:14:18 +00:00
Chenjie Yu
83baaa1212 Fix pulling interval may become 0 in cts
If the bucket size is lower than 1 min, the interval should be at least
1 min.

Bug: 74533948
Test: cts
Change-Id: Icb72579367cd12d3f475c7e2935b98c0ebc66419
2018-03-19 10:41:35 -07:00
Tej Singh
eee317b7b6 Atoms: Mobile Connection
Atom definitions for MobileConnectionStateChanged and
MobileRadioTechnologyChanged

Also cleans up batterystats.

Bug: b/72320589
Test: verified logs appear in adb logcat -b stats
Change-Id: I9feb258cf6dd4a8c8bf1cffc9566b5d0a851a9fa
2018-03-19 09:48:22 -07:00
TreeHugger Robot
790befca1d Merge "Delete TODO about renumbering statd atoms" into pi-dev 2018-03-19 05:54:22 +00:00
TreeHugger Robot
ad121b9fdc Merge changes I3ffb6e97,I689df136,Ia67a8eb6 into pi-dev
* changes:
  Statsd: remove DurationAnomalyTracker.resetStorage
  Statsd AnomalyDetection stopAlarm also checks old
  Statsd AnomalyDetection improvements
2018-03-19 05:49:27 +00:00