• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2024 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 CppOptional
17from python.generators.trace_processor_table.public import CppUint32
18from python.generators.trace_processor_table.public import Table
19
20# This class should contain all table schemas for functions (scalar or
21# aggregate) which return tables.
22
23DFS_TABLE = Table(
24    python_module=__file__,
25    class_name="DfsTable",
26    sql_name="__intrinsic_dfs",
27    columns=[
28        C("node_id", CppUint32()),
29        C("parent_node_id", CppOptional(CppUint32())),
30    ])
31
32DOMINATOR_TREE_TABLE = Table(
33    python_module=__file__,
34    class_name="DominatorTreeTable",
35    sql_name="__intrinsic_dominator_tree",
36    columns=[
37        C("node_id", CppUint32()),
38        C("dominator_node_id", CppOptional(CppUint32())),
39    ])
40
41STRUCTURAL_TREE_PARTITION_TABLE = Table(
42    python_module=__file__,
43    class_name="StructuralTreePartitionTable",
44    sql_name="__intrinsic_structural_tree_partition",
45    columns=[
46        C("node_id", CppUint32()),
47        C("parent_node_id", CppOptional(CppUint32())),
48        C("group_key", CppUint32()),
49    ])
50
51# Keep this list sorted.
52ALL_TABLES = [
53    DFS_TABLE,
54    DOMINATOR_TREE_TABLE,
55    STRUCTURAL_TREE_PARTITION_TABLE,
56]
57