Update task event logs with display id

In order to help debug bugs in multi-display scenarios.

Also adding the config changes that resulted in activity
relaunches into the event log.

Bug: 240733437
Test: build
Change-Id: I71f0c98f7123157c182e28e776f2a8afafb690ba
This commit is contained in:
Louis Chang
2022-11-09 07:54:25 +00:00
parent 1986848b31
commit f721b3dc07
5 changed files with 18 additions and 18 deletions

View File

@@ -9204,10 +9204,10 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
+ " preserveWindow=" + preserveWindow);
if (andResume) {
EventLogTags.writeWmRelaunchResumeActivity(mUserId, System.identityHashCode(this),
task.mTaskId, shortComponentName);
task.mTaskId, shortComponentName, Integer.toHexString(configChangeFlags));
} else {
EventLogTags.writeWmRelaunchActivity(mUserId, System.identityHashCode(this),
task.mTaskId, shortComponentName);
task.mTaskId, shortComponentName, Integer.toHexString(configChangeFlags));
}
startFreezingScreenLocked(0);

View File

@@ -1663,7 +1663,8 @@ class ActivityStarter {
}
final Task startedTask = mStartActivity.getTask();
if (newTask) {
EventLogTags.writeWmCreateTask(mStartActivity.mUserId, startedTask.mTaskId);
EventLogTags.writeWmCreateTask(mStartActivity.mUserId, startedTask.mTaskId,
startedTask.getRootTaskId(), startedTask.getDisplayId());
}
mStartActivity.logStartActivity(EventLogTags.WM_CREATE_ACTIVITY, startedTask);

View File

@@ -8,11 +8,11 @@ option java_package com.android.server.wm
# 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)
30002 wm_task_to_front (User|1|5),(Task|1|5),(Display Id|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)
30004 wm_create_task (User|1|5),(Task ID|1|5),(Root Task ID|1|5),(Display 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:
@@ -32,9 +32,9 @@ option java_package com.android.server.wm
# 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)
30019 wm_relaunch_resume_activity (User|1|5),(Token|1|5),(Task ID|1|5),(Component Name|3),(config mask|3)
# An activity has been relaunched:
30020 wm_relaunch_activity (User|1|5),(Token|1|5),(Task ID|1|5),(Component Name|3)
30020 wm_relaunch_activity (User|1|5),(Token|1|5),(Task ID|1|5),(Component Name|3),(config mask|3)
# Activity set to resumed
30043 wm_set_resumed_activity (User|1|5),(Component Name|3),(Reason|3)
@@ -45,9 +45,6 @@ option java_package com.android.server.wm
# 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 task
30061 wm_remove_task (Task ID|1|5), (Root Task 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)
@@ -57,11 +54,11 @@ option java_package com.android.server.wm
# 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),(RootTaskId|1|5)
31001 wm_task_created (TaskId|1|5)
# Task moved to top (1) or bottom (0).
31002 wm_task_moved (TaskId|1|5),(ToTop|1),(Index|1)
31002 wm_task_moved (TaskId|1|5),(Root Task ID|1|5),(Display Id|1|5),(ToTop|1),(Index|1)
# Task removed with source explanation.
31003 wm_task_removed (TaskId|1|5),(Reason|3)
31003 wm_task_removed (TaskId|1|5),(Root Task ID|1|5),(Display Id|1|5),(Reason|3)
# bootanim finished:
31007 wm_boot_animation_done (time|2|3)

View File

@@ -680,7 +680,7 @@ class Task extends TaskFragment {
mLaunchCookie = _launchCookie;
mDeferTaskAppear = _deferTaskAppear;
mRemoveWithTaskOrganizer = _removeWithTaskOrganizer;
EventLogTags.writeWmTaskCreated(mTaskId, isRootTask() ? INVALID_TASK_ID : getRootTaskId());
EventLogTags.writeWmTaskCreated(mTaskId);
}
static Task fromWindowContainerToken(WindowContainerToken token) {
@@ -1297,7 +1297,8 @@ class Task extends TaskFragment {
}
void updateTaskMovement(boolean toTop, int position) {
EventLogTags.writeWmTaskMoved(mTaskId, toTop ? 1 : 0, position);
EventLogTags.writeWmTaskMoved(mTaskId, getRootTaskId(), getDisplayId(), toTop ? 1 : 0,
position);
final TaskDisplayArea taskDisplayArea = getDisplayArea();
if (taskDisplayArea != null && isLeafTask()) {
taskDisplayArea.onLeafTaskMoved(this, toTop);
@@ -2560,7 +2561,7 @@ class Task extends TaskFragment {
}
mRemoving = true;
EventLogTags.writeWmTaskRemoved(mTaskId, reason);
EventLogTags.writeWmTaskRemoved(mTaskId, getRootTaskId(), getDisplayId(), reason);
clearPinnedTaskIfNeed();
// If applicable let the TaskOrganizer know the Task is vanishing.
setTaskOrganizer(null);
@@ -2573,7 +2574,8 @@ class Task extends TaskFragment {
void reparent(Task rootTask, int position, boolean moveParents, String reason) {
if (DEBUG_ROOT_TASK) Slog.i(TAG, "reParentTask: removing taskId=" + mTaskId
+ " from rootTask=" + getRootTask());
EventLogTags.writeWmTaskRemoved(mTaskId, "reParentTask:" + reason);
EventLogTags.writeWmTaskRemoved(mTaskId, getRootTaskId(), getDisplayId(),
"reParentTask:" + reason);
reparent(rootTask, position);

View File

@@ -455,7 +455,7 @@ final class TaskDisplayArea extends DisplayArea<WindowContainer> {
}
mLastLeafTaskToFrontId = t.mTaskId;
EventLogTags.writeWmTaskToFront(t.mUserId, t.mTaskId);
EventLogTags.writeWmTaskToFront(t.mUserId, t.mTaskId, getDisplayId());
// Notifying only when a leaf task moved to front. Or the listeners would be notified
// couple times from the leaf task all the way up to the root task.
mAtmService.getTaskChangeNotificationController().notifyTaskMovedToFront(t.getTaskInfo());