Updated Winscope view for IME tracing clients information
Updated the IME tracing view in Winscope for the new optimized proto
dump format. This change included only the clients view since only
this information is currently dumped.
Bug: 154348613
Test: build and run the code using "yarn run dev"
build and flash the android code to a device
start and stop IME trace from the command line and then upload the file into Winscope or
start IME trace from the web interface, open an IME on the android device to generate logs, end trace from the web interface to see the logs
Change-Id: I3dc01d602147d41af3c5b99b848cb428e402c219
This commit is contained in:
@@ -47,7 +47,7 @@ LOG_LEVEL = logging.WARNING
|
||||
PORT = 5544
|
||||
|
||||
# Keep in sync with WINSCOPE_PROXY_VERSION in Winscope DataAdb.vue
|
||||
VERSION = '0.7'
|
||||
VERSION = '0.8'
|
||||
|
||||
WINSCOPE_VERSION_HEADER = "Winscope-Proxy-Version"
|
||||
WINSCOPE_TOKEN_HEADER = "Winscope-Token"
|
||||
@@ -139,9 +139,9 @@ TRACE_TARGETS = {
|
||||
'su root cmd window logging start\necho "WM logging started."',
|
||||
'su root cmd window logging stop >/dev/null 2>&1'
|
||||
),
|
||||
"ime_trace": TraceTarget(
|
||||
File("/data/misc/wmtrace/ime_trace.pb", "ime_trace"),
|
||||
'su root ime tracing start\necho "IME trace started."',
|
||||
"ime_trace_clients": TraceTarget(
|
||||
File("/data/misc/wmtrace/ime_trace_clients.pb", "ime_trace_clients"),
|
||||
'su root ime tracing start\necho "Clients IME trace started."',
|
||||
'su root ime tracing stop >/dev/null 2>&1'
|
||||
),
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ const STATES = {
|
||||
LOAD_DATA: 8,
|
||||
};
|
||||
|
||||
const WINSCOPE_PROXY_VERSION = '0.7';
|
||||
const WINSCOPE_PROXY_VERSION = '0.8';
|
||||
const WINSCOPE_PROXY_URL = 'http://localhost:5544';
|
||||
const PROXY_ENDPOINTS = {
|
||||
DEVICES: '/devices/',
|
||||
@@ -170,8 +170,8 @@ const TRACES = {
|
||||
'screen_recording': {
|
||||
name: 'Screen Recording',
|
||||
},
|
||||
'ime_trace': {
|
||||
name: 'Input Method',
|
||||
'ime_trace_clients': {
|
||||
name: 'Input Method Clients',
|
||||
},
|
||||
};
|
||||
|
||||
@@ -204,7 +204,7 @@ const proxyFileTypeAdapter = {
|
||||
'proto_log': FILE_TYPES.PROTO_LOG,
|
||||
'system_ui_trace': FILE_TYPES.SYSTEM_UI,
|
||||
'launcher_trace': FILE_TYPES.LAUNCHER,
|
||||
'ime_trace': FILE_TYPES.IME_TRACE,
|
||||
'ime_trace_clients': FILE_TYPES.IME_TRACE_CLIENTS,
|
||||
};
|
||||
|
||||
const CONFIGS = Object.keys(TRACE_CONFIG).flatMap((file) => TRACE_CONFIG[file]);
|
||||
|
||||
@@ -44,7 +44,7 @@ import WaylandTrace from '@/traces/Wayland.ts';
|
||||
import ProtoLogTrace from '@/traces/ProtoLog.ts';
|
||||
import SystemUITrace from '@/traces/SystemUI.ts';
|
||||
import LauncherTrace from '@/traces/Launcher.ts';
|
||||
import ImeTrace from '@/traces/InputMethodEditor.ts';
|
||||
import ImeTraceClients from '@/traces/InputMethodClients.ts';
|
||||
|
||||
import SurfaceFlingerDump from '@/dumps/SurfaceFlinger.ts';
|
||||
import WindowManagerDump from '@/dumps/WindowManager.ts';
|
||||
@@ -60,7 +60,7 @@ const WaylandDumpMessage = lookup_type(jsonProtoDefsWl, 'org.chromium.arc.waylan
|
||||
const ProtoLogMessage = lookup_type(jsonProtoDefsProtoLog, 'com.android.internal.protolog.ProtoLogFileProto');
|
||||
const SystemUiTraceMessage = lookup_type(jsonProtoDefsSysUi, 'com.android.systemui.tracing.SystemUiTraceFileProto');
|
||||
const LauncherTraceMessage = lookup_type(jsonProtoDefsLauncher, 'com.android.launcher3.tracing.LauncherTraceFileProto');
|
||||
const InputMethodEditorTraceMessage = lookup_type(jsonProtoDefsIme, "android.view.inputmethod.InputMethodEditorTraceFileProto");
|
||||
const InputMethodClientsTraceMessage = lookup_type(jsonProtoDefsIme, "android.view.inputmethod.InputMethodClientsTraceFileProto");
|
||||
|
||||
const LAYER_TRACE_MAGIC_NUMBER = [0x09, 0x4c, 0x59, 0x52, 0x54, 0x52, 0x41, 0x43, 0x45]; // .LYRTRACE
|
||||
const WINDOW_TRACE_MAGIC_NUMBER = [0x09, 0x57, 0x49, 0x4e, 0x54, 0x52, 0x41, 0x43, 0x45]; // .WINTRACE
|
||||
@@ -69,7 +69,7 @@ const WAYLAND_TRACE_MAGIC_NUMBER = [0x09, 0x57, 0x59, 0x4c, 0x54, 0x52, 0x41, 0x
|
||||
const PROTO_LOG_MAGIC_NUMBER = [0x09, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x4c, 0x4f, 0x47]; // .PROTOLOG
|
||||
const SYSTEM_UI_MAGIC_NUMBER = [0x09, 0x53, 0x59, 0x53, 0x55, 0x49, 0x54, 0x52, 0x43]; // .SYSUITRC
|
||||
const LAUNCHER_MAGIC_NUMBER = [0x09, 0x4C, 0x4E, 0x43, 0x48, 0x52, 0x54, 0x52, 0x43]; // .LNCHRTRC
|
||||
const IME_TRACE_MAGIC_NUMBER = [0x09, 0x49, 0x4d, 0x45, 0x54, 0x52, 0x41, 0x43, 0x45] //.IMETRACE
|
||||
const IMC_TRACE_MAGIC_NUMBER = [0x09, 0x49, 0x4d, 0x43, 0x54, 0x52, 0x41, 0x43, 0x45] //.IMCTRACE
|
||||
|
||||
const FILE_TYPES = Object.freeze({
|
||||
WINDOW_MANAGER_TRACE: 'WindowManagerTrace',
|
||||
@@ -83,7 +83,7 @@ const FILE_TYPES = Object.freeze({
|
||||
PROTO_LOG: 'ProtoLog',
|
||||
SYSTEM_UI: 'SystemUI',
|
||||
LAUNCHER: 'Launcher',
|
||||
IME_TRACE: 'ImeTrace',
|
||||
IME_TRACE_CLIENTS: 'ImeTraceClients',
|
||||
});
|
||||
|
||||
const WINDOW_MANAGER_ICON = 'view_compact';
|
||||
@@ -108,7 +108,7 @@ const FILE_ICONS = {
|
||||
[FILE_TYPES.PROTO_LOG]: PROTO_LOG_ICON,
|
||||
[FILE_TYPES.SYSTEM_UI]: SYSTEM_UI_ICON,
|
||||
[FILE_TYPES.LAUNCHER]: LAUNCHER_ICON,
|
||||
[FILE_TYPES.IME_TRACE]: IME_ICON,
|
||||
[FILE_TYPES.IME_TRACE_CLIENTS]: IME_ICON,
|
||||
};
|
||||
|
||||
function oneOf(dataType) {
|
||||
@@ -128,7 +128,7 @@ const TRACE_TYPES = Object.freeze({
|
||||
PROTO_LOG: 'ProtoLog',
|
||||
SYSTEM_UI: 'SystemUI',
|
||||
LAUNCHER: 'Launcher',
|
||||
IME: 'ImeTrace',
|
||||
IME_CLIENTS: 'ImeTraceClients',
|
||||
});
|
||||
|
||||
const TRACE_INFO = {
|
||||
@@ -182,11 +182,11 @@ const TRACE_INFO = {
|
||||
files: [oneOf(FILE_TYPES.LAUNCHER)],
|
||||
constructor: LauncherTrace,
|
||||
},
|
||||
[TRACE_TYPES.IME]: {
|
||||
name: 'InputMethodEditor',
|
||||
[TRACE_TYPES.IME_CLIENTS]: {
|
||||
name: 'InputMethodClients',
|
||||
icon: IME_ICON,
|
||||
files: [oneOf(FILE_TYPES.IME_TRACE)],
|
||||
constructor: ImeTrace,
|
||||
files: [oneOf(FILE_TYPES.IME_TRACE_CLIENTS)],
|
||||
constructor: ImeTraceClients,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -226,6 +226,7 @@ export const TRACE_ICONS = {
|
||||
[TRACE_TYPES.PROTO_LOG]: PROTO_LOG_ICON,
|
||||
[TRACE_TYPES.SYSTEM_UI]: SYSTEM_UI_ICON,
|
||||
[TRACE_TYPES.LAUNCHER]: LAUNCHER_ICON,
|
||||
[TRACE_TYPES.IME_CLIENTS]: IME_ICON,
|
||||
|
||||
[DUMP_TYPES.WINDOW_MANAGER]: WINDOW_MANAGER_ICON,
|
||||
[DUMP_TYPES.SURFACE_FLINGER]: SURFACE_FLINGER_ICON,
|
||||
@@ -352,13 +353,13 @@ const FILE_DECODERS = {
|
||||
timeline: true,
|
||||
},
|
||||
},
|
||||
[FILE_TYPES.IME_TRACE]: {
|
||||
name: 'InputMethodEditor trace',
|
||||
[FILE_TYPES.IME_TRACE_CLIENTS]: {
|
||||
name: 'InputMethodClients trace',
|
||||
decoder: protoDecoder,
|
||||
decoderParams: {
|
||||
type: FILE_TYPES.IME_TRACE,
|
||||
type: FILE_TYPES.IME_TRACE_CLIENTS,
|
||||
mime: 'application/octet-stream',
|
||||
protoType: InputMethodEditorTraceMessage,
|
||||
protoType: InputMethodClientsTraceMessage,
|
||||
transform: transform_ime_trace,
|
||||
timeline: true,
|
||||
},
|
||||
@@ -493,8 +494,8 @@ function detectAndDecode(buffer, fileName, store) {
|
||||
if (arrayStartsWith(buffer, LAUNCHER_MAGIC_NUMBER)) {
|
||||
return decodedFile(FILE_TYPES.LAUNCHER, buffer, fileName, store);
|
||||
}
|
||||
if (arrayStartsWith(buffer, IME_TRACE_MAGIC_NUMBER)) {
|
||||
return decodedFile(FILE_TYPES.IME_TRACE, buffer, fileName, store);
|
||||
if (arrayStartsWith(buffer, IMC_TRACE_MAGIC_NUMBER)) {
|
||||
return decodedFile(FILE_TYPES.IME_TRACE_CLIENTS, buffer, fileName, store);
|
||||
}
|
||||
|
||||
// TODO(b/169305853): Add magic number at beginning of file for better auto detection
|
||||
|
||||
@@ -34,7 +34,7 @@ const fileOrder = {
|
||||
[TRACE_TYPES.SURFACE_FLINGER]: 2,
|
||||
[TRACE_TYPES.TRANSACTION]: 3,
|
||||
[TRACE_TYPES.PROTO_LOG]: 4,
|
||||
[TRACE_TYPES.IME]: 5,
|
||||
[TRACE_TYPES.IME_CLIENTS]: 5,
|
||||
};
|
||||
|
||||
function sortFiles(files) {
|
||||
|
||||
@@ -23,7 +23,7 @@ const mixin = {
|
||||
file.type == TRACE_TYPES.WAYLAND ||
|
||||
file.type == TRACE_TYPES.SYSTEM_UI ||
|
||||
file.type == TRACE_TYPES.LAUNCHER ||
|
||||
file.type == TRACE_TYPES.IME ||
|
||||
file.type == TRACE_TYPES.IME_CLIENTS ||
|
||||
file.type == DUMP_TYPES.WINDOW_MANAGER ||
|
||||
file.type == DUMP_TYPES.SURFACE_FLINGER ||
|
||||
file.type == DUMP_TYPES.WAYLAND;
|
||||
|
||||
@@ -17,17 +17,17 @@
|
||||
import { FILE_TYPES, TRACE_TYPES } from '@/decode.js';
|
||||
import TraceBase from './TraceBase';
|
||||
|
||||
export default class InputMethodEditor extends TraceBase {
|
||||
export default class InputMethodClients extends TraceBase {
|
||||
imeTraceFile: any;
|
||||
|
||||
constructor(files) {
|
||||
const imeTraceFile = files[FILE_TYPES.IME_TRACE];
|
||||
const imeTraceFile = files[FILE_TYPES.IME_TRACE_CLIENTS];
|
||||
super(imeTraceFile.data, imeTraceFile.timeline, files);
|
||||
|
||||
this.imeTraceFile = imeTraceFile;
|
||||
}
|
||||
|
||||
get type() {
|
||||
return TRACE_TYPES.IME;
|
||||
return TRACE_TYPES.IME_CLIENTS;
|
||||
}
|
||||
}
|
||||
@@ -15,10 +15,8 @@ function transform_entry(entry) {
|
||||
return transform({
|
||||
obj: entry,
|
||||
kind: 'entry',
|
||||
name: nanos_to_string(entry.elapsedRealtimeNanos),
|
||||
name: nanos_to_string(entry.elapsedRealtimeNanos) + " - " + entry.where,
|
||||
children: [
|
||||
[[entry.inputMethodManagerService], transform_imms_dump],
|
||||
[[entry.inputMethodService], transform_ims_dump],
|
||||
[[entry.clients], transform_client_dump]
|
||||
],
|
||||
timestamp: entry.elapsedRealtimeNanos,
|
||||
@@ -26,15 +24,6 @@ function transform_entry(entry) {
|
||||
});
|
||||
}
|
||||
|
||||
function transform_imms_dump(entry) {
|
||||
return transform({
|
||||
obj: entry,
|
||||
kind: 'InputMethodManagerService',
|
||||
name: '',
|
||||
children: []
|
||||
});
|
||||
}
|
||||
|
||||
function transform_client_dump(entry) {
|
||||
return transform({
|
||||
obj: entry,
|
||||
@@ -44,13 +33,4 @@ function transform_client_dump(entry) {
|
||||
});
|
||||
}
|
||||
|
||||
function transform_ims_dump(entry) {
|
||||
return transform({
|
||||
obj: entry,
|
||||
kind: 'InputMethodService',
|
||||
name: '',
|
||||
children: []
|
||||
});
|
||||
}
|
||||
|
||||
export {transform_ime_trace};
|
||||
export {transform_ime_trace};
|
||||
|
||||
Reference in New Issue
Block a user