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/ftrace/ftrace_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_FTRACE_CONFIG_H_ 29 #define INCLUDE_PERFETTO_TRACING_CORE_FTRACE_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 // Forward declarations for protobuf types. 39 namespace perfetto { 40 namespace protos { 41 class FtraceConfig; 42 } 43 } // namespace perfetto 44 45 namespace perfetto { 46 47 class PERFETTO_EXPORT FtraceConfig { 48 public: 49 FtraceConfig(); 50 ~FtraceConfig(); 51 FtraceConfig(FtraceConfig&&) noexcept; 52 FtraceConfig& operator=(FtraceConfig&&); 53 FtraceConfig(const FtraceConfig&); 54 FtraceConfig& operator=(const FtraceConfig&); 55 56 // Conversion methods from/to the corresponding protobuf types. 57 void FromProto(const perfetto::protos::FtraceConfig&); 58 void ToProto(perfetto::protos::FtraceConfig*) const; 59 60 int ftrace_events_size() const { 61 return static_cast<int>(ftrace_events_.size()); 62 } 63 const std::vector<std::string>& ftrace_events() const { 64 return ftrace_events_; 65 } 66 std::string* add_ftrace_events() { 67 ftrace_events_.emplace_back(); 68 return &ftrace_events_.back(); 69 } 70 71 int atrace_categories_size() const { 72 return static_cast<int>(atrace_categories_.size()); 73 } 74 const std::vector<std::string>& atrace_categories() const { 75 return atrace_categories_; 76 } 77 std::string* add_atrace_categories() { 78 atrace_categories_.emplace_back(); 79 return &atrace_categories_.back(); 80 } 81 82 int atrace_apps_size() const { return static_cast<int>(atrace_apps_.size()); } 83 const std::vector<std::string>& atrace_apps() const { return atrace_apps_; } 84 std::string* add_atrace_apps() { 85 atrace_apps_.emplace_back(); 86 return &atrace_apps_.back(); 87 } 88 89 uint32_t buffer_size_kb() const { return buffer_size_kb_; } 90 void set_buffer_size_kb(uint32_t value) { buffer_size_kb_ = value; } 91 92 uint32_t drain_period_ms() const { return drain_period_ms_; } 93 void set_drain_period_ms(uint32_t value) { drain_period_ms_ = value; } 94 95 private: 96 std::vector<std::string> ftrace_events_; 97 std::vector<std::string> atrace_categories_; 98 std::vector<std::string> atrace_apps_; 99 uint32_t buffer_size_kb_ = {}; 100 uint32_t drain_period_ms_ = {}; 101 102 // Allows to preserve unknown protobuf fields for compatibility 103 // with future versions of .proto files. 104 std::string unknown_fields_; 105 }; 106 107 } // namespace perfetto 108 #endif // INCLUDE_PERFETTO_TRACING_CORE_FTRACE_CONFIG_H_ 109