diff options
| author | 2024-09-04 10:35:20 +0000 | |
|---|---|---|
| committer | 2024-09-06 13:29:21 +0000 | |
| commit | 3fda9e8e5b06d9dd0f8a114c0429ced050502a47 (patch) | |
| tree | e2d3eed9e150fc866e185092394d59907d66eb6d | |
| parent | c259a67f983674a0030f1ac7248a266ed7502bfa (diff) | |
Add logging to help debugging missing viewerConfig issue.
Test: n/a
Flag: EXEMPT adding logging
Bug: 364254249
Change-Id: Ica26ccbcb27cb6803777328fced134f0475e3f91
| -rw-r--r-- | core/java/com/android/internal/protolog/PerfettoProtoLogImpl.java | 11 | ||||
| -rw-r--r-- | core/java/com/android/internal/protolog/ProtoLogImpl.java | 9 |
2 files changed, 20 insertions, 0 deletions
diff --git a/core/java/com/android/internal/protolog/PerfettoProtoLogImpl.java b/core/java/com/android/internal/protolog/PerfettoProtoLogImpl.java index 6c4d63763d7e..e440dc9053fd 100644 --- a/core/java/com/android/internal/protolog/PerfettoProtoLogImpl.java +++ b/core/java/com/android/internal/protolog/PerfettoProtoLogImpl.java @@ -480,8 +480,19 @@ public class PerfettoProtoLogImpl extends IProtoLogClient.Stub implements IProto String messageString; if (mViewerConfigReader == null) { messageString = message.getMessage(); + + if (messageString == null) { + Log.e(LOG_TAG, "Failed to decode message for logcat. " + + "Message not available without ViewerConfig to decode the hash."); + } } else { messageString = message.getMessage(mViewerConfigReader); + + if (messageString == null) { + Log.e(LOG_TAG, "Failed to decode message for logcat. " + + "Message hash either not available in viewerConfig file or " + + "not loaded into memory from file before decoding."); + } } if (messageString == null) { diff --git a/core/java/com/android/internal/protolog/ProtoLogImpl.java b/core/java/com/android/internal/protolog/ProtoLogImpl.java index da6d8cff6890..7bdcf2d14b19 100644 --- a/core/java/com/android/internal/protolog/ProtoLogImpl.java +++ b/core/java/com/android/internal/protolog/ProtoLogImpl.java @@ -23,6 +23,7 @@ import static com.android.internal.protolog.common.ProtoLogToolInjected.Value.LO import static com.android.internal.protolog.common.ProtoLogToolInjected.Value.VIEWER_CONFIG_PATH; import android.annotation.Nullable; +import android.util.Log; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.protolog.common.IProtoLog; @@ -37,6 +38,8 @@ import java.util.TreeMap; * A service for the ProtoLog logging system. */ public class ProtoLogImpl { + private static final String LOG_TAG = "ProtoLogImpl"; + private static IProtoLog sServiceInstance = null; @ProtoLogToolInjected(VIEWER_CONFIG_PATH) @@ -97,6 +100,9 @@ public class ProtoLogImpl { */ public static synchronized IProtoLog getSingleInstance() { if (sServiceInstance == null) { + Log.i(LOG_TAG, "Setting up " + ProtoLogImpl.class.getSimpleName() + " with " + + "viewerConfigPath = " + sViewerConfigPath); + final var groups = sLogGroups.values().toArray(new IProtoLogGroup[0]); if (android.tracing.Flags.perfettoProtologTracing()) { @@ -105,6 +111,9 @@ public class ProtoLogImpl { // TODO(b/353530422): Remove - temporary fix to unblock b/352290057 // In some tests the viewer config file might not exist in which we don't // want to provide config path to the user + Log.w(LOG_TAG, "Failed to find viewerConfigFile when setting up " + + ProtoLogImpl.class.getSimpleName() + ". " + + "Setting up without a viewer config instead..."); sServiceInstance = new PerfettoProtoLogImpl(sCacheUpdater, groups); } else { sServiceInstance = |