1# Copyright (C) 2023 The Android Open Source Project 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15from python.generators.trace_processor_table.public import Column as C 16from python.generators.trace_processor_table.public import CppInt64 17from python.generators.trace_processor_table.public import Table 18from python.generators.trace_processor_table.public import CppTableId 19from python.generators.trace_processor_table.public import TableDoc 20from python.generators.trace_processor_table.public import CppUint32 21from python.generators.trace_processor_table.public import CppString 22 23INPUTMETHOD_CLIENTS_TABLE = Table( 24 python_module=__file__, 25 class_name='InputMethodClientsTable', 26 sql_name='__intrinsic_inputmethod_clients', 27 columns=[ 28 C('ts', CppInt64()), 29 C('arg_set_id', CppUint32()), 30 ], 31 tabledoc=TableDoc( 32 doc='InputMethod clients', 33 group='Winscope', 34 columns={ 35 'ts': 'The timestamp the dump was triggered', 36 'arg_set_id': 'Extra args parsed from the proto message', 37 })) 38 39INPUTMETHOD_MANAGER_SERVICE_TABLE = Table( 40 python_module=__file__, 41 class_name='InputMethodManagerServiceTable', 42 sql_name='__intrinsic_inputmethod_manager_service', 43 columns=[ 44 C('ts', CppInt64()), 45 C('arg_set_id', CppUint32()), 46 ], 47 tabledoc=TableDoc( 48 doc='InputMethod manager service', 49 group='Winscope', 50 columns={ 51 'ts': 'The timestamp the dump was triggered', 52 'arg_set_id': 'Extra args parsed from the proto message', 53 })) 54 55INPUTMETHOD_SERVICE_TABLE = Table( 56 python_module=__file__, 57 class_name='InputMethodServiceTable', 58 sql_name='__intrinsic_inputmethod_service', 59 columns=[ 60 C('ts', CppInt64()), 61 C('arg_set_id', CppUint32()), 62 ], 63 tabledoc=TableDoc( 64 doc='InputMethod service', 65 group='Winscope', 66 columns={ 67 'ts': 'The timestamp the dump was triggered', 68 'arg_set_id': 'Extra args parsed from the proto message', 69 })) 70 71SURFACE_FLINGER_LAYERS_SNAPSHOT_TABLE = Table( 72 python_module=__file__, 73 class_name='SurfaceFlingerLayersSnapshotTable', 74 sql_name='surfaceflinger_layers_snapshot', 75 columns=[ 76 C('ts', CppInt64()), 77 C('arg_set_id', CppUint32()), 78 ], 79 tabledoc=TableDoc( 80 doc='SurfaceFlinger layers snapshot', 81 group='Winscope', 82 columns={ 83 'ts': 'Timestamp of the snapshot', 84 'arg_set_id': 'Extra args parsed from the proto message', 85 })) 86 87SURFACE_FLINGER_LAYER_TABLE = Table( 88 python_module=__file__, 89 class_name='SurfaceFlingerLayerTable', 90 sql_name='surfaceflinger_layer', 91 columns=[ 92 C('snapshot_id', CppTableId(SURFACE_FLINGER_LAYERS_SNAPSHOT_TABLE)), 93 C('arg_set_id', CppUint32()), 94 ], 95 tabledoc=TableDoc( 96 doc='SurfaceFlinger layer', 97 group='Winscope', 98 columns={ 99 'snapshot_id': 'The snapshot that generated this layer', 100 'arg_set_id': 'Extra args parsed from the proto message', 101 })) 102 103SURFACE_FLINGER_TRANSACTIONS_TABLE = Table( 104 python_module=__file__, 105 class_name='SurfaceFlingerTransactionsTable', 106 sql_name='surfaceflinger_transactions', 107 columns=[ 108 C('ts', CppInt64()), 109 C('arg_set_id', CppUint32()), 110 ], 111 tabledoc=TableDoc( 112 doc='SurfaceFlinger transactions. Each row contains a set of ' + 113 'transactions that SurfaceFlinger committed together.', 114 group='Winscope', 115 columns={ 116 'ts': 'Timestamp of the transactions commit', 117 'arg_set_id': 'Extra args parsed from the proto message', 118 })) 119 120VIEWCAPTURE_TABLE = Table( 121 python_module=__file__, 122 class_name='ViewCaptureTable', 123 sql_name='__intrinsic_viewcapture', 124 columns=[ 125 C('ts', CppInt64()), 126 C('arg_set_id', CppUint32()), 127 ], 128 tabledoc=TableDoc( 129 doc='ViewCapture', 130 group='Winscope', 131 columns={ 132 'ts': 'The timestamp the views were captured', 133 'arg_set_id': 'Extra args parsed from the proto message', 134 })) 135 136WINDOW_MANAGER_SHELL_TRANSITIONS_TABLE = Table( 137 python_module=__file__, 138 class_name='WindowManagerShellTransitionsTable', 139 sql_name='window_manager_shell_transitions', 140 columns=[ 141 C('ts', CppInt64()), 142 C('transition_id', CppInt64()), 143 C('arg_set_id', CppUint32()), 144 ], 145 tabledoc=TableDoc( 146 doc='Window Manager Shell Transitions', 147 group='Winscope', 148 columns={ 149 'ts': 'The timestamp the transition started playing', 150 'transition_id': 'The id of the transition', 151 'arg_set_id': 'Extra args parsed from the proto message', 152 })) 153 154WINDOW_MANAGER_SHELL_TRANSITION_HANDLERS_TABLE = Table( 155 python_module=__file__, 156 class_name='WindowManagerShellTransitionHandlersTable', 157 sql_name='window_manager_shell_transition_handlers', 158 columns=[ 159 C('handler_id', CppInt64()), 160 C('handler_name', CppString()), 161 ], 162 tabledoc=TableDoc( 163 doc='Window Manager Shell Transition Handlers', 164 group='Winscope', 165 columns={ 166 'handler_id': 'The id of the handler', 167 'handler_name': 'The name of the handler', 168 })) 169 170PROTOLOG_TABLE = Table( 171 python_module=__file__, 172 class_name='ProtoLogTable', 173 sql_name='protolog', 174 columns=[ 175 C('ts', CppInt64()), 176 C('level', CppString()), 177 C('tag', CppString()), 178 C('message', CppString()), 179 C('stacktrace', CppString()), 180 ], 181 tabledoc=TableDoc( 182 doc='Protolog', 183 group='Winscope', 184 columns={ 185 'ts': 'The timestamp the log message was sent', 186 'level': 'The log level of the protolog message', 187 'tag': 'The log tag of the protolog message', 188 'message': 'The protolog message', 189 'stacktrace': 'Stacktrace captured at the message\'s logpoint', 190 })) 191 192# Keep this list sorted. 193ALL_TABLES = [ 194 PROTOLOG_TABLE, 195 INPUTMETHOD_CLIENTS_TABLE, 196 INPUTMETHOD_MANAGER_SERVICE_TABLE, 197 INPUTMETHOD_SERVICE_TABLE, 198 SURFACE_FLINGER_LAYERS_SNAPSHOT_TABLE, 199 SURFACE_FLINGER_LAYER_TABLE, 200 SURFACE_FLINGER_TRANSACTIONS_TABLE, 201 VIEWCAPTURE_TABLE, 202 WINDOW_MANAGER_SHELL_TRANSITIONS_TABLE, 203 WINDOW_MANAGER_SHELL_TRANSITION_HANDLERS_TABLE, 204] 205