• 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/profiling/heapprofd_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 #include "perfetto/tracing/core/heapprofd_config.h"
29 
30 #include "perfetto/config/profiling/heapprofd_config.pb.h"
31 
32 namespace perfetto {
33 
34 HeapprofdConfig::HeapprofdConfig() = default;
35 HeapprofdConfig::~HeapprofdConfig() = default;
36 HeapprofdConfig::HeapprofdConfig(const HeapprofdConfig&) = default;
37 HeapprofdConfig& HeapprofdConfig::operator=(const HeapprofdConfig&) = default;
38 HeapprofdConfig::HeapprofdConfig(HeapprofdConfig&&) noexcept = default;
39 HeapprofdConfig& HeapprofdConfig::operator=(HeapprofdConfig&&) = default;
40 
41 #pragma GCC diagnostic push
42 #pragma GCC diagnostic ignored "-Wfloat-equal"
operator ==(const HeapprofdConfig & other) const43 bool HeapprofdConfig::operator==(const HeapprofdConfig& other) const {
44   return (sampling_interval_bytes_ == other.sampling_interval_bytes_) &&
45          (process_cmdline_ == other.process_cmdline_) && (pid_ == other.pid_) &&
46          (all_ == other.all_) &&
47          (skip_symbol_prefix_ == other.skip_symbol_prefix_) &&
48          (continuous_dump_config_ == other.continuous_dump_config_) &&
49          (shmem_size_bytes_ == other.shmem_size_bytes_) &&
50          (block_client_ == other.block_client_);
51 }
52 #pragma GCC diagnostic pop
53 
FromProto(const perfetto::protos::HeapprofdConfig & proto)54 void HeapprofdConfig::FromProto(
55     const perfetto::protos::HeapprofdConfig& proto) {
56   static_assert(sizeof(sampling_interval_bytes_) ==
57                     sizeof(proto.sampling_interval_bytes()),
58                 "size mismatch");
59   sampling_interval_bytes_ = static_cast<decltype(sampling_interval_bytes_)>(
60       proto.sampling_interval_bytes());
61 
62   process_cmdline_.clear();
63   for (const auto& field : proto.process_cmdline()) {
64     process_cmdline_.emplace_back();
65     static_assert(
66         sizeof(process_cmdline_.back()) == sizeof(proto.process_cmdline(0)),
67         "size mismatch");
68     process_cmdline_.back() =
69         static_cast<decltype(process_cmdline_)::value_type>(field);
70   }
71 
72   pid_.clear();
73   for (const auto& field : proto.pid()) {
74     pid_.emplace_back();
75     static_assert(sizeof(pid_.back()) == sizeof(proto.pid(0)), "size mismatch");
76     pid_.back() = static_cast<decltype(pid_)::value_type>(field);
77   }
78 
79   static_assert(sizeof(all_) == sizeof(proto.all()), "size mismatch");
80   all_ = static_cast<decltype(all_)>(proto.all());
81 
82   skip_symbol_prefix_.clear();
83   for (const auto& field : proto.skip_symbol_prefix()) {
84     skip_symbol_prefix_.emplace_back();
85     static_assert(sizeof(skip_symbol_prefix_.back()) ==
86                       sizeof(proto.skip_symbol_prefix(0)),
87                   "size mismatch");
88     skip_symbol_prefix_.back() =
89         static_cast<decltype(skip_symbol_prefix_)::value_type>(field);
90   }
91 
92   continuous_dump_config_.FromProto(proto.continuous_dump_config());
93 
94   static_assert(sizeof(shmem_size_bytes_) == sizeof(proto.shmem_size_bytes()),
95                 "size mismatch");
96   shmem_size_bytes_ =
97       static_cast<decltype(shmem_size_bytes_)>(proto.shmem_size_bytes());
98 
99   static_assert(sizeof(block_client_) == sizeof(proto.block_client()),
100                 "size mismatch");
101   block_client_ = static_cast<decltype(block_client_)>(proto.block_client());
102   unknown_fields_ = proto.unknown_fields();
103 }
104 
ToProto(perfetto::protos::HeapprofdConfig * proto) const105 void HeapprofdConfig::ToProto(perfetto::protos::HeapprofdConfig* proto) const {
106   proto->Clear();
107 
108   static_assert(sizeof(sampling_interval_bytes_) ==
109                     sizeof(proto->sampling_interval_bytes()),
110                 "size mismatch");
111   proto->set_sampling_interval_bytes(
112       static_cast<decltype(proto->sampling_interval_bytes())>(
113           sampling_interval_bytes_));
114 
115   for (const auto& it : process_cmdline_) {
116     proto->add_process_cmdline(
117         static_cast<decltype(proto->process_cmdline(0))>(it));
118     static_assert(sizeof(it) == sizeof(proto->process_cmdline(0)),
119                   "size mismatch");
120   }
121 
122   for (const auto& it : pid_) {
123     proto->add_pid(static_cast<decltype(proto->pid(0))>(it));
124     static_assert(sizeof(it) == sizeof(proto->pid(0)), "size mismatch");
125   }
126 
127   static_assert(sizeof(all_) == sizeof(proto->all()), "size mismatch");
128   proto->set_all(static_cast<decltype(proto->all())>(all_));
129 
130   for (const auto& it : skip_symbol_prefix_) {
131     proto->add_skip_symbol_prefix(
132         static_cast<decltype(proto->skip_symbol_prefix(0))>(it));
133     static_assert(sizeof(it) == sizeof(proto->skip_symbol_prefix(0)),
134                   "size mismatch");
135   }
136 
137   continuous_dump_config_.ToProto(proto->mutable_continuous_dump_config());
138 
139   static_assert(sizeof(shmem_size_bytes_) == sizeof(proto->shmem_size_bytes()),
140                 "size mismatch");
141   proto->set_shmem_size_bytes(
142       static_cast<decltype(proto->shmem_size_bytes())>(shmem_size_bytes_));
143 
144   static_assert(sizeof(block_client_) == sizeof(proto->block_client()),
145                 "size mismatch");
146   proto->set_block_client(
147       static_cast<decltype(proto->block_client())>(block_client_));
148   *(proto->mutable_unknown_fields()) = unknown_fields_;
149 }
150 
151 HeapprofdConfig::ContinuousDumpConfig::ContinuousDumpConfig() = default;
152 HeapprofdConfig::ContinuousDumpConfig::~ContinuousDumpConfig() = default;
153 HeapprofdConfig::ContinuousDumpConfig::ContinuousDumpConfig(
154     const HeapprofdConfig::ContinuousDumpConfig&) = default;
155 HeapprofdConfig::ContinuousDumpConfig& HeapprofdConfig::ContinuousDumpConfig::
156 operator=(const HeapprofdConfig::ContinuousDumpConfig&) = default;
157 HeapprofdConfig::ContinuousDumpConfig::ContinuousDumpConfig(
158     HeapprofdConfig::ContinuousDumpConfig&&) noexcept = default;
159 HeapprofdConfig::ContinuousDumpConfig& HeapprofdConfig::ContinuousDumpConfig::
160 operator=(HeapprofdConfig::ContinuousDumpConfig&&) = default;
161 
162 #pragma GCC diagnostic push
163 #pragma GCC diagnostic ignored "-Wfloat-equal"
operator ==(const HeapprofdConfig::ContinuousDumpConfig & other) const164 bool HeapprofdConfig::ContinuousDumpConfig::operator==(
165     const HeapprofdConfig::ContinuousDumpConfig& other) const {
166   return (dump_phase_ms_ == other.dump_phase_ms_) &&
167          (dump_interval_ms_ == other.dump_interval_ms_);
168 }
169 #pragma GCC diagnostic pop
170 
FromProto(const perfetto::protos::HeapprofdConfig_ContinuousDumpConfig & proto)171 void HeapprofdConfig::ContinuousDumpConfig::FromProto(
172     const perfetto::protos::HeapprofdConfig_ContinuousDumpConfig& proto) {
173   static_assert(sizeof(dump_phase_ms_) == sizeof(proto.dump_phase_ms()),
174                 "size mismatch");
175   dump_phase_ms_ = static_cast<decltype(dump_phase_ms_)>(proto.dump_phase_ms());
176 
177   static_assert(sizeof(dump_interval_ms_) == sizeof(proto.dump_interval_ms()),
178                 "size mismatch");
179   dump_interval_ms_ =
180       static_cast<decltype(dump_interval_ms_)>(proto.dump_interval_ms());
181   unknown_fields_ = proto.unknown_fields();
182 }
183 
ToProto(perfetto::protos::HeapprofdConfig_ContinuousDumpConfig * proto) const184 void HeapprofdConfig::ContinuousDumpConfig::ToProto(
185     perfetto::protos::HeapprofdConfig_ContinuousDumpConfig* proto) const {
186   proto->Clear();
187 
188   static_assert(sizeof(dump_phase_ms_) == sizeof(proto->dump_phase_ms()),
189                 "size mismatch");
190   proto->set_dump_phase_ms(
191       static_cast<decltype(proto->dump_phase_ms())>(dump_phase_ms_));
192 
193   static_assert(sizeof(dump_interval_ms_) == sizeof(proto->dump_interval_ms()),
194                 "size mismatch");
195   proto->set_dump_interval_ms(
196       static_cast<decltype(proto->dump_interval_ms())>(dump_interval_ms_));
197   *(proto->mutable_unknown_fields()) = unknown_fields_;
198 }
199 
200 }  // namespace perfetto
201