summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Riddle Hsu <riddlehsu@google.com> 2019-07-01 20:16:12 +0800
committer Riddle Hsu <riddlehsu@google.com> 2019-07-01 20:16:12 +0800
commit9a5bb3bbc5d7dbaffef45b655a189348db9fca81 (patch)
tree0109e570087a6854e25dc8feb942362b127ada14
parent0a0be77a82ac19cff659f05c9d71ec2c3b4ce5f9 (diff)
Print activity event log with token identity
The log information will be clearer when there are multiple activities use the same class. The user id field is replaced because it can be easily read by the printed uid (logcat -v uid) or mapped to the corresponding log printed by system server that contains user id. Bug: 136456023 Test: The server and client am_* lifecycle related event logs print the same identity. Change-Id: Iaf82041bc8b4e6690e3aee822c91389bd166b6df
-rw-r--r--core/java/android/app/Activity.java3
-rw-r--r--services/core/java/com/android/server/am/EventLogTags.logtags20
2 files changed, 11 insertions, 12 deletions
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index 28d3165b8073..f655c8993456 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -8554,8 +8554,7 @@ 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, UserHandle.myUserId(), getComponentName().getClassName(),
- reason);
+ EventLog.writeEvent(event, mIdent, getComponentName().getClassName(), reason);
}
class HostCallbacks extends FragmentHostCallback<Activity> {
diff --git a/services/core/java/com/android/server/am/EventLogTags.logtags b/services/core/java/com/android/server/am/EventLogTags.logtags
index 30a297e221ae..421b75586224 100644
--- a/services/core/java/com/android/server/am/EventLogTags.logtags
+++ b/services/core/java/com/android/server/am/EventLogTags.logtags
@@ -54,9 +54,9 @@ option java_package com.android.server.am
# 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 (User|1|5),(Component Name|3),(Reason|3)
+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 (User|1|5),(Component Name|3),(Reason|3)
+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)
@@ -104,7 +104,7 @@ option java_package com.android.server.am
# 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 (User|1|5),(Component Name|3),(Reason|3)
+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)
@@ -124,15 +124,15 @@ option java_package com.android.server.am
30056 am_stop_idle_service (UID|1|5),(Component Name|3)
# The activity's onCreate has been called.
-30057 am_on_create_called (User|1|5),(Component Name|3),(Reason|3)
+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 (User|1|5),(Component Name|3),(Reason|3)
+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 (User|1|5),(Component Name|3),(Reason|3)
+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 (User|1|5),(Component Name|3),(Reason|3)
+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 (User|1|5),(Component Name|3),(Reason|3)
+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)
@@ -141,9 +141,9 @@ option java_package com.android.server.am
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 (User|1|5),(Component Name|3),(Reason|3)
+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 (User|1|5),(Component Name|3),(Reason|3)
+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) \ No newline at end of file