• 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
23# Helper table to return any sort of "tree-like" table from functions.
24TREE_TABLE = Table(
25    python_module=__file__,
26    class_name="TreeTable",
27    sql_name="__unused",
28    columns=[
29        C("node_id", CppUint32()),
30        C("parent_node_id", CppOptional(CppUint32())),
31    ])
32
33DOMINATOR_TREE_TABLE = Table(
34    python_module=__file__,
35    class_name="DominatorTreeTable",
36    sql_name="__intrinsic_dominator_tree",
37    columns=[
38        C("node_id", CppUint32()),
39        C("dominator_node_id", CppOptional(CppUint32())),
40    ])
41
42STRUCTURAL_TREE_PARTITION_TABLE = Table(
43    python_module=__file__,
44    class_name="StructuralTreePartitionTable",
45    sql_name="__intrinsic_structural_tree_partition",
46    columns=[
47        C("node_id", CppUint32()),
48        C("parent_node_id", CppOptional(CppUint32())),
49        C("group_key", CppUint32()),
50    ])
51
52# Keep this list sorted.
53ALL_TABLES = [
54    DOMINATOR_TREE_TABLE,
55    STRUCTURAL_TREE_PARTITION_TABLE,
56    TREE_TABLE,
57]
58