Previously, fdopen was being called on a file descriptor that was owned
by a unique_fd without releasing. This leads to a double close, since
both fclose and the unique_fd destructor will try to close the fd.
Bug: http://b/113880863
Test: treehugger
Change-Id: I6f6f48d304861b5e4d7efee0d3ad0e30178a95a4
Adds LooperStats and LooperStatsService which set a static
Looper.Observer to record the count of dispatched messages and
cpu/latency information. The aggregated stats are collected by
Westworld as pulled atoms.
The collection is disabled by default and requires a manual call to
enable:
adb shell cmd looper_stats enable
Test: Unit tests and tested manually that the collected data seems
reasonable.
Change-Id: I7162fbca4e324f62887f95df3405205cbe4416ca
The list of events in this file is meant to be used with Generic Atom
defined in atoms.proto in statsd. Instead of unique int, we would like
to log it with an enum that shows semantic meaning of events. Also, this
change re-sorts imports and removes unused imports and remove the
previous logging line to test GenericAtom.
Test: statsd_test
Change-Id: Ia9335e48ada68bee6d716ad4d7ac50238932da95
This reverts commit f154cf018994bc8a814996e4e0345c6388507054.
Reason for revert: Temporary rollback to allow ag/4819964 to go into pi-dev (and into master).
Change-Id: I607ec64aa9da3b0b1adf49bd361f9ed4927dba05
+ 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
Migrates the existing information collected by diskstats to westworld.
Creates 4 pulled atoms, 2 of which read from a cached file produced by
DiskStatsLoggingService. Most of the logic is taken from
DiskStatsService.java.
Test: Manually verified information is the same as dumpsys. Will look
into cts as well.
Change-Id: I9818ac787de46514bc09ab3887cbfaec6cff273c
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
+ 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
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
+ Created bugs for those TODOs that are still relevant.
+ Remove obsolete TODOs.
Test: no code change.
Change-Id: I41c2a89a882f087817ee6cbc3f095e1d80e1928e
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
Statsd calls were sometimes made from BatteryStats, instead of directly
from the source, as a way of getting it running quickly in P. These must
now be done properly and separately.
Note that Statsd needs to be independent of BatteryStats, in preparation
for deprecating large parts of BatteryStats.
Bug: 80308558
Test: cts-tradefed run cts-dev -m CtsStatsdHostTestCases
Change-Id: I54fa54a2dc59dfa68f0e063d7063fac423bf0bf4