diff options
18 files changed, 203 insertions, 205 deletions
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index f54e841fd2a0..6bea68b446a4 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -769,17 +769,6 @@ public class Activity extends ContextThemeWrapper private static final String KEYBOARD_SHORTCUTS_RECEIVER_PKG_NAME = "com.android.systemui"; - private static final int LOG_AM_ON_CREATE_CALLED = 30057; - private static final int LOG_AM_ON_START_CALLED = 30059; - private static final int LOG_AM_ON_RESUME_CALLED = 30022; - private static final int LOG_AM_ON_PAUSE_CALLED = 30021; - private static final int LOG_AM_ON_STOP_CALLED = 30049; - private static final int LOG_AM_ON_RESTART_CALLED = 30058; - private static final int LOG_AM_ON_DESTROY_CALLED = 30060; - private static final int LOG_AM_ON_ACTIVITY_RESULT_CALLED = 30062; - private static final int LOG_AM_ON_TOP_RESUMED_GAINED_CALLED = 30064; - private static final int LOG_AM_ON_TOP_RESUMED_LOST_CALLED = 30065; - private static class ManagedDialog { Dialog mDialog; Bundle mArgs; @@ -1863,8 +1852,13 @@ public class Activity extends ContextThemeWrapper final void performTopResumedActivityChanged(boolean isTopResumedActivity, String reason) { onTopResumedActivityChanged(isTopResumedActivity); - writeEventLog(isTopResumedActivity - ? LOG_AM_ON_TOP_RESUMED_GAINED_CALLED : LOG_AM_ON_TOP_RESUMED_LOST_CALLED, reason); + if (isTopResumedActivity) { + EventLogTags.writeWmOnTopResumedGainedCalled(mIdent, getComponentName().getClassName(), + reason); + } else { + EventLogTags.writeWmOnTopResumedLostCalled(mIdent, getComponentName().getClassName(), + reason); + } } void setVoiceInteractor(IVoiceInteractor voiceInteractor) { @@ -7898,7 +7892,8 @@ public class Activity extends ContextThemeWrapper } else { onCreate(icicle); } - writeEventLog(LOG_AM_ON_CREATE_CALLED, "performCreate"); + EventLogTags.writeWmOnCreateCalled(mIdent, getComponentName().getClassName(), + "performCreate"); mActivityTransitionState.readState(icicle); mVisibleFromClient = !mWindow.getWindowStyle().getBoolean( @@ -7920,7 +7915,7 @@ public class Activity extends ContextThemeWrapper mCalled = false; mFragments.execPendingActions(); mInstrumentation.callActivityOnStart(this); - writeEventLog(LOG_AM_ON_START_CALLED, reason); + EventLogTags.writeWmOnStartCalled(mIdent, getComponentName().getClassName(), reason); if (!mCalled) { throw new SuperNotCalledException( @@ -7998,7 +7993,7 @@ public class Activity extends ContextThemeWrapper mCalled = false; mInstrumentation.callActivityOnRestart(this); - writeEventLog(LOG_AM_ON_RESTART_CALLED, reason); + EventLogTags.writeWmOnRestartCalled(mIdent, getComponentName().getClassName(), reason); if (!mCalled) { throw new SuperNotCalledException( "Activity " + mComponent.toShortString() + @@ -8031,7 +8026,7 @@ public class Activity extends ContextThemeWrapper mCalled = false; // mResumed is set by the instrumentation mInstrumentation.callActivityOnResume(this); - writeEventLog(LOG_AM_ON_RESUME_CALLED, reason); + EventLogTags.writeWmOnResumeCalled(mIdent, getComponentName().getClassName(), reason); if (!mCalled) { throw new SuperNotCalledException( "Activity " + mComponent.toShortString() + @@ -8070,7 +8065,8 @@ public class Activity extends ContextThemeWrapper mFragments.dispatchPause(); mCalled = false; onPause(); - writeEventLog(LOG_AM_ON_PAUSE_CALLED, "performPause"); + EventLogTags.writeWmOnPausedCalled(mIdent, getComponentName().getClassName(), + "performPause"); mResumed = false; if (!mCalled && getApplicationInfo().targetSdkVersion >= android.os.Build.VERSION_CODES.GINGERBREAD) { @@ -8110,7 +8106,7 @@ public class Activity extends ContextThemeWrapper mCalled = false; mInstrumentation.callActivityOnStop(this); - writeEventLog(LOG_AM_ON_STOP_CALLED, reason); + EventLogTags.writeWmOnStopCalled(mIdent, getComponentName().getClassName(), reason); if (!mCalled) { throw new SuperNotCalledException( "Activity " + mComponent.toShortString() + @@ -8140,7 +8136,8 @@ public class Activity extends ContextThemeWrapper mWindow.destroy(); mFragments.dispatchDestroy(); onDestroy(); - writeEventLog(LOG_AM_ON_DESTROY_CALLED, "performDestroy"); + EventLogTags.writeWmOnDestroyCalled(mIdent, getComponentName().getClassName(), + "performDestroy"); mFragments.doLoaderDestroy(); if (mVoiceInteractor != null) { mVoiceInteractor.detachActivity(); @@ -8233,7 +8230,9 @@ public class Activity extends ContextThemeWrapper frag.onActivityResult(requestCode, resultCode, data); } } - writeEventLog(LOG_AM_ON_ACTIVITY_RESULT_CALLED, reason); + + EventLogTags.writeWmOnActivityResultCalled(mIdent, getComponentName().getClassName(), + reason); } /** @@ -8660,11 +8659,6 @@ public class Activity extends ContextThemeWrapper } } - /** Log a lifecycle event for current user id and component class. */ - private void writeEventLog(int event, String reason) { - EventLog.writeEvent(event, mIdent, getComponentName().getClassName(), reason); - } - class HostCallbacks extends FragmentHostCallback<Activity> { public HostCallbacks() { super(Activity.this /*activity*/); diff --git a/core/java/android/app/EventLogTags.logtags b/core/java/android/app/EventLogTags.logtags new file mode 100644 index 000000000000..6296a689b6dd --- /dev/null +++ b/core/java/android/app/EventLogTags.logtags @@ -0,0 +1,36 @@ +# See system/core/logcat/event.logtags for a description of the format of this file. + +option java_package android.app + +# Do not change these names without updating the checkin_events setting in +# google3/googledata/wireless/android/provisioning/gservices.config !! +# +# The activity's onPause has been called. +30021 wm_on_paused_called (Token|1|5),(Component Name|3),(Reason|3) +# The activity's onResume has been called. +30022 wm_on_resume_called (Token|1|5),(Component Name|3),(Reason|3) + +# Attempting to stop an activity +30048 wm_stop_activity (User|1|5),(Token|1|5),(Component Name|3) +# The activity's onStop has been called. +30049 wm_on_stop_called (Token|1|5),(Component Name|3),(Reason|3) + +# The activity's onCreate has been called. +30057 wm_on_create_called (Token|1|5),(Component Name|3),(Reason|3) +# The activity's onRestart has been called. +30058 wm_on_restart_called (Token|1|5),(Component Name|3),(Reason|3) +# The activity's onStart has been called. +30059 wm_on_start_called (Token|1|5),(Component Name|3),(Reason|3) +# The activity's onDestroy has been called. +30060 wm_on_destroy_called (Token|1|5),(Component Name|3),(Reason|3) +# The activity's onActivityResult has been called. +30062 wm_on_activity_result_called (Token|1|5),(Component Name|3),(Reason|3) + +# The activity's onTopResumedActivityChanged(true) has been called. +30064 wm_on_top_resumed_gained_called (Token|1|5),(Component Name|3),(Reason|3) +# The activity's onTopResumedActivityChanged(false) has been called. +30065 wm_on_top_resumed_lost_called (Token|1|5),(Component Name|3),(Reason|3) + +# An activity been add into stopping list +30066 wm_add_to_stopping (User|1|5),(Token|1|5),(Component Name|3),(Reason|3) + diff --git a/services/core/Android.bp b/services/core/Android.bp index 594ac104ebd0..9291adc1896c 100644 --- a/services/core/Android.bp +++ b/services/core/Android.bp @@ -86,6 +86,7 @@ java_library_static { ":tethering-servicescore-srcs", "java/com/android/server/EventLogTags.logtags", "java/com/android/server/am/EventLogTags.logtags", + "java/com/android/server/wm/EventLogTags.logtags", "java/com/android/server/policy/EventLogTags.logtags", ], diff --git a/services/core/java/com/android/server/EventLogTags.logtags b/services/core/java/com/android/server/EventLogTags.logtags index bec08f45188f..b595eb15ee15 100644 --- a/services/core/java/com/android/server/EventLogTags.logtags +++ b/services/core/java/com/android/server/EventLogTags.logtags @@ -175,27 +175,6 @@ option java_package com.android.server 3121 pm_package_stats (manual_time|2|3),(quota_time|2|3),(manual_data|2|2),(quota_data|2|2),(manual_cache|2|2),(quota_cache|2|2) # --------------------------- -# WindowManagerService.java -# --------------------------- -# Out of memory for surfaces. -31000 wm_no_surface_memory (Window|3),(PID|1|5),(Operation|3) -# Task created. -31001 wm_task_created (TaskId|1|5),(StackId|1|5) -# Task moved to top (1) or bottom (0). -31002 wm_task_moved (TaskId|1|5),(ToTop|1),(Index|1) -# Task removed with source explanation. -31003 wm_task_removed (TaskId|1|5),(Reason|3) -# Stack created. -31004 wm_stack_created (StackId|1|5) -# Home stack moved to top (1) or bottom (0). -31005 wm_home_stack_moved (ToTop|1) -# Stack removed. -31006 wm_stack_removed (StackId|1|5) -# bootanim finished: -31007 wm_boot_animation_done (time|2|3) - - -# --------------------------- # InputMethodManagerService.java # --------------------------- # Re-connecting to input method service because we haven't received its interface diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index 5b7a8148d694..a95a4637035a 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -2786,8 +2786,8 @@ public class ActivityManagerService extends IActivityManager.Stub int total = user + system + iowait + irq + softIrq + idle; if (total == 0) total = 1; - EventLog.writeEvent(EventLogTags.CPU, - ((user+system+iowait+irq+softIrq) * 100) / total, + EventLogTags.writeCpu( + ((user + system + iowait + irq + softIrq) * 100) / total, (user * 100) / total, (system * 100) / total, (iowait * 100) / total, @@ -3656,7 +3656,7 @@ public class ActivityManagerService extends IActivityManager.Stub final ArrayList<ProcessMemInfo> memInfos = doReport ? new ArrayList<ProcessMemInfo>(mProcessList.getLruSizeLocked()) : null; - EventLog.writeEvent(EventLogTags.AM_LOW_MEMORY, mProcessList.getLruSizeLocked()); + EventLogTags.writeAmLowMemory(mProcessList.getLruSizeLocked()); long now = SystemClock.uptimeMillis(); for (int i = mProcessList.mLruProcesses.size() - 1; i >= 0; i--) { ProcessRecord rec = mProcessList.mLruProcesses.get(i); @@ -3737,8 +3737,8 @@ public class ActivityManagerService extends IActivityManager.Stub mAllowLowerMemLevel = false; doLowMem = false; } - EventLog.writeEvent(EventLogTags.AM_PROC_DIED, app.userId, app.pid, app.processName, - app.setAdj, app.setProcState); + EventLogTags.writeAmProcDied(app.userId, app.pid, app.processName, app.setAdj, + app.setProcState); if (DEBUG_CLEANUP) Slog.v(TAG_CLEANUP, "Dying app: " + app + ", pid: " + pid + ", thread: " + thread.asBinder()); handleAppDiedLocked(app, false, true); @@ -3761,7 +3761,8 @@ public class ActivityManagerService extends IActivityManager.Stub // Execute the callback if there is any. doAppDiedCallbackLocked(app); - EventLog.writeEvent(EventLogTags.AM_PROC_DIED, app.userId, app.pid, app.processName); + EventLogTags.writeAmProcDied(app.userId, app.pid, app.processName, app.setAdj, + app.setProcState); } else if (DEBUG_PROCESSES) { Slog.d(TAG_PROCESSES, "Received spurious death notification for thread " + thread.asBinder()); @@ -4755,8 +4756,7 @@ public class ActivityManagerService extends IActivityManager.Stub if (gone) { Slog.w(TAG, "Process " + app + " failed to attach"); - EventLog.writeEvent(EventLogTags.AM_PROCESS_START_TIMEOUT, app.userId, - pid, app.uid, app.processName); + EventLogTags.writeAmProcessStartTimeout(app.userId, pid, app.uid, app.processName); mProcessList.removeProcessNameLocked(app.processName, app.uid); mAtmInternal.clearHeavyWeightProcessIfEquals(app.getWindowProcessController()); mBatteryStatsService.noteProcessFinish(app.processName, app.info.uid); @@ -4847,7 +4847,7 @@ public class ActivityManagerService extends IActivityManager.Stub if (app == null) { Slog.w(TAG, "No pending application record for pid " + pid + " (IApplicationThread " + thread + "); dropping process"); - EventLog.writeEvent(EventLogTags.AM_DROP_PROCESS, pid); + EventLogTags.writeAmDropProcess(pid); if (pid > 0 && pid != MY_PID) { killProcessQuiet(pid); //TODO: killProcessGroup(app.info.uid, pid); @@ -4885,7 +4885,7 @@ public class ActivityManagerService extends IActivityManager.Stub return false; } - EventLog.writeEvent(EventLogTags.AM_PROC_BOUND, app.userId, app.pid, app.processName); + EventLogTags.writeAmProcBound(app.userId, app.pid, app.processName); app.curAdj = app.setAdj = app.verifiedAdj = ProcessList.INVALID_ADJ; mOomAdjuster.setAttachingSchedGroupLocked(app); @@ -7163,7 +7163,7 @@ public class ActivityManagerService extends IActivityManager.Stub + cpi.applicationInfo.packageName + "/" + cpi.applicationInfo.uid + " for provider " + name + ": launching app became null"); - EventLog.writeEvent(EventLogTags.AM_PROVIDER_LOST_PROCESS, + EventLogTags.writeAmProviderLostProcess( UserHandle.getUserId(cpi.applicationInfo.uid), cpi.applicationInfo.packageName, cpi.applicationInfo.uid, name); @@ -9156,7 +9156,8 @@ public class ActivityManagerService extends IActivityManager.Stub t.traceEnd(); // KillProcesses Slog.i(TAG, "System now ready"); - EventLog.writeEvent(EventLogTags.BOOT_PROGRESS_AMS_READY, SystemClock.uptimeMillis()); + + EventLogTags.writeBootProgressAmsReady(SystemClock.uptimeMillis()); t.traceBegin("updateTopComponentForFactoryTest"); mAtmInternal.updateTopComponentForFactoryTest(); @@ -9410,7 +9411,8 @@ public class ActivityManagerService extends IActivityManager.Stub */ void handleApplicationCrashInner(String eventType, ProcessRecord r, String processName, ApplicationErrorReport.CrashInfo crashInfo) { - EventLog.writeEvent(EventLogTags.AM_CRASH, Binder.getCallingPid(), + + EventLogTags.writeAmCrash(Binder.getCallingPid(), UserHandle.getUserId(Binder.getCallingUid()), processName, r == null ? -1 : r.info.flags, crashInfo.exceptionClassName, @@ -9613,7 +9615,7 @@ public class ActivityManagerService extends IActivityManager.Stub final String processName = app == null ? "system_server" : (r == null ? "unknown" : r.processName); - EventLog.writeEvent(EventLogTags.AM_WTF, UserHandle.getUserId(callingUid), callingPid, + EventLogTags.writeAmWtf(UserHandle.getUserId(callingUid), callingPid, processName, r == null ? -1 : r.info.flags, tag, crashInfo.exceptionMessage); StatsLog.write(StatsLog.WTF_OCCURRED, callingUid, tag, processName, diff --git a/services/core/java/com/android/server/am/EventLogTags.logtags b/services/core/java/com/android/server/am/EventLogTags.logtags index cf0de061185f..23674bbd89c7 100644 --- a/services/core/java/com/android/server/am/EventLogTags.logtags +++ b/services/core/java/com/android/server/am/EventLogTags.logtags @@ -13,32 +13,14 @@ option java_package com.android.server.am # Do not change these names without updating the checkin_events setting in # google3/googledata/wireless/android/provisioning/gservices.config !! # -# An activity is being finished: -30001 am_finish_activity (User|1|5),(Token|1|5),(Task ID|1|5),(Component Name|3),(Reason|3) -# A task is being brought to the front of the screen: -30002 am_task_to_front (User|1|5),(Task|1|5) -# An existing activity is being given a new intent: -30003 am_new_intent (User|1|5),(Token|1|5),(Task ID|1|5),(Component Name|3),(Action|3),(MIME Type|3),(URI|3),(Flags|1|5) -# A new task is being created: -30004 am_create_task (User|1|5),(Task ID|1|5) -# A new activity is being created in an existing task: -30005 am_create_activity (User|1|5),(Token|1|5),(Task ID|1|5),(Component Name|3),(Action|3),(MIME Type|3),(URI|3),(Flags|1|5) -# An activity has been resumed into the foreground but was not already running: -30006 am_restart_activity (User|1|5),(Token|1|5),(Task ID|1|5),(Component Name|3) -# An activity has been resumed and is now in the foreground: -30007 am_resume_activity (User|1|5),(Token|1|5),(Task ID|1|5),(Component Name|3) # Application Not Responding 30008 am_anr (User|1|5),(pid|1|5),(Package Name|3),(Flags|1|5),(reason|3) -# Activity launch time -30009 am_activity_launch_time (User|1|5),(Token|1|5),(Component Name|3),(time|2|3) + # Application process bound to work 30010 am_proc_bound (User|1|5),(PID|1|5),(Process Name|3) # Application process died 30011 am_proc_died (User|1|5),(PID|1|5),(Process Name|3),(OomAdj|1|5),(ProcState|1|5) -# The Activity Manager failed to pause the given activity. -30012 am_failed_to_pause (User|1|5),(Token|1|5),(Wanting to pause|3),(Currently pausing|3) -# Attempting to pause the current activity -30013 am_pause_activity (User|1|5),(Token|1|5),(Component Name|3),(User Leaving|3) + # Application process has been started 30014 am_proc_start (User|1|5),(PID|1|5),(UID|1|5),(Process Name|3),(Type|3),(Component|3) # An application process has been marked as bad @@ -47,16 +29,7 @@ option java_package com.android.server.am 30016 am_proc_good (User|1|5),(UID|1|5),(Process Name|3) # Reporting to applications that memory is low 30017 am_low_memory (Num Processes|1|1) -# An activity is being destroyed: -30018 am_destroy_activity (User|1|5),(Token|1|5),(Task ID|1|5),(Component Name|3),(Reason|3) -# An activity has been relaunched, resumed, and is now in the foreground: -30019 am_relaunch_resume_activity (User|1|5),(Token|1|5),(Task ID|1|5),(Component Name|3) -# An activity has been relaunched: -30020 am_relaunch_activity (User|1|5),(Token|1|5),(Task ID|1|5),(Component Name|3) -# The activity's onPause has been called. -30021 am_on_paused_called (Token|1|5),(Component Name|3),(Reason|3) -# The activity's onResume has been called. -30022 am_on_resume_called (Token|1|5),(Component Name|3),(Reason|3) + # Kill a process to reclaim memory. 30023 am_kill (User|1|5),(PID|1|5),(Process Name|3),(OomAdj|1|5),(Reason|3) # Discard an undelivered serialized broadcast (timeout/ANR/crash) @@ -87,12 +60,6 @@ option java_package com.android.server.am # User switched 30041 am_switch_user (id|1|5) -# Activity set to resumed -30043 am_set_resumed_activity (User|1|5),(Component Name|3),(Reason|3) - -# Stack focus -30044 am_focused_stack (User|1|5),(Display Id|1|5),(Focused Stack Id|1|5),(Last Focused Stack Id|1|5),(Reason|3) - # Running pre boot receiver 30045 am_pre_boot (User|1|5),(Package|3) @@ -101,11 +68,6 @@ option java_package com.android.server.am # Report collection of memory used by a process 30047 am_pss (Pid|1|5),(UID|1|5),(Process Name|3),(Pss|2|2),(Uss|2|2),(SwapPss|2|2),(Rss|2|2),(StatType|1|5),(ProcState|1|5),(TimeToCollect|2|2) -# Attempting to stop an activity -30048 am_stop_activity (User|1|5),(Token|1|5),(Component Name|3) -# The activity's onStop has been called. -30049 am_on_stop_called (Token|1|5),(Component Name|3),(Reason|3) - # Report changing memory conditions (Values are ProcessStats.ADJ_MEM_FACTOR* constants) 30050 am_mem_factor (Current|1|5),(Previous|1|5) @@ -123,30 +85,6 @@ option java_package com.android.server.am # Note when a service is being forcibly stopped because its app went idle. 30056 am_stop_idle_service (UID|1|5),(Component Name|3) -# The activity's onCreate has been called. -30057 am_on_create_called (Token|1|5),(Component Name|3),(Reason|3) -# The activity's onRestart has been called. -30058 am_on_restart_called (Token|1|5),(Component Name|3),(Reason|3) -# The activity's onStart has been called. -30059 am_on_start_called (Token|1|5),(Component Name|3),(Reason|3) -# The activity's onDestroy has been called. -30060 am_on_destroy_called (Token|1|5),(Component Name|3),(Reason|3) -# The activity's onActivityResult has been called. -30062 am_on_activity_result_called (Token|1|5),(Component Name|3),(Reason|3) - -# The task is being removed from its parent stack -30061 am_remove_task (Task ID|1|5), (Stack ID|1|5) - # The task is being compacted 30063 am_compact (Pid|1|5),(Process Name|3),(Action|3),(BeforeRssTotal|2|2),(BeforeRssFile|2|2),(BeforeRssAnon|2|2),(BeforeRssSwap|2|2),(DeltaRssTotal|2|2),(DeltaRssFile|2|2),(DeltaRssAnon|2|2),(DeltaRssSwap|2|2),(Time|2|3),(LastAction|1|2),(LastActionTimestamp|2|3),(setAdj|1|2),(procState|1|2),(BeforeZRAMFree|2|2),(DeltaZRAMFree|2|2) -# The activity's onTopResumedActivityChanged(true) has been called. -30064 am_on_top_resumed_gained_called (Token|1|5),(Component Name|3),(Reason|3) -# The activity's onTopResumedActivityChanged(false) has been called. -30065 am_on_top_resumed_lost_called (Token|1|5),(Component Name|3),(Reason|3) - -# An activity been add into stopping list -30066 am_add_to_stopping (User|1|5),(Token|1|5),(Component Name|3),(Reason|3) - -# Keyguard status changed -+30067 am_set_keyguard_shown (keyguardShowing|1),(aodShowing|1),(keyguardGoingAway|1),(Reason|3)
\ No newline at end of file diff --git a/services/core/java/com/android/server/wm/ActivityDisplay.java b/services/core/java/com/android/server/wm/ActivityDisplay.java index be7dfe53c1c1..45e3c689e81e 100644 --- a/services/core/java/com/android/server/wm/ActivityDisplay.java +++ b/services/core/java/com/android/server/wm/ActivityDisplay.java @@ -74,7 +74,6 @@ import android.view.Display; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.util.function.pooled.PooledLambda; -import com.android.server.am.EventLogTags; import com.android.server.protolog.common.ProtoLog; import java.io.PrintWriter; @@ -299,7 +298,7 @@ class ActivityDisplay extends ConfigurationContainer<ActivityStack> { final ActivityStack currentFocusedStack = getFocusedStack(); if (currentFocusedStack != prevFocusedStack) { mLastFocusedStack = prevFocusedStack; - EventLogTags.writeAmFocusedStack(mRootActivityContainer.mCurrentUser, mDisplayId, + EventLogTags.writeWmFocusedStack(mRootActivityContainer.mCurrentUser, mDisplayId, currentFocusedStack == null ? -1 : currentFocusedStack.getStackId(), mLastFocusedStack == null ? -1 : mLastFocusedStack.getStackId(), updateLastFocusedStackReason); diff --git a/services/core/java/com/android/server/wm/ActivityMetricsLogger.java b/services/core/java/com/android/server/wm/ActivityMetricsLogger.java index 0a861ade2900..9fa5d9f15f3e 100644 --- a/services/core/java/com/android/server/wm/ActivityMetricsLogger.java +++ b/services/core/java/com/android/server/wm/ActivityMetricsLogger.java @@ -56,13 +56,13 @@ import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.TYPE_T import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.TYPE_TRANSITION_REPORTED_DRAWN_NO_BUNDLE; import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.TYPE_TRANSITION_REPORTED_DRAWN_WITH_BUNDLE; import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.TYPE_TRANSITION_WARM_LAUNCH; -import static com.android.server.am.EventLogTags.AM_ACTIVITY_LAUNCH_TIME; import static com.android.server.am.MemoryStatUtil.MemoryStat; import static com.android.server.am.MemoryStatUtil.readMemoryStatFromFilesystem; import static com.android.server.wm.ActivityTaskManagerDebugConfig.DEBUG_METRICS; import static com.android.server.wm.ActivityTaskManagerDebugConfig.TAG_ATM; import static com.android.server.wm.ActivityTaskManagerDebugConfig.TAG_WITH_CLASS_NAME; import static com.android.server.wm.ActivityTaskManagerInternal.APP_TRANSITION_TIMEOUT; +import static com.android.server.wm.EventLogTags.WM_ACTIVITY_LAUNCH_TIME; import android.app.WaitResult; import android.app.WindowConfiguration.WindowingMode; @@ -805,7 +805,7 @@ class ActivityMetricsLogger { return; } - EventLog.writeEvent(AM_ACTIVITY_LAUNCH_TIME, + EventLog.writeEvent(WM_ACTIVITY_LAUNCH_TIME, info.userId, info.activityRecordIdHashCode, info.launchedActivityShortComponentName, info.windowsDrawnDelayMs); diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java index f627dda0f7f7..23b59c10f11d 100644 --- a/services/core/java/com/android/server/wm/ActivityRecord.java +++ b/services/core/java/com/android/server/wm/ActivityRecord.java @@ -122,8 +122,6 @@ import static com.android.server.am.ActivityRecordProto.STATE; import static com.android.server.am.ActivityRecordProto.TRANSLUCENT; import static com.android.server.am.ActivityRecordProto.VISIBLE; import static com.android.server.am.ActivityRecordProto.VISIBLE_REQUESTED; -import static com.android.server.am.EventLogTags.AM_RELAUNCH_ACTIVITY; -import static com.android.server.am.EventLogTags.AM_RELAUNCH_RESUME_ACTIVITY; import static com.android.server.policy.WindowManagerPolicy.FINISH_LAYOUT_REDO_ANIM; import static com.android.server.policy.WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER; import static com.android.server.wm.ActivityStack.ActivityState.DESTROYED; @@ -306,7 +304,6 @@ import com.android.internal.util.XmlUtils; import com.android.server.AttributeCache; import com.android.server.LocalServices; import com.android.server.am.AppTimeTracker; -import com.android.server.am.EventLogTags; import com.android.server.am.PendingIntentRecord; import com.android.server.display.color.ColorDisplayService; import com.android.server.policy.WindowManagerPolicy; @@ -2379,8 +2376,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A // Make a local reference to its task since this.task could be set to null once this // activity is destroyed and detached from task. final Task task = getTask(); - EventLog.writeEvent(EventLogTags.AM_FINISH_ACTIVITY, - mUserId, System.identityHashCode(this), + EventLogTags.writeWmFinishActivity(mUserId, System.identityHashCode(this), task.mTaskId, shortComponentName, reason); final ArrayList<ActivityRecord> activities = task.mChildren; final int index = activities.indexOf(this); @@ -2655,8 +2651,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A return false; } - EventLog.writeEvent(EventLogTags.AM_DESTROY_ACTIVITY, mUserId, - System.identityHashCode(this), task.mTaskId, shortComponentName, reason); + EventLogTags.writeWmDestroyActivity(mUserId, System.identityHashCode(this), + task.mTaskId, shortComponentName, reason); final ActivityStack stack = getActivityStack(); if (hasProcess() && !stack.inLruList(this)) { @@ -4739,7 +4735,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A if (!mVisibleRequested) { setVisibility(false); } - EventLogTags.writeAmStopActivity( + EventLogTags.writeWmStopActivity( mUserId, System.identityHashCode(this), shortComponentName); mAtmService.getLifecycleManager().scheduleTransaction(app.getThread(), appToken, StopActivityItem.obtain(mVisibleRequested, configChangeFlags)); @@ -4808,8 +4804,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A void addToStopping(boolean scheduleIdle, boolean idleDelayed, String reason) { if (!mStackSupervisor.mStoppingActivities.contains(this)) { - EventLog.writeEvent(EventLogTags.AM_ADD_TO_STOPPING, mUserId, - System.identityHashCode(this), shortComponentName, reason); + EventLogTags.writeWmAddToStopping(mUserId, System.identityHashCode(this), + shortComponentName, reason); mStackSupervisor.mStoppingActivities.add(this); } @@ -6939,9 +6935,13 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A "Relaunching: " + this + " with results=" + pendingResults + " newIntents=" + pendingNewIntents + " andResume=" + andResume + " preserveWindow=" + preserveWindow); - EventLog.writeEvent(andResume ? AM_RELAUNCH_RESUME_ACTIVITY - : AM_RELAUNCH_ACTIVITY, mUserId, System.identityHashCode(this), - task.mTaskId, shortComponentName); + if (andResume) { + EventLogTags.writeWmRelaunchResumeActivity(mUserId, System.identityHashCode(this), + task.mTaskId, shortComponentName); + } else { + EventLogTags.writeWmRelaunchActivity(mUserId, System.identityHashCode(this), + task.mTaskId, shortComponentName); + } startFreezingScreenLocked(0); diff --git a/services/core/java/com/android/server/wm/ActivityStack.java b/services/core/java/com/android/server/wm/ActivityStack.java index f1c47eb8644c..6ddbb0df2ccc 100644 --- a/services/core/java/com/android/server/wm/ActivityStack.java +++ b/services/core/java/com/android/server/wm/ActivityStack.java @@ -84,7 +84,6 @@ import static com.android.server.wm.ActivityTaskManagerDebugConfig.DEBUG_SWITCH; import static com.android.server.wm.ActivityTaskManagerDebugConfig.DEBUG_TASKS; import static com.android.server.wm.ActivityTaskManagerDebugConfig.DEBUG_TRANSITION; import static com.android.server.wm.ActivityTaskManagerDebugConfig.DEBUG_USER_LEAVING; -import static com.android.server.wm.ActivityTaskManagerDebugConfig.DEBUG_VISIBILITY; import static com.android.server.wm.ActivityTaskManagerDebugConfig.POSTFIX_ADD_REMOVE; import static com.android.server.wm.ActivityTaskManagerDebugConfig.POSTFIX_APP; import static com.android.server.wm.ActivityTaskManagerDebugConfig.POSTFIX_CLEANUP; @@ -163,7 +162,6 @@ import android.os.UserHandle; import android.service.voice.IVoiceInteractionSession; import android.util.ArraySet; import android.util.DisplayMetrics; -import android.util.EventLog; import android.util.IntArray; import android.util.Log; import android.util.Slog; @@ -185,7 +183,6 @@ import com.android.server.Watchdog; import com.android.server.am.ActivityManagerService; import com.android.server.am.ActivityManagerService.ItemMatcher; import com.android.server.am.AppTimeTracker; -import com.android.server.am.EventLogTags; import java.io.FileDescriptor; import java.io.PrintWriter; @@ -533,7 +530,7 @@ class ActivityStack extends WindowContainer<Task> implements BoundsAnimationTarg mDockedStackMinimizeThickness = supervisor.mService.mWindowManager.mContext.getResources().getDimensionPixelSize( com.android.internal.R.dimen.docked_stack_minimize_thickness); - EventLog.writeEvent(com.android.server.EventLogTags.WM_STACK_CREATED, stackId); + EventLogTags.writeWmStackCreated(stackId); mStackSupervisor = supervisor; mService = supervisor.mService; mRootActivityContainer = mService.mRootActivityContainer; @@ -1586,7 +1583,7 @@ class ActivityStack extends WindowContainer<Task> implements BoundsAnimationTarg if (prev.attachedToProcess()) { if (DEBUG_PAUSE) Slog.v(TAG_PAUSE, "Enqueueing pending pause: " + prev); try { - EventLogTags.writeAmPauseActivity(prev.mUserId, System.identityHashCode(prev), + EventLogTags.writeWmPauseActivity(prev.mUserId, System.identityHashCode(prev), prev.shortComponentName, "userLeaving=" + userLeaving); mService.getLifecycleManager().scheduleTransaction(prev.app.getThread(), @@ -1663,10 +1660,9 @@ class ActivityStack extends WindowContainer<Task> implements BoundsAnimationTarg } return; } else { - EventLog.writeEvent(EventLogTags.AM_FAILED_TO_PAUSE, - r.mUserId, System.identityHashCode(r), r.shortComponentName, - mPausingActivity != null - ? mPausingActivity.shortComponentName : "(none)"); + EventLogTags.writeWmFailedToPause(r.mUserId, System.identityHashCode(r), + r.shortComponentName, mPausingActivity != null + ? mPausingActivity.shortComponentName : "(none)"); if (r.isState(PAUSING)) { r.setState(PAUSED, "activityPausedLocked"); if (r.finishing) { @@ -2659,9 +2655,8 @@ class ActivityStack extends WindowContainer<Task> implements BoundsAnimationTarg // Clear app token stopped state in window manager if needed. next.notifyAppResumed(next.stopped); - EventLog.writeEvent(EventLogTags.AM_RESUME_ACTIVITY, next.mUserId, - System.identityHashCode(next), next.getTask().mTaskId, - next.shortComponentName); + EventLogTags.writeWmResumeActivity(next.mUserId, System.identityHashCode(next), + next.getTask().mTaskId, next.shortComponentName); next.sleeping = false; mService.getAppWarningsLocked().onResumeActivity(next); @@ -3519,10 +3514,9 @@ class ActivityStack extends WindowContainer<Task> implements BoundsAnimationTarg + " state=" + r.getState() + " callers=" + Debug.getCallers(5)); if (!r.finishing || isProcessRemoved) { Slog.w(TAG, "Force removing " + r + ": app died, no saved state"); - EventLog.writeEvent(EventLogTags.AM_FINISH_ACTIVITY, - r.mUserId, System.identityHashCode(r), - r.getTask().mTaskId, r.shortComponentName, - "proc died without state saved"); + EventLogTags.writeWmFinishActivity(r.mUserId, + System.identityHashCode(r), r.getTask().mTaskId, + r.shortComponentName, "proc died without state saved"); } } else { // We have the current state for this activity, so @@ -3634,7 +3628,7 @@ class ActivityStack extends WindowContainer<Task> implements BoundsAnimationTarg } mRootActivityContainer.resumeFocusedStacksTopActivities(); - EventLog.writeEvent(EventLogTags.AM_TASK_TO_FRONT, tr.mUserId, tr.mTaskId); + EventLogTags.writeWmTaskToFront(tr.mUserId, tr.mTaskId); mService.getTaskChangeNotificationController().notifyTaskMovedToFront(tr.getTaskInfo()); } finally { getDisplay().continueUpdateImeTarget(); @@ -4141,7 +4135,7 @@ class ActivityStack extends WindowContainer<Task> implements BoundsAnimationTarg super.removeChild(child); - EventLog.writeEvent(EventLogTags.AM_REMOVE_TASK, child.mTaskId, mStackId); + EventLogTags.writeWmRemoveTask(child.mTaskId, mStackId); if (display.isSingleTaskInstance()) { mService.notifySingleTaskDisplayEmpty(display.mDisplayId); @@ -4820,9 +4814,7 @@ class ActivityStack extends WindowContainer<Task> implements BoundsAnimationTarg } final int toTop = targetPosition == mChildren.size() - 1 ? 1 : 0; - EventLog.writeEvent(com.android.server.EventLogTags.WM_TASK_MOVED, child.mTaskId, toTop, - targetPosition); - + EventLogTags.writeWmTaskMoved(child.mTaskId, toTop, targetPosition); return targetPosition; } @@ -4872,8 +4864,7 @@ class ActivityStack extends WindowContainer<Task> implements BoundsAnimationTarg } super.onParentChanged(newParent, oldParent); if (getParent() == null && mDisplayContent != null) { - EventLog.writeEvent(com.android.server.EventLogTags.WM_STACK_REMOVED, mStackId); - + EventLogTags.writeWmStackRemoved(mStackId); mDisplayContent = null; mWmService.mWindowPlacerLocked.requestTraversal(); } diff --git a/services/core/java/com/android/server/wm/ActivityStackSupervisor.java b/services/core/java/com/android/server/wm/ActivityStackSupervisor.java index 304f2300e308..d088a5e286c1 100644 --- a/services/core/java/com/android/server/wm/ActivityStackSupervisor.java +++ b/services/core/java/com/android/server/wm/ActivityStackSupervisor.java @@ -126,7 +126,6 @@ import android.os.WorkSource; import android.provider.MediaStore; import android.util.ArrayMap; import android.util.ArraySet; -import android.util.EventLog; import android.util.MergedConfiguration; import android.util.Slog; import android.util.SparseArray; @@ -141,7 +140,6 @@ import com.android.internal.os.logging.MetricsLoggerWrapper; import com.android.internal.util.ArrayUtils; import com.android.internal.util.function.pooled.PooledLambda; import com.android.server.am.ActivityManagerService; -import com.android.server.am.EventLogTags; import com.android.server.am.UserState; import java.io.FileDescriptor; @@ -823,8 +821,8 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { "Launching: " + r + " savedState=" + r.getSavedState() + " with results=" + results + " newIntents=" + newIntents + " andResume=" + andResume); - EventLog.writeEvent(EventLogTags.AM_RESTART_ACTIVITY, r.mUserId, - System.identityHashCode(r), task.mTaskId, r.shortComponentName); + EventLogTags.writeWmRestartActivity(r.mUserId, System.identityHashCode(r), + task.mTaskId, r.shortComponentName); if (r.isActivityTypeHome()) { // Home process is the root process of the task. updateHomeProcess(task.getChildAt(0).app); diff --git a/services/core/java/com/android/server/wm/ActivityStarter.java b/services/core/java/com/android/server/wm/ActivityStarter.java index 8455c6d04b3d..0f912f1a4956 100644 --- a/services/core/java/com/android/server/wm/ActivityStarter.java +++ b/services/core/java/com/android/server/wm/ActivityStarter.java @@ -60,7 +60,6 @@ import static android.os.Process.INVALID_UID; import static android.view.Display.DEFAULT_DISPLAY; import static android.view.Display.INVALID_DISPLAY; -import static com.android.server.am.EventLogTags.AM_NEW_INTENT; import static com.android.server.wm.ActivityStack.ActivityState.RESUMED; import static com.android.server.wm.ActivityStackSupervisor.DEFER_RESUME; import static com.android.server.wm.ActivityStackSupervisor.ON_TOP; @@ -114,14 +113,12 @@ import android.os.UserManager; import android.service.voice.IVoiceInteractionSession; import android.text.TextUtils; import android.util.ArraySet; -import android.util.EventLog; import android.util.Pools.SynchronizedPool; import android.util.Slog; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.app.HeavyWeightSwitcherActivity; import com.android.internal.app.IVoiceInteractor; -import com.android.server.am.EventLogTags; import com.android.server.am.PendingIntentRecord; import com.android.server.pm.InstantAppResolver; import com.android.server.wm.ActivityStackSupervisor.PendingActivityLaunch; @@ -1550,11 +1547,12 @@ class ActivityStarter { UserHandle.getAppId(mStartActivity.info.applicationInfo.uid) ); if (newTask) { - EventLog.writeEvent(EventLogTags.AM_CREATE_TASK, mStartActivity.mUserId, + EventLogTags.writeWmCreateTask(mStartActivity.mUserId, mStartActivity.getTask().mTaskId); } mStartActivity.logStartActivity( - EventLogTags.AM_CREATE_ACTIVITY, mStartActivity.getTask()); + EventLogTags.WM_CREATE_ACTIVITY, mStartActivity.getTask()); + mTargetStack.mLastPausedActivity = null; mRootActivityContainer.sendPowerHintForLaunchStartIfNeeded( @@ -2405,7 +2403,7 @@ class ActivityStarter { return; } - activity.logStartActivity(AM_NEW_INTENT, activity.getTask()); + activity.logStartActivity(EventLogTags.WM_NEW_INTENT, activity.getTask()); activity.deliverNewIntentLocked(mCallingUid, mStartActivity.intent, mStartActivity.launchedFromPackage); mIntentDelivered = true; diff --git a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java index bef4f5a847f3..bcd5d369ee0c 100644 --- a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java +++ b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java @@ -83,6 +83,8 @@ import static com.android.server.am.ActivityManagerServiceDumpProcessesProto.PRE import static com.android.server.am.ActivityManagerServiceDumpProcessesProto.SCREEN_COMPAT_PACKAGES; import static com.android.server.am.ActivityManagerServiceDumpProcessesProto.ScreenCompatPackage.MODE; import static com.android.server.am.ActivityManagerServiceDumpProcessesProto.ScreenCompatPackage.PACKAGE; +import static com.android.server.am.EventLogTags.writeBootProgressEnableScreen; +import static com.android.server.am.EventLogTags.writeConfigurationChanged; import static com.android.server.wm.ActivityStack.ActivityState.DESTROYED; import static com.android.server.wm.ActivityStack.ActivityState.DESTROYING; import static com.android.server.wm.ActivityStackSupervisor.DEFER_RESUME; @@ -215,7 +217,6 @@ import android.text.TextUtils; import android.text.format.TimeMigrationUtils; import android.util.ArrayMap; import android.util.ArraySet; -import android.util.EventLog; import android.util.Log; import android.util.Slog; import android.util.SparseArray; @@ -258,7 +259,6 @@ import com.android.server.am.ActivityManagerServiceDumpActivitiesProto; import com.android.server.am.ActivityManagerServiceDumpProcessesProto; import com.android.server.am.AppTimeTracker; import com.android.server.am.BaseErrorDialog; -import com.android.server.am.EventLogTags; import com.android.server.am.PendingIntentController; import com.android.server.am.PendingIntentRecord; import com.android.server.am.UserState; @@ -5195,8 +5195,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { if (DEBUG_SWITCH || DEBUG_CONFIGURATION) Slog.i(TAG_CONFIGURATION, "Updating global configuration to: " + values); - - EventLog.writeEvent(EventLogTags.CONFIGURATION_CHANGED, changes); + writeConfigurationChanged(changes); StatsLog.write(StatsLog.RESOURCE_CONFIGURATION_CHANGED, values.colorMode, values.densityDpi, @@ -5359,8 +5358,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { } void enableScreenAfterBoot(boolean booted) { - EventLog.writeEvent(EventLogTags.BOOT_PROGRESS_ENABLE_SCREEN, - SystemClock.uptimeMillis()); + writeBootProgressEnableScreen(SystemClock.uptimeMillis()); mWindowManager.enableScreenAfterBoot(); synchronized (mGlobalLock) { @@ -5491,7 +5489,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { applyUpdateLockStateLocked(r); applyUpdateVrModeLocked(r); - EventLogTags.writeAmSetResumedActivity( + EventLogTags.writeWmSetResumedActivity( r == null ? -1 : r.mUserId, r == null ? "NULL" : r.shortComponentName, reason); @@ -6419,8 +6417,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { @Override public void enableScreenAfterBoot(boolean booted) { synchronized (mGlobalLock) { - EventLog.writeEvent(EventLogTags.BOOT_PROGRESS_ENABLE_SCREEN, - SystemClock.uptimeMillis()); + writeBootProgressEnableScreen(SystemClock.uptimeMillis()); mWindowManager.enableScreenAfterBoot(); updateEventDispatchingLocked(booted); } diff --git a/services/core/java/com/android/server/wm/EventLogTags.logtags b/services/core/java/com/android/server/wm/EventLogTags.logtags new file mode 100644 index 000000000000..aab901ebcdb6 --- /dev/null +++ b/services/core/java/com/android/server/wm/EventLogTags.logtags @@ -0,0 +1,77 @@ +# See system/core/logcat/event.logtags for a description of the format of this file. + +option java_package com.android.server.wm + +# Do not change these names without updating the checkin_events setting in +# google3/googledata/wireless/android/provisioning/gservices.config !! +# +# An activity is being finished: +30001 wm_finish_activity (User|1|5),(Token|1|5),(Task ID|1|5),(Component Name|3),(Reason|3) +# A task is being brought to the front of the screen: +30002 wm_task_to_front (User|1|5),(Task|1|5) +# An existing activity is being given a new intent: +30003 wm_new_intent (User|1|5),(Token|1|5),(Task ID|1|5),(Component Name|3),(Action|3),(MIME Type|3),(URI|3),(Flags|1|5) +# A new task is being created: +30004 wm_create_task (User|1|5),(Task ID|1|5) +# A new activity is being created in an existing task: +30005 wm_create_activity (User|1|5),(Token|1|5),(Task ID|1|5),(Component Name|3),(Action|3),(MIME Type|3),(URI|3),(Flags|1|5) +# An activity has been resumed into the foreground but was not already running: +30006 wm_restart_activity (User|1|5),(Token|1|5),(Task ID|1|5),(Component Name|3) +# An activity has been resumed and is now in the foreground: +30007 wm_resume_activity (User|1|5),(Token|1|5),(Task ID|1|5),(Component Name|3) + +# Activity launch time +30009 wm_activity_launch_time (User|1|5),(Token|1|5),(Component Name|3),(time|2|3) + +# The Activity Manager failed to pause the given activity. +30012 wm_failed_to_pause (User|1|5),(Token|1|5),(Wanting to pause|3),(Currently pausing|3) +# Attempting to pause the current activity +30013 wm_pause_activity (User|1|5),(Token|1|5),(Component Name|3),(User Leaving|3) +# Application process has been started + +# An activity is being destroyed: +30018 wm_destroy_activity (User|1|5),(Token|1|5),(Task ID|1|5),(Component Name|3),(Reason|3) +# An activity has been relaunched, resumed, and is now in the foreground: +30019 wm_relaunch_resume_activity (User|1|5),(Token|1|5),(Task ID|1|5),(Component Name|3) +# An activity has been relaunched: +30020 wm_relaunch_activity (User|1|5),(Token|1|5),(Task ID|1|5),(Component Name|3) +# The activity's onPause has been called. +30021 wm_on_paused_called (Token|1|5),(Component Name|3),(Reason|3) +# The activity's onResume has been called. +30022 wm_on_resume_called (Token|1|5),(Component Name|3),(Reason|3) + +# Activity set to resumed +30043 wm_set_resumed_activity (User|1|5),(Component Name|3),(Reason|3) + +# Stack focus +30044 wm_focused_stack (User|1|5),(Display Id|1|5),(Focused Stack Id|1|5),(Last Focused Stack Id|1|5),(Reason|3) + +# Attempting to stop an activity +30048 wm_stop_activity (User|1|5),(Token|1|5),(Component Name|3) + +# The task is being removed from its parent stack +30061 wm_remove_task (Task ID|1|5), (Stack ID|1|5) + +# An activity been add into stopping list +30066 wm_add_to_stopping (User|1|5),(Token|1|5),(Component Name|3),(Reason|3) + +# Keyguard status changed +30067 wm_set_keyguard_shown (keyguardShowing|1),(aodShowing|1),(keyguardGoingAway|1),(Reason|3) + +# Out of memory for surfaces. +31000 wm_no_surface_memory (Window|3),(PID|1|5),(Operation|3) +# Task created. +31001 wm_task_created (TaskId|1|5),(StackId|1|5) +# Task moved to top (1) or bottom (0). +31002 wm_task_moved (TaskId|1|5),(ToTop|1),(Index|1) +# Task removed with source explanation. +31003 wm_task_removed (TaskId|1|5),(Reason|3) +# Stack created. +31004 wm_stack_created (StackId|1|5) +# Home stack moved to top (1) or bottom (0). +31005 wm_home_stack_moved (ToTop|1) +# Stack removed. +31006 wm_stack_removed (StackId|1|5) +# bootanim finished: +31007 wm_boot_animation_done (time|2|3) + diff --git a/services/core/java/com/android/server/wm/KeyguardController.java b/services/core/java/com/android/server/wm/KeyguardController.java index 52cc422f8c51..3b58eca2ecb9 100644 --- a/services/core/java/com/android/server/wm/KeyguardController.java +++ b/services/core/java/com/android/server/wm/KeyguardController.java @@ -43,13 +43,11 @@ import static com.android.server.wm.ActivityTaskManagerDebugConfig.TAG_WITH_CLAS import android.os.IBinder; import android.os.RemoteException; import android.os.Trace; -import android.util.EventLog; import android.util.Slog; import android.util.SparseArray; import android.util.proto.ProtoOutputStream; import com.android.internal.policy.IKeyguardDismissCallback; -import com.android.server.am.EventLogTags; import com.android.server.policy.WindowManagerPolicy; import com.android.server.wm.ActivityTaskManagerInternal.SleepToken; @@ -143,7 +141,7 @@ class KeyguardController { if (!keyguardChanged && !aodChanged) { return; } - EventLog.writeEvent(EventLogTags.AM_SET_KEYGUARD_SHOWN, + EventLogTags.writeWmSetKeyguardShown( keyguardShowing ? 1 : 0, aodShowing ? 1 : 0, mKeyguardGoingAway ? 1 : 0, @@ -184,7 +182,7 @@ class KeyguardController { mService.deferWindowLayout(); try { setKeyguardGoingAway(true); - EventLog.writeEvent(EventLogTags.AM_SET_KEYGUARD_SHOWN, + EventLogTags.writeWmSetKeyguardShown( 1 /* keyguardShowing */, mAodShowing ? 1 : 0, 1 /* keyguardGoingAway */, diff --git a/services/core/java/com/android/server/wm/RootWindowContainer.java b/services/core/java/com/android/server/wm/RootWindowContainer.java index 565f95e3681b..5ec9599cf7b1 100644 --- a/services/core/java/com/android/server/wm/RootWindowContainer.java +++ b/services/core/java/com/android/server/wm/RootWindowContainer.java @@ -68,7 +68,6 @@ import android.os.RemoteException; import android.os.Trace; import android.os.UserHandle; import android.util.ArraySet; -import android.util.EventLog; import android.util.Slog; import android.util.SparseIntArray; import android.util.proto.ProtoOutputStream; @@ -77,7 +76,6 @@ import android.view.DisplayInfo; import android.view.SurfaceControl; import android.view.WindowManager; -import com.android.server.EventLogTags; import com.android.server.protolog.common.ProtoLog; import java.io.PrintWriter; @@ -488,10 +486,8 @@ class RootWindowContainer extends WindowContainer<DisplayContent> final WindowSurfaceController surfaceController = winAnimator.mSurfaceController; boolean leakedSurface = false; boolean killedApps = false; - - EventLog.writeEvent(EventLogTags.WM_NO_SURFACE_MEMORY, winAnimator.mWin.toString(), + EventLogTags.writeWmNoSurfaceMemory(winAnimator.mWin.toString(), winAnimator.mSession.mPid, operation); - final long callingIdentity = Binder.clearCallingIdentity(); try { // There was some problem...first, do a sanity check of the window list to make sure diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java index 3b16b59a5540..7a8614b7bfea 100644 --- a/services/core/java/com/android/server/wm/Task.java +++ b/services/core/java/com/android/server/wm/Task.java @@ -56,8 +56,6 @@ import static android.provider.Settings.Secure.USER_SETUP_COMPLETE; import static android.view.Display.DEFAULT_DISPLAY; import static android.view.SurfaceControl.METADATA_TASK_ID; -import static com.android.server.EventLogTags.WM_TASK_CREATED; -import static com.android.server.EventLogTags.WM_TASK_REMOVED; import static com.android.server.am.TaskRecordProto.ACTIVITIES; import static com.android.server.am.TaskRecordProto.ACTIVITY_TYPE; import static com.android.server.am.TaskRecordProto.FULLSCREEN; @@ -128,7 +126,6 @@ import android.os.UserHandle; import android.provider.Settings; import android.service.voice.IVoiceInteractionSession; import android.util.DisplayMetrics; -import android.util.EventLog; import android.util.Slog; import android.util.proto.ProtoOutputStream; import android.view.Display; @@ -421,8 +418,7 @@ class Task extends WindowContainer<ActivityRecord> implements ConfigurationConta ActivityStack stack) { super(atmService.mWindowManager); - EventLog.writeEvent(WM_TASK_CREATED, _taskId, - stack != null ? stack.mStackId : INVALID_STACK_ID); + EventLogTags.writeWmTaskCreated(_taskId, stack != null ? stack.mStackId : INVALID_STACK_ID); mAtmService = atmService; mTaskId = _taskId; mUserId = _userId; @@ -1301,7 +1297,7 @@ class Task extends WindowContainer<ActivityRecord> implements ConfigurationConta } else if (!mReuseTask) { // Remove entire task if it doesn't have any activity left and it isn't marked for reuse mStack.removeChild(this, reason); - EventLog.writeEvent(WM_TASK_REMOVED, mTaskId, + EventLogTags.writeWmTaskRemoved(mTaskId, "removeChild: last r=" + r + " in t=" + this); removeIfPossible(); } @@ -2306,7 +2302,7 @@ class Task extends WindowContainer<ActivityRecord> implements ConfigurationConta @Override void removeImmediately() { if (DEBUG_STACK) Slog.i(TAG, "removeTask: removing taskId=" + mTaskId); - EventLog.writeEvent(WM_TASK_REMOVED, mTaskId, "removeTask"); + EventLogTags.writeWmTaskRemoved(mTaskId, "removeTask"); super.removeImmediately(); } @@ -2314,7 +2310,7 @@ class Task extends WindowContainer<ActivityRecord> implements ConfigurationConta void reparent(ActivityStack stack, int position, boolean moveParents, String reason) { if (DEBUG_STACK) Slog.i(TAG, "reParentTask: removing taskId=" + mTaskId + " from stack=" + getTaskStack()); - EventLog.writeEvent(WM_TASK_REMOVED, mTaskId, "reParentTask"); + EventLogTags.writeWmTaskRemoved(mTaskId, "reParentTask"); final ActivityStack prevStack = getTaskStack(); final boolean wasTopFocusedStack = diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index a2467e6b7341..c937bfa856dc 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -193,7 +193,6 @@ import android.text.format.DateUtils; import android.util.ArrayMap; import android.util.ArraySet; import android.util.DisplayMetrics; -import android.util.EventLog; import android.util.Log; import android.util.MergedConfiguration; import android.util.Slog; @@ -265,7 +264,6 @@ import com.android.internal.util.function.pooled.PooledLambda; import com.android.internal.view.WindowManagerPolicyThread; import com.android.server.AnimationThread; import com.android.server.DisplayThread; -import com.android.server.EventLogTags; import com.android.server.FgThread; import com.android.server.LocalServices; import com.android.server.UiThread; @@ -3327,7 +3325,7 @@ public class WindowManagerService extends IWindowManager.Stub ProtoLog.e(WM_ERROR, "Boot completed: SurfaceFlinger is dead!"); } - EventLog.writeEvent(EventLogTags.WM_BOOT_ANIMATION_DONE, SystemClock.uptimeMillis()); + EventLogTags.writeWmBootAnimationDone(SystemClock.uptimeMillis()); Trace.asyncTraceEnd(TRACE_TAG_WINDOW_MANAGER, "Stop bootanim", 0); mDisplayEnabled = true; ProtoLog.i(WM_DEBUG_SCREEN_ON, "******************** ENABLING SCREEN!"); |