7009 Commits

Author SHA1 Message Date
bquezada
724ed1e303 Add auto rotate metrics in statsd.
Test: Tested with local device.
Bug: 171820651
Change-Id: I19df36964d0fb9aeb1cdf6dff4a0574c0854ed3e
2020-11-19 17:25:06 +00:00
Riddle Hsu
6e4f57488d Merge "Add a new launch type for hot start with relaunched activity" 2020-11-19 06:52:27 +00:00
Nick Chalko
1fd8b5675e Add TifTuneStateChanged atom.
This is the base atom for all TIF metrics

Test: ./out/host/linux-x86/bin/statsd_testdrive
Bug: 165369586
Change-Id: I2e5c3e7f51abd2700611fcc0eaef91ec029513c8
2020-11-18 11:11:36 -08:00
Shuzhen Wang
b2443990e9 Camera: Enhance camera atoms for system health
Introduce camera system health atoms, including:
- Camera open, close, and session creation time
- Camera session and stream combination information,
- Stream statistics:
  - stream width, height, format, dataspace, usage flag,
  - max buffer count
  - buffer loss
  - first frame latency.

Test: ./out/host/linux-x86/bin/statsd_testdrive 227
Test: CTS PerformanceTest
Bug: 154159000
Change-Id: I858d64f3324bb9652a59e5857f2730c92c616a8e
2020-11-18 09:49:17 -08:00
Sergey Troshin
3a829f0ce8 Merge "Declare Wifi Scan atom." 2020-11-18 09:55:30 +00:00
Riddle Hsu
59c2e7cf8a Add a new launch type for hot start with relaunched activity
An existing activity may be relaunched when moving from background
to front if the current configuration is changed and the activity
cannot handle the change.

The relaunch type was reported as a hot start because its process
is alive and the original activity exists. But the relaunch needs to
destroy the original activity and create a new instance, which may
even take longer time than a warm start. So the case should be
separated from hot start.

Also:
- Make WaitResult#launchState is always populated by
  ActivityMetricsLogger, so "am start -W" can get consistent
  launch type.
- Remove dead code in ActivityRecord#ensureActivityConfiguration
  that it already early returns if !attachedToProcess.

Bug: 172528316
Test: atest ActivityMetricsLaunchObserverTests#testLaunchState
Change-Id: I3ef64ce1e23b2f13d42fa2b12bc31c0cdb4652fc
2020-11-18 15:11:20 +08:00
Ryan Mitchell
db21f09a8e Revert^2 "libandroidfw hardening for IncFs"
55ef6167a2c235bd88c7216238b2001b46795b79

Change-Id: I02d4890d181655dfd0a14c188468db512559d27b
2020-11-17 23:01:35 +00:00
Sergey Troshin
2b334ab253 Declare Wifi Scan atom.
Test: not required
Bug: 171790175

Change-Id: I87c861d263a25db2ef05688007654622886f75a8
2020-11-17 18:56:26 +01:00
Maryam Karimzadehgan
81b1321413 Add package_name to log for debugging the back gesture model. am: 8c95065cb7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13005358

Change-Id: I99aa9a670cde9df8317a3433c21fda47326e2875
2020-11-17 03:26:18 +00:00
Maryam Karimzadehgan
619cbfa07b Add log entries for the results for the ML model for am: 832d060168
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13005357

Change-Id: Id49f87dd43c69e29e0840fbdfba2a38361211e2a
2020-11-17 03:26:02 +00:00
TreeHugger Robot
bfdd1a33dd Merge changes from topic "voice_metrics_android_s"
* changes:
  Add band mapping for GERAN and UTRAN
  Add new metrics to VoiceCallSession atom.
2020-11-16 20:21:54 +00:00
Maryam Karimzadehgan
8c95065cb7 Add package_name to log for debugging the back gesture model.
Test: manual.
Bug: 150170384
Change-Id: I94efa3ec6af62b485c45f9bf17861722b73ecca3
Merged-In: I94efa3ec6af62b485c45f9bf17861722b73ecca3
2020-11-16 18:56:18 +00:00
Maryam Karimzadehgan
832d060168 Add log entries for the results for the ML model for
the back gesture.

Test: manual
Bug: 150170384
Change-Id: Ic08bdea27fea085bcbb425dbac6682a88d29aa8a
Merged-In: Ic08bdea27fea085bcbb425dbac6682a88d29aa8a
2020-11-16 18:56:08 +00:00
TreeHugger Robot
baf630d362 Merge changes from topic "USB-GADGET-HAL-v1.2"
* changes:
  Add methods for Usb Gadget Hal v1.2
  Support USB Gadget V1.2 HAL
2020-11-16 10:43:46 +00:00
Tej Singh
18a3a6644d Merge changes from topic "revert-12787270-FYIHXORGZY"
* changes:
  Revert "libandroidfw hardening for IncFs"
  Revert "Cache resolved theme values"
  Revert "Do not cache bag parent stack until requested"
2020-11-14 03:22:09 +00:00
Ryan Mitchell
55ef6167a2 Revert "libandroidfw hardening for IncFs"
Revert "Move map_ptr to incfs namspace"

Revert submission 12787270

Reason for revert: b/173250495
Reverted Changes:
I5cd1bc8a2:libandroidfw hardening for IncFs
Ice5dbcfb2:Move map_ptr to incfs namspace
I29ccdc8ed:Do not cache bag parent stack until requested
I1e9e9acaa:Cache resolved theme values

Change-Id: Ib90ef68339710086df41e9abe0833a542d03a74f
2020-11-13 23:55:20 +00:00
Oli Lan
ab89267d93 Merge "Enable instrumentation of system server on debuggable devices." 2020-11-13 17:51:09 +00:00
Tej Singh
9d56d63242 Merge "Partial config update: test update states" 2020-11-13 08:42:15 +00:00
Tej Singh
084e50400d Partial config update: test update states
Adds a unit test for updating states. Mostly to ensure that replaced
states are calculated correctly.

Also refactor the logic a bit to make it easier to test.

Test: atest statsd_test
Bug: 162323667
Change-Id: Ie0e72c25c879d1c4dd59c330d40e5757ef750ec5
2020-11-12 16:20:31 -08:00
Ryan Mitchell
c234812e27 Merge changes from topic "libaw-hardening"
* changes:
  Do not cache bag parent stack until requested
  Cache resolved theme values
  libandroidfw hardening for IncFs
2020-11-13 00:05:40 +00:00
TreeHugger Robot
42f01ac56c Merge "Partial config update: various small things" 2020-11-12 19:06:20 +00:00
Ryan Mitchell
c75c2e0922 libandroidfw hardening for IncFs
Migrate libandroifw to using incfs::util::map_ptr to prevent processes
from crashing when parsing the resources.arsc, parsing compiled xml,
files, and retrieving resource values.

This change propagates incremental failures to the JNI level where they
are raised as ResourcesNotFoundException.

Performance of ResourcesPerfWorkloads without change (time in
nanoseconds):
[1/3] com.android.resources.perf.PerfTest#youtube: PASSED (11.883s)
    youtube_ns_median: 93812805
    youtube_ns_standardDeviation: 4387062
    youtube_ns_mean: 94455597
[2/3] com.android.resources.perf.PerfTest#maps: PASSED (11.265s)
    maps_ns_standardDeviation: 2997543
    maps_ns_mean: 83480371
    maps_ns_median: 82210941
[3/3] com.android.resources.perf.PerfTest#gmail: PASSED (24.963s)
    gmail_ns_median: 266141091
    gmail_ns_standardDeviation: 3492043
    gmail_ns_mean: 267472765

With change and verification forcibly enabled for all apks
(including the framework-res.apk):
[1/3] com.android.resources.perf.PerfTest#youtube: PASSED (11.646s)
    youtube_ns_median: 101999396
    youtube_ns_standardDeviation: 4625782
    youtube_ns_mean: 102631770
[2/3] com.android.resources.perf.PerfTest#maps: PASSED (11.286s)
    maps_ns_standardDeviation: 2692088
    maps_ns_mean: 91326538
    maps_ns_median: 90519884
[3/3] com.android.resources.perf.PerfTest#gmail: PASSED (24.694s)
    gmail_ns_median: 290284442
    gmail_ns_standardDeviation: 5764632
    gmail_ns_mean: 291660464

With change and verification disabled:
[1/3] com.android.resources.perf.PerfTest#youtube: PASSED (11.748s)
    youtube_ns_median: 95490747
    youtube_ns_standardDeviation: 7282249
    youtube_ns_mean: 98442515
[2/3] com.android.resources.perf.PerfTest#maps: PASSED (10.862s)
    maps_ns_standardDeviation: 4484213
    maps_ns_mean: 87912988
    maps_ns_median: 86325549
[3/3] com.android.resources.perf.PerfTest#gmail: PASSED (24.034s)
    gmail_ns_median: 282175838
    gmail_ns_standardDeviation: 6560876
    gmail_ns_mean: 282869146

These tests were done on a Pixel 3 and with cpu settings configured by
libs/hwui/tests/scripts/prep_generic.sh:

 Locked CPUs 4,5,6,7 to 1459200 / 2803200 KHz
 Disabled CPUs 0,1,2,3

Bug: 160635104
Bug: 169423204
Test: boot device && atest ResourcesPerfWorkloads

Change-Id: I5cd1bc8a2257bffaba6ca4a1c96f4e6640106866
2020-11-12 08:13:44 -08:00
Shubang Lu
19bb47aa4f Merge "Add media playback atom" 2020-11-12 10:10:36 +00:00
shubang
25d4184190 Add media playback atom
Bug: 159337195
Test: make
Change-Id: Id0fef718bbcf131c71f50fccc020115e3a9481d4
2020-11-12 00:19:44 -08:00
TreeHugger Robot
5bba6f62ab Merge "Partial config update: various metadata" 2020-11-12 06:11:59 +00:00
raychi
062ddc3475 Add methods for Usb Gadget Hal v1.2
1. Add svc usb getUsbSpeed method
2. Add svc usb getCurrentGadgetHalVersion method

Bug: 168282708
Test: build pass and get test result
Change-Id: Id3480757fd3545b0cce083aaa3cf906e09ae318c
2020-11-12 11:00:08 +08:00
Michele Berionne
a680bdfc3d Add new metrics to VoiceCallSession atom.
Bug: 151843373
Test: manual
Change-Id: Ibd3338cbf64f5f079bb65f599a423b06699f1acc
2020-11-11 18:25:36 +00:00
Jeff Sharkey
55ee3e4913 Custom binary XML wire protocol tools.
To support local development work, add new "xml2abx" and "abx2xml"
shell utilities which offer to convert between human-readable XML and
our new binary XML protocol.

Interally this utility uses Xml.copy() which is already covered by
existing unit tests that verify lossless conversion between the two
underlying protocols.

Bug: 171832118
Test: manual
Change-Id: I2f4c9850754cafb2bb31eeefa6bd611360963b03
2020-11-10 19:12:10 -07:00
Songchun Fan
2503bdd788 Merge changes from topic "anr-add-loading-info"
* changes:
  [am/incremental] add package loading info in main logcat for crash/ANRs
  [metrics/incremental] add package loading info in ANR and crash metrics
2020-11-11 00:07:05 +00:00
Songchun Fan
6a6c0cf526 [metrics/incremental] add package loading info in ANR and crash metrics
On ANR or crash, ProcessRecord will obtain the package loading info from
Package Manager and log it as part of the Westworld metrics "ANROccurred".

BUG: 162600251
Test: atest CtsStatsdAtomHostTestCases:android.cts.statsdatom.statsd.UidAtomTests#testANROccurred
Change-Id: I4b527d731c59c6590771f898c26bfeacb16e6ad5
2020-11-10 20:41:01 +00:00
Tej Singh
9465da161d Partial config update: various small things
- init new/replaced metrics
- guardrails for number of metrics/matchers/conditions/alerts
- report update to statsdstats
- update if the config is active

Test: atest statsd_test
Bug: 162323476
Change-Id: Ieaa2d18903de8020fcee5bb128124ab19f10a152
2020-11-09 17:35:35 -08:00
Tej Singh
57206c825a Partial config update: various metadata
Partial config update for:
- atoms allowed from any uid
- no report metrics
- installer/version strings in uidmap
- hash strings
- annotations
- config ttl
- persisting configs locally

Mostly just reset these fields.

BYPASS_INCLUSIVE_LANGUAGE_REASON=proto field that cant be renamed

Test: atest statsd_test
Bug: 162323476
Change-Id: I5e636f8eb240bd3d44f08a87811b1dfefc428191
2020-11-09 17:15:52 -08:00
Jeffrey Huang
76b6e28720 Deprecate DaveyOccurred Atom
Bug: 172692115
Test: m libhwui
Change-Id: I56df46ac5b8e00acc251f222bd6d0c1f4e0f17ac
2020-11-09 12:20:42 -08:00
Oli Lan
26ff5508df Enable instrumentation of system server on debuggable devices.
This makes two changes to enable the instrumentation of system server
and other system processes:

- A new option '--no-restart' has been added to 'am instrument', that
causes the test apk to be loaded without restarting the target app.

- On debuggable devices, the check that the test apk has the same
signature as the target app is not performed.

With these changes, a test apk with instrumentation configured
with targetPackage="android" can run a test from within the system
server process, on debuggable devices. These options may also allow
other system processes to be tested.

See go/internal-api-testing for more information.

Test: atest FrameworksInProcessTests
Change-Id: I8829bcbe7f3373170bcf1e7fa869d5d31f40576d
2020-11-05 16:57:43 +00:00
Nikita Iashchenko
c271490863 Merge "Import TLS handshake atom for Conscrypt" am: 97f35bbbef am: bce0208847 am: d5cad5b37b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1484136

Change-Id: I34e7639f6fb4aa3516302d6d63fc74fd632dbcea
2020-11-05 11:16:07 +00:00
TreeHugger Robot
9106cc18e2 Merge "Config update for allowed log sources" 2020-11-05 02:45:49 +00:00
TreeHugger Robot
12915194fb Merge "Add carwatchdog atoms for apps' stats on killing." 2020-11-04 21:32:08 +00:00
Makoto Onuki
2247c3c6d4 Merge "Add sync manager documentation on app-standby exemption" 2020-11-04 21:30:19 +00:00
Julia Reynolds
0ef853937d Merge "Add some missing conversation log fields" 2020-11-04 13:14:47 +00:00
TreeHugger Robot
35615f9bc3 Merge "Instrument CUJ for HUN and App launch from notification" 2020-11-04 06:00:04 +00:00
Tej Singh
34eac18349 Config update for allowed log sources
Completely resets the allowed log sources from scratch.

Also:
- renamed initLogSourceWhitelist to initAllowedLogSources.
- refactored tests to have cleaner asserts on data structures

Test: atest statsd_test
Bug: 162323471
Change-Id: Ie717da732eea82c764b5b1f272080a4d97a7a8eb
2020-11-03 13:24:12 -08:00
Nikita Iashchenko
ff64fd0f36 Import TLS handshake atom for Conscrypt
Bug: 160345816
Test: m droid
Change-Id: I7ddf7626376bd649c8b10306d464b783cf16959b
Merged-In: I142a792c34dced6b0e27b867ed3a1d95249a5f7f
2020-11-03 16:48:04 +00:00
TreeHugger Robot
1aa05b5b0f Merge "Update SurfaceFlinger atoms to include shared timeline counters" 2020-11-02 23:28:29 +00:00
TreeHugger Robot
4c5831a696 Merge changes Ia2fb33e9,Id3afa04b
* changes:
  Update Alarms/Subscriptions
  Partial config update for alerts/subscriptions
2020-11-02 23:00:07 +00:00
Tej Singh
8b46bc11b4 Update Alarms/Subscriptions
This is the same as initializing because alarms have no state to carry
over. We can just replace them all without losing anything.

Test: atest statsd_test
Bug: 162323547
Change-Id: Ia2fb33e9ac79476babce57e2e0fb1ca49091e260
2020-11-02 12:32:42 -08:00
Julia Reynolds
1785b2efb6 Add some missing conversation log fields
Test: cts, manual
Fixes: 157240045
Change-Id: I5c77649596612115c8db99d7e32221b07bf1bda6
2020-11-02 09:41:08 -05:00
Tej Singh
d07d0ff02f Partial config update for alerts/subscriptions
Preserves alerts if the definition didn't change and the underlying
metric didnt change.

All alerts need to be readded to the metric b/c metrics will always
clear the alerts on config updates. In the existing code, the metric
producer created the AnomalyTracker (since duration metrics need
DurationAnomalyTrackers). Preserved alerts already have an
AnomalyTracker. Therefore, we need a second overload of
addAnomalyTracker within MetricProducer to add existing ones. Note that
we don't need to worry about the type of AnomlayTracker, since if the
alert is preserved, both the AnomalyTracker and metric must not have
changed, so they will both be the correct type.

Subscriptions are also redone - alerts will clear their subscriptions,
and all subscriptions will be readded.

For duration metric, we now need to propagate adding anomaly trackers to
the DurationTrackers since it's now possible to add anomaly trackers
after the durationTrackers have been created.

Test: atest statsd_test
Bug: 162323547
Change-Id: Id3afa04b252f3a3523114407a389be25b9171a97
2020-11-02 02:01:00 -08:00
Santiago Seifert
9ca23a4863 Add MediaMetrics support to MediaParser
Includes:
- Java changes to collect the metrics.
- JNI changes to plumb metrics to the MediaMetrics service.
- statsd atoms.proto changes for data transmission.

Bug: 158742256
Test: atest CtsMediaParserTestCases
Test: atest CtsMediaParserHostTestCases
Test: Manually using dumpsys.
Change-Id: If51ee018da3056231910cd9c18f1b938a5c0e343
Merged-In: If51ee018da3056231910cd9c18f1b938a5c0e343
2020-10-31 11:28:00 +00:00
Santiago Seifert
f347c9537c Add MediaMetrics support to MediaParser
Includes:
- Java changes to collect the metrics.
- JNI changes to plumb metrics to the MediaMetrics service.
- statsd atoms.proto changes for data transmission.

Bug: 158742256
Test: atest CtsMediaParserTestCases
Test: atest CtsMediaParserHostTestCases
Test: Manually using dumpsys.
Change-Id: If51ee018da3056231910cd9c18f1b938a5c0e343
Merged-In: If51ee018da3056231910cd9c18f1b938a5c0e343
2020-10-31 11:27:18 +00:00
Lakshman Annadorai
9a15572240 Add carwatchdog atoms for apps' stats on killing.
- CarWatchdog will capture applications' stats using
KilledAppStatsReported on application killing.

Bug: 158131194
Test: Tested locally and verified the atoms are reported with
statsd_testdrive.

Change-Id: I8cf40a340350add9fadccaa887ece73227875b24
2020-10-30 13:43:28 -07:00