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 15 #ifndef INCLUDE_PERFETTO_TRACE_PROCESSOR_METATRACE_CONFIG_H_ 16 #define INCLUDE_PERFETTO_TRACE_PROCESSOR_METATRACE_CONFIG_H_ 17 18 #include <cstddef> 19 #include <cstdint> 20 21 namespace perfetto { 22 namespace trace_processor { 23 namespace metatrace { 24 25 enum MetatraceCategories : uint32_t { 26 // Category for low-frequency events which provide a high-level timeline of 27 // SQL query execution. 28 QUERY_TIMELINE = 1 << 0, 29 30 // Category for high-frequency events which provide details about SQL query 31 // execution. 32 QUERY_DETAILED = 1 << 1, 33 34 // Category for high-frequency events which provide details about SQL function 35 // calls. 36 FUNCTION_CALL = 1 << 2, 37 38 // Category for high-frequency events which provide details about the columnar 39 // database operations. 40 DB = 1 << 3, 41 42 // Category for low-frequency events which provide a high-level timeline of 43 // SQL query execution. 44 API_TIMELINE = 1 << 4, 45 46 // Alias for turning off all other categories. 47 NONE = 0, 48 49 // Alias for turning on all other categories. 50 ALL = QUERY_TIMELINE | QUERY_DETAILED | FUNCTION_CALL | DB | API_TIMELINE, 51 }; 52 53 struct MetatraceConfig { 54 MetatraceConfig(); 55 56 MetatraceCategories categories = static_cast<MetatraceCategories>( 57 MetatraceCategories::QUERY_TIMELINE | MetatraceCategories::API_TIMELINE); 58 59 // Requested buffer size. The implemenation may choose to allocate a larger 60 // buffer size for efficiency. 61 size_t override_buffer_size = 0; 62 }; 63 64 } // namespace metatrace 65 } // namespace trace_processor 66 } // namespace perfetto 67 68 #endif // INCLUDE_PERFETTO_TRACE_PROCESSOR_METATRACE_CONFIG_H_ 69