1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: protos/perfetto/trace/etw/etw_event_bundle.proto
3
4 #include "protos/perfetto/trace/etw/etw_event_bundle.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 {
EtwTraceEventBundle(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR EtwTraceEventBundle::EtwTraceEventBundle(
24 ::_pbi::ConstantInitialized): _impl_{
25 /*decltype(_impl_._has_bits_)*/{}
26 , /*decltype(_impl_._cached_size_)*/{}
27 , /*decltype(_impl_.event_)*/{}
28 , /*decltype(_impl_.cpu_)*/0u} {}
29 struct EtwTraceEventBundleDefaultTypeInternal {
EtwTraceEventBundleDefaultTypeInternalperfetto::protos::EtwTraceEventBundleDefaultTypeInternal30 PROTOBUF_CONSTEXPR EtwTraceEventBundleDefaultTypeInternal()
31 : _instance(::_pbi::ConstantInitialized{}) {}
~EtwTraceEventBundleDefaultTypeInternalperfetto::protos::EtwTraceEventBundleDefaultTypeInternal32 ~EtwTraceEventBundleDefaultTypeInternal() {}
33 union { // NOLINT(misc-non-private-member-variables-in-classes)
34 EtwTraceEventBundle _instance;
35 };
36 };
37 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 EtwTraceEventBundleDefaultTypeInternal _EtwTraceEventBundle_default_instance_;
38 } // namespace protos
39 } // namespace perfetto
40 namespace perfetto {
41 namespace protos {
42
43 // ===================================================================
44
45 class EtwTraceEventBundle::_Internal {
46 public:
47 using HasBits = decltype(std::declval<EtwTraceEventBundle>()._impl_._has_bits_);
set_has_cpu(HasBits * has_bits)48 static void set_has_cpu(HasBits* has_bits) {
49 (*has_bits)[0] |= 1u;
50 }
51 };
52
clear_event()53 void EtwTraceEventBundle::clear_event() {
54 _impl_.event_.Clear();
55 }
EtwTraceEventBundle(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)56 EtwTraceEventBundle::EtwTraceEventBundle(::PROTOBUF_NAMESPACE_ID::Arena* arena,
57 bool is_message_owned)
58 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
59 SharedCtor(arena, is_message_owned);
60 // @@protoc_insertion_point(arena_constructor:perfetto.protos.EtwTraceEventBundle)
61 }
EtwTraceEventBundle(const EtwTraceEventBundle & from)62 EtwTraceEventBundle::EtwTraceEventBundle(const EtwTraceEventBundle& from)
63 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
64 EtwTraceEventBundle* const _this = this; (void)_this;
65 new (&_impl_) Impl_{
66 decltype(_impl_._has_bits_){from._impl_._has_bits_}
67 , /*decltype(_impl_._cached_size_)*/{}
68 , decltype(_impl_.event_){from._impl_.event_}
69 , decltype(_impl_.cpu_){}};
70
71 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
72 _this->_impl_.cpu_ = from._impl_.cpu_;
73 // @@protoc_insertion_point(copy_constructor:perfetto.protos.EtwTraceEventBundle)
74 }
75
SharedCtor(::_pb::Arena * arena,bool is_message_owned)76 inline void EtwTraceEventBundle::SharedCtor(
77 ::_pb::Arena* arena, bool is_message_owned) {
78 (void)arena;
79 (void)is_message_owned;
80 new (&_impl_) Impl_{
81 decltype(_impl_._has_bits_){}
82 , /*decltype(_impl_._cached_size_)*/{}
83 , decltype(_impl_.event_){arena}
84 , decltype(_impl_.cpu_){0u}
85 };
86 }
87
~EtwTraceEventBundle()88 EtwTraceEventBundle::~EtwTraceEventBundle() {
89 // @@protoc_insertion_point(destructor:perfetto.protos.EtwTraceEventBundle)
90 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
91 (void)arena;
92 return;
93 }
94 SharedDtor();
95 }
96
SharedDtor()97 inline void EtwTraceEventBundle::SharedDtor() {
98 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
99 _impl_.event_.~RepeatedPtrField();
100 }
101
SetCachedSize(int size) const102 void EtwTraceEventBundle::SetCachedSize(int size) const {
103 _impl_._cached_size_.Set(size);
104 }
105
Clear()106 void EtwTraceEventBundle::Clear() {
107 // @@protoc_insertion_point(message_clear_start:perfetto.protos.EtwTraceEventBundle)
108 ::uint32_t cached_has_bits = 0;
109 // Prevent compiler warnings about cached_has_bits being unused
110 (void) cached_has_bits;
111
112 _impl_.event_.Clear();
113 _impl_.cpu_ = 0u;
114 _impl_._has_bits_.Clear();
115 _internal_metadata_.Clear<std::string>();
116 }
117
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)118 const char* EtwTraceEventBundle::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
119 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
120 _Internal::HasBits has_bits{};
121 while (!ctx->Done(&ptr)) {
122 ::uint32_t tag;
123 ptr = ::_pbi::ReadTag(ptr, &tag);
124 switch (tag >> 3) {
125 // optional uint32 cpu = 1;
126 case 1:
127 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
128 _Internal::set_has_cpu(&has_bits);
129 _impl_.cpu_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
130 CHK_(ptr);
131 } else {
132 goto handle_unusual;
133 }
134 continue;
135 // repeated .perfetto.protos.EtwTraceEvent event = 2;
136 case 2:
137 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
138 ptr -= 1;
139 do {
140 ptr += 1;
141 ptr = ctx->ParseMessage(_internal_add_event(), ptr);
142 CHK_(ptr);
143 if (!ctx->DataAvailable(ptr)) break;
144 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
145 } else {
146 goto handle_unusual;
147 }
148 continue;
149 default:
150 goto handle_unusual;
151 } // switch
152 handle_unusual:
153 if ((tag == 0) || ((tag & 7) == 4)) {
154 CHK_(ptr);
155 ctx->SetLastTag(tag);
156 goto message_done;
157 }
158 ptr = UnknownFieldParse(
159 tag,
160 _internal_metadata_.mutable_unknown_fields<std::string>(),
161 ptr, ctx);
162 CHK_(ptr != nullptr);
163 } // while
164 message_done:
165 _impl_._has_bits_.Or(has_bits);
166 return ptr;
167 failure:
168 ptr = nullptr;
169 goto message_done;
170 #undef CHK_
171 }
172
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const173 ::uint8_t* EtwTraceEventBundle::_InternalSerialize(
174 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
175 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.EtwTraceEventBundle)
176 ::uint32_t cached_has_bits = 0;
177 (void) cached_has_bits;
178
179 cached_has_bits = _impl_._has_bits_[0];
180 // optional uint32 cpu = 1;
181 if (cached_has_bits & 0x00000001u) {
182 target = stream->EnsureSpace(target);
183 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(1, this->_internal_cpu(), target);
184 }
185
186 // repeated .perfetto.protos.EtwTraceEvent event = 2;
187 for (unsigned i = 0,
188 n = static_cast<unsigned>(this->_internal_event_size()); i < n; i++) {
189 const auto& repfield = this->_internal_event(i);
190 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
191 InternalWriteMessage(2, repfield, repfield.GetCachedSize(), target, stream);
192 }
193
194 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
195 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
196 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
197 }
198 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.EtwTraceEventBundle)
199 return target;
200 }
201
ByteSizeLong() const202 size_t EtwTraceEventBundle::ByteSizeLong() const {
203 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.EtwTraceEventBundle)
204 size_t total_size = 0;
205
206 ::uint32_t cached_has_bits = 0;
207 // Prevent compiler warnings about cached_has_bits being unused
208 (void) cached_has_bits;
209
210 // repeated .perfetto.protos.EtwTraceEvent event = 2;
211 total_size += 1UL * this->_internal_event_size();
212 for (const auto& msg : this->_impl_.event_) {
213 total_size +=
214 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
215 }
216
217 // optional uint32 cpu = 1;
218 cached_has_bits = _impl_._has_bits_[0];
219 if (cached_has_bits & 0x00000001u) {
220 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_cpu());
221 }
222
223 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
224 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
225 }
226 int cached_size = ::_pbi::ToCachedSize(total_size);
227 SetCachedSize(cached_size);
228 return total_size;
229 }
230
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)231 void EtwTraceEventBundle::CheckTypeAndMergeFrom(
232 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
233 MergeFrom(*::_pbi::DownCast<const EtwTraceEventBundle*>(
234 &from));
235 }
236
MergeFrom(const EtwTraceEventBundle & from)237 void EtwTraceEventBundle::MergeFrom(const EtwTraceEventBundle& from) {
238 EtwTraceEventBundle* const _this = this;
239 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.EtwTraceEventBundle)
240 GOOGLE_DCHECK_NE(&from, _this);
241 ::uint32_t cached_has_bits = 0;
242 (void) cached_has_bits;
243
244 _this->_impl_.event_.MergeFrom(from._impl_.event_);
245 if (from._internal_has_cpu()) {
246 _this->_internal_set_cpu(from._internal_cpu());
247 }
248 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
249 }
250
CopyFrom(const EtwTraceEventBundle & from)251 void EtwTraceEventBundle::CopyFrom(const EtwTraceEventBundle& from) {
252 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.EtwTraceEventBundle)
253 if (&from == this) return;
254 Clear();
255 MergeFrom(from);
256 }
257
IsInitialized() const258 bool EtwTraceEventBundle::IsInitialized() const {
259 return true;
260 }
261
InternalSwap(EtwTraceEventBundle * other)262 void EtwTraceEventBundle::InternalSwap(EtwTraceEventBundle* other) {
263 using std::swap;
264 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
265 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
266 _impl_.event_.InternalSwap(&other->_impl_.event_);
267 swap(_impl_.cpu_, other->_impl_.cpu_);
268 }
269
GetTypeName() const270 std::string EtwTraceEventBundle::GetTypeName() const {
271 return "perfetto.protos.EtwTraceEventBundle";
272 }
273
274
275 // @@protoc_insertion_point(namespace_scope)
276 } // namespace protos
277 } // namespace perfetto
278 PROTOBUF_NAMESPACE_OPEN
279 template<> PROTOBUF_NOINLINE ::perfetto::protos::EtwTraceEventBundle*
CreateMaybeMessage(Arena * arena)280 Arena::CreateMaybeMessage< ::perfetto::protos::EtwTraceEventBundle >(Arena* arena) {
281 return Arena::CreateMessageInternal< ::perfetto::protos::EtwTraceEventBundle >(arena);
282 }
283 PROTOBUF_NAMESPACE_CLOSE
284
285 // @@protoc_insertion_point(global_scope)
286 #include <google/protobuf/port_undef.inc>
287