Commit Graph

3400 Commits

Author SHA1 Message Date
TreeHugger Robot
0f3a3ac1f8 Merge "Add more accurate logging for stats log loss." 2018-08-23 18:00:09 +00:00
Jorim Jaggi
acfabaa32b Merge "BootAnimation: Fix boot animation with hidden cutout" into pi-dev am: e387ce18d8
am: 2c68abc9fc

Change-Id: I1a0db9f30f7270d49136fa3984dc8d9633ead690
2018-08-22 16:38:27 -07:00
Jorim Jaggi
2c68abc9fc Merge "BootAnimation: Fix boot animation with hidden cutout" into pi-dev
am: e387ce18d8

Change-Id: I55c32ef69c4bb565376946ce65101f37ef0cce8a
2018-08-22 16:20:32 -07:00
Yao Chen
0f5d661803 Add more accurate logging for stats log loss.
+ Only record eventual failure after the retries to get a accurate log loss count.
+ Record all types of failures which lead to log loss
+ Change the timestamp from elapsedRealtime to wallclock time for easier debugging server side
+ Also log the count too.

Bug: 80538532
Test: manually tested

Change-Id: I4fcccae3fa39c9e280a842e27c6432bb0a090b85
2018-08-22 14:21:42 -07:00
Adrian Roos
9ee5dff83c BootAnimation: Fix boot animation with hidden cutout
We do this by storing the masking inset in a persistent property.
The boot animation then animates itself to where it would be if that
masking inset were applied, then changes the viewport.

For this to work, we also need to make sure the DisplayManagerService
has the right overlay right at the start.

Bug: 112876936
Test: Hide cutout, then reboot. Verify boot animation is smooth.
Change-Id: I3e988b2340b2e0d2be3939bdc6878704c234ccc8
2018-08-22 21:37:39 +01:00
Bernardo Rufino
607d78e188 Add adb shell bmgr init TRANSPORT... to bmgr help
Wasn't there.

Test: adb shell bmgr init
      android/com.android.internal.backup.LocalTransport, verify it works
Test: adb shell bmgr, check help message

Change-Id: Icceb78eac8c73128897f64a3d7c72fd27ff269dc
2018-08-22 09:56:34 +01:00
Yangster-mac
48b3d62bfe Create log event from key value maps.
BUG: b/112816333
Test: statsd test.
Change-Id: Ib66f06186abfacd77807436379e1e142a5b87c99
2018-08-19 22:37:59 +00:00
TreeHugger Robot
a5f28237e4 Merge "allow statsd pull based on event trigger" 2018-08-11 20:09:22 +00:00
Chenjie Yu
8858897205 allow statsd pull based on event trigger
Several restrictions:
1) This is only with GaugeMetric. We don't have use case for ValueMetric
to pull on event trigger.
2) trigger_event is set in the config. It can be generic atom matcher. But
we limit the number of atoms referenced in it to be 1. So we don't allow
multiple atoms to form a complex trigger.
3) This has to go with ALL_CONDITION_CHANGES sampling type.

+ also specify atom id of GaugeMetric output.

Bug: 111937835
Test: unit test
Change-Id: Ia15b1f209945f022edffb9ec5d673317d55d9e4f
2018-08-10 20:49:52 -07:00
TreeHugger Robot
632b39288d Merge "Remove the obsolete code for logd and add statsd socket log loss detection." 2018-08-11 00:30:47 +00:00
Yangster
8a34384797 Return unknown for combination condition eval when operation is NOT and
there is no child.

Test: added unit test and rerun the statsd tests.

BUG: b/112311529

Change-Id: I0c5829e3cb26474b7dbcc05f20c4311e9f801d97
2018-08-10 04:30:11 +00:00
Siarhei Vishniakou
216142bff1 Merge "Refactor hid command, mitigate overflows" 2018-08-09 21:34:43 +00:00
Bernardo Rufino
deee39507f Merge "Add --monitor to bmgr backupnow" 2018-08-09 13:33:20 +00:00
Bernardo Rufino
3deabebb24 Add --monitor to bmgr backupnow
And --monitor-verbose. For debugging.

Test: adb shell bmgr backupnow --monitor <packages> and verify output
Test: adb shell bmgr backupnow --monitor-verbose <packages> and verify
      output

Change-Id: I6c0a46a6b642063c37e548e181f4659dd46426a5
2018-08-09 10:48:45 +01:00
Yi Kong
288f355e1a Modernize codebase by replacing NULL with nullptr
Fixes -Wzero-as-null-pointer-constant warning.

Test: m
Bug: 68236239
Change-Id: Ic440b9fcb9be97c316448b764f7110ef1f7eb525
Merged-In: Ic440b9fcb9be97c316448b764f7110ef1f7eb525
(cherry picked from commit 08a8d728db)
2018-08-08 14:08:35 -07:00
Siarhei Vishniakou
d54b70c8bf Refactor hid command, mitigate overflows
Currently there are a few overflows possible in the hid command by
sending malformed json requests. Refactor the code to avoid these
overflows. These are mostly memcpy usage, where the size comes
(indirectly) from the size of the json array.
The json array must still be valid, because invalid json will produce an
earlier exception in the java layer.

Test: hid malformed_commands.json
The file "malformed_commands.json" can be found in the bug.
Bug: 111363077

Change-Id: I2f9dd31e0bfa2badc58779f40f4a80e025754cd2
2018-08-08 13:40:48 -07:00
Yi Kong
3caa540453 Merge "Modernize codebase by replacing NULL with nullptr" 2018-08-07 07:04:08 +00:00
Yao Chen
3ff3a490e4 Remove the obsolete code for logd and add statsd socket log loss detection.
+ Remove dead code
+ Add a simple log loss detection as a starter to see if there is any log loss
  detected at all.

TODO: If we do see log loss, we can add more sophisticated logging and reset mechanism.

Bug: 80538532
Test: statsd_test
Change-Id: Iff150c9d8f9f936dbd4586161a3484bef7035c28
2018-08-06 16:24:49 -07:00
TreeHugger Robot
8a645682c4 Merge "Move GenericAtom from pulled atom group to pushed atom group" 2018-08-06 23:07:37 +00:00
Howard Ro
21a039cb8b Move GenericAtom from pulled atom group to pushed atom group
Test: no test needed
Change-Id: I67fb88e6707a8196d379d37d170aa1199abf849a
2018-08-06 14:55:47 -07:00
Yi Kong
08a8d728db Modernize codebase by replacing NULL with nullptr
Fixes -Wzero-as-null-pointer-constant warning.

Test: m
Bug: 68236239
Change-Id: Ic440b9fcb9be97c316448b764f7110ef1f7eb525
2018-08-06 14:48:58 -07:00
Kenneth Magic
3abb439916 Update PageTypeInfoParser to be less restrictive.
The page block order is an independent variable from the free
page order table in the kernel, so the parser should not error
out if they do not match.

Bug: 110559361
Test: incident_helper_test
Change-Id: I08ad9c8f9b29cc15b80a89929f3a1fb6886852e6
2018-07-31 18:35:19 +00:00
TreeHugger Robot
4c3b325d7b Merge "make proto change backwards compatible" 2018-07-30 16:28:08 +00:00
TreeHugger Robot
4481c7c2f5 Merge "Adjust 1st bucket start time" 2018-07-27 21:28:38 +00:00
TreeHugger Robot
f94dcd9818 Merge "Update GenericAtom definition to decouple from metrics_constants proto" 2018-07-27 19:26:46 +00:00
Howard Ro
de7130bbbb Update GenericAtom definition to decouple from metrics_constants proto
Bug: 110537998
Test: statsd, statsd_test
Change-Id: Ib82b90731f7c49a9e27ceff5d5fdb8e2cd6fb4e6
2018-07-27 11:01:55 -07:00
Chenjie Yu
e1361ed422 Adjust 1st bucket start time
adjust 1st bucket start time for a partial bucket
also make valuemetric and gauge metric pull on first bucket

Bug: 111607838
Bug: 111660710
Bug: 111842941

Test: unit test
Change-Id: I5932c2258f8deac57e7abbf26f3214f87914a964
2018-07-27 10:53:38 -07:00
Chenjie Yu
c3f0077cfc make proto change backwards compatible
use [deprecated] rather than reserved as this change is for Q and we
expect data from P to come in for a long time.

Bug: 111889247
Test: cts tests that rely on this proto works correctly
Change-Id: Id64b40ab1566f02fc0e19f617ac58bab3adafab5
2018-07-26 13:54:38 -07:00
Olivier Gaillard
6f52d1572d Pull more data from binder calls.
Exceptions counts by class name and few new fields for binder calls.

> adb shell cmd stats pull-source 10023
Pull from 10023: { 1532528725000000000 49754068496 (10023)0x10000->java.lang.SecurityException[S] 0x20000->2[I]  }
Pull from 10023: { 1532528725000000000 49754068496 (10023)0x10000->java.lang.IllegalArgumentException[S] 0x20000->16[I]  }

Test: manual
Change-Id: I4d24528a7df8edde87f629837fb3117a0504d09e
2018-07-25 23:43:19 +01:00
Damien Bargiacchi
1a8a213b77 Fix use-after-free: release the animation after we're done with it
Bug: 64504131
Change-Id: Ibddbc37d96957eeec63035d7f045a8982fb04254
2018-07-24 15:20:26 -07:00
Olivier Gaillard
9ea238d2a4 Update BinderCalls and add BinderCallsExceptions.
Add a new field recorded_call_count since binder calls now supports
random sampling.

Add BinderCallsExceptions to track which exception classes are thrown by
binder calls.

Test: n/a (proto changes only)
Change-Id: I8f9f9a027fd950706112a9deef39ac01cacaa24d
2018-07-24 18:31:37 +01:00
Chenjie Yu
bd1a28f45c Atoms for ProcStats duration and pss metrics
atom and logging for statsd to mimic procstats process duration metrics.

ActivityManagerSleepStateChanged
MemoryFactorStateChanged
ExcessiveCpuUsageReported
CachedKillReported
ProcessStateChanged
ProcessMemoryStatReported

Some of the enums will need to use frameworks proto. It is blocked by
other cls that are cleaning namespace, etc.

Bug: 110784286
Bug: 110538804
Bug: 110539297
Bug: 111561536
Bug: 111685402
Bug: 111128767

Test: cts test
Change-Id: I7502eb0bb36b90f43493b147a35bee48bad1b000
2018-07-23 14:22:45 -07:00
Primiano Tucci
65c72fc53c Remove unnecessary perfetto/perfprofd messages from statsd_config proto
This change simplifies the on-device statsd_config.proto when
it comes to handling perfetto and perfprofd configs.
In both cases statsd doesn't need to deserialize or know the schema
of the nested perfetto/perfprofd configs, because it just passes
the binary-encoded message to the corresponding daemons.
This change replaces the submessage with a generic "bytes" field.

As per https://developers.google.com/protocol-buffers/docs/proto#updating
"Embedded messages are compatible with bytes if the bytes contain an
encoded version of the message."

Advantages:
* One less copy of perfetto/perfprofd config around, reducing the risk
  of getting that out of sync and the corresponding maintenance cost.
* Reduce the risk of failures within statsd if trying to parse an invalid
  or outdated config proto.
* Reduce the CPU usage of statsd, by avoiding deserialization and
  re-encoding of the config protos.
* Avoid bugs like b/111448265 where the binary size of statsd inflates
  if the config protos are too big.
* Reflect what happens in the statsd code, specifically the fact that
  statsd only sees the bytes of the config but doesn't touch/alter its
  contents.

This change depends on: aosp/718808 and ag/4569627

Bug: 111448265
Test: Manual + CTS (atest AnomalyDetectionTests#testPerfetto)
Change-Id: I6ede5fa07c3ab3f71d29d38f2a40a90e88a16fd6
2018-07-19 22:46:23 +00:00
TreeHugger Robot
a6b034c093 Merge "Fix timestamp error in GaugeMetric" 2018-07-17 00:38:36 +00:00
Yao Chen
f4be88f780 Fix timestamp error in GaugeMetric
Bug: 111516208
Test: unit tests pass, manually tested too
Change-Id: Ia268d3a38c331daab0f96c33461bb7dc794ce610
2018-07-16 15:39:18 -07:00
TreeHugger Robot
b4fc58bab7 Merge "Definition of GenericAtom" 2018-07-14 09:45:12 +00:00
Howard Ro
cb767f659c Definition of GenericAtom
Test: no test is necessary as it only adds a field to atoms.proto
Change-Id: If4e7c9497d1a4a8ba0fda3e8fb1ef67c525d6e64
Bug: 110537998
2018-07-13 14:41:26 -07:00
Chenjie Yu
a0f0224906 ValueMetric supports multiple aggregation types
1. Add support for MIN, MAX, AVG
2. ValueMetric also allow floats now, in addition to long data type.
AnomalyDetection still takes long only. I am not sure if it makes
sense to do anomaly on AVG. I will leave that for later.
3. ValueMetric supports sliced condition change for pushed events.
I don't think it makes sense for pulled events to have sliced condition
changes so leave it for now.

Test: unit test
Change-Id: I8bc510d98ea9b8a6eb16d04ff99dce6b574249cd
2018-07-13 10:24:41 -07:00
Olivier Gaillard
00bfb1b95a Collects binder call stats data through WestWorld.
We require binder calls detailed tracking to be enabled to collect the
stats (in addition to enabling it in WestWorld).

Test: unit test + manual

adb shell cmd stats pull-source 10022
Pull from 10022: { 1531240941000000000 25807560798 (10022)0x10000->0[I]
0x20000->com.android.server.StorageManagerService$3[S]
0x30000->onVolumePathChanged[S] 0x40000->1[L] 0x50000->0[L]
0x60000->18490[L] 0x70000->18490[L] 0x80000->2611[L] 0x90000->2611[L]
0xa0000->0[L]  } ...

Change-Id: I07cad5d8678426cdac45872cda028ea7a85d7d81
2018-07-11 10:44:49 +01:00
Dianne Hackborn
95031ef2e6 Now track "active time" in procstats.
Associations now keep track of the time they are
actively involved in impacting their target application.
This is based on the procstate propagating through the
association being the same as the procstate of its target
process...  so it may count as active when there is
another reason for that process to be in the same state.

To do this, we now maintain a set of "tracking
associations" -- these are in-use associations that
we know we need to be tracking to determine whether
they are active.  This list is built based on whether
we at all consider an association during an oom_adj
computation, and at the end of that walked to determine
which of those associations are currently active.

Also add tracking of associations through external
provider references, with a tag name now needing to be
passed through so we can mark up the reason for the
external reference.

Test: manual
Bug: 110957691
Change-Id: I426a499834e20a9d7f2b439faf9cb398d9792fa2
2018-07-09 12:46:53 -07:00
TreeHugger Robot
87230dceac Merge "Add kernel version to incident report" 2018-06-26 21:15:05 +00:00
TreeHugger Robot
3e2e1ae482 Merge "Clean up TODOs in statsd" 2018-06-26 17:40:06 +00:00
Yao Chen
5bfffb54da Clean up TODOs in statsd
+ Created bugs for those TODOs that are still relevant.
+ Remove obsolete TODOs.

Test: no code change.
Change-Id: I41c2a89a882f087817ee6cbc3f095e1d80e1928e
2018-06-25 11:08:04 -07:00
Andreas Gampe
9e4e689f8f Statsd: Update perfprofd config proto location
Link to new location.

Bug: 110555909
Test: m
Change-Id: I306e1dc740886d1227787604a48158d9f0c3c40a
2018-06-25 09:59:26 -07:00
Yi Jin
908c02f5c1 Add kernel version to incident report
Bug: 110230810
Test: atest incidentd_test
Change-Id: I502b34f23d61a7346d79ff0dc378add8461d2d27
2018-06-22 16:51:40 -07:00
Mickey Keeley
00f2d6038a Merge "BootParameters: Use proto for disk io." 2018-06-20 20:27:49 +00:00
Mickey Keeley
81121bd0ac BootParameters: Use proto for disk io.
Use proto for disk usage.

Bug: 79932027
Test: Ran through the following scenarios-
- RebootActivity parses previous boot parameters; sets next as expected.
- Push old parameters to device and ensured bootanimations reads it and
saves new format (serialized proto) that can be read in userspace
(RebootActivity).
- Unit tests pass.

Change-Id: I98aefb7a832c985d5061ee80ab85a4523f067641
2018-06-20 10:37:54 -07:00
Irina Dumitrescu
24ed35cd83 Add dpm force-network-logs command to force network logs retrieval.
This is useful because logs are batched every 1.5-2hrs if there are
not enough logs to fill up a batch. The command is throttled at
10 seconds as a spam prevention measure.

Bug: 62251154
Test: in adb shell run dpm force-network-logs. Observe a new batch
being created in the phone directory
/storage/emulated/0/Android/data/com.afwsamples.testdpc/files/. Also
observe a fresh batch is being displayed on the phone in the TestDPC
app, under "Retrieve network logs".
Change-Id: I5ff9d5c78497ea81533b5248816b4d6e160d338f
2018-06-20 16:23:58 +01:00
TreeHugger Robot
9e48343247 Merge "StatsPullerManager not use singleton" 2018-06-15 00:50:50 +00:00
Chenjie Yu
e22192071d StatsPullerManager not use singleton
This is to be consistent with other patterns such as UidMap.
This also makes unit test simpler.

Change-Id: I1558cd609e470481f269ecf2ae616277a95cfbf0
Bug: 72722120
Test: unit test
2018-06-14 15:46:54 -07:00