• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2019 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef SRC_TRACE_PROCESSOR_TABLES_SLICE_TABLES_H_
18 #define SRC_TRACE_PROCESSOR_TABLES_SLICE_TABLES_H_
19 
20 #include "src/trace_processor/tables/macros.h"
21 #include "src/trace_processor/tables/track_tables.h"
22 
23 namespace perfetto {
24 namespace trace_processor {
25 namespace tables {
26 
27 // @name slice
28 // @tablegroup Events
29 // @param arg_set_id {@joinable args.arg_set_id}
30 #define PERFETTO_TP_SLICE_TABLE_DEF(NAME, PARENT, C) \
31   NAME(SliceTable, "internal_slice")                 \
32   PERFETTO_TP_ROOT_TABLE(PARENT, C)                  \
33   C(int64_t, ts, Column::Flag::kSorted)              \
34   C(int64_t, dur)                                    \
35   C(TrackTable::Id, track_id)                        \
36   C(StringPool::Id, category)                        \
37   C(StringPool::Id, name)                            \
38   C(uint32_t, depth)                                 \
39   C(int64_t, stack_id)                               \
40   C(int64_t, parent_stack_id)                        \
41   C(base::Optional<SliceTable::Id>, parent_id)       \
42   C(uint32_t, arg_set_id)
43 
44 PERFETTO_TP_TABLE(PERFETTO_TP_SLICE_TABLE_DEF);
45 
46 // @tablegroup Events
47 // @param arg_set_id {@joinable args.arg_set_id}
48 #define PERFETTO_TP_INSTANT_TABLE_DEF(NAME, PARENT, C) \
49   NAME(InstantTable, "instant")                        \
50   PERFETTO_TP_ROOT_TABLE(PARENT, C)                    \
51   C(int64_t, ts, Column::Flag::kSorted)                \
52   C(StringPool::Id, name)                              \
53   C(int64_t, ref)                                      \
54   C(StringPool::Id, ref_type)                          \
55   C(uint32_t, arg_set_id)
56 
57 PERFETTO_TP_TABLE(PERFETTO_TP_INSTANT_TABLE_DEF);
58 
59 // @tablegroup Events
60 // @param utid {@joinable thread.utid}
61 #define PERFETTO_TP_SCHED_SLICE_TABLE_DEF(NAME, PARENT, C) \
62   NAME(SchedSliceTable, "sched_slice")                     \
63   PERFETTO_TP_ROOT_TABLE(PARENT, C)                        \
64   C(int64_t, ts, Column::Flag::kSorted)                    \
65   C(int64_t, dur)                                          \
66   C(uint32_t, cpu)                                         \
67   C(uint32_t, utid)                                        \
68   C(StringPool::Id, end_state)                             \
69   C(int32_t, priority)
70 
71 PERFETTO_TP_TABLE(PERFETTO_TP_SCHED_SLICE_TABLE_DEF);
72 
73 // @tablegroup Events
74 #define PERFETTO_TP_GPU_SLICES_DEF(NAME, PARENT, C) \
75   NAME(GpuSliceTable, "gpu_slice")                  \
76   PARENT(PERFETTO_TP_SLICE_TABLE_DEF, C)            \
77   C(base::Optional<int64_t>, context_id)            \
78   C(base::Optional<int64_t>, render_target)         \
79   C(StringPool::Id, render_target_name)             \
80   C(base::Optional<int64_t>, render_pass)           \
81   C(StringPool::Id, render_pass_name)               \
82   C(base::Optional<int64_t>, command_buffer)        \
83   C(StringPool::Id, command_buffer_name)            \
84   C(base::Optional<uint32_t>, frame_id)             \
85   C(base::Optional<uint32_t>, submission_id)        \
86   C(base::Optional<uint32_t>, hw_queue_id)
87 
88 PERFETTO_TP_TABLE(PERFETTO_TP_GPU_SLICES_DEF);
89 
90 // @tablegroup Events
91 #define PERFETTO_TP_GRAPHICS_FRAME_SLICES_DEF(NAME, PARENT, C) \
92   NAME(GraphicsFrameSliceTable, "frame_slice")                 \
93   PARENT(PERFETTO_TP_SLICE_TABLE_DEF, C)                       \
94   C(uint32_t, frame_number)                                    \
95   C(StringPool::Id, layer_name)                                \
96   C(int64_t, queue_to_acquire_time)                            \
97   C(int64_t, acquire_to_latch_time)                            \
98   C(int64_t, latch_to_present_time)
99 
100 PERFETTO_TP_TABLE(PERFETTO_TP_GRAPHICS_FRAME_SLICES_DEF);
101 
102 #define PERFETTO_TP_DESCRIBE_SLICE_TABLE(NAME, PARENT, C) \
103   NAME(DescribeSliceTable, "describe_slice")              \
104   PERFETTO_TP_ROOT_TABLE(PARENT, C)                       \
105   C(uint32_t, slice_id, Column::Flag::kHidden)            \
106   C(StringPool::Id, description)                          \
107   C(StringPool::Id, doc_link)
108 
109 PERFETTO_TP_TABLE(PERFETTO_TP_DESCRIBE_SLICE_TABLE);
110 
111 }  // namespace tables
112 }  // namespace trace_processor
113 }  // namespace perfetto
114 
115 #endif  // SRC_TRACE_PROCESSOR_TABLES_SLICE_TABLES_H_
116