This reverts commit 203a9ab7665787c94f7d0711a1ad172588070aa6.
Reason for revert: Fix the original issue. There was a race with the
cleanup method which was resetting the app record to null.
Test: manual, adb logcat -b events | grep sysui_multi_action
repeat steps from bugreport reporting the crash
Bug: 73102540
Change-Id: I6d9c6110a9d5dadeb9d4361592711d63563c958a
+ A state change atom can have one exclusive state field, and any
number of primary key fields.
When there is primary key in the atom, it means the state belongs to the primary key.
For example,
message UidProcessStateChanged {
optional int32 uid = 1 [(stateFieldOption).option = PRIMARY];
optional android.app.ProcessStateEnum state = 2 [(stateFieldOption).option = EXCLUSIVE];
}
When there is no primary key fields in the atom, the state is global.
For example,
message ScreenStateChanged {
optional android.view.DisplayStateEnum state = 1 [(stateFieldOption).option = EXCLUSIVE];
}
+ The annotation is consumed by stats_log_api_gen to generate a static map from the state
atoms to its primary fields, and exclusive fields
+ stats_log.proto is splitted into 2 proto files, because statsd needs proto lite, and c++
lite proto library cannot properly ignore the field options which requires full proto.
This CL doesn't change any logic in the statsd yet. A separate CL will use the field option
information to correctly track the state.
Test: added unit tests in stats_log_api_gen_test. and statsd_test pases.
Change-Id: I9e8a979fe81ba60efd4d854bb7087ce4b2b147ec
Statsd supports anomaly detection for max duration, which is
conceptually like asking for an anomaly on the current duration.
There was a bug previously in the logic for max duration since we
recorded a duration every time a dimension went into pause. Now, we
only record a max duration when the dimension goes into stop.
When a dimension inside the MaxDurationTracker leaves the started
state, we need to check if we still need to keep an anomaly alarm
set. It's possible that we just immediately set an alarm with the
same timestamp as what was just deleted.
Test: Added some unit-tests and tested on marlin-eng.
Change-Id: I09c82cd266b4cc6e1c893ad166e602bf08baca0e
Getting a past bucket value will always crash for anomalies
configured to track only the most recent one bucket.
Test: N/A
Change-Id: I2cd1c82fe8ba4cecb4fac21038bb5f04a60c360e
This reverts commit 0a8bea818c330d02161322901534992253a2f9ee.
E AndroidRuntime: *** FATAL EXCEPTION IN SYSTEM PROCESS: ActivityManager
E AndroidRuntime: java.lang.NullPointerException: Attempt to read from field 'java.lang.String com.android.server.am.ProcessRecord.requiredAbi' on a null object reference
E AndroidRuntime: at com.android.server.am.ActivityMetricsLogger.logAppTransition(ActivityMetricsLogger.java:504)
E AndroidRuntime: at com.android.server.am.ActivityMetricsLogger.access$100(ActivityMetricsLogger.java:62)
Bug: 73626352
Change-Id: Idd50e0d2cf34e5393b4ae76ef8bc48b0067532eb
The config can specify that when an alarm fires the relevant
subscriber is only informed with some probability. This allows
only a fraction of firings to trigger the subscriber's action.
Bug: 73287237
Test: none yet
Change-Id: I365faad8ffd1b40b01782c1d761b1c0e09c7c299
Log the apk optimization state for app transition events. This will allow
precise measurement of the events based on the level of optimizations
performed.
Test: manual, adb logcat -b events | grep sysui_multi_action
Bug: 73102540
Change-Id: Ia8ccddff4ebe4120e05bb5d1dfb1cd458fa61e8a
In ag/3554499 we made it so that comparisons of longs was supported.
That support was apparantly deleted by accident during a refactoring of
code, so this adds it back.
Bug: 73509837
Test: it gets used in run cts-dev -m CtsStatsdHostTestCases -t android.cts.statsd.alert.AnomalyDetectionTests#testCountAnomalyDetection
Change-Id: I3dbe7da61bbfb3e9982fd1e0cc7d4658b0168690
We would like to gather memory metrics of the processes when LMKD kills
a process. By gathering this info we would be able to analyze and improve
system health by potentially reducing memory footprint of the processes
contributing to the memory pressure on the device.
This feature would be available on production builds.
Perf analysis:
On an average getMemoryStateForProcesses method call takes
0.59 milli seconds per process.
To know more about this see: http://go/android-p-memory-metrics
Bug: 72177881
Test: Tested manually
Change-Id: Ice94c2d937a5c84bc205981d99588a30f686ff9b
The ConfigManager can be triggered by Binder threads, so we should
lock any reads or writes to the config managers. We don't need to
lock within StatsService, so those methods simply call the methods
in ConfigManager.
Test: Test that statsd builds and unit tests pass.
Change-Id: I96904c4140a95dc60a419281c8c54f606a443fbc
The logic previously assumed that each bucket can only contain a
duration up to the bucket size, but this is not true for the max
sparse aggregation type. Instead of trying to keep this logic up to
date on the client, we will remove this check.
Test: Test that statsd still builds and unit-tests pass.
Change-Id: I576d75f8697b4e691b864f12ccaa6fa4611336c5
Now, each config is allowed at most 100 Alerts in it.
That is, for each uid, for each config id, the config's alert section
can have at most 100 items in it.
Bug: 73287046
Test: none yet
Change-Id: I2c81bc647627e432337c359c0a76aa3fc08bdd23
Renames the apphook atom to be more descriptive. Renames time
suffixes to match more clear convention (ms and msec are ambiguous).
Adds a field to CPU active time that's required for the metrics
to be usable.
Test: Test that statsd can still build.
Change-Id: I94866510738db994e8d757260f30e599ba995dbd
In ag/3580546 we now round up when setting anomaly alarms. This means
the test needs to be updated by 1s in one place.
Test: make statsd_test && adb sync data && adb shell data/nativetest64/statsd_test/statsd_test
Change-Id: Ibd3548833dcc2c1b9ca3a1da2c183bb771799775