From 6411a3353dfd1e72a33c03b0d2d99c3dc532075f Mon Sep 17 00:00:00 2001 From: Yan Wang Date: Wed, 19 Feb 2020 09:43:46 -0800 Subject: [PATCH 1/2] startop: Fix a bug in iorap functional test. The prefetching work runs on another process. Grep everything to workaround it. Bug: 137403231 Test: atest iorap-functional-tests Change-Id: Iac1796cb22f0db83ac5ebd78cb40e5cc5ac3a930 (cherry picked from commit 7d76f014eb92661f4fb8fdb949ac000ffdce3c65) --- .../android/startop/iorap/IorapWorkFlowTest.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/startop/iorap/functional_tests/src/com/google/android/startop/iorap/IorapWorkFlowTest.java b/startop/iorap/functional_tests/src/com/google/android/startop/iorap/IorapWorkFlowTest.java index 40023878af193..9abbcd71cfd29 100644 --- a/startop/iorap/functional_tests/src/com/google/android/startop/iorap/IorapWorkFlowTest.java +++ b/startop/iorap/functional_tests/src/com/google/android/startop/iorap/IorapWorkFlowTest.java @@ -70,7 +70,7 @@ public class IorapWorkFlowTest { private static final Duration TIMEOUT = Duration.ofSeconds(300L); private static final String READAHEAD_INDICATOR = - "Description = /data/misc/iorapd/com.android.settings/none/com.android.settings.Settings/compiled_traces/compiled_trace.pb"; + "Description = /data/misc/iorapd/com.android.settings/-?\\d+/com.android.settings.Settings/compiled_traces/compiled_trace.pb"; private UiDevice mDevice; @@ -326,14 +326,14 @@ public class IorapWorkFlowTest { return false; } - String log = executeShellCommand("logcat -s iorapd -d"); + String log = executeShellCommand("logcat -d"); Pattern p = Pattern.compile( - ".*" + READAHEAD_INDICATOR - + ".*Total File Paths=(\\d+) \\(good: (\\d+)%\\)\n" - + ".*Total Entries=(\\d+) \\(good: (\\d+)%\\)\n" - + ".*Total Bytes=(\\d+) \\(good: (\\d+)%\\).*", - Pattern.DOTALL); + ".*" + READAHEAD_INDICATOR + + ".*Total File Paths=(\\d+) \\(good: (\\d+[.]?\\d*)%\\)\n" + + ".*Total Entries=(\\d+) \\(good: (\\d+[.]?\\d*)%\\)\n" + + ".*Total Bytes=(\\d+) \\(good: (\\d+[.]?\\d*)%\\).*", + Pattern.DOTALL); Matcher m = p.matcher(log); if (!m.matches()) { From be178769addde35a14b7a7c033b41da24f6c21b2 Mon Sep 17 00:00:00 2001 From: Yan Wang Date: Fri, 21 Feb 2020 09:36:10 -0800 Subject: [PATCH 2/2] iorap: Increase the JobScheduledEvent#TYPE_MAX to 1. Fixes system_server crashes at the end of a job (in #onStopJob) by correcting the MAX type number. Bug: 148191073 Test: make Change-Id: I12b0c65a0b3ad7ab3277a94f51fa2e71d323f862 (cherry picked from commit aa1ac9309416519dab21a17b8632645860e1431b) --- .../src/com/google/android/startop/iorap/JobScheduledEvent.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/startop/iorap/src/com/google/android/startop/iorap/JobScheduledEvent.java b/startop/iorap/src/com/google/android/startop/iorap/JobScheduledEvent.java index 9b3bfcb0fa4a0..2055b206dd7af 100644 --- a/startop/iorap/src/com/google/android/startop/iorap/JobScheduledEvent.java +++ b/startop/iorap/src/com/google/android/startop/iorap/JobScheduledEvent.java @@ -40,7 +40,7 @@ public class JobScheduledEvent implements Parcelable { public static final int TYPE_START_JOB = 0; /** JobService#onJobStopped */ public static final int TYPE_STOP_JOB = 1; - private static final int TYPE_MAX = 0; + private static final int TYPE_MAX = 1; /** @hide */ @IntDef(flag = true, prefix = { "TYPE_" }, value = {