1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: protos/perfetto/trace/ftrace/cros_ec.proto
3
4 #include "protos/perfetto/trace/ftrace/cros_ec.pb.h"
5
6 #include <algorithm>
7 #include <cstdint>
8
9 #include <google/protobuf/io/coded_stream.h>
10 #include <google/protobuf/extension_set.h>
11 #include <google/protobuf/wire_format_lite.h>
12 #include <google/protobuf/io/zero_copy_stream_impl_lite.h>
13 // @@protoc_insertion_point(includes)
14 #include <google/protobuf/port_def.inc>
15
16 PROTOBUF_PRAGMA_INIT_SEG
17
18 namespace _pb = ::PROTOBUF_NAMESPACE_ID;
19 namespace _pbi = _pb::internal;
20
21 namespace perfetto {
22 namespace protos {
CrosEcSensorhubDataFtraceEvent(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR CrosEcSensorhubDataFtraceEvent::CrosEcSensorhubDataFtraceEvent(
24 ::_pbi::ConstantInitialized): _impl_{
25 /*decltype(_impl_._has_bits_)*/{}
26 , /*decltype(_impl_._cached_size_)*/{}
27 , /*decltype(_impl_.current_time_)*/::int64_t{0}
28 , /*decltype(_impl_.current_timestamp_)*/::int64_t{0}
29 , /*decltype(_impl_.delta_)*/::int64_t{0}
30 , /*decltype(_impl_.ec_fifo_timestamp_)*/0u
31 , /*decltype(_impl_.ec_sensor_num_)*/0u
32 , /*decltype(_impl_.fifo_timestamp_)*/::int64_t{0}} {}
33 struct CrosEcSensorhubDataFtraceEventDefaultTypeInternal {
CrosEcSensorhubDataFtraceEventDefaultTypeInternalperfetto::protos::CrosEcSensorhubDataFtraceEventDefaultTypeInternal34 PROTOBUF_CONSTEXPR CrosEcSensorhubDataFtraceEventDefaultTypeInternal()
35 : _instance(::_pbi::ConstantInitialized{}) {}
~CrosEcSensorhubDataFtraceEventDefaultTypeInternalperfetto::protos::CrosEcSensorhubDataFtraceEventDefaultTypeInternal36 ~CrosEcSensorhubDataFtraceEventDefaultTypeInternal() {}
37 union { // NOLINT(misc-non-private-member-variables-in-classes)
38 CrosEcSensorhubDataFtraceEvent _instance;
39 };
40 };
41 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 CrosEcSensorhubDataFtraceEventDefaultTypeInternal _CrosEcSensorhubDataFtraceEvent_default_instance_;
42 } // namespace protos
43 } // namespace perfetto
44 namespace perfetto {
45 namespace protos {
46
47 // ===================================================================
48
49 class CrosEcSensorhubDataFtraceEvent::_Internal {
50 public:
51 using HasBits = decltype(std::declval<CrosEcSensorhubDataFtraceEvent>()._impl_._has_bits_);
set_has_current_time(HasBits * has_bits)52 static void set_has_current_time(HasBits* has_bits) {
53 (*has_bits)[0] |= 1u;
54 }
set_has_current_timestamp(HasBits * has_bits)55 static void set_has_current_timestamp(HasBits* has_bits) {
56 (*has_bits)[0] |= 2u;
57 }
set_has_delta(HasBits * has_bits)58 static void set_has_delta(HasBits* has_bits) {
59 (*has_bits)[0] |= 4u;
60 }
set_has_ec_fifo_timestamp(HasBits * has_bits)61 static void set_has_ec_fifo_timestamp(HasBits* has_bits) {
62 (*has_bits)[0] |= 8u;
63 }
set_has_ec_sensor_num(HasBits * has_bits)64 static void set_has_ec_sensor_num(HasBits* has_bits) {
65 (*has_bits)[0] |= 16u;
66 }
set_has_fifo_timestamp(HasBits * has_bits)67 static void set_has_fifo_timestamp(HasBits* has_bits) {
68 (*has_bits)[0] |= 32u;
69 }
70 };
71
CrosEcSensorhubDataFtraceEvent(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)72 CrosEcSensorhubDataFtraceEvent::CrosEcSensorhubDataFtraceEvent(::PROTOBUF_NAMESPACE_ID::Arena* arena,
73 bool is_message_owned)
74 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
75 SharedCtor(arena, is_message_owned);
76 // @@protoc_insertion_point(arena_constructor:perfetto.protos.CrosEcSensorhubDataFtraceEvent)
77 }
CrosEcSensorhubDataFtraceEvent(const CrosEcSensorhubDataFtraceEvent & from)78 CrosEcSensorhubDataFtraceEvent::CrosEcSensorhubDataFtraceEvent(const CrosEcSensorhubDataFtraceEvent& from)
79 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
80 CrosEcSensorhubDataFtraceEvent* const _this = this; (void)_this;
81 new (&_impl_) Impl_{
82 decltype(_impl_._has_bits_){from._impl_._has_bits_}
83 , /*decltype(_impl_._cached_size_)*/{}
84 , decltype(_impl_.current_time_){}
85 , decltype(_impl_.current_timestamp_){}
86 , decltype(_impl_.delta_){}
87 , decltype(_impl_.ec_fifo_timestamp_){}
88 , decltype(_impl_.ec_sensor_num_){}
89 , decltype(_impl_.fifo_timestamp_){}};
90
91 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
92 ::memcpy(&_impl_.current_time_, &from._impl_.current_time_,
93 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.fifo_timestamp_) -
94 reinterpret_cast<char*>(&_impl_.current_time_)) + sizeof(_impl_.fifo_timestamp_));
95 // @@protoc_insertion_point(copy_constructor:perfetto.protos.CrosEcSensorhubDataFtraceEvent)
96 }
97
SharedCtor(::_pb::Arena * arena,bool is_message_owned)98 inline void CrosEcSensorhubDataFtraceEvent::SharedCtor(
99 ::_pb::Arena* arena, bool is_message_owned) {
100 (void)arena;
101 (void)is_message_owned;
102 new (&_impl_) Impl_{
103 decltype(_impl_._has_bits_){}
104 , /*decltype(_impl_._cached_size_)*/{}
105 , decltype(_impl_.current_time_){::int64_t{0}}
106 , decltype(_impl_.current_timestamp_){::int64_t{0}}
107 , decltype(_impl_.delta_){::int64_t{0}}
108 , decltype(_impl_.ec_fifo_timestamp_){0u}
109 , decltype(_impl_.ec_sensor_num_){0u}
110 , decltype(_impl_.fifo_timestamp_){::int64_t{0}}
111 };
112 }
113
~CrosEcSensorhubDataFtraceEvent()114 CrosEcSensorhubDataFtraceEvent::~CrosEcSensorhubDataFtraceEvent() {
115 // @@protoc_insertion_point(destructor:perfetto.protos.CrosEcSensorhubDataFtraceEvent)
116 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
117 (void)arena;
118 return;
119 }
120 SharedDtor();
121 }
122
SharedDtor()123 inline void CrosEcSensorhubDataFtraceEvent::SharedDtor() {
124 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
125 }
126
SetCachedSize(int size) const127 void CrosEcSensorhubDataFtraceEvent::SetCachedSize(int size) const {
128 _impl_._cached_size_.Set(size);
129 }
130
Clear()131 void CrosEcSensorhubDataFtraceEvent::Clear() {
132 // @@protoc_insertion_point(message_clear_start:perfetto.protos.CrosEcSensorhubDataFtraceEvent)
133 ::uint32_t cached_has_bits = 0;
134 // Prevent compiler warnings about cached_has_bits being unused
135 (void) cached_has_bits;
136
137 cached_has_bits = _impl_._has_bits_[0];
138 if (cached_has_bits & 0x0000003fu) {
139 ::memset(&_impl_.current_time_, 0, static_cast<size_t>(
140 reinterpret_cast<char*>(&_impl_.fifo_timestamp_) -
141 reinterpret_cast<char*>(&_impl_.current_time_)) + sizeof(_impl_.fifo_timestamp_));
142 }
143 _impl_._has_bits_.Clear();
144 _internal_metadata_.Clear<std::string>();
145 }
146
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)147 const char* CrosEcSensorhubDataFtraceEvent::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
148 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
149 _Internal::HasBits has_bits{};
150 while (!ctx->Done(&ptr)) {
151 ::uint32_t tag;
152 ptr = ::_pbi::ReadTag(ptr, &tag);
153 switch (tag >> 3) {
154 // optional int64 current_time = 1;
155 case 1:
156 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
157 _Internal::set_has_current_time(&has_bits);
158 _impl_.current_time_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
159 CHK_(ptr);
160 } else {
161 goto handle_unusual;
162 }
163 continue;
164 // optional int64 current_timestamp = 2;
165 case 2:
166 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
167 _Internal::set_has_current_timestamp(&has_bits);
168 _impl_.current_timestamp_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
169 CHK_(ptr);
170 } else {
171 goto handle_unusual;
172 }
173 continue;
174 // optional int64 delta = 3;
175 case 3:
176 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
177 _Internal::set_has_delta(&has_bits);
178 _impl_.delta_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
179 CHK_(ptr);
180 } else {
181 goto handle_unusual;
182 }
183 continue;
184 // optional uint32 ec_fifo_timestamp = 4;
185 case 4:
186 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
187 _Internal::set_has_ec_fifo_timestamp(&has_bits);
188 _impl_.ec_fifo_timestamp_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
189 CHK_(ptr);
190 } else {
191 goto handle_unusual;
192 }
193 continue;
194 // optional uint32 ec_sensor_num = 5;
195 case 5:
196 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 40)) {
197 _Internal::set_has_ec_sensor_num(&has_bits);
198 _impl_.ec_sensor_num_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
199 CHK_(ptr);
200 } else {
201 goto handle_unusual;
202 }
203 continue;
204 // optional int64 fifo_timestamp = 6;
205 case 6:
206 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 48)) {
207 _Internal::set_has_fifo_timestamp(&has_bits);
208 _impl_.fifo_timestamp_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
209 CHK_(ptr);
210 } else {
211 goto handle_unusual;
212 }
213 continue;
214 default:
215 goto handle_unusual;
216 } // switch
217 handle_unusual:
218 if ((tag == 0) || ((tag & 7) == 4)) {
219 CHK_(ptr);
220 ctx->SetLastTag(tag);
221 goto message_done;
222 }
223 ptr = UnknownFieldParse(
224 tag,
225 _internal_metadata_.mutable_unknown_fields<std::string>(),
226 ptr, ctx);
227 CHK_(ptr != nullptr);
228 } // while
229 message_done:
230 _impl_._has_bits_.Or(has_bits);
231 return ptr;
232 failure:
233 ptr = nullptr;
234 goto message_done;
235 #undef CHK_
236 }
237
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const238 ::uint8_t* CrosEcSensorhubDataFtraceEvent::_InternalSerialize(
239 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
240 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.CrosEcSensorhubDataFtraceEvent)
241 ::uint32_t cached_has_bits = 0;
242 (void) cached_has_bits;
243
244 cached_has_bits = _impl_._has_bits_[0];
245 // optional int64 current_time = 1;
246 if (cached_has_bits & 0x00000001u) {
247 target = stream->EnsureSpace(target);
248 target = ::_pbi::WireFormatLite::WriteInt64ToArray(1, this->_internal_current_time(), target);
249 }
250
251 // optional int64 current_timestamp = 2;
252 if (cached_has_bits & 0x00000002u) {
253 target = stream->EnsureSpace(target);
254 target = ::_pbi::WireFormatLite::WriteInt64ToArray(2, this->_internal_current_timestamp(), target);
255 }
256
257 // optional int64 delta = 3;
258 if (cached_has_bits & 0x00000004u) {
259 target = stream->EnsureSpace(target);
260 target = ::_pbi::WireFormatLite::WriteInt64ToArray(3, this->_internal_delta(), target);
261 }
262
263 // optional uint32 ec_fifo_timestamp = 4;
264 if (cached_has_bits & 0x00000008u) {
265 target = stream->EnsureSpace(target);
266 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(4, this->_internal_ec_fifo_timestamp(), target);
267 }
268
269 // optional uint32 ec_sensor_num = 5;
270 if (cached_has_bits & 0x00000010u) {
271 target = stream->EnsureSpace(target);
272 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(5, this->_internal_ec_sensor_num(), target);
273 }
274
275 // optional int64 fifo_timestamp = 6;
276 if (cached_has_bits & 0x00000020u) {
277 target = stream->EnsureSpace(target);
278 target = ::_pbi::WireFormatLite::WriteInt64ToArray(6, this->_internal_fifo_timestamp(), target);
279 }
280
281 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
282 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
283 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
284 }
285 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.CrosEcSensorhubDataFtraceEvent)
286 return target;
287 }
288
ByteSizeLong() const289 size_t CrosEcSensorhubDataFtraceEvent::ByteSizeLong() const {
290 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.CrosEcSensorhubDataFtraceEvent)
291 size_t total_size = 0;
292
293 ::uint32_t cached_has_bits = 0;
294 // Prevent compiler warnings about cached_has_bits being unused
295 (void) cached_has_bits;
296
297 cached_has_bits = _impl_._has_bits_[0];
298 if (cached_has_bits & 0x0000003fu) {
299 // optional int64 current_time = 1;
300 if (cached_has_bits & 0x00000001u) {
301 total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_current_time());
302 }
303
304 // optional int64 current_timestamp = 2;
305 if (cached_has_bits & 0x00000002u) {
306 total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_current_timestamp());
307 }
308
309 // optional int64 delta = 3;
310 if (cached_has_bits & 0x00000004u) {
311 total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_delta());
312 }
313
314 // optional uint32 ec_fifo_timestamp = 4;
315 if (cached_has_bits & 0x00000008u) {
316 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_ec_fifo_timestamp());
317 }
318
319 // optional uint32 ec_sensor_num = 5;
320 if (cached_has_bits & 0x00000010u) {
321 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_ec_sensor_num());
322 }
323
324 // optional int64 fifo_timestamp = 6;
325 if (cached_has_bits & 0x00000020u) {
326 total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_fifo_timestamp());
327 }
328
329 }
330 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
331 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
332 }
333 int cached_size = ::_pbi::ToCachedSize(total_size);
334 SetCachedSize(cached_size);
335 return total_size;
336 }
337
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)338 void CrosEcSensorhubDataFtraceEvent::CheckTypeAndMergeFrom(
339 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
340 MergeFrom(*::_pbi::DownCast<const CrosEcSensorhubDataFtraceEvent*>(
341 &from));
342 }
343
MergeFrom(const CrosEcSensorhubDataFtraceEvent & from)344 void CrosEcSensorhubDataFtraceEvent::MergeFrom(const CrosEcSensorhubDataFtraceEvent& from) {
345 CrosEcSensorhubDataFtraceEvent* const _this = this;
346 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.CrosEcSensorhubDataFtraceEvent)
347 GOOGLE_DCHECK_NE(&from, _this);
348 ::uint32_t cached_has_bits = 0;
349 (void) cached_has_bits;
350
351 cached_has_bits = from._impl_._has_bits_[0];
352 if (cached_has_bits & 0x0000003fu) {
353 if (cached_has_bits & 0x00000001u) {
354 _this->_impl_.current_time_ = from._impl_.current_time_;
355 }
356 if (cached_has_bits & 0x00000002u) {
357 _this->_impl_.current_timestamp_ = from._impl_.current_timestamp_;
358 }
359 if (cached_has_bits & 0x00000004u) {
360 _this->_impl_.delta_ = from._impl_.delta_;
361 }
362 if (cached_has_bits & 0x00000008u) {
363 _this->_impl_.ec_fifo_timestamp_ = from._impl_.ec_fifo_timestamp_;
364 }
365 if (cached_has_bits & 0x00000010u) {
366 _this->_impl_.ec_sensor_num_ = from._impl_.ec_sensor_num_;
367 }
368 if (cached_has_bits & 0x00000020u) {
369 _this->_impl_.fifo_timestamp_ = from._impl_.fifo_timestamp_;
370 }
371 _this->_impl_._has_bits_[0] |= cached_has_bits;
372 }
373 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
374 }
375
CopyFrom(const CrosEcSensorhubDataFtraceEvent & from)376 void CrosEcSensorhubDataFtraceEvent::CopyFrom(const CrosEcSensorhubDataFtraceEvent& from) {
377 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.CrosEcSensorhubDataFtraceEvent)
378 if (&from == this) return;
379 Clear();
380 MergeFrom(from);
381 }
382
IsInitialized() const383 bool CrosEcSensorhubDataFtraceEvent::IsInitialized() const {
384 return true;
385 }
386
InternalSwap(CrosEcSensorhubDataFtraceEvent * other)387 void CrosEcSensorhubDataFtraceEvent::InternalSwap(CrosEcSensorhubDataFtraceEvent* other) {
388 using std::swap;
389 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
390 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
391 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
392 PROTOBUF_FIELD_OFFSET(CrosEcSensorhubDataFtraceEvent, _impl_.fifo_timestamp_)
393 + sizeof(CrosEcSensorhubDataFtraceEvent::_impl_.fifo_timestamp_) // NOLINT
394 - PROTOBUF_FIELD_OFFSET(CrosEcSensorhubDataFtraceEvent, _impl_.current_time_)>(
395 reinterpret_cast<char*>(&_impl_.current_time_),
396 reinterpret_cast<char*>(&other->_impl_.current_time_));
397 }
398
GetTypeName() const399 std::string CrosEcSensorhubDataFtraceEvent::GetTypeName() const {
400 return "perfetto.protos.CrosEcSensorhubDataFtraceEvent";
401 }
402
403
404 // @@protoc_insertion_point(namespace_scope)
405 } // namespace protos
406 } // namespace perfetto
407 PROTOBUF_NAMESPACE_OPEN
408 template<> PROTOBUF_NOINLINE ::perfetto::protos::CrosEcSensorhubDataFtraceEvent*
CreateMaybeMessage(Arena * arena)409 Arena::CreateMaybeMessage< ::perfetto::protos::CrosEcSensorhubDataFtraceEvent >(Arena* arena) {
410 return Arena::CreateMessageInternal< ::perfetto::protos::CrosEcSensorhubDataFtraceEvent >(arena);
411 }
412 PROTOBUF_NAMESPACE_CLOSE
413
414 // @@protoc_insertion_point(global_scope)
415 #include <google/protobuf/port_undef.inc>
416