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
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
+ 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
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
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
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
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
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
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
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
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
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
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
+ Created bugs for those TODOs that are still relevant.
+ Remove obsolete TODOs.
Test: no code change.
Change-Id: I41c2a89a882f087817ee6cbc3f095e1d80e1928e
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
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
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
Arc++ devices don't have the /d/wakeup_sources file. There's a chance
other device won't have it either, and there may be other files that we
thought were standard but are actually not, so it's safer to just assume
that not every file will be available on every device and not treat a
missing file as an error.
Bug: 110109543
Test: atest incidentd_test
Change-Id: Ief09427f08d18aee611d057ddafdb9a3466744db
Also put comment on RestoreSession saying that it doesn't kill the app
in the end.
Bug: 29255593
Test: Builds
adb shell bmgr help, verify usage
adb shell bmgr restore android, verify no-op
Change-Id: I89304149ea6c03a80937e321cf3a46fd173308e2