1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: protos/perfetto/trace/gpu/gpu_log.proto
3
4 #include "protos/perfetto/trace/gpu/gpu_log.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 {
GpuLog(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR GpuLog::GpuLog(
24 ::_pbi::ConstantInitialized): _impl_{
25 /*decltype(_impl_._has_bits_)*/{}
26 , /*decltype(_impl_._cached_size_)*/{}
27 , /*decltype(_impl_.tag_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
28 , /*decltype(_impl_.log_message_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
29 , /*decltype(_impl_.severity_)*/0} {}
30 struct GpuLogDefaultTypeInternal {
GpuLogDefaultTypeInternalperfetto::protos::GpuLogDefaultTypeInternal31 PROTOBUF_CONSTEXPR GpuLogDefaultTypeInternal()
32 : _instance(::_pbi::ConstantInitialized{}) {}
~GpuLogDefaultTypeInternalperfetto::protos::GpuLogDefaultTypeInternal33 ~GpuLogDefaultTypeInternal() {}
34 union { // NOLINT(misc-non-private-member-variables-in-classes)
35 GpuLog _instance;
36 };
37 };
38 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GpuLogDefaultTypeInternal _GpuLog_default_instance_;
39 } // namespace protos
40 } // namespace perfetto
41 namespace perfetto {
42 namespace protos {
GpuLog_Severity_IsValid(int value)43 bool GpuLog_Severity_IsValid(int value) {
44 switch (value) {
45 case 0:
46 case 1:
47 case 2:
48 case 3:
49 case 4:
50 case 5:
51 return true;
52 default:
53 return false;
54 }
55 }
56
57 static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> GpuLog_Severity_strings[6] = {};
58
59 static const char GpuLog_Severity_names[] =
60 "LOG_SEVERITY_DEBUG"
61 "LOG_SEVERITY_ERROR"
62 "LOG_SEVERITY_INFO"
63 "LOG_SEVERITY_UNSPECIFIED"
64 "LOG_SEVERITY_VERBOSE"
65 "LOG_SEVERITY_WARNING";
66
67 static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry GpuLog_Severity_entries[] = {
68 { {GpuLog_Severity_names + 0, 18}, 2 },
69 { {GpuLog_Severity_names + 18, 18}, 5 },
70 { {GpuLog_Severity_names + 36, 17}, 3 },
71 { {GpuLog_Severity_names + 53, 24}, 0 },
72 { {GpuLog_Severity_names + 77, 20}, 1 },
73 { {GpuLog_Severity_names + 97, 20}, 4 },
74 };
75
76 static const int GpuLog_Severity_entries_by_number[] = {
77 3, // 0 -> LOG_SEVERITY_UNSPECIFIED
78 4, // 1 -> LOG_SEVERITY_VERBOSE
79 0, // 2 -> LOG_SEVERITY_DEBUG
80 2, // 3 -> LOG_SEVERITY_INFO
81 5, // 4 -> LOG_SEVERITY_WARNING
82 1, // 5 -> LOG_SEVERITY_ERROR
83 };
84
GpuLog_Severity_Name(GpuLog_Severity value)85 const std::string& GpuLog_Severity_Name(
86 GpuLog_Severity value) {
87 static const bool dummy =
88 ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
89 GpuLog_Severity_entries,
90 GpuLog_Severity_entries_by_number,
91 6, GpuLog_Severity_strings);
92 (void) dummy;
93 int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
94 GpuLog_Severity_entries,
95 GpuLog_Severity_entries_by_number,
96 6, value);
97 return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
98 GpuLog_Severity_strings[idx].get();
99 }
GpuLog_Severity_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,GpuLog_Severity * value)100 bool GpuLog_Severity_Parse(
101 ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, GpuLog_Severity* value) {
102 int int_value;
103 bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
104 GpuLog_Severity_entries, 6, name, &int_value);
105 if (success) {
106 *value = static_cast<GpuLog_Severity>(int_value);
107 }
108 return success;
109 }
110 #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
111 constexpr GpuLog_Severity GpuLog::LOG_SEVERITY_UNSPECIFIED;
112 constexpr GpuLog_Severity GpuLog::LOG_SEVERITY_VERBOSE;
113 constexpr GpuLog_Severity GpuLog::LOG_SEVERITY_DEBUG;
114 constexpr GpuLog_Severity GpuLog::LOG_SEVERITY_INFO;
115 constexpr GpuLog_Severity GpuLog::LOG_SEVERITY_WARNING;
116 constexpr GpuLog_Severity GpuLog::LOG_SEVERITY_ERROR;
117 constexpr GpuLog_Severity GpuLog::Severity_MIN;
118 constexpr GpuLog_Severity GpuLog::Severity_MAX;
119 constexpr int GpuLog::Severity_ARRAYSIZE;
120 #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
121
122 // ===================================================================
123
124 class GpuLog::_Internal {
125 public:
126 using HasBits = decltype(std::declval<GpuLog>()._impl_._has_bits_);
set_has_severity(HasBits * has_bits)127 static void set_has_severity(HasBits* has_bits) {
128 (*has_bits)[0] |= 4u;
129 }
set_has_tag(HasBits * has_bits)130 static void set_has_tag(HasBits* has_bits) {
131 (*has_bits)[0] |= 1u;
132 }
set_has_log_message(HasBits * has_bits)133 static void set_has_log_message(HasBits* has_bits) {
134 (*has_bits)[0] |= 2u;
135 }
136 };
137
GpuLog(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)138 GpuLog::GpuLog(::PROTOBUF_NAMESPACE_ID::Arena* arena,
139 bool is_message_owned)
140 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
141 SharedCtor(arena, is_message_owned);
142 // @@protoc_insertion_point(arena_constructor:perfetto.protos.GpuLog)
143 }
GpuLog(const GpuLog & from)144 GpuLog::GpuLog(const GpuLog& from)
145 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
146 GpuLog* const _this = this; (void)_this;
147 new (&_impl_) Impl_{
148 decltype(_impl_._has_bits_){from._impl_._has_bits_}
149 , /*decltype(_impl_._cached_size_)*/{}
150 , decltype(_impl_.tag_){}
151 , decltype(_impl_.log_message_){}
152 , decltype(_impl_.severity_){}};
153
154 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
155 _impl_.tag_.InitDefault();
156 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
157 _impl_.tag_.Set("", GetArenaForAllocation());
158 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
159 if (from._internal_has_tag()) {
160 _this->_impl_.tag_.Set(from._internal_tag(),
161 _this->GetArenaForAllocation());
162 }
163 _impl_.log_message_.InitDefault();
164 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
165 _impl_.log_message_.Set("", GetArenaForAllocation());
166 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
167 if (from._internal_has_log_message()) {
168 _this->_impl_.log_message_.Set(from._internal_log_message(),
169 _this->GetArenaForAllocation());
170 }
171 _this->_impl_.severity_ = from._impl_.severity_;
172 // @@protoc_insertion_point(copy_constructor:perfetto.protos.GpuLog)
173 }
174
SharedCtor(::_pb::Arena * arena,bool is_message_owned)175 inline void GpuLog::SharedCtor(
176 ::_pb::Arena* arena, bool is_message_owned) {
177 (void)arena;
178 (void)is_message_owned;
179 new (&_impl_) Impl_{
180 decltype(_impl_._has_bits_){}
181 , /*decltype(_impl_._cached_size_)*/{}
182 , decltype(_impl_.tag_){}
183 , decltype(_impl_.log_message_){}
184 , decltype(_impl_.severity_){0}
185 };
186 _impl_.tag_.InitDefault();
187 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
188 _impl_.tag_.Set("", GetArenaForAllocation());
189 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
190 _impl_.log_message_.InitDefault();
191 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
192 _impl_.log_message_.Set("", GetArenaForAllocation());
193 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
194 }
195
~GpuLog()196 GpuLog::~GpuLog() {
197 // @@protoc_insertion_point(destructor:perfetto.protos.GpuLog)
198 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
199 (void)arena;
200 return;
201 }
202 SharedDtor();
203 }
204
SharedDtor()205 inline void GpuLog::SharedDtor() {
206 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
207 _impl_.tag_.Destroy();
208 _impl_.log_message_.Destroy();
209 }
210
SetCachedSize(int size) const211 void GpuLog::SetCachedSize(int size) const {
212 _impl_._cached_size_.Set(size);
213 }
214
Clear()215 void GpuLog::Clear() {
216 // @@protoc_insertion_point(message_clear_start:perfetto.protos.GpuLog)
217 ::uint32_t cached_has_bits = 0;
218 // Prevent compiler warnings about cached_has_bits being unused
219 (void) cached_has_bits;
220
221 cached_has_bits = _impl_._has_bits_[0];
222 if (cached_has_bits & 0x00000003u) {
223 if (cached_has_bits & 0x00000001u) {
224 _impl_.tag_.ClearNonDefaultToEmpty();
225 }
226 if (cached_has_bits & 0x00000002u) {
227 _impl_.log_message_.ClearNonDefaultToEmpty();
228 }
229 }
230 _impl_.severity_ = 0;
231 _impl_._has_bits_.Clear();
232 _internal_metadata_.Clear<std::string>();
233 }
234
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)235 const char* GpuLog::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
236 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
237 _Internal::HasBits has_bits{};
238 while (!ctx->Done(&ptr)) {
239 ::uint32_t tag;
240 ptr = ::_pbi::ReadTag(ptr, &tag);
241 switch (tag >> 3) {
242 // optional .perfetto.protos.GpuLog.Severity severity = 1;
243 case 1:
244 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
245 ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
246 CHK_(ptr);
247 if (PROTOBUF_PREDICT_TRUE(::perfetto::protos::GpuLog_Severity_IsValid(val))) {
248 _internal_set_severity(static_cast<::perfetto::protos::GpuLog_Severity>(val));
249 } else {
250 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
251 }
252 } else {
253 goto handle_unusual;
254 }
255 continue;
256 // optional string tag = 2;
257 case 2:
258 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
259 auto str = _internal_mutable_tag();
260 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
261 CHK_(ptr);
262 } else {
263 goto handle_unusual;
264 }
265 continue;
266 // optional string log_message = 3;
267 case 3:
268 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 26)) {
269 auto str = _internal_mutable_log_message();
270 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
271 CHK_(ptr);
272 } else {
273 goto handle_unusual;
274 }
275 continue;
276 default:
277 goto handle_unusual;
278 } // switch
279 handle_unusual:
280 if ((tag == 0) || ((tag & 7) == 4)) {
281 CHK_(ptr);
282 ctx->SetLastTag(tag);
283 goto message_done;
284 }
285 ptr = UnknownFieldParse(
286 tag,
287 _internal_metadata_.mutable_unknown_fields<std::string>(),
288 ptr, ctx);
289 CHK_(ptr != nullptr);
290 } // while
291 message_done:
292 _impl_._has_bits_.Or(has_bits);
293 return ptr;
294 failure:
295 ptr = nullptr;
296 goto message_done;
297 #undef CHK_
298 }
299
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const300 ::uint8_t* GpuLog::_InternalSerialize(
301 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
302 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.GpuLog)
303 ::uint32_t cached_has_bits = 0;
304 (void) cached_has_bits;
305
306 cached_has_bits = _impl_._has_bits_[0];
307 // optional .perfetto.protos.GpuLog.Severity severity = 1;
308 if (cached_has_bits & 0x00000004u) {
309 target = stream->EnsureSpace(target);
310 target = ::_pbi::WireFormatLite::WriteEnumToArray(
311 1, this->_internal_severity(), target);
312 }
313
314 // optional string tag = 2;
315 if (cached_has_bits & 0x00000001u) {
316 target = stream->WriteStringMaybeAliased(
317 2, this->_internal_tag(), target);
318 }
319
320 // optional string log_message = 3;
321 if (cached_has_bits & 0x00000002u) {
322 target = stream->WriteStringMaybeAliased(
323 3, this->_internal_log_message(), target);
324 }
325
326 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
327 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
328 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
329 }
330 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.GpuLog)
331 return target;
332 }
333
ByteSizeLong() const334 size_t GpuLog::ByteSizeLong() const {
335 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.GpuLog)
336 size_t total_size = 0;
337
338 ::uint32_t cached_has_bits = 0;
339 // Prevent compiler warnings about cached_has_bits being unused
340 (void) cached_has_bits;
341
342 cached_has_bits = _impl_._has_bits_[0];
343 if (cached_has_bits & 0x00000007u) {
344 // optional string tag = 2;
345 if (cached_has_bits & 0x00000001u) {
346 total_size += 1 +
347 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
348 this->_internal_tag());
349 }
350
351 // optional string log_message = 3;
352 if (cached_has_bits & 0x00000002u) {
353 total_size += 1 +
354 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
355 this->_internal_log_message());
356 }
357
358 // optional .perfetto.protos.GpuLog.Severity severity = 1;
359 if (cached_has_bits & 0x00000004u) {
360 total_size += 1 +
361 ::_pbi::WireFormatLite::EnumSize(this->_internal_severity());
362 }
363
364 }
365 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
366 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
367 }
368 int cached_size = ::_pbi::ToCachedSize(total_size);
369 SetCachedSize(cached_size);
370 return total_size;
371 }
372
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)373 void GpuLog::CheckTypeAndMergeFrom(
374 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
375 MergeFrom(*::_pbi::DownCast<const GpuLog*>(
376 &from));
377 }
378
MergeFrom(const GpuLog & from)379 void GpuLog::MergeFrom(const GpuLog& from) {
380 GpuLog* const _this = this;
381 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.GpuLog)
382 GOOGLE_DCHECK_NE(&from, _this);
383 ::uint32_t cached_has_bits = 0;
384 (void) cached_has_bits;
385
386 cached_has_bits = from._impl_._has_bits_[0];
387 if (cached_has_bits & 0x00000007u) {
388 if (cached_has_bits & 0x00000001u) {
389 _this->_internal_set_tag(from._internal_tag());
390 }
391 if (cached_has_bits & 0x00000002u) {
392 _this->_internal_set_log_message(from._internal_log_message());
393 }
394 if (cached_has_bits & 0x00000004u) {
395 _this->_impl_.severity_ = from._impl_.severity_;
396 }
397 _this->_impl_._has_bits_[0] |= cached_has_bits;
398 }
399 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
400 }
401
CopyFrom(const GpuLog & from)402 void GpuLog::CopyFrom(const GpuLog& from) {
403 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.GpuLog)
404 if (&from == this) return;
405 Clear();
406 MergeFrom(from);
407 }
408
IsInitialized() const409 bool GpuLog::IsInitialized() const {
410 return true;
411 }
412
InternalSwap(GpuLog * other)413 void GpuLog::InternalSwap(GpuLog* other) {
414 using std::swap;
415 auto* lhs_arena = GetArenaForAllocation();
416 auto* rhs_arena = other->GetArenaForAllocation();
417 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
418 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
419 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
420 &_impl_.tag_, lhs_arena,
421 &other->_impl_.tag_, rhs_arena
422 );
423 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
424 &_impl_.log_message_, lhs_arena,
425 &other->_impl_.log_message_, rhs_arena
426 );
427 swap(_impl_.severity_, other->_impl_.severity_);
428 }
429
GetTypeName() const430 std::string GpuLog::GetTypeName() const {
431 return "perfetto.protos.GpuLog";
432 }
433
434
435 // @@protoc_insertion_point(namespace_scope)
436 } // namespace protos
437 } // namespace perfetto
438 PROTOBUF_NAMESPACE_OPEN
439 template<> PROTOBUF_NOINLINE ::perfetto::protos::GpuLog*
CreateMaybeMessage(Arena * arena)440 Arena::CreateMaybeMessage< ::perfetto::protos::GpuLog >(Arena* arena) {
441 return Arena::CreateMessageInternal< ::perfetto::protos::GpuLog >(arena);
442 }
443 PROTOBUF_NAMESPACE_CLOSE
444
445 // @@protoc_insertion_point(global_scope)
446 #include <google/protobuf/port_undef.inc>
447