Loading core/java/android/view/SurfaceControlRegistry.java +22 −10 Original line number Diff line number Diff line Loading @@ -295,16 +295,7 @@ public class SurfaceControlRegistry { } sCallStackDebuggingInitialized = true; sCallStackDebuggingMatchCall = SystemProperties.get("persist.wm.debug.sc.tx.log_match_call", null) .toLowerCase(); sCallStackDebuggingMatchName = SystemProperties.get("persist.wm.debug.sc.tx.log_match_name", null) .toLowerCase(); sLogAllTxCallsOnApply = sCallStackDebuggingMatchCall.contains("apply"); // Only enable stack debugging if any of the match filters are set sCallStackDebuggingEnabled = !sCallStackDebuggingMatchCall.isEmpty() || !sCallStackDebuggingMatchName.isEmpty(); updateCallStackDebuggingParams(); if (sCallStackDebuggingEnabled) { Log.d(TAG, "Enabling transaction call stack debugging:" + " matchCall=" + sCallStackDebuggingMatchCall Loading @@ -325,6 +316,11 @@ public class SurfaceControlRegistry { final void checkCallStackDebugging(@NonNull String call, @Nullable SurfaceControl.Transaction tx, @Nullable SurfaceControl sc, @Nullable String details) { if (sCallStackDebuggingInitialized && sCallStackDebuggingEnabled) { updateCallStackDebuggingParams(); } if (!sCallStackDebuggingEnabled) { return; } Loading Loading @@ -355,6 +351,22 @@ public class SurfaceControlRegistry { } } /** * Updates the call stack debugging params from the system properties. */ private static void updateCallStackDebuggingParams() { sCallStackDebuggingMatchCall = SystemProperties.get("persist.wm.debug.sc.tx.log_match_call", null) .toLowerCase(); sCallStackDebuggingMatchName = SystemProperties.get("persist.wm.debug.sc.tx.log_match_name", null) .toLowerCase(); sLogAllTxCallsOnApply = sCallStackDebuggingMatchCall.contains("apply"); // Only enable stack debugging if any of the match filters are set sCallStackDebuggingEnabled = !sCallStackDebuggingMatchCall.isEmpty() || !sCallStackDebuggingMatchName.isEmpty(); } /** * Tests whether the given surface control name/method call matches the filters set for the * call stack debugging. Loading libs/WindowManager/Shell/src/com/android/wm/shell/docs/debugging.md +4 −2 Original line number Diff line number Diff line Loading @@ -81,9 +81,11 @@ adb logcat -s "SurfaceControlRegistry" # Disabling logging adb shell setprop persist.wm.debug.sc.tx.log_match_call \"\" adb shell setprop persist.wm.debug.sc.tx.log_match_name \"\" adb reboot ``` A reboot is required to enable the logging. Once enabled, reboot is not needed to update the properties. It is not necessary to set both `log_match_call` and `log_match_name`, but note logs can be quite noisy if unfiltered. Loading Loading
core/java/android/view/SurfaceControlRegistry.java +22 −10 Original line number Diff line number Diff line Loading @@ -295,16 +295,7 @@ public class SurfaceControlRegistry { } sCallStackDebuggingInitialized = true; sCallStackDebuggingMatchCall = SystemProperties.get("persist.wm.debug.sc.tx.log_match_call", null) .toLowerCase(); sCallStackDebuggingMatchName = SystemProperties.get("persist.wm.debug.sc.tx.log_match_name", null) .toLowerCase(); sLogAllTxCallsOnApply = sCallStackDebuggingMatchCall.contains("apply"); // Only enable stack debugging if any of the match filters are set sCallStackDebuggingEnabled = !sCallStackDebuggingMatchCall.isEmpty() || !sCallStackDebuggingMatchName.isEmpty(); updateCallStackDebuggingParams(); if (sCallStackDebuggingEnabled) { Log.d(TAG, "Enabling transaction call stack debugging:" + " matchCall=" + sCallStackDebuggingMatchCall Loading @@ -325,6 +316,11 @@ public class SurfaceControlRegistry { final void checkCallStackDebugging(@NonNull String call, @Nullable SurfaceControl.Transaction tx, @Nullable SurfaceControl sc, @Nullable String details) { if (sCallStackDebuggingInitialized && sCallStackDebuggingEnabled) { updateCallStackDebuggingParams(); } if (!sCallStackDebuggingEnabled) { return; } Loading Loading @@ -355,6 +351,22 @@ public class SurfaceControlRegistry { } } /** * Updates the call stack debugging params from the system properties. */ private static void updateCallStackDebuggingParams() { sCallStackDebuggingMatchCall = SystemProperties.get("persist.wm.debug.sc.tx.log_match_call", null) .toLowerCase(); sCallStackDebuggingMatchName = SystemProperties.get("persist.wm.debug.sc.tx.log_match_name", null) .toLowerCase(); sLogAllTxCallsOnApply = sCallStackDebuggingMatchCall.contains("apply"); // Only enable stack debugging if any of the match filters are set sCallStackDebuggingEnabled = !sCallStackDebuggingMatchCall.isEmpty() || !sCallStackDebuggingMatchName.isEmpty(); } /** * Tests whether the given surface control name/method call matches the filters set for the * call stack debugging. Loading
libs/WindowManager/Shell/src/com/android/wm/shell/docs/debugging.md +4 −2 Original line number Diff line number Diff line Loading @@ -81,9 +81,11 @@ adb logcat -s "SurfaceControlRegistry" # Disabling logging adb shell setprop persist.wm.debug.sc.tx.log_match_call \"\" adb shell setprop persist.wm.debug.sc.tx.log_match_name \"\" adb reboot ``` A reboot is required to enable the logging. Once enabled, reboot is not needed to update the properties. It is not necessary to set both `log_match_call` and `log_match_name`, but note logs can be quite noisy if unfiltered. Loading