• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2022 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 tracks."""
15
16from python.generators.trace_processor_table.public import Column as C
17from python.generators.trace_processor_table.public import ColumnDoc
18from python.generators.trace_processor_table.public import CppInt64
19from python.generators.trace_processor_table.public import CppOptional
20from python.generators.trace_processor_table.public import CppSelfTableId
21from python.generators.trace_processor_table.public import CppString
22from python.generators.trace_processor_table.public import CppTableId
23from python.generators.trace_processor_table.public import CppUint32
24from python.generators.trace_processor_table.public import Table
25from python.generators.trace_processor_table.public import TableDoc
26
27from src.trace_processor.tables.metadata_tables import MACHINE_TABLE
28from src.trace_processor.tables.metadata_tables import THREAD_TABLE
29from src.trace_processor.tables.metadata_tables import PROCESS_TABLE
30
31TRACK_TABLE = Table(
32    python_module=__file__,
33    class_name="TrackTable",
34    sql_name="__intrinsic_track",
35    columns=[
36        C("name", CppString()),
37        C("parent_id", CppOptional(CppSelfTableId())),
38        C("source_arg_set_id", CppOptional(CppUint32())),
39        C('machine_id', CppOptional(CppTableId(MACHINE_TABLE))),
40        C("type", CppString()),
41        C("dimension_arg_set_id", CppOptional(CppUint32())),
42        C("event_type", CppString()),
43        C("counter_unit", CppOptional(CppString())),
44        C("utid", CppOptional(CppTableId(THREAD_TABLE))),
45        C("upid", CppOptional(CppTableId(PROCESS_TABLE))),
46    ])
47
48# Keep this list sorted.
49ALL_TABLES = [
50    TRACK_TABLE,
51]
52