1 /* 2 * Copyright (C) 2017 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 /******************************************************************************* 18 * AUTOGENERATED - DO NOT EDIT 19 ******************************************************************************* 20 * This file has been generated from the protobuf message 21 * perfetto/config/data_source_config.proto 22 * by 23 * ../../tools/proto_to_cpp/proto_to_cpp.cc. 24 * If you need to make changes here, change the .proto file and then run 25 * ./tools/gen_tracing_cpp_headers_from_protos.py 26 */ 27 28 #ifndef INCLUDE_PERFETTO_TRACING_CORE_DATA_SOURCE_CONFIG_H_ 29 #define INCLUDE_PERFETTO_TRACING_CORE_DATA_SOURCE_CONFIG_H_ 30 31 #include <stdint.h> 32 #include <string> 33 #include <type_traits> 34 #include <vector> 35 36 #include "perfetto/base/export.h" 37 38 #include "perfetto/tracing/core/chrome_config.h" 39 #include "perfetto/tracing/core/ftrace_config.h" 40 #include "perfetto/tracing/core/inode_file_config.h" 41 #include "perfetto/tracing/core/process_stats_config.h" 42 #include "perfetto/tracing/core/test_config.h" 43 44 // Forward declarations for protobuf types. 45 namespace perfetto { 46 namespace protos { 47 class DataSourceConfig; 48 class FtraceConfig; 49 class ChromeConfig; 50 class InodeFileConfig; 51 class InodeFileConfig_MountPointMappingEntry; 52 class ProcessStatsConfig; 53 class TestConfig; 54 } // namespace protos 55 } // namespace perfetto 56 57 namespace perfetto { 58 59 class PERFETTO_EXPORT DataSourceConfig { 60 public: 61 DataSourceConfig(); 62 ~DataSourceConfig(); 63 DataSourceConfig(DataSourceConfig&&) noexcept; 64 DataSourceConfig& operator=(DataSourceConfig&&); 65 DataSourceConfig(const DataSourceConfig&); 66 DataSourceConfig& operator=(const DataSourceConfig&); 67 68 // Conversion methods from/to the corresponding protobuf types. 69 void FromProto(const perfetto::protos::DataSourceConfig&); 70 void ToProto(perfetto::protos::DataSourceConfig*) const; 71 name()72 const std::string& name() const { return name_; } set_name(const std::string & value)73 void set_name(const std::string& value) { name_ = value; } 74 target_buffer()75 uint32_t target_buffer() const { return target_buffer_; } set_target_buffer(uint32_t value)76 void set_target_buffer(uint32_t value) { target_buffer_ = value; } 77 trace_duration_ms()78 uint32_t trace_duration_ms() const { return trace_duration_ms_; } set_trace_duration_ms(uint32_t value)79 void set_trace_duration_ms(uint32_t value) { trace_duration_ms_ = value; } 80 ftrace_config()81 const FtraceConfig& ftrace_config() const { return ftrace_config_; } mutable_ftrace_config()82 FtraceConfig* mutable_ftrace_config() { return &ftrace_config_; } 83 chrome_config()84 const ChromeConfig& chrome_config() const { return chrome_config_; } mutable_chrome_config()85 ChromeConfig* mutable_chrome_config() { return &chrome_config_; } 86 inode_file_config()87 const InodeFileConfig& inode_file_config() const { 88 return inode_file_config_; 89 } mutable_inode_file_config()90 InodeFileConfig* mutable_inode_file_config() { return &inode_file_config_; } 91 process_stats_config()92 const ProcessStatsConfig& process_stats_config() const { 93 return process_stats_config_; 94 } mutable_process_stats_config()95 ProcessStatsConfig* mutable_process_stats_config() { 96 return &process_stats_config_; 97 } 98 legacy_config()99 const std::string& legacy_config() const { return legacy_config_; } set_legacy_config(const std::string & value)100 void set_legacy_config(const std::string& value) { legacy_config_ = value; } 101 for_testing()102 const TestConfig& for_testing() const { return for_testing_; } mutable_for_testing()103 TestConfig* mutable_for_testing() { return &for_testing_; } 104 105 private: 106 std::string name_ = {}; 107 uint32_t target_buffer_ = {}; 108 uint32_t trace_duration_ms_ = {}; 109 FtraceConfig ftrace_config_ = {}; 110 ChromeConfig chrome_config_ = {}; 111 InodeFileConfig inode_file_config_ = {}; 112 ProcessStatsConfig process_stats_config_ = {}; 113 std::string legacy_config_ = {}; 114 TestConfig for_testing_ = {}; 115 116 // Allows to preserve unknown protobuf fields for compatibility 117 // with future versions of .proto files. 118 std::string unknown_fields_; 119 }; 120 121 } // namespace perfetto 122 #endif // INCLUDE_PERFETTO_TRACING_CORE_DATA_SOURCE_CONFIG_H_ 123