xref: /aosp_15_r20/external/perfetto/src/trace_processor/tables/trace_proto_tables.py (revision 6dbdd20afdafa5e3ca9b8809fa73465d530080dc)
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"""Contains tables for relevant for TODO."""
15
16from python.generators.trace_processor_table.public import Column as C
17from python.generators.trace_processor_table.public import CppInt64
18from python.generators.trace_processor_table.public import CppOptional
19from python.generators.trace_processor_table.public import CppSelfTableId
20from python.generators.trace_processor_table.public import CppString
21from python.generators.trace_processor_table.public import Table
22from python.generators.trace_processor_table.public import TableDoc
23from python.generators.trace_processor_table.public import CppTableId
24from python.generators.trace_processor_table.public import CppUint32
25
26EXPERIMENTAL_PROTO_PATH_TABLE = Table(
27    python_module=__file__,
28    class_name='ExperimentalProtoPathTable',
29    sql_name='experimental_proto_path',
30    columns=[
31        C('parent_id', CppOptional(CppSelfTableId())),
32        C('field_type', CppString()),
33        C('field_name', CppOptional(CppString())),
34        C('arg_set_id', CppOptional(CppUint32())),
35    ],
36    tabledoc=TableDoc(
37        doc='''
38          Experimental table, subject to arbitrary breaking changes.
39        ''',
40        group='Proto',
41        columns={
42            'parent_id': '''''',
43            'field_type': '''''',
44            'field_name': '''''',
45            'arg_set_id': ''''''
46        }))
47
48EXPERIMENTAL_PROTO_CONTENT_TABLE = Table(
49    python_module=__file__,
50    class_name='ExperimentalProtoContentTable',
51    sql_name='experimental_proto_content',
52    columns=[
53        C('path', CppString()),
54        C('path_id', CppTableId(EXPERIMENTAL_PROTO_PATH_TABLE)),
55        C('total_size', CppInt64()),
56        C('size', CppInt64()),
57        C('count', CppInt64()),
58    ],
59    tabledoc=TableDoc(
60        doc='''''',
61        group='Proto',
62        columns={
63            'path': '''''',
64            'path_id': '''''',
65            'total_size': '''''',
66            'size': '''''',
67            'count': ''''''
68        }))
69
70# Keep this list sorted.
71ALL_TABLES = [
72    EXPERIMENTAL_PROTO_CONTENT_TABLE,
73    EXPERIMENTAL_PROTO_PATH_TABLE,
74]
75