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
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   bool operator==(const FtraceConfig&) const;
56   bool operator!=(const FtraceConfig& other) const { return !(*this == other); }
57 
58   // Conversion methods from/to the corresponding protobuf types.
59   void FromProto(const perfetto::protos::FtraceConfig&);
60   void ToProto(perfetto::protos::FtraceConfig*) const;
61 
ftrace_events_size()62   int ftrace_events_size() const {
63     return static_cast<int>(ftrace_events_.size());
64   }
ftrace_events()65   const std::vector<std::string>& ftrace_events() const {
66     return ftrace_events_;
67   }
mutable_ftrace_events()68   std::vector<std::string>* mutable_ftrace_events() { return &ftrace_events_; }
clear_ftrace_events()69   void clear_ftrace_events() { ftrace_events_.clear(); }
add_ftrace_events()70   std::string* add_ftrace_events() {
71     ftrace_events_.emplace_back();
72     return &ftrace_events_.back();
73   }
74 
atrace_categories_size()75   int atrace_categories_size() const {
76     return static_cast<int>(atrace_categories_.size());
77   }
atrace_categories()78   const std::vector<std::string>& atrace_categories() const {
79     return atrace_categories_;
80   }
mutable_atrace_categories()81   std::vector<std::string>* mutable_atrace_categories() {
82     return &atrace_categories_;
83   }
clear_atrace_categories()84   void clear_atrace_categories() { atrace_categories_.clear(); }
add_atrace_categories()85   std::string* add_atrace_categories() {
86     atrace_categories_.emplace_back();
87     return &atrace_categories_.back();
88   }
89 
atrace_apps_size()90   int atrace_apps_size() const { return static_cast<int>(atrace_apps_.size()); }
atrace_apps()91   const std::vector<std::string>& atrace_apps() const { return atrace_apps_; }
mutable_atrace_apps()92   std::vector<std::string>* mutable_atrace_apps() { return &atrace_apps_; }
clear_atrace_apps()93   void clear_atrace_apps() { atrace_apps_.clear(); }
add_atrace_apps()94   std::string* add_atrace_apps() {
95     atrace_apps_.emplace_back();
96     return &atrace_apps_.back();
97   }
98 
buffer_size_kb()99   uint32_t buffer_size_kb() const { return buffer_size_kb_; }
set_buffer_size_kb(uint32_t value)100   void set_buffer_size_kb(uint32_t value) { buffer_size_kb_ = value; }
101 
drain_period_ms()102   uint32_t drain_period_ms() const { return drain_period_ms_; }
set_drain_period_ms(uint32_t value)103   void set_drain_period_ms(uint32_t value) { drain_period_ms_ = value; }
104 
105  private:
106   std::vector<std::string> ftrace_events_;
107   std::vector<std::string> atrace_categories_;
108   std::vector<std::string> atrace_apps_;
109   uint32_t buffer_size_kb_ = {};
110   uint32_t drain_period_ms_ = {};
111 
112   // Allows to preserve unknown protobuf fields for compatibility
113   // with future versions of .proto files.
114   std::string unknown_fields_;
115 };
116 
117 }  // namespace perfetto
118 
119 #endif  // INCLUDE_PERFETTO_TRACING_CORE_FTRACE_CONFIG_H_
120