diff options
| author | 2020-09-10 20:34:31 +0000 | |
|---|---|---|
| committer | 2020-09-10 20:34:31 +0000 | |
| commit | 95425202db6f091e0237a6d556fd12fd67e0c6df (patch) | |
| tree | 51b6ca61457306c915595a9ba96f5cb533024327 | |
| parent | 5b8380c335c52d3f06935389cc881186697c4271 (diff) | |
| parent | a39a1cead737c52370c53959559241d801137a2f (diff) | |
Merge "Quiet excessive logging of missing lambdas during preload"
| -rw-r--r-- | core/java/com/android/internal/os/ZygoteInit.java | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/core/java/com/android/internal/os/ZygoteInit.java b/core/java/com/android/internal/os/ZygoteInit.java index 32e7fdc51d6c..5948e7eab4ee 100644 --- a/core/java/com/android/internal/os/ZygoteInit.java +++ b/core/java/com/android/internal/os/ZygoteInit.java @@ -86,9 +86,10 @@ import java.security.Security; */ public class ZygoteInit { - // TODO (chriswailes): Change this so it is set with Zygote or ZygoteSecondary as appropriate private static final String TAG = "Zygote"; + private static final boolean LOGGING_DEBUG = Log.isLoggable(TAG, Log.DEBUG); + private static final String PROPERTY_DISABLE_GRAPHICS_DRIVER_PRELOADING = "ro.zygote.disable_gl_preload"; @@ -284,6 +285,7 @@ public class ZygoteInit { new BufferedReader(new InputStreamReader(is), Zygote.SOCKET_BUFFER_SIZE); int count = 0; + int missingLambdaCount = 0; String line; while ((line = br.readLine()) != null) { // Skip comments and blank lines. @@ -302,24 +304,33 @@ public class ZygoteInit { Class.forName(line, true, null); count++; } catch (ClassNotFoundException e) { - Log.w(TAG, "Class not found for preloading: " + line); + if (line.contains("$$Lambda$")) { + if (LOGGING_DEBUG) { + missingLambdaCount++; + } + } else { + Log.w(TAG, "Class not found for preloading: " + line); + } } catch (UnsatisfiedLinkError e) { Log.w(TAG, "Problem preloading " + line + ": " + e); } catch (Throwable t) { Log.e(TAG, "Error preloading " + line + ".", t); if (t instanceof Error) { throw (Error) t; - } - if (t instanceof RuntimeException) { + } else if (t instanceof RuntimeException) { throw (RuntimeException) t; + } else { + throw new RuntimeException(t); } - throw new RuntimeException(t); } Trace.traceEnd(Trace.TRACE_TAG_DALVIK); } Log.i(TAG, "...preloaded " + count + " classes in " + (SystemClock.uptimeMillis() - startTime) + "ms."); + if (LOGGING_DEBUG && missingLambdaCount != 0) { + Log.i(TAG, "Unresolved lambda preloads: " + missingLambdaCount); + } } catch (IOException e) { Log.e(TAG, "Error reading " + PRELOADED_CLASSES + ".", e); } finally { |