• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
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/android_log_config.h"
39 #include "perfetto/tracing/core/android_power_config.h"
40 #include "perfetto/tracing/core/chrome_config.h"
41 #include "perfetto/tracing/core/ftrace_config.h"
42 #include "perfetto/tracing/core/heapprofd_config.h"
43 #include "perfetto/tracing/core/inode_file_config.h"
44 #include "perfetto/tracing/core/packages_list_config.h"
45 #include "perfetto/tracing/core/process_stats_config.h"
46 #include "perfetto/tracing/core/sys_stats_config.h"
47 #include "perfetto/tracing/core/test_config.h"
48 
49 // Forward declarations for protobuf types.
50 namespace perfetto {
51 namespace protos {
52 class DataSourceConfig;
53 class FtraceConfig;
54 class ChromeConfig;
55 class InodeFileConfig;
56 class InodeFileConfig_MountPointMappingEntry;
57 class ProcessStatsConfig;
58 class SysStatsConfig;
59 class HeapprofdConfig;
60 class HeapprofdConfig_ContinuousDumpConfig;
61 class AndroidPowerConfig;
62 class AndroidLogConfig;
63 class PackagesListConfig;
64 class TestConfig;
65 class TestConfig_DummyFields;
66 }  // namespace protos
67 }  // namespace perfetto
68 
69 namespace perfetto {
70 
71 class PERFETTO_EXPORT DataSourceConfig {
72  public:
73   DataSourceConfig();
74   ~DataSourceConfig();
75   DataSourceConfig(DataSourceConfig&&) noexcept;
76   DataSourceConfig& operator=(DataSourceConfig&&);
77   DataSourceConfig(const DataSourceConfig&);
78   DataSourceConfig& operator=(const DataSourceConfig&);
79   bool operator==(const DataSourceConfig&) const;
80   bool operator!=(const DataSourceConfig& other) const {
81     return !(*this == other);
82   }
83 
84   // Conversion methods from/to the corresponding protobuf types.
85   void FromProto(const perfetto::protos::DataSourceConfig&);
86   void ToProto(perfetto::protos::DataSourceConfig*) const;
87 
name()88   const std::string& name() const { return name_; }
set_name(const std::string & value)89   void set_name(const std::string& value) { name_ = value; }
90 
target_buffer()91   uint32_t target_buffer() const { return target_buffer_; }
set_target_buffer(uint32_t value)92   void set_target_buffer(uint32_t value) { target_buffer_ = value; }
93 
trace_duration_ms()94   uint32_t trace_duration_ms() const { return trace_duration_ms_; }
set_trace_duration_ms(uint32_t value)95   void set_trace_duration_ms(uint32_t value) { trace_duration_ms_ = value; }
96 
enable_extra_guardrails()97   bool enable_extra_guardrails() const { return enable_extra_guardrails_; }
set_enable_extra_guardrails(bool value)98   void set_enable_extra_guardrails(bool value) {
99     enable_extra_guardrails_ = value;
100   }
101 
tracing_session_id()102   uint64_t tracing_session_id() const { return tracing_session_id_; }
set_tracing_session_id(uint64_t value)103   void set_tracing_session_id(uint64_t value) { tracing_session_id_ = value; }
104 
ftrace_config()105   const FtraceConfig& ftrace_config() const { return ftrace_config_; }
mutable_ftrace_config()106   FtraceConfig* mutable_ftrace_config() { return &ftrace_config_; }
107 
chrome_config()108   const ChromeConfig& chrome_config() const { return chrome_config_; }
mutable_chrome_config()109   ChromeConfig* mutable_chrome_config() { return &chrome_config_; }
110 
inode_file_config()111   const InodeFileConfig& inode_file_config() const {
112     return inode_file_config_;
113   }
mutable_inode_file_config()114   InodeFileConfig* mutable_inode_file_config() { return &inode_file_config_; }
115 
process_stats_config()116   const ProcessStatsConfig& process_stats_config() const {
117     return process_stats_config_;
118   }
mutable_process_stats_config()119   ProcessStatsConfig* mutable_process_stats_config() {
120     return &process_stats_config_;
121   }
122 
sys_stats_config()123   const SysStatsConfig& sys_stats_config() const { return sys_stats_config_; }
mutable_sys_stats_config()124   SysStatsConfig* mutable_sys_stats_config() { return &sys_stats_config_; }
125 
heapprofd_config()126   const HeapprofdConfig& heapprofd_config() const { return heapprofd_config_; }
mutable_heapprofd_config()127   HeapprofdConfig* mutable_heapprofd_config() { return &heapprofd_config_; }
128 
android_power_config()129   const AndroidPowerConfig& android_power_config() const {
130     return android_power_config_;
131   }
mutable_android_power_config()132   AndroidPowerConfig* mutable_android_power_config() {
133     return &android_power_config_;
134   }
135 
android_log_config()136   const AndroidLogConfig& android_log_config() const {
137     return android_log_config_;
138   }
mutable_android_log_config()139   AndroidLogConfig* mutable_android_log_config() {
140     return &android_log_config_;
141   }
142 
packages_list_config()143   const PackagesListConfig& packages_list_config() const {
144     return packages_list_config_;
145   }
mutable_packages_list_config()146   PackagesListConfig* mutable_packages_list_config() {
147     return &packages_list_config_;
148   }
149 
legacy_config()150   const std::string& legacy_config() const { return legacy_config_; }
set_legacy_config(const std::string & value)151   void set_legacy_config(const std::string& value) { legacy_config_ = value; }
152 
for_testing()153   const TestConfig& for_testing() const { return for_testing_; }
mutable_for_testing()154   TestConfig* mutable_for_testing() { return &for_testing_; }
155 
156  private:
157   std::string name_ = {};
158   uint32_t target_buffer_ = {};
159   uint32_t trace_duration_ms_ = {};
160   bool enable_extra_guardrails_ = {};
161   uint64_t tracing_session_id_ = {};
162   FtraceConfig ftrace_config_ = {};
163   ChromeConfig chrome_config_ = {};
164   InodeFileConfig inode_file_config_ = {};
165   ProcessStatsConfig process_stats_config_ = {};
166   SysStatsConfig sys_stats_config_ = {};
167   HeapprofdConfig heapprofd_config_ = {};
168   AndroidPowerConfig android_power_config_ = {};
169   AndroidLogConfig android_log_config_ = {};
170   PackagesListConfig packages_list_config_ = {};
171   std::string legacy_config_ = {};
172   TestConfig for_testing_ = {};
173 
174   // Allows to preserve unknown protobuf fields for compatibility
175   // with future versions of .proto files.
176   std::string unknown_fields_;
177 };
178 
179 }  // namespace perfetto
180 
181 #endif  // INCLUDE_PERFETTO_TRACING_CORE_DATA_SOURCE_CONFIG_H_
182