Loading core/java/com/android/internal/inputmethod/ImeTracingServerImpl.java +15 −1 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import static android.os.Build.IS_USER; import android.annotation.Nullable; import android.os.RemoteException; import android.os.ServiceManager.ServiceNotFoundException; import android.os.SystemClock; import android.util.Log; import android.util.proto.ProtoOutputStream; import android.view.inputmethod.InputMethodEditorTraceProto.InputMethodClientsTraceFileProto; Loading @@ -34,6 +35,7 @@ import com.android.internal.util.TraceBuffer; import java.io.File; import java.io.IOException; import java.io.PrintWriter; import java.util.concurrent.TimeUnit; /** * An implementation of {@link ImeTracing} for the system_server process. Loading Loading @@ -139,18 +141,30 @@ class ImeTracingServerImpl extends ImeTracing { private void writeTracesToFilesLocked() { try { long timeOffsetNs = TimeUnit.NANOSECONDS.convert(System.currentTimeMillis(), TimeUnit.NANOSECONDS) - SystemClock.elapsedRealtimeNanos(); ProtoOutputStream clientsProto = new ProtoOutputStream(); clientsProto.write(InputMethodClientsTraceFileProto.MAGIC_NUMBER, MAGIC_NUMBER_CLIENTS_VALUE); clientsProto.write(InputMethodClientsTraceFileProto.REAL_TO_ELAPSED_TIME_OFFSET_NANOS, timeOffsetNs); mBufferClients.writeTraceToFile(mTraceFileClients, clientsProto); ProtoOutputStream imsProto = new ProtoOutputStream(); imsProto.write(InputMethodServiceTraceFileProto.MAGIC_NUMBER, MAGIC_NUMBER_IMS_VALUE); imsProto.write(InputMethodServiceTraceFileProto.MAGIC_NUMBER, MAGIC_NUMBER_IMS_VALUE); imsProto.write(InputMethodServiceTraceFileProto.REAL_TO_ELAPSED_TIME_OFFSET_NANOS, timeOffsetNs); mBufferIms.writeTraceToFile(mTraceFileIms, imsProto); ProtoOutputStream immsProto = new ProtoOutputStream(); immsProto.write(InputMethodManagerServiceTraceFileProto.MAGIC_NUMBER, MAGIC_NUMBER_IMMS_VALUE); immsProto.write( InputMethodManagerServiceTraceFileProto.REAL_TO_ELAPSED_TIME_OFFSET_NANOS, timeOffsetNs); mBufferImms.writeTraceToFile(mTraceFileImms, immsProto); resetBuffers(); Loading core/proto/android/server/accessibilitytrace.proto +4 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,10 @@ message AccessibilityTraceFileProto { optional fixed64 magic_number = 1; /* Must be the first field, set to value in MagicNumber */ repeated AccessibilityTraceProto entry = 2; /* offset between real-time clock and elapsed time clock in nanoseconds. Calculated as: 1000000 * System.currentTimeMillis() - SystemClock.elapsedRealtimeNanos() */ optional fixed64 real_to_elapsed_time_offset_nanos = 3; } /* one accessibility trace entry. */ Loading core/proto/android/server/windowmanagertrace.proto +4 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,10 @@ message WindowManagerTraceFileProto { optional fixed64 magic_number = 1; /* Must be the first field, set to value in MagicNumber */ repeated WindowManagerTraceProto entry = 2; /* offset between real-time clock and elapsed time clock in nanoseconds. Calculated as: 1000000 * System.currentTimeMillis() - SystemClock.elapsedRealtimeNanos() */ optional fixed64 real_to_elapsed_time_offset_nanos = 3; } /* one window manager trace entry. */ Loading core/proto/android/view/inputmethod/inputmethodeditortrace.proto +12 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,10 @@ message InputMethodClientsTraceFileProto { in MagicNumber */ optional fixed64 magic_number = 1; repeated InputMethodClientsTraceProto entry = 2; /* offset between real-time clock and elapsed time clock in nanoseconds. Calculated as: 1000000 * System.currentTimeMillis() - SystemClock.elapsedRealtimeNanos() */ optional fixed64 real_to_elapsed_time_offset_nanos = 3; } /* One dump entry for clients that use InputMethod. */ Loading Loading @@ -96,6 +100,10 @@ message InputMethodServiceTraceFileProto { in MagicNumber */ optional fixed64 magic_number = 1; repeated InputMethodServiceTraceProto entry = 2; /* offset between real-time clock and elapsed time clock in nanoseconds. Calculated as: 1000000 * System.currentTimeMillis() - SystemClock.elapsedRealtimeNanos() */ optional fixed64 real_to_elapsed_time_offset_nanos = 3; } /* One dump entry for InputMethodService. */ Loading Loading @@ -129,6 +137,10 @@ message InputMethodManagerServiceTraceFileProto { in MagicNumber */ optional fixed64 magic_number = 1; repeated InputMethodManagerServiceTraceProto entry = 2; /* offset between real-time clock and elapsed time clock in nanoseconds. Calculated as: 1000000 * System.currentTimeMillis() - SystemClock.elapsedRealtimeNanos() */ optional fixed64 real_to_elapsed_time_offset_nanos = 3; } /* One dump entry for InputMethodManagerService. */ Loading services/core/java/com/android/server/wm/AccessibilityController.java +7 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import static com.android.server.accessibility.AccessibilityTraceFileProto.ENTRY import static com.android.server.accessibility.AccessibilityTraceFileProto.MAGIC_NUMBER; import static com.android.server.accessibility.AccessibilityTraceFileProto.MAGIC_NUMBER_H; import static com.android.server.accessibility.AccessibilityTraceFileProto.MAGIC_NUMBER_L; import static com.android.server.accessibility.AccessibilityTraceFileProto.REAL_TO_ELAPSED_TIME_OFFSET_NANOS; import static com.android.server.accessibility.AccessibilityTraceProto.ACCESSIBILITY_SERVICE; import static com.android.server.accessibility.AccessibilityTraceProto.CALENDAR_TIME; import static com.android.server.accessibility.AccessibilityTraceProto.CALLING_PARAMS; Loading Loading @@ -116,6 +117,7 @@ import java.util.Date; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.concurrent.TimeUnit; /** * This class contains the accessibility related logic of the window manager. Loading Loading @@ -2215,6 +2217,11 @@ final class AccessibilityController { try { ProtoOutputStream proto = new ProtoOutputStream(); proto.write(MAGIC_NUMBER, MAGIC_NUMBER_VALUE); long timeOffsetNs = TimeUnit.NANOSECONDS.convert(System.currentTimeMillis(), TimeUnit.NANOSECONDS) - SystemClock.elapsedRealtimeNanos(); proto.write(REAL_TO_ELAPSED_TIME_OFFSET_NANOS, timeOffsetNs); mBuffer.writeTraceToFile(mTraceFile, proto); } catch (IOException e) { Slog.e(TAG, "Unable to write buffer to file", e); Loading Loading
core/java/com/android/internal/inputmethod/ImeTracingServerImpl.java +15 −1 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import static android.os.Build.IS_USER; import android.annotation.Nullable; import android.os.RemoteException; import android.os.ServiceManager.ServiceNotFoundException; import android.os.SystemClock; import android.util.Log; import android.util.proto.ProtoOutputStream; import android.view.inputmethod.InputMethodEditorTraceProto.InputMethodClientsTraceFileProto; Loading @@ -34,6 +35,7 @@ import com.android.internal.util.TraceBuffer; import java.io.File; import java.io.IOException; import java.io.PrintWriter; import java.util.concurrent.TimeUnit; /** * An implementation of {@link ImeTracing} for the system_server process. Loading Loading @@ -139,18 +141,30 @@ class ImeTracingServerImpl extends ImeTracing { private void writeTracesToFilesLocked() { try { long timeOffsetNs = TimeUnit.NANOSECONDS.convert(System.currentTimeMillis(), TimeUnit.NANOSECONDS) - SystemClock.elapsedRealtimeNanos(); ProtoOutputStream clientsProto = new ProtoOutputStream(); clientsProto.write(InputMethodClientsTraceFileProto.MAGIC_NUMBER, MAGIC_NUMBER_CLIENTS_VALUE); clientsProto.write(InputMethodClientsTraceFileProto.REAL_TO_ELAPSED_TIME_OFFSET_NANOS, timeOffsetNs); mBufferClients.writeTraceToFile(mTraceFileClients, clientsProto); ProtoOutputStream imsProto = new ProtoOutputStream(); imsProto.write(InputMethodServiceTraceFileProto.MAGIC_NUMBER, MAGIC_NUMBER_IMS_VALUE); imsProto.write(InputMethodServiceTraceFileProto.MAGIC_NUMBER, MAGIC_NUMBER_IMS_VALUE); imsProto.write(InputMethodServiceTraceFileProto.REAL_TO_ELAPSED_TIME_OFFSET_NANOS, timeOffsetNs); mBufferIms.writeTraceToFile(mTraceFileIms, imsProto); ProtoOutputStream immsProto = new ProtoOutputStream(); immsProto.write(InputMethodManagerServiceTraceFileProto.MAGIC_NUMBER, MAGIC_NUMBER_IMMS_VALUE); immsProto.write( InputMethodManagerServiceTraceFileProto.REAL_TO_ELAPSED_TIME_OFFSET_NANOS, timeOffsetNs); mBufferImms.writeTraceToFile(mTraceFileImms, immsProto); resetBuffers(); Loading
core/proto/android/server/accessibilitytrace.proto +4 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,10 @@ message AccessibilityTraceFileProto { optional fixed64 magic_number = 1; /* Must be the first field, set to value in MagicNumber */ repeated AccessibilityTraceProto entry = 2; /* offset between real-time clock and elapsed time clock in nanoseconds. Calculated as: 1000000 * System.currentTimeMillis() - SystemClock.elapsedRealtimeNanos() */ optional fixed64 real_to_elapsed_time_offset_nanos = 3; } /* one accessibility trace entry. */ Loading
core/proto/android/server/windowmanagertrace.proto +4 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,10 @@ message WindowManagerTraceFileProto { optional fixed64 magic_number = 1; /* Must be the first field, set to value in MagicNumber */ repeated WindowManagerTraceProto entry = 2; /* offset between real-time clock and elapsed time clock in nanoseconds. Calculated as: 1000000 * System.currentTimeMillis() - SystemClock.elapsedRealtimeNanos() */ optional fixed64 real_to_elapsed_time_offset_nanos = 3; } /* one window manager trace entry. */ Loading
core/proto/android/view/inputmethod/inputmethodeditortrace.proto +12 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,10 @@ message InputMethodClientsTraceFileProto { in MagicNumber */ optional fixed64 magic_number = 1; repeated InputMethodClientsTraceProto entry = 2; /* offset between real-time clock and elapsed time clock in nanoseconds. Calculated as: 1000000 * System.currentTimeMillis() - SystemClock.elapsedRealtimeNanos() */ optional fixed64 real_to_elapsed_time_offset_nanos = 3; } /* One dump entry for clients that use InputMethod. */ Loading Loading @@ -96,6 +100,10 @@ message InputMethodServiceTraceFileProto { in MagicNumber */ optional fixed64 magic_number = 1; repeated InputMethodServiceTraceProto entry = 2; /* offset between real-time clock and elapsed time clock in nanoseconds. Calculated as: 1000000 * System.currentTimeMillis() - SystemClock.elapsedRealtimeNanos() */ optional fixed64 real_to_elapsed_time_offset_nanos = 3; } /* One dump entry for InputMethodService. */ Loading Loading @@ -129,6 +137,10 @@ message InputMethodManagerServiceTraceFileProto { in MagicNumber */ optional fixed64 magic_number = 1; repeated InputMethodManagerServiceTraceProto entry = 2; /* offset between real-time clock and elapsed time clock in nanoseconds. Calculated as: 1000000 * System.currentTimeMillis() - SystemClock.elapsedRealtimeNanos() */ optional fixed64 real_to_elapsed_time_offset_nanos = 3; } /* One dump entry for InputMethodManagerService. */ Loading
services/core/java/com/android/server/wm/AccessibilityController.java +7 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import static com.android.server.accessibility.AccessibilityTraceFileProto.ENTRY import static com.android.server.accessibility.AccessibilityTraceFileProto.MAGIC_NUMBER; import static com.android.server.accessibility.AccessibilityTraceFileProto.MAGIC_NUMBER_H; import static com.android.server.accessibility.AccessibilityTraceFileProto.MAGIC_NUMBER_L; import static com.android.server.accessibility.AccessibilityTraceFileProto.REAL_TO_ELAPSED_TIME_OFFSET_NANOS; import static com.android.server.accessibility.AccessibilityTraceProto.ACCESSIBILITY_SERVICE; import static com.android.server.accessibility.AccessibilityTraceProto.CALENDAR_TIME; import static com.android.server.accessibility.AccessibilityTraceProto.CALLING_PARAMS; Loading Loading @@ -116,6 +117,7 @@ import java.util.Date; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.concurrent.TimeUnit; /** * This class contains the accessibility related logic of the window manager. Loading Loading @@ -2215,6 +2217,11 @@ final class AccessibilityController { try { ProtoOutputStream proto = new ProtoOutputStream(); proto.write(MAGIC_NUMBER, MAGIC_NUMBER_VALUE); long timeOffsetNs = TimeUnit.NANOSECONDS.convert(System.currentTimeMillis(), TimeUnit.NANOSECONDS) - SystemClock.elapsedRealtimeNanos(); proto.write(REAL_TO_ELAPSED_TIME_OFFSET_NANOS, timeOffsetNs); mBuffer.writeTraceToFile(mTraceFile, proto); } catch (IOException e) { Slog.e(TAG, "Unable to write buffer to file", e); Loading