1 // Generated by the protocol buffer compiler.  DO NOT EDIT!
2 // source: protos/perfetto/common/trace_stats.proto
3 
4 #include "protos/perfetto/common/trace_stats.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 {
TraceStats_BufferStats(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR TraceStats_BufferStats::TraceStats_BufferStats(
24     ::_pbi::ConstantInitialized): _impl_{
25     /*decltype(_impl_._has_bits_)*/{}
26   , /*decltype(_impl_._cached_size_)*/{}
27   , /*decltype(_impl_.bytes_written_)*/::uint64_t{0u}
28   , /*decltype(_impl_.chunks_written_)*/::uint64_t{0u}
29   , /*decltype(_impl_.chunks_overwritten_)*/::uint64_t{0u}
30   , /*decltype(_impl_.write_wrap_count_)*/::uint64_t{0u}
31   , /*decltype(_impl_.patches_succeeded_)*/::uint64_t{0u}
32   , /*decltype(_impl_.patches_failed_)*/::uint64_t{0u}
33   , /*decltype(_impl_.readaheads_succeeded_)*/::uint64_t{0u}
34   , /*decltype(_impl_.readaheads_failed_)*/::uint64_t{0u}
35   , /*decltype(_impl_.abi_violations_)*/::uint64_t{0u}
36   , /*decltype(_impl_.chunks_rewritten_)*/::uint64_t{0u}
37   , /*decltype(_impl_.chunks_committed_out_of_order_)*/::uint64_t{0u}
38   , /*decltype(_impl_.buffer_size_)*/::uint64_t{0u}
39   , /*decltype(_impl_.bytes_overwritten_)*/::uint64_t{0u}
40   , /*decltype(_impl_.bytes_read_)*/::uint64_t{0u}
41   , /*decltype(_impl_.padding_bytes_written_)*/::uint64_t{0u}
42   , /*decltype(_impl_.padding_bytes_cleared_)*/::uint64_t{0u}
43   , /*decltype(_impl_.chunks_read_)*/::uint64_t{0u}
44   , /*decltype(_impl_.chunks_discarded_)*/::uint64_t{0u}
45   , /*decltype(_impl_.trace_writer_packet_loss_)*/::uint64_t{0u}} {}
46 struct TraceStats_BufferStatsDefaultTypeInternal {
TraceStats_BufferStatsDefaultTypeInternalperfetto::protos::TraceStats_BufferStatsDefaultTypeInternal47   PROTOBUF_CONSTEXPR TraceStats_BufferStatsDefaultTypeInternal()
48       : _instance(::_pbi::ConstantInitialized{}) {}
~TraceStats_BufferStatsDefaultTypeInternalperfetto::protos::TraceStats_BufferStatsDefaultTypeInternal49   ~TraceStats_BufferStatsDefaultTypeInternal() {}
50   union {  // NOLINT(misc-non-private-member-variables-in-classes)
51     TraceStats_BufferStats _instance;
52   };
53 };
54 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TraceStats_BufferStatsDefaultTypeInternal _TraceStats_BufferStats_default_instance_;
TraceStats_WriterStats(::_pbi::ConstantInitialized)55 PROTOBUF_CONSTEXPR TraceStats_WriterStats::TraceStats_WriterStats(
56     ::_pbi::ConstantInitialized): _impl_{
57     /*decltype(_impl_._has_bits_)*/{}
58   , /*decltype(_impl_._cached_size_)*/{}
59   , /*decltype(_impl_.chunk_payload_histogram_counts_)*/{}
60   , /*decltype(_impl_._chunk_payload_histogram_counts_cached_byte_size_)*/{0}
61   , /*decltype(_impl_.chunk_payload_histogram_sum_)*/{}
62   , /*decltype(_impl_._chunk_payload_histogram_sum_cached_byte_size_)*/{0}
63   , /*decltype(_impl_.sequence_id_)*/::uint64_t{0u}
64   , /*decltype(_impl_.buffer_)*/0u} {}
65 struct TraceStats_WriterStatsDefaultTypeInternal {
TraceStats_WriterStatsDefaultTypeInternalperfetto::protos::TraceStats_WriterStatsDefaultTypeInternal66   PROTOBUF_CONSTEXPR TraceStats_WriterStatsDefaultTypeInternal()
67       : _instance(::_pbi::ConstantInitialized{}) {}
~TraceStats_WriterStatsDefaultTypeInternalperfetto::protos::TraceStats_WriterStatsDefaultTypeInternal68   ~TraceStats_WriterStatsDefaultTypeInternal() {}
69   union {  // NOLINT(misc-non-private-member-variables-in-classes)
70     TraceStats_WriterStats _instance;
71   };
72 };
73 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TraceStats_WriterStatsDefaultTypeInternal _TraceStats_WriterStats_default_instance_;
TraceStats_FilterStats(::_pbi::ConstantInitialized)74 PROTOBUF_CONSTEXPR TraceStats_FilterStats::TraceStats_FilterStats(
75     ::_pbi::ConstantInitialized): _impl_{
76     /*decltype(_impl_._has_bits_)*/{}
77   , /*decltype(_impl_._cached_size_)*/{}
78   , /*decltype(_impl_.bytes_discarded_per_buffer_)*/{}
79   , /*decltype(_impl_.input_packets_)*/::uint64_t{0u}
80   , /*decltype(_impl_.input_bytes_)*/::uint64_t{0u}
81   , /*decltype(_impl_.output_bytes_)*/::uint64_t{0u}
82   , /*decltype(_impl_.errors_)*/::uint64_t{0u}
83   , /*decltype(_impl_.time_taken_ns_)*/::uint64_t{0u}} {}
84 struct TraceStats_FilterStatsDefaultTypeInternal {
TraceStats_FilterStatsDefaultTypeInternalperfetto::protos::TraceStats_FilterStatsDefaultTypeInternal85   PROTOBUF_CONSTEXPR TraceStats_FilterStatsDefaultTypeInternal()
86       : _instance(::_pbi::ConstantInitialized{}) {}
~TraceStats_FilterStatsDefaultTypeInternalperfetto::protos::TraceStats_FilterStatsDefaultTypeInternal87   ~TraceStats_FilterStatsDefaultTypeInternal() {}
88   union {  // NOLINT(misc-non-private-member-variables-in-classes)
89     TraceStats_FilterStats _instance;
90   };
91 };
92 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TraceStats_FilterStatsDefaultTypeInternal _TraceStats_FilterStats_default_instance_;
TraceStats(::_pbi::ConstantInitialized)93 PROTOBUF_CONSTEXPR TraceStats::TraceStats(
94     ::_pbi::ConstantInitialized): _impl_{
95     /*decltype(_impl_._has_bits_)*/{}
96   , /*decltype(_impl_._cached_size_)*/{}
97   , /*decltype(_impl_.buffer_stats_)*/{}
98   , /*decltype(_impl_.chunk_payload_histogram_def_)*/{}
99   , /*decltype(_impl_.writer_stats_)*/{}
100   , /*decltype(_impl_.filter_stats_)*/nullptr
101   , /*decltype(_impl_.producers_seen_)*/::uint64_t{0u}
102   , /*decltype(_impl_.producers_connected_)*/0u
103   , /*decltype(_impl_.data_sources_registered_)*/0u
104   , /*decltype(_impl_.data_sources_seen_)*/::uint64_t{0u}
105   , /*decltype(_impl_.tracing_sessions_)*/0u
106   , /*decltype(_impl_.total_buffers_)*/0u
107   , /*decltype(_impl_.chunks_discarded_)*/::uint64_t{0u}
108   , /*decltype(_impl_.patches_discarded_)*/::uint64_t{0u}
109   , /*decltype(_impl_.invalid_packets_)*/::uint64_t{0u}
110   , /*decltype(_impl_.flushes_requested_)*/::uint64_t{0u}
111   , /*decltype(_impl_.flushes_succeeded_)*/::uint64_t{0u}
112   , /*decltype(_impl_.flushes_failed_)*/::uint64_t{0u}
113   , /*decltype(_impl_.final_flush_outcome_)*/0} {}
114 struct TraceStatsDefaultTypeInternal {
TraceStatsDefaultTypeInternalperfetto::protos::TraceStatsDefaultTypeInternal115   PROTOBUF_CONSTEXPR TraceStatsDefaultTypeInternal()
116       : _instance(::_pbi::ConstantInitialized{}) {}
~TraceStatsDefaultTypeInternalperfetto::protos::TraceStatsDefaultTypeInternal117   ~TraceStatsDefaultTypeInternal() {}
118   union {  // NOLINT(misc-non-private-member-variables-in-classes)
119     TraceStats _instance;
120   };
121 };
122 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TraceStatsDefaultTypeInternal _TraceStats_default_instance_;
123 }  // namespace protos
124 }  // namespace perfetto
125 namespace perfetto {
126 namespace protos {
TraceStats_FinalFlushOutcome_IsValid(int value)127 bool TraceStats_FinalFlushOutcome_IsValid(int value) {
128   switch (value) {
129     case 0:
130     case 1:
131     case 2:
132       return true;
133     default:
134       return false;
135   }
136 }
137 
138 static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> TraceStats_FinalFlushOutcome_strings[3] = {};
139 
140 static const char TraceStats_FinalFlushOutcome_names[] =
141   "FINAL_FLUSH_FAILED"
142   "FINAL_FLUSH_SUCCEEDED"
143   "FINAL_FLUSH_UNSPECIFIED";
144 
145 static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry TraceStats_FinalFlushOutcome_entries[] = {
146   { {TraceStats_FinalFlushOutcome_names + 0, 18}, 2 },
147   { {TraceStats_FinalFlushOutcome_names + 18, 21}, 1 },
148   { {TraceStats_FinalFlushOutcome_names + 39, 23}, 0 },
149 };
150 
151 static const int TraceStats_FinalFlushOutcome_entries_by_number[] = {
152   2, // 0 -> FINAL_FLUSH_UNSPECIFIED
153   1, // 1 -> FINAL_FLUSH_SUCCEEDED
154   0, // 2 -> FINAL_FLUSH_FAILED
155 };
156 
TraceStats_FinalFlushOutcome_Name(TraceStats_FinalFlushOutcome value)157 const std::string& TraceStats_FinalFlushOutcome_Name(
158     TraceStats_FinalFlushOutcome value) {
159   static const bool dummy =
160       ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
161           TraceStats_FinalFlushOutcome_entries,
162           TraceStats_FinalFlushOutcome_entries_by_number,
163           3, TraceStats_FinalFlushOutcome_strings);
164   (void) dummy;
165   int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
166       TraceStats_FinalFlushOutcome_entries,
167       TraceStats_FinalFlushOutcome_entries_by_number,
168       3, value);
169   return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
170                      TraceStats_FinalFlushOutcome_strings[idx].get();
171 }
TraceStats_FinalFlushOutcome_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,TraceStats_FinalFlushOutcome * value)172 bool TraceStats_FinalFlushOutcome_Parse(
173     ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, TraceStats_FinalFlushOutcome* value) {
174   int int_value;
175   bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
176       TraceStats_FinalFlushOutcome_entries, 3, name, &int_value);
177   if (success) {
178     *value = static_cast<TraceStats_FinalFlushOutcome>(int_value);
179   }
180   return success;
181 }
182 #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
183 constexpr TraceStats_FinalFlushOutcome TraceStats::FINAL_FLUSH_UNSPECIFIED;
184 constexpr TraceStats_FinalFlushOutcome TraceStats::FINAL_FLUSH_SUCCEEDED;
185 constexpr TraceStats_FinalFlushOutcome TraceStats::FINAL_FLUSH_FAILED;
186 constexpr TraceStats_FinalFlushOutcome TraceStats::FinalFlushOutcome_MIN;
187 constexpr TraceStats_FinalFlushOutcome TraceStats::FinalFlushOutcome_MAX;
188 constexpr int TraceStats::FinalFlushOutcome_ARRAYSIZE;
189 #endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
190 
191 // ===================================================================
192 
193 class TraceStats_BufferStats::_Internal {
194  public:
195   using HasBits = decltype(std::declval<TraceStats_BufferStats>()._impl_._has_bits_);
set_has_buffer_size(HasBits * has_bits)196   static void set_has_buffer_size(HasBits* has_bits) {
197     (*has_bits)[0] |= 2048u;
198   }
set_has_bytes_written(HasBits * has_bits)199   static void set_has_bytes_written(HasBits* has_bits) {
200     (*has_bits)[0] |= 1u;
201   }
set_has_bytes_overwritten(HasBits * has_bits)202   static void set_has_bytes_overwritten(HasBits* has_bits) {
203     (*has_bits)[0] |= 4096u;
204   }
set_has_bytes_read(HasBits * has_bits)205   static void set_has_bytes_read(HasBits* has_bits) {
206     (*has_bits)[0] |= 8192u;
207   }
set_has_padding_bytes_written(HasBits * has_bits)208   static void set_has_padding_bytes_written(HasBits* has_bits) {
209     (*has_bits)[0] |= 16384u;
210   }
set_has_padding_bytes_cleared(HasBits * has_bits)211   static void set_has_padding_bytes_cleared(HasBits* has_bits) {
212     (*has_bits)[0] |= 32768u;
213   }
set_has_chunks_written(HasBits * has_bits)214   static void set_has_chunks_written(HasBits* has_bits) {
215     (*has_bits)[0] |= 2u;
216   }
set_has_chunks_rewritten(HasBits * has_bits)217   static void set_has_chunks_rewritten(HasBits* has_bits) {
218     (*has_bits)[0] |= 512u;
219   }
set_has_chunks_overwritten(HasBits * has_bits)220   static void set_has_chunks_overwritten(HasBits* has_bits) {
221     (*has_bits)[0] |= 4u;
222   }
set_has_chunks_discarded(HasBits * has_bits)223   static void set_has_chunks_discarded(HasBits* has_bits) {
224     (*has_bits)[0] |= 131072u;
225   }
set_has_chunks_read(HasBits * has_bits)226   static void set_has_chunks_read(HasBits* has_bits) {
227     (*has_bits)[0] |= 65536u;
228   }
set_has_chunks_committed_out_of_order(HasBits * has_bits)229   static void set_has_chunks_committed_out_of_order(HasBits* has_bits) {
230     (*has_bits)[0] |= 1024u;
231   }
set_has_write_wrap_count(HasBits * has_bits)232   static void set_has_write_wrap_count(HasBits* has_bits) {
233     (*has_bits)[0] |= 8u;
234   }
set_has_patches_succeeded(HasBits * has_bits)235   static void set_has_patches_succeeded(HasBits* has_bits) {
236     (*has_bits)[0] |= 16u;
237   }
set_has_patches_failed(HasBits * has_bits)238   static void set_has_patches_failed(HasBits* has_bits) {
239     (*has_bits)[0] |= 32u;
240   }
set_has_readaheads_succeeded(HasBits * has_bits)241   static void set_has_readaheads_succeeded(HasBits* has_bits) {
242     (*has_bits)[0] |= 64u;
243   }
set_has_readaheads_failed(HasBits * has_bits)244   static void set_has_readaheads_failed(HasBits* has_bits) {
245     (*has_bits)[0] |= 128u;
246   }
set_has_abi_violations(HasBits * has_bits)247   static void set_has_abi_violations(HasBits* has_bits) {
248     (*has_bits)[0] |= 256u;
249   }
set_has_trace_writer_packet_loss(HasBits * has_bits)250   static void set_has_trace_writer_packet_loss(HasBits* has_bits) {
251     (*has_bits)[0] |= 262144u;
252   }
253 };
254 
TraceStats_BufferStats(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)255 TraceStats_BufferStats::TraceStats_BufferStats(::PROTOBUF_NAMESPACE_ID::Arena* arena,
256                          bool is_message_owned)
257   : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
258   SharedCtor(arena, is_message_owned);
259   // @@protoc_insertion_point(arena_constructor:perfetto.protos.TraceStats.BufferStats)
260 }
TraceStats_BufferStats(const TraceStats_BufferStats & from)261 TraceStats_BufferStats::TraceStats_BufferStats(const TraceStats_BufferStats& from)
262   : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
263   TraceStats_BufferStats* const _this = this; (void)_this;
264   new (&_impl_) Impl_{
265       decltype(_impl_._has_bits_){from._impl_._has_bits_}
266     , /*decltype(_impl_._cached_size_)*/{}
267     , decltype(_impl_.bytes_written_){}
268     , decltype(_impl_.chunks_written_){}
269     , decltype(_impl_.chunks_overwritten_){}
270     , decltype(_impl_.write_wrap_count_){}
271     , decltype(_impl_.patches_succeeded_){}
272     , decltype(_impl_.patches_failed_){}
273     , decltype(_impl_.readaheads_succeeded_){}
274     , decltype(_impl_.readaheads_failed_){}
275     , decltype(_impl_.abi_violations_){}
276     , decltype(_impl_.chunks_rewritten_){}
277     , decltype(_impl_.chunks_committed_out_of_order_){}
278     , decltype(_impl_.buffer_size_){}
279     , decltype(_impl_.bytes_overwritten_){}
280     , decltype(_impl_.bytes_read_){}
281     , decltype(_impl_.padding_bytes_written_){}
282     , decltype(_impl_.padding_bytes_cleared_){}
283     , decltype(_impl_.chunks_read_){}
284     , decltype(_impl_.chunks_discarded_){}
285     , decltype(_impl_.trace_writer_packet_loss_){}};
286 
287   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
288   ::memcpy(&_impl_.bytes_written_, &from._impl_.bytes_written_,
289     static_cast<size_t>(reinterpret_cast<char*>(&_impl_.trace_writer_packet_loss_) -
290     reinterpret_cast<char*>(&_impl_.bytes_written_)) + sizeof(_impl_.trace_writer_packet_loss_));
291   // @@protoc_insertion_point(copy_constructor:perfetto.protos.TraceStats.BufferStats)
292 }
293 
SharedCtor(::_pb::Arena * arena,bool is_message_owned)294 inline void TraceStats_BufferStats::SharedCtor(
295     ::_pb::Arena* arena, bool is_message_owned) {
296   (void)arena;
297   (void)is_message_owned;
298   new (&_impl_) Impl_{
299       decltype(_impl_._has_bits_){}
300     , /*decltype(_impl_._cached_size_)*/{}
301     , decltype(_impl_.bytes_written_){::uint64_t{0u}}
302     , decltype(_impl_.chunks_written_){::uint64_t{0u}}
303     , decltype(_impl_.chunks_overwritten_){::uint64_t{0u}}
304     , decltype(_impl_.write_wrap_count_){::uint64_t{0u}}
305     , decltype(_impl_.patches_succeeded_){::uint64_t{0u}}
306     , decltype(_impl_.patches_failed_){::uint64_t{0u}}
307     , decltype(_impl_.readaheads_succeeded_){::uint64_t{0u}}
308     , decltype(_impl_.readaheads_failed_){::uint64_t{0u}}
309     , decltype(_impl_.abi_violations_){::uint64_t{0u}}
310     , decltype(_impl_.chunks_rewritten_){::uint64_t{0u}}
311     , decltype(_impl_.chunks_committed_out_of_order_){::uint64_t{0u}}
312     , decltype(_impl_.buffer_size_){::uint64_t{0u}}
313     , decltype(_impl_.bytes_overwritten_){::uint64_t{0u}}
314     , decltype(_impl_.bytes_read_){::uint64_t{0u}}
315     , decltype(_impl_.padding_bytes_written_){::uint64_t{0u}}
316     , decltype(_impl_.padding_bytes_cleared_){::uint64_t{0u}}
317     , decltype(_impl_.chunks_read_){::uint64_t{0u}}
318     , decltype(_impl_.chunks_discarded_){::uint64_t{0u}}
319     , decltype(_impl_.trace_writer_packet_loss_){::uint64_t{0u}}
320   };
321 }
322 
~TraceStats_BufferStats()323 TraceStats_BufferStats::~TraceStats_BufferStats() {
324   // @@protoc_insertion_point(destructor:perfetto.protos.TraceStats.BufferStats)
325   if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
326   (void)arena;
327     return;
328   }
329   SharedDtor();
330 }
331 
SharedDtor()332 inline void TraceStats_BufferStats::SharedDtor() {
333   GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
334 }
335 
SetCachedSize(int size) const336 void TraceStats_BufferStats::SetCachedSize(int size) const {
337   _impl_._cached_size_.Set(size);
338 }
339 
Clear()340 void TraceStats_BufferStats::Clear() {
341 // @@protoc_insertion_point(message_clear_start:perfetto.protos.TraceStats.BufferStats)
342   ::uint32_t cached_has_bits = 0;
343   // Prevent compiler warnings about cached_has_bits being unused
344   (void) cached_has_bits;
345 
346   cached_has_bits = _impl_._has_bits_[0];
347   if (cached_has_bits & 0x000000ffu) {
348     ::memset(&_impl_.bytes_written_, 0, static_cast<size_t>(
349         reinterpret_cast<char*>(&_impl_.readaheads_failed_) -
350         reinterpret_cast<char*>(&_impl_.bytes_written_)) + sizeof(_impl_.readaheads_failed_));
351   }
352   if (cached_has_bits & 0x0000ff00u) {
353     ::memset(&_impl_.abi_violations_, 0, static_cast<size_t>(
354         reinterpret_cast<char*>(&_impl_.padding_bytes_cleared_) -
355         reinterpret_cast<char*>(&_impl_.abi_violations_)) + sizeof(_impl_.padding_bytes_cleared_));
356   }
357   if (cached_has_bits & 0x00070000u) {
358     ::memset(&_impl_.chunks_read_, 0, static_cast<size_t>(
359         reinterpret_cast<char*>(&_impl_.trace_writer_packet_loss_) -
360         reinterpret_cast<char*>(&_impl_.chunks_read_)) + sizeof(_impl_.trace_writer_packet_loss_));
361   }
362   _impl_._has_bits_.Clear();
363   _internal_metadata_.Clear<std::string>();
364 }
365 
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)366 const char* TraceStats_BufferStats::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
367 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
368   _Internal::HasBits has_bits{};
369   while (!ctx->Done(&ptr)) {
370     ::uint32_t tag;
371     ptr = ::_pbi::ReadTag(ptr, &tag);
372     switch (tag >> 3) {
373       // optional uint64 bytes_written = 1;
374       case 1:
375         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
376           _Internal::set_has_bytes_written(&has_bits);
377           _impl_.bytes_written_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
378           CHK_(ptr);
379         } else {
380           goto handle_unusual;
381         }
382         continue;
383       // optional uint64 chunks_written = 2;
384       case 2:
385         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
386           _Internal::set_has_chunks_written(&has_bits);
387           _impl_.chunks_written_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
388           CHK_(ptr);
389         } else {
390           goto handle_unusual;
391         }
392         continue;
393       // optional uint64 chunks_overwritten = 3;
394       case 3:
395         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
396           _Internal::set_has_chunks_overwritten(&has_bits);
397           _impl_.chunks_overwritten_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
398           CHK_(ptr);
399         } else {
400           goto handle_unusual;
401         }
402         continue;
403       // optional uint64 write_wrap_count = 4;
404       case 4:
405         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
406           _Internal::set_has_write_wrap_count(&has_bits);
407           _impl_.write_wrap_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
408           CHK_(ptr);
409         } else {
410           goto handle_unusual;
411         }
412         continue;
413       // optional uint64 patches_succeeded = 5;
414       case 5:
415         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 40)) {
416           _Internal::set_has_patches_succeeded(&has_bits);
417           _impl_.patches_succeeded_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
418           CHK_(ptr);
419         } else {
420           goto handle_unusual;
421         }
422         continue;
423       // optional uint64 patches_failed = 6;
424       case 6:
425         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 48)) {
426           _Internal::set_has_patches_failed(&has_bits);
427           _impl_.patches_failed_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
428           CHK_(ptr);
429         } else {
430           goto handle_unusual;
431         }
432         continue;
433       // optional uint64 readaheads_succeeded = 7;
434       case 7:
435         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 56)) {
436           _Internal::set_has_readaheads_succeeded(&has_bits);
437           _impl_.readaheads_succeeded_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
438           CHK_(ptr);
439         } else {
440           goto handle_unusual;
441         }
442         continue;
443       // optional uint64 readaheads_failed = 8;
444       case 8:
445         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 64)) {
446           _Internal::set_has_readaheads_failed(&has_bits);
447           _impl_.readaheads_failed_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
448           CHK_(ptr);
449         } else {
450           goto handle_unusual;
451         }
452         continue;
453       // optional uint64 abi_violations = 9;
454       case 9:
455         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 72)) {
456           _Internal::set_has_abi_violations(&has_bits);
457           _impl_.abi_violations_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
458           CHK_(ptr);
459         } else {
460           goto handle_unusual;
461         }
462         continue;
463       // optional uint64 chunks_rewritten = 10;
464       case 10:
465         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 80)) {
466           _Internal::set_has_chunks_rewritten(&has_bits);
467           _impl_.chunks_rewritten_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
468           CHK_(ptr);
469         } else {
470           goto handle_unusual;
471         }
472         continue;
473       // optional uint64 chunks_committed_out_of_order = 11;
474       case 11:
475         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 88)) {
476           _Internal::set_has_chunks_committed_out_of_order(&has_bits);
477           _impl_.chunks_committed_out_of_order_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
478           CHK_(ptr);
479         } else {
480           goto handle_unusual;
481         }
482         continue;
483       // optional uint64 buffer_size = 12;
484       case 12:
485         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 96)) {
486           _Internal::set_has_buffer_size(&has_bits);
487           _impl_.buffer_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
488           CHK_(ptr);
489         } else {
490           goto handle_unusual;
491         }
492         continue;
493       // optional uint64 bytes_overwritten = 13;
494       case 13:
495         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 104)) {
496           _Internal::set_has_bytes_overwritten(&has_bits);
497           _impl_.bytes_overwritten_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
498           CHK_(ptr);
499         } else {
500           goto handle_unusual;
501         }
502         continue;
503       // optional uint64 bytes_read = 14;
504       case 14:
505         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 112)) {
506           _Internal::set_has_bytes_read(&has_bits);
507           _impl_.bytes_read_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
508           CHK_(ptr);
509         } else {
510           goto handle_unusual;
511         }
512         continue;
513       // optional uint64 padding_bytes_written = 15;
514       case 15:
515         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 120)) {
516           _Internal::set_has_padding_bytes_written(&has_bits);
517           _impl_.padding_bytes_written_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
518           CHK_(ptr);
519         } else {
520           goto handle_unusual;
521         }
522         continue;
523       // optional uint64 padding_bytes_cleared = 16;
524       case 16:
525         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 128)) {
526           _Internal::set_has_padding_bytes_cleared(&has_bits);
527           _impl_.padding_bytes_cleared_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
528           CHK_(ptr);
529         } else {
530           goto handle_unusual;
531         }
532         continue;
533       // optional uint64 chunks_read = 17;
534       case 17:
535         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 136)) {
536           _Internal::set_has_chunks_read(&has_bits);
537           _impl_.chunks_read_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
538           CHK_(ptr);
539         } else {
540           goto handle_unusual;
541         }
542         continue;
543       // optional uint64 chunks_discarded = 18;
544       case 18:
545         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 144)) {
546           _Internal::set_has_chunks_discarded(&has_bits);
547           _impl_.chunks_discarded_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
548           CHK_(ptr);
549         } else {
550           goto handle_unusual;
551         }
552         continue;
553       // optional uint64 trace_writer_packet_loss = 19;
554       case 19:
555         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 152)) {
556           _Internal::set_has_trace_writer_packet_loss(&has_bits);
557           _impl_.trace_writer_packet_loss_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
558           CHK_(ptr);
559         } else {
560           goto handle_unusual;
561         }
562         continue;
563       default:
564         goto handle_unusual;
565     }  // switch
566   handle_unusual:
567     if ((tag == 0) || ((tag & 7) == 4)) {
568       CHK_(ptr);
569       ctx->SetLastTag(tag);
570       goto message_done;
571     }
572     ptr = UnknownFieldParse(
573         tag,
574         _internal_metadata_.mutable_unknown_fields<std::string>(),
575         ptr, ctx);
576     CHK_(ptr != nullptr);
577   }  // while
578 message_done:
579   _impl_._has_bits_.Or(has_bits);
580   return ptr;
581 failure:
582   ptr = nullptr;
583   goto message_done;
584 #undef CHK_
585 }
586 
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const587 ::uint8_t* TraceStats_BufferStats::_InternalSerialize(
588     ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
589   // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.TraceStats.BufferStats)
590   ::uint32_t cached_has_bits = 0;
591   (void) cached_has_bits;
592 
593   cached_has_bits = _impl_._has_bits_[0];
594   // optional uint64 bytes_written = 1;
595   if (cached_has_bits & 0x00000001u) {
596     target = stream->EnsureSpace(target);
597     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_bytes_written(), target);
598   }
599 
600   // optional uint64 chunks_written = 2;
601   if (cached_has_bits & 0x00000002u) {
602     target = stream->EnsureSpace(target);
603     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(2, this->_internal_chunks_written(), target);
604   }
605 
606   // optional uint64 chunks_overwritten = 3;
607   if (cached_has_bits & 0x00000004u) {
608     target = stream->EnsureSpace(target);
609     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(3, this->_internal_chunks_overwritten(), target);
610   }
611 
612   // optional uint64 write_wrap_count = 4;
613   if (cached_has_bits & 0x00000008u) {
614     target = stream->EnsureSpace(target);
615     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(4, this->_internal_write_wrap_count(), target);
616   }
617 
618   // optional uint64 patches_succeeded = 5;
619   if (cached_has_bits & 0x00000010u) {
620     target = stream->EnsureSpace(target);
621     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(5, this->_internal_patches_succeeded(), target);
622   }
623 
624   // optional uint64 patches_failed = 6;
625   if (cached_has_bits & 0x00000020u) {
626     target = stream->EnsureSpace(target);
627     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(6, this->_internal_patches_failed(), target);
628   }
629 
630   // optional uint64 readaheads_succeeded = 7;
631   if (cached_has_bits & 0x00000040u) {
632     target = stream->EnsureSpace(target);
633     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(7, this->_internal_readaheads_succeeded(), target);
634   }
635 
636   // optional uint64 readaheads_failed = 8;
637   if (cached_has_bits & 0x00000080u) {
638     target = stream->EnsureSpace(target);
639     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(8, this->_internal_readaheads_failed(), target);
640   }
641 
642   // optional uint64 abi_violations = 9;
643   if (cached_has_bits & 0x00000100u) {
644     target = stream->EnsureSpace(target);
645     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(9, this->_internal_abi_violations(), target);
646   }
647 
648   // optional uint64 chunks_rewritten = 10;
649   if (cached_has_bits & 0x00000200u) {
650     target = stream->EnsureSpace(target);
651     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(10, this->_internal_chunks_rewritten(), target);
652   }
653 
654   // optional uint64 chunks_committed_out_of_order = 11;
655   if (cached_has_bits & 0x00000400u) {
656     target = stream->EnsureSpace(target);
657     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(11, this->_internal_chunks_committed_out_of_order(), target);
658   }
659 
660   // optional uint64 buffer_size = 12;
661   if (cached_has_bits & 0x00000800u) {
662     target = stream->EnsureSpace(target);
663     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(12, this->_internal_buffer_size(), target);
664   }
665 
666   // optional uint64 bytes_overwritten = 13;
667   if (cached_has_bits & 0x00001000u) {
668     target = stream->EnsureSpace(target);
669     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(13, this->_internal_bytes_overwritten(), target);
670   }
671 
672   // optional uint64 bytes_read = 14;
673   if (cached_has_bits & 0x00002000u) {
674     target = stream->EnsureSpace(target);
675     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(14, this->_internal_bytes_read(), target);
676   }
677 
678   // optional uint64 padding_bytes_written = 15;
679   if (cached_has_bits & 0x00004000u) {
680     target = stream->EnsureSpace(target);
681     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(15, this->_internal_padding_bytes_written(), target);
682   }
683 
684   // optional uint64 padding_bytes_cleared = 16;
685   if (cached_has_bits & 0x00008000u) {
686     target = stream->EnsureSpace(target);
687     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(16, this->_internal_padding_bytes_cleared(), target);
688   }
689 
690   // optional uint64 chunks_read = 17;
691   if (cached_has_bits & 0x00010000u) {
692     target = stream->EnsureSpace(target);
693     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(17, this->_internal_chunks_read(), target);
694   }
695 
696   // optional uint64 chunks_discarded = 18;
697   if (cached_has_bits & 0x00020000u) {
698     target = stream->EnsureSpace(target);
699     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(18, this->_internal_chunks_discarded(), target);
700   }
701 
702   // optional uint64 trace_writer_packet_loss = 19;
703   if (cached_has_bits & 0x00040000u) {
704     target = stream->EnsureSpace(target);
705     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(19, this->_internal_trace_writer_packet_loss(), target);
706   }
707 
708   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
709     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
710         static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
711   }
712   // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.TraceStats.BufferStats)
713   return target;
714 }
715 
ByteSizeLong() const716 size_t TraceStats_BufferStats::ByteSizeLong() const {
717 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.TraceStats.BufferStats)
718   size_t total_size = 0;
719 
720   ::uint32_t cached_has_bits = 0;
721   // Prevent compiler warnings about cached_has_bits being unused
722   (void) cached_has_bits;
723 
724   cached_has_bits = _impl_._has_bits_[0];
725   if (cached_has_bits & 0x000000ffu) {
726     // optional uint64 bytes_written = 1;
727     if (cached_has_bits & 0x00000001u) {
728       total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_bytes_written());
729     }
730 
731     // optional uint64 chunks_written = 2;
732     if (cached_has_bits & 0x00000002u) {
733       total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_chunks_written());
734     }
735 
736     // optional uint64 chunks_overwritten = 3;
737     if (cached_has_bits & 0x00000004u) {
738       total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_chunks_overwritten());
739     }
740 
741     // optional uint64 write_wrap_count = 4;
742     if (cached_has_bits & 0x00000008u) {
743       total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_write_wrap_count());
744     }
745 
746     // optional uint64 patches_succeeded = 5;
747     if (cached_has_bits & 0x00000010u) {
748       total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_patches_succeeded());
749     }
750 
751     // optional uint64 patches_failed = 6;
752     if (cached_has_bits & 0x00000020u) {
753       total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_patches_failed());
754     }
755 
756     // optional uint64 readaheads_succeeded = 7;
757     if (cached_has_bits & 0x00000040u) {
758       total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_readaheads_succeeded());
759     }
760 
761     // optional uint64 readaheads_failed = 8;
762     if (cached_has_bits & 0x00000080u) {
763       total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_readaheads_failed());
764     }
765 
766   }
767   if (cached_has_bits & 0x0000ff00u) {
768     // optional uint64 abi_violations = 9;
769     if (cached_has_bits & 0x00000100u) {
770       total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_abi_violations());
771     }
772 
773     // optional uint64 chunks_rewritten = 10;
774     if (cached_has_bits & 0x00000200u) {
775       total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_chunks_rewritten());
776     }
777 
778     // optional uint64 chunks_committed_out_of_order = 11;
779     if (cached_has_bits & 0x00000400u) {
780       total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_chunks_committed_out_of_order());
781     }
782 
783     // optional uint64 buffer_size = 12;
784     if (cached_has_bits & 0x00000800u) {
785       total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_buffer_size());
786     }
787 
788     // optional uint64 bytes_overwritten = 13;
789     if (cached_has_bits & 0x00001000u) {
790       total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_bytes_overwritten());
791     }
792 
793     // optional uint64 bytes_read = 14;
794     if (cached_has_bits & 0x00002000u) {
795       total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_bytes_read());
796     }
797 
798     // optional uint64 padding_bytes_written = 15;
799     if (cached_has_bits & 0x00004000u) {
800       total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_padding_bytes_written());
801     }
802 
803     // optional uint64 padding_bytes_cleared = 16;
804     if (cached_has_bits & 0x00008000u) {
805       total_size += 2 +
806         ::_pbi::WireFormatLite::UInt64Size(
807           this->_internal_padding_bytes_cleared());
808     }
809 
810   }
811   if (cached_has_bits & 0x00070000u) {
812     // optional uint64 chunks_read = 17;
813     if (cached_has_bits & 0x00010000u) {
814       total_size += 2 +
815         ::_pbi::WireFormatLite::UInt64Size(
816           this->_internal_chunks_read());
817     }
818 
819     // optional uint64 chunks_discarded = 18;
820     if (cached_has_bits & 0x00020000u) {
821       total_size += 2 +
822         ::_pbi::WireFormatLite::UInt64Size(
823           this->_internal_chunks_discarded());
824     }
825 
826     // optional uint64 trace_writer_packet_loss = 19;
827     if (cached_has_bits & 0x00040000u) {
828       total_size += 2 +
829         ::_pbi::WireFormatLite::UInt64Size(
830           this->_internal_trace_writer_packet_loss());
831     }
832 
833   }
834   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
835     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
836   }
837   int cached_size = ::_pbi::ToCachedSize(total_size);
838   SetCachedSize(cached_size);
839   return total_size;
840 }
841 
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)842 void TraceStats_BufferStats::CheckTypeAndMergeFrom(
843     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
844   MergeFrom(*::_pbi::DownCast<const TraceStats_BufferStats*>(
845       &from));
846 }
847 
MergeFrom(const TraceStats_BufferStats & from)848 void TraceStats_BufferStats::MergeFrom(const TraceStats_BufferStats& from) {
849   TraceStats_BufferStats* const _this = this;
850   // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.TraceStats.BufferStats)
851   GOOGLE_DCHECK_NE(&from, _this);
852   ::uint32_t cached_has_bits = 0;
853   (void) cached_has_bits;
854 
855   cached_has_bits = from._impl_._has_bits_[0];
856   if (cached_has_bits & 0x000000ffu) {
857     if (cached_has_bits & 0x00000001u) {
858       _this->_impl_.bytes_written_ = from._impl_.bytes_written_;
859     }
860     if (cached_has_bits & 0x00000002u) {
861       _this->_impl_.chunks_written_ = from._impl_.chunks_written_;
862     }
863     if (cached_has_bits & 0x00000004u) {
864       _this->_impl_.chunks_overwritten_ = from._impl_.chunks_overwritten_;
865     }
866     if (cached_has_bits & 0x00000008u) {
867       _this->_impl_.write_wrap_count_ = from._impl_.write_wrap_count_;
868     }
869     if (cached_has_bits & 0x00000010u) {
870       _this->_impl_.patches_succeeded_ = from._impl_.patches_succeeded_;
871     }
872     if (cached_has_bits & 0x00000020u) {
873       _this->_impl_.patches_failed_ = from._impl_.patches_failed_;
874     }
875     if (cached_has_bits & 0x00000040u) {
876       _this->_impl_.readaheads_succeeded_ = from._impl_.readaheads_succeeded_;
877     }
878     if (cached_has_bits & 0x00000080u) {
879       _this->_impl_.readaheads_failed_ = from._impl_.readaheads_failed_;
880     }
881     _this->_impl_._has_bits_[0] |= cached_has_bits;
882   }
883   if (cached_has_bits & 0x0000ff00u) {
884     if (cached_has_bits & 0x00000100u) {
885       _this->_impl_.abi_violations_ = from._impl_.abi_violations_;
886     }
887     if (cached_has_bits & 0x00000200u) {
888       _this->_impl_.chunks_rewritten_ = from._impl_.chunks_rewritten_;
889     }
890     if (cached_has_bits & 0x00000400u) {
891       _this->_impl_.chunks_committed_out_of_order_ = from._impl_.chunks_committed_out_of_order_;
892     }
893     if (cached_has_bits & 0x00000800u) {
894       _this->_impl_.buffer_size_ = from._impl_.buffer_size_;
895     }
896     if (cached_has_bits & 0x00001000u) {
897       _this->_impl_.bytes_overwritten_ = from._impl_.bytes_overwritten_;
898     }
899     if (cached_has_bits & 0x00002000u) {
900       _this->_impl_.bytes_read_ = from._impl_.bytes_read_;
901     }
902     if (cached_has_bits & 0x00004000u) {
903       _this->_impl_.padding_bytes_written_ = from._impl_.padding_bytes_written_;
904     }
905     if (cached_has_bits & 0x00008000u) {
906       _this->_impl_.padding_bytes_cleared_ = from._impl_.padding_bytes_cleared_;
907     }
908     _this->_impl_._has_bits_[0] |= cached_has_bits;
909   }
910   if (cached_has_bits & 0x00070000u) {
911     if (cached_has_bits & 0x00010000u) {
912       _this->_impl_.chunks_read_ = from._impl_.chunks_read_;
913     }
914     if (cached_has_bits & 0x00020000u) {
915       _this->_impl_.chunks_discarded_ = from._impl_.chunks_discarded_;
916     }
917     if (cached_has_bits & 0x00040000u) {
918       _this->_impl_.trace_writer_packet_loss_ = from._impl_.trace_writer_packet_loss_;
919     }
920     _this->_impl_._has_bits_[0] |= cached_has_bits;
921   }
922   _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
923 }
924 
CopyFrom(const TraceStats_BufferStats & from)925 void TraceStats_BufferStats::CopyFrom(const TraceStats_BufferStats& from) {
926 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.TraceStats.BufferStats)
927   if (&from == this) return;
928   Clear();
929   MergeFrom(from);
930 }
931 
IsInitialized() const932 bool TraceStats_BufferStats::IsInitialized() const {
933   return true;
934 }
935 
InternalSwap(TraceStats_BufferStats * other)936 void TraceStats_BufferStats::InternalSwap(TraceStats_BufferStats* other) {
937   using std::swap;
938   _internal_metadata_.InternalSwap(&other->_internal_metadata_);
939   swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
940   ::PROTOBUF_NAMESPACE_ID::internal::memswap<
941       PROTOBUF_FIELD_OFFSET(TraceStats_BufferStats, _impl_.trace_writer_packet_loss_)
942       + sizeof(TraceStats_BufferStats::_impl_.trace_writer_packet_loss_)  // NOLINT
943       - PROTOBUF_FIELD_OFFSET(TraceStats_BufferStats, _impl_.bytes_written_)>(
944           reinterpret_cast<char*>(&_impl_.bytes_written_),
945           reinterpret_cast<char*>(&other->_impl_.bytes_written_));
946 }
947 
GetTypeName() const948 std::string TraceStats_BufferStats::GetTypeName() const {
949   return "perfetto.protos.TraceStats.BufferStats";
950 }
951 
952 
953 // ===================================================================
954 
955 class TraceStats_WriterStats::_Internal {
956  public:
957   using HasBits = decltype(std::declval<TraceStats_WriterStats>()._impl_._has_bits_);
set_has_sequence_id(HasBits * has_bits)958   static void set_has_sequence_id(HasBits* has_bits) {
959     (*has_bits)[0] |= 1u;
960   }
set_has_buffer(HasBits * has_bits)961   static void set_has_buffer(HasBits* has_bits) {
962     (*has_bits)[0] |= 2u;
963   }
964 };
965 
TraceStats_WriterStats(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)966 TraceStats_WriterStats::TraceStats_WriterStats(::PROTOBUF_NAMESPACE_ID::Arena* arena,
967                          bool is_message_owned)
968   : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
969   SharedCtor(arena, is_message_owned);
970   // @@protoc_insertion_point(arena_constructor:perfetto.protos.TraceStats.WriterStats)
971 }
TraceStats_WriterStats(const TraceStats_WriterStats & from)972 TraceStats_WriterStats::TraceStats_WriterStats(const TraceStats_WriterStats& from)
973   : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
974   TraceStats_WriterStats* const _this = this; (void)_this;
975   new (&_impl_) Impl_{
976       decltype(_impl_._has_bits_){from._impl_._has_bits_}
977     , /*decltype(_impl_._cached_size_)*/{}
978     , decltype(_impl_.chunk_payload_histogram_counts_){from._impl_.chunk_payload_histogram_counts_}
979     , /*decltype(_impl_._chunk_payload_histogram_counts_cached_byte_size_)*/{0}
980     , decltype(_impl_.chunk_payload_histogram_sum_){from._impl_.chunk_payload_histogram_sum_}
981     , /*decltype(_impl_._chunk_payload_histogram_sum_cached_byte_size_)*/{0}
982     , decltype(_impl_.sequence_id_){}
983     , decltype(_impl_.buffer_){}};
984 
985   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
986   ::memcpy(&_impl_.sequence_id_, &from._impl_.sequence_id_,
987     static_cast<size_t>(reinterpret_cast<char*>(&_impl_.buffer_) -
988     reinterpret_cast<char*>(&_impl_.sequence_id_)) + sizeof(_impl_.buffer_));
989   // @@protoc_insertion_point(copy_constructor:perfetto.protos.TraceStats.WriterStats)
990 }
991 
SharedCtor(::_pb::Arena * arena,bool is_message_owned)992 inline void TraceStats_WriterStats::SharedCtor(
993     ::_pb::Arena* arena, bool is_message_owned) {
994   (void)arena;
995   (void)is_message_owned;
996   new (&_impl_) Impl_{
997       decltype(_impl_._has_bits_){}
998     , /*decltype(_impl_._cached_size_)*/{}
999     , decltype(_impl_.chunk_payload_histogram_counts_){arena}
1000     , /*decltype(_impl_._chunk_payload_histogram_counts_cached_byte_size_)*/{0}
1001     , decltype(_impl_.chunk_payload_histogram_sum_){arena}
1002     , /*decltype(_impl_._chunk_payload_histogram_sum_cached_byte_size_)*/{0}
1003     , decltype(_impl_.sequence_id_){::uint64_t{0u}}
1004     , decltype(_impl_.buffer_){0u}
1005   };
1006 }
1007 
~TraceStats_WriterStats()1008 TraceStats_WriterStats::~TraceStats_WriterStats() {
1009   // @@protoc_insertion_point(destructor:perfetto.protos.TraceStats.WriterStats)
1010   if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
1011   (void)arena;
1012     return;
1013   }
1014   SharedDtor();
1015 }
1016 
SharedDtor()1017 inline void TraceStats_WriterStats::SharedDtor() {
1018   GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
1019   _impl_.chunk_payload_histogram_counts_.~RepeatedField();
1020   _impl_.chunk_payload_histogram_sum_.~RepeatedField();
1021 }
1022 
SetCachedSize(int size) const1023 void TraceStats_WriterStats::SetCachedSize(int size) const {
1024   _impl_._cached_size_.Set(size);
1025 }
1026 
Clear()1027 void TraceStats_WriterStats::Clear() {
1028 // @@protoc_insertion_point(message_clear_start:perfetto.protos.TraceStats.WriterStats)
1029   ::uint32_t cached_has_bits = 0;
1030   // Prevent compiler warnings about cached_has_bits being unused
1031   (void) cached_has_bits;
1032 
1033   _impl_.chunk_payload_histogram_counts_.Clear();
1034   _impl_.chunk_payload_histogram_sum_.Clear();
1035   cached_has_bits = _impl_._has_bits_[0];
1036   if (cached_has_bits & 0x00000003u) {
1037     ::memset(&_impl_.sequence_id_, 0, static_cast<size_t>(
1038         reinterpret_cast<char*>(&_impl_.buffer_) -
1039         reinterpret_cast<char*>(&_impl_.sequence_id_)) + sizeof(_impl_.buffer_));
1040   }
1041   _impl_._has_bits_.Clear();
1042   _internal_metadata_.Clear<std::string>();
1043 }
1044 
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)1045 const char* TraceStats_WriterStats::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
1046 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
1047   _Internal::HasBits has_bits{};
1048   while (!ctx->Done(&ptr)) {
1049     ::uint32_t tag;
1050     ptr = ::_pbi::ReadTag(ptr, &tag);
1051     switch (tag >> 3) {
1052       // optional uint64 sequence_id = 1;
1053       case 1:
1054         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
1055           _Internal::set_has_sequence_id(&has_bits);
1056           _impl_.sequence_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
1057           CHK_(ptr);
1058         } else {
1059           goto handle_unusual;
1060         }
1061         continue;
1062       // repeated uint64 chunk_payload_histogram_counts = 2 [packed = true];
1063       case 2:
1064         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
1065           ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt64Parser(_internal_mutable_chunk_payload_histogram_counts(), ptr, ctx);
1066           CHK_(ptr);
1067         } else if (static_cast<::uint8_t>(tag) == 16) {
1068           _internal_add_chunk_payload_histogram_counts(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
1069           CHK_(ptr);
1070         } else {
1071           goto handle_unusual;
1072         }
1073         continue;
1074       // repeated int64 chunk_payload_histogram_sum = 3 [packed = true];
1075       case 3:
1076         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 26)) {
1077           ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt64Parser(_internal_mutable_chunk_payload_histogram_sum(), ptr, ctx);
1078           CHK_(ptr);
1079         } else if (static_cast<::uint8_t>(tag) == 24) {
1080           _internal_add_chunk_payload_histogram_sum(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
1081           CHK_(ptr);
1082         } else {
1083           goto handle_unusual;
1084         }
1085         continue;
1086       // optional uint32 buffer = 4;
1087       case 4:
1088         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
1089           _Internal::set_has_buffer(&has_bits);
1090           _impl_.buffer_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
1091           CHK_(ptr);
1092         } else {
1093           goto handle_unusual;
1094         }
1095         continue;
1096       default:
1097         goto handle_unusual;
1098     }  // switch
1099   handle_unusual:
1100     if ((tag == 0) || ((tag & 7) == 4)) {
1101       CHK_(ptr);
1102       ctx->SetLastTag(tag);
1103       goto message_done;
1104     }
1105     ptr = UnknownFieldParse(
1106         tag,
1107         _internal_metadata_.mutable_unknown_fields<std::string>(),
1108         ptr, ctx);
1109     CHK_(ptr != nullptr);
1110   }  // while
1111 message_done:
1112   _impl_._has_bits_.Or(has_bits);
1113   return ptr;
1114 failure:
1115   ptr = nullptr;
1116   goto message_done;
1117 #undef CHK_
1118 }
1119 
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const1120 ::uint8_t* TraceStats_WriterStats::_InternalSerialize(
1121     ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
1122   // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.TraceStats.WriterStats)
1123   ::uint32_t cached_has_bits = 0;
1124   (void) cached_has_bits;
1125 
1126   cached_has_bits = _impl_._has_bits_[0];
1127   // optional uint64 sequence_id = 1;
1128   if (cached_has_bits & 0x00000001u) {
1129     target = stream->EnsureSpace(target);
1130     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_sequence_id(), target);
1131   }
1132 
1133   // repeated uint64 chunk_payload_histogram_counts = 2 [packed = true];
1134   {
1135     int byte_size = _impl_._chunk_payload_histogram_counts_cached_byte_size_.load(std::memory_order_relaxed);
1136     if (byte_size > 0) {
1137       target = stream->WriteUInt64Packed(
1138           2, _internal_chunk_payload_histogram_counts(), byte_size, target);
1139     }
1140   }
1141 
1142   // repeated int64 chunk_payload_histogram_sum = 3 [packed = true];
1143   {
1144     int byte_size = _impl_._chunk_payload_histogram_sum_cached_byte_size_.load(std::memory_order_relaxed);
1145     if (byte_size > 0) {
1146       target = stream->WriteInt64Packed(
1147           3, _internal_chunk_payload_histogram_sum(), byte_size, target);
1148     }
1149   }
1150 
1151   // optional uint32 buffer = 4;
1152   if (cached_has_bits & 0x00000002u) {
1153     target = stream->EnsureSpace(target);
1154     target = ::_pbi::WireFormatLite::WriteUInt32ToArray(4, this->_internal_buffer(), target);
1155   }
1156 
1157   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1158     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
1159         static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
1160   }
1161   // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.TraceStats.WriterStats)
1162   return target;
1163 }
1164 
ByteSizeLong() const1165 size_t TraceStats_WriterStats::ByteSizeLong() const {
1166 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.TraceStats.WriterStats)
1167   size_t total_size = 0;
1168 
1169   ::uint32_t cached_has_bits = 0;
1170   // Prevent compiler warnings about cached_has_bits being unused
1171   (void) cached_has_bits;
1172 
1173   // repeated uint64 chunk_payload_histogram_counts = 2 [packed = true];
1174   {
1175     size_t data_size = ::_pbi::WireFormatLite::
1176       UInt64Size(this->_impl_.chunk_payload_histogram_counts_);
1177     if (data_size > 0) {
1178       total_size += 1 +
1179         ::_pbi::WireFormatLite::Int32Size(static_cast<::int32_t>(data_size));
1180     }
1181     int cached_size = ::_pbi::ToCachedSize(data_size);
1182     _impl_._chunk_payload_histogram_counts_cached_byte_size_.store(cached_size,
1183                                     std::memory_order_relaxed);
1184     total_size += data_size;
1185   }
1186 
1187   // repeated int64 chunk_payload_histogram_sum = 3 [packed = true];
1188   {
1189     size_t data_size = ::_pbi::WireFormatLite::
1190       Int64Size(this->_impl_.chunk_payload_histogram_sum_);
1191     if (data_size > 0) {
1192       total_size += 1 +
1193         ::_pbi::WireFormatLite::Int32Size(static_cast<::int32_t>(data_size));
1194     }
1195     int cached_size = ::_pbi::ToCachedSize(data_size);
1196     _impl_._chunk_payload_histogram_sum_cached_byte_size_.store(cached_size,
1197                                     std::memory_order_relaxed);
1198     total_size += data_size;
1199   }
1200 
1201   cached_has_bits = _impl_._has_bits_[0];
1202   if (cached_has_bits & 0x00000003u) {
1203     // optional uint64 sequence_id = 1;
1204     if (cached_has_bits & 0x00000001u) {
1205       total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_sequence_id());
1206     }
1207 
1208     // optional uint32 buffer = 4;
1209     if (cached_has_bits & 0x00000002u) {
1210       total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_buffer());
1211     }
1212 
1213   }
1214   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1215     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
1216   }
1217   int cached_size = ::_pbi::ToCachedSize(total_size);
1218   SetCachedSize(cached_size);
1219   return total_size;
1220 }
1221 
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)1222 void TraceStats_WriterStats::CheckTypeAndMergeFrom(
1223     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
1224   MergeFrom(*::_pbi::DownCast<const TraceStats_WriterStats*>(
1225       &from));
1226 }
1227 
MergeFrom(const TraceStats_WriterStats & from)1228 void TraceStats_WriterStats::MergeFrom(const TraceStats_WriterStats& from) {
1229   TraceStats_WriterStats* const _this = this;
1230   // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.TraceStats.WriterStats)
1231   GOOGLE_DCHECK_NE(&from, _this);
1232   ::uint32_t cached_has_bits = 0;
1233   (void) cached_has_bits;
1234 
1235   _this->_impl_.chunk_payload_histogram_counts_.MergeFrom(from._impl_.chunk_payload_histogram_counts_);
1236   _this->_impl_.chunk_payload_histogram_sum_.MergeFrom(from._impl_.chunk_payload_histogram_sum_);
1237   cached_has_bits = from._impl_._has_bits_[0];
1238   if (cached_has_bits & 0x00000003u) {
1239     if (cached_has_bits & 0x00000001u) {
1240       _this->_impl_.sequence_id_ = from._impl_.sequence_id_;
1241     }
1242     if (cached_has_bits & 0x00000002u) {
1243       _this->_impl_.buffer_ = from._impl_.buffer_;
1244     }
1245     _this->_impl_._has_bits_[0] |= cached_has_bits;
1246   }
1247   _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1248 }
1249 
CopyFrom(const TraceStats_WriterStats & from)1250 void TraceStats_WriterStats::CopyFrom(const TraceStats_WriterStats& from) {
1251 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.TraceStats.WriterStats)
1252   if (&from == this) return;
1253   Clear();
1254   MergeFrom(from);
1255 }
1256 
IsInitialized() const1257 bool TraceStats_WriterStats::IsInitialized() const {
1258   return true;
1259 }
1260 
InternalSwap(TraceStats_WriterStats * other)1261 void TraceStats_WriterStats::InternalSwap(TraceStats_WriterStats* other) {
1262   using std::swap;
1263   _internal_metadata_.InternalSwap(&other->_internal_metadata_);
1264   swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
1265   _impl_.chunk_payload_histogram_counts_.InternalSwap(&other->_impl_.chunk_payload_histogram_counts_);
1266   _impl_.chunk_payload_histogram_sum_.InternalSwap(&other->_impl_.chunk_payload_histogram_sum_);
1267   ::PROTOBUF_NAMESPACE_ID::internal::memswap<
1268       PROTOBUF_FIELD_OFFSET(TraceStats_WriterStats, _impl_.buffer_)
1269       + sizeof(TraceStats_WriterStats::_impl_.buffer_)  // NOLINT
1270       - PROTOBUF_FIELD_OFFSET(TraceStats_WriterStats, _impl_.sequence_id_)>(
1271           reinterpret_cast<char*>(&_impl_.sequence_id_),
1272           reinterpret_cast<char*>(&other->_impl_.sequence_id_));
1273 }
1274 
GetTypeName() const1275 std::string TraceStats_WriterStats::GetTypeName() const {
1276   return "perfetto.protos.TraceStats.WriterStats";
1277 }
1278 
1279 
1280 // ===================================================================
1281 
1282 class TraceStats_FilterStats::_Internal {
1283  public:
1284   using HasBits = decltype(std::declval<TraceStats_FilterStats>()._impl_._has_bits_);
set_has_input_packets(HasBits * has_bits)1285   static void set_has_input_packets(HasBits* has_bits) {
1286     (*has_bits)[0] |= 1u;
1287   }
set_has_input_bytes(HasBits * has_bits)1288   static void set_has_input_bytes(HasBits* has_bits) {
1289     (*has_bits)[0] |= 2u;
1290   }
set_has_output_bytes(HasBits * has_bits)1291   static void set_has_output_bytes(HasBits* has_bits) {
1292     (*has_bits)[0] |= 4u;
1293   }
set_has_errors(HasBits * has_bits)1294   static void set_has_errors(HasBits* has_bits) {
1295     (*has_bits)[0] |= 8u;
1296   }
set_has_time_taken_ns(HasBits * has_bits)1297   static void set_has_time_taken_ns(HasBits* has_bits) {
1298     (*has_bits)[0] |= 16u;
1299   }
1300 };
1301 
TraceStats_FilterStats(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)1302 TraceStats_FilterStats::TraceStats_FilterStats(::PROTOBUF_NAMESPACE_ID::Arena* arena,
1303                          bool is_message_owned)
1304   : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
1305   SharedCtor(arena, is_message_owned);
1306   // @@protoc_insertion_point(arena_constructor:perfetto.protos.TraceStats.FilterStats)
1307 }
TraceStats_FilterStats(const TraceStats_FilterStats & from)1308 TraceStats_FilterStats::TraceStats_FilterStats(const TraceStats_FilterStats& from)
1309   : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
1310   TraceStats_FilterStats* const _this = this; (void)_this;
1311   new (&_impl_) Impl_{
1312       decltype(_impl_._has_bits_){from._impl_._has_bits_}
1313     , /*decltype(_impl_._cached_size_)*/{}
1314     , decltype(_impl_.bytes_discarded_per_buffer_){from._impl_.bytes_discarded_per_buffer_}
1315     , decltype(_impl_.input_packets_){}
1316     , decltype(_impl_.input_bytes_){}
1317     , decltype(_impl_.output_bytes_){}
1318     , decltype(_impl_.errors_){}
1319     , decltype(_impl_.time_taken_ns_){}};
1320 
1321   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1322   ::memcpy(&_impl_.input_packets_, &from._impl_.input_packets_,
1323     static_cast<size_t>(reinterpret_cast<char*>(&_impl_.time_taken_ns_) -
1324     reinterpret_cast<char*>(&_impl_.input_packets_)) + sizeof(_impl_.time_taken_ns_));
1325   // @@protoc_insertion_point(copy_constructor:perfetto.protos.TraceStats.FilterStats)
1326 }
1327 
SharedCtor(::_pb::Arena * arena,bool is_message_owned)1328 inline void TraceStats_FilterStats::SharedCtor(
1329     ::_pb::Arena* arena, bool is_message_owned) {
1330   (void)arena;
1331   (void)is_message_owned;
1332   new (&_impl_) Impl_{
1333       decltype(_impl_._has_bits_){}
1334     , /*decltype(_impl_._cached_size_)*/{}
1335     , decltype(_impl_.bytes_discarded_per_buffer_){arena}
1336     , decltype(_impl_.input_packets_){::uint64_t{0u}}
1337     , decltype(_impl_.input_bytes_){::uint64_t{0u}}
1338     , decltype(_impl_.output_bytes_){::uint64_t{0u}}
1339     , decltype(_impl_.errors_){::uint64_t{0u}}
1340     , decltype(_impl_.time_taken_ns_){::uint64_t{0u}}
1341   };
1342 }
1343 
~TraceStats_FilterStats()1344 TraceStats_FilterStats::~TraceStats_FilterStats() {
1345   // @@protoc_insertion_point(destructor:perfetto.protos.TraceStats.FilterStats)
1346   if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
1347   (void)arena;
1348     return;
1349   }
1350   SharedDtor();
1351 }
1352 
SharedDtor()1353 inline void TraceStats_FilterStats::SharedDtor() {
1354   GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
1355   _impl_.bytes_discarded_per_buffer_.~RepeatedField();
1356 }
1357 
SetCachedSize(int size) const1358 void TraceStats_FilterStats::SetCachedSize(int size) const {
1359   _impl_._cached_size_.Set(size);
1360 }
1361 
Clear()1362 void TraceStats_FilterStats::Clear() {
1363 // @@protoc_insertion_point(message_clear_start:perfetto.protos.TraceStats.FilterStats)
1364   ::uint32_t cached_has_bits = 0;
1365   // Prevent compiler warnings about cached_has_bits being unused
1366   (void) cached_has_bits;
1367 
1368   _impl_.bytes_discarded_per_buffer_.Clear();
1369   cached_has_bits = _impl_._has_bits_[0];
1370   if (cached_has_bits & 0x0000001fu) {
1371     ::memset(&_impl_.input_packets_, 0, static_cast<size_t>(
1372         reinterpret_cast<char*>(&_impl_.time_taken_ns_) -
1373         reinterpret_cast<char*>(&_impl_.input_packets_)) + sizeof(_impl_.time_taken_ns_));
1374   }
1375   _impl_._has_bits_.Clear();
1376   _internal_metadata_.Clear<std::string>();
1377 }
1378 
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)1379 const char* TraceStats_FilterStats::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
1380 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
1381   _Internal::HasBits has_bits{};
1382   while (!ctx->Done(&ptr)) {
1383     ::uint32_t tag;
1384     ptr = ::_pbi::ReadTag(ptr, &tag);
1385     switch (tag >> 3) {
1386       // optional uint64 input_packets = 1;
1387       case 1:
1388         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
1389           _Internal::set_has_input_packets(&has_bits);
1390           _impl_.input_packets_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
1391           CHK_(ptr);
1392         } else {
1393           goto handle_unusual;
1394         }
1395         continue;
1396       // optional uint64 input_bytes = 2;
1397       case 2:
1398         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
1399           _Internal::set_has_input_bytes(&has_bits);
1400           _impl_.input_bytes_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
1401           CHK_(ptr);
1402         } else {
1403           goto handle_unusual;
1404         }
1405         continue;
1406       // optional uint64 output_bytes = 3;
1407       case 3:
1408         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
1409           _Internal::set_has_output_bytes(&has_bits);
1410           _impl_.output_bytes_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
1411           CHK_(ptr);
1412         } else {
1413           goto handle_unusual;
1414         }
1415         continue;
1416       // optional uint64 errors = 4;
1417       case 4:
1418         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
1419           _Internal::set_has_errors(&has_bits);
1420           _impl_.errors_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
1421           CHK_(ptr);
1422         } else {
1423           goto handle_unusual;
1424         }
1425         continue;
1426       // optional uint64 time_taken_ns = 5;
1427       case 5:
1428         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 40)) {
1429           _Internal::set_has_time_taken_ns(&has_bits);
1430           _impl_.time_taken_ns_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
1431           CHK_(ptr);
1432         } else {
1433           goto handle_unusual;
1434         }
1435         continue;
1436       // repeated uint64 bytes_discarded_per_buffer = 20;
1437       case 20:
1438         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 160)) {
1439           ptr -= 2;
1440           do {
1441             ptr += 2;
1442             _internal_add_bytes_discarded_per_buffer(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
1443             CHK_(ptr);
1444             if (!ctx->DataAvailable(ptr)) break;
1445           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<160>(ptr));
1446         } else if (static_cast<::uint8_t>(tag) == 162) {
1447           ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt64Parser(_internal_mutable_bytes_discarded_per_buffer(), ptr, ctx);
1448           CHK_(ptr);
1449         } else {
1450           goto handle_unusual;
1451         }
1452         continue;
1453       default:
1454         goto handle_unusual;
1455     }  // switch
1456   handle_unusual:
1457     if ((tag == 0) || ((tag & 7) == 4)) {
1458       CHK_(ptr);
1459       ctx->SetLastTag(tag);
1460       goto message_done;
1461     }
1462     ptr = UnknownFieldParse(
1463         tag,
1464         _internal_metadata_.mutable_unknown_fields<std::string>(),
1465         ptr, ctx);
1466     CHK_(ptr != nullptr);
1467   }  // while
1468 message_done:
1469   _impl_._has_bits_.Or(has_bits);
1470   return ptr;
1471 failure:
1472   ptr = nullptr;
1473   goto message_done;
1474 #undef CHK_
1475 }
1476 
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const1477 ::uint8_t* TraceStats_FilterStats::_InternalSerialize(
1478     ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
1479   // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.TraceStats.FilterStats)
1480   ::uint32_t cached_has_bits = 0;
1481   (void) cached_has_bits;
1482 
1483   cached_has_bits = _impl_._has_bits_[0];
1484   // optional uint64 input_packets = 1;
1485   if (cached_has_bits & 0x00000001u) {
1486     target = stream->EnsureSpace(target);
1487     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_input_packets(), target);
1488   }
1489 
1490   // optional uint64 input_bytes = 2;
1491   if (cached_has_bits & 0x00000002u) {
1492     target = stream->EnsureSpace(target);
1493     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(2, this->_internal_input_bytes(), target);
1494   }
1495 
1496   // optional uint64 output_bytes = 3;
1497   if (cached_has_bits & 0x00000004u) {
1498     target = stream->EnsureSpace(target);
1499     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(3, this->_internal_output_bytes(), target);
1500   }
1501 
1502   // optional uint64 errors = 4;
1503   if (cached_has_bits & 0x00000008u) {
1504     target = stream->EnsureSpace(target);
1505     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(4, this->_internal_errors(), target);
1506   }
1507 
1508   // optional uint64 time_taken_ns = 5;
1509   if (cached_has_bits & 0x00000010u) {
1510     target = stream->EnsureSpace(target);
1511     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(5, this->_internal_time_taken_ns(), target);
1512   }
1513 
1514   // repeated uint64 bytes_discarded_per_buffer = 20;
1515   for (int i = 0, n = this->_internal_bytes_discarded_per_buffer_size(); i < n; i++) {
1516     target = stream->EnsureSpace(target);
1517     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(20, this->_internal_bytes_discarded_per_buffer(i), target);
1518   }
1519 
1520   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1521     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
1522         static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
1523   }
1524   // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.TraceStats.FilterStats)
1525   return target;
1526 }
1527 
ByteSizeLong() const1528 size_t TraceStats_FilterStats::ByteSizeLong() const {
1529 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.TraceStats.FilterStats)
1530   size_t total_size = 0;
1531 
1532   ::uint32_t cached_has_bits = 0;
1533   // Prevent compiler warnings about cached_has_bits being unused
1534   (void) cached_has_bits;
1535 
1536   // repeated uint64 bytes_discarded_per_buffer = 20;
1537   {
1538     size_t data_size = ::_pbi::WireFormatLite::
1539       UInt64Size(this->_impl_.bytes_discarded_per_buffer_);
1540     total_size += 2 *
1541                   ::_pbi::FromIntSize(this->_internal_bytes_discarded_per_buffer_size());
1542     total_size += data_size;
1543   }
1544 
1545   cached_has_bits = _impl_._has_bits_[0];
1546   if (cached_has_bits & 0x0000001fu) {
1547     // optional uint64 input_packets = 1;
1548     if (cached_has_bits & 0x00000001u) {
1549       total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_input_packets());
1550     }
1551 
1552     // optional uint64 input_bytes = 2;
1553     if (cached_has_bits & 0x00000002u) {
1554       total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_input_bytes());
1555     }
1556 
1557     // optional uint64 output_bytes = 3;
1558     if (cached_has_bits & 0x00000004u) {
1559       total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_output_bytes());
1560     }
1561 
1562     // optional uint64 errors = 4;
1563     if (cached_has_bits & 0x00000008u) {
1564       total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_errors());
1565     }
1566 
1567     // optional uint64 time_taken_ns = 5;
1568     if (cached_has_bits & 0x00000010u) {
1569       total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_time_taken_ns());
1570     }
1571 
1572   }
1573   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1574     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
1575   }
1576   int cached_size = ::_pbi::ToCachedSize(total_size);
1577   SetCachedSize(cached_size);
1578   return total_size;
1579 }
1580 
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)1581 void TraceStats_FilterStats::CheckTypeAndMergeFrom(
1582     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
1583   MergeFrom(*::_pbi::DownCast<const TraceStats_FilterStats*>(
1584       &from));
1585 }
1586 
MergeFrom(const TraceStats_FilterStats & from)1587 void TraceStats_FilterStats::MergeFrom(const TraceStats_FilterStats& from) {
1588   TraceStats_FilterStats* const _this = this;
1589   // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.TraceStats.FilterStats)
1590   GOOGLE_DCHECK_NE(&from, _this);
1591   ::uint32_t cached_has_bits = 0;
1592   (void) cached_has_bits;
1593 
1594   _this->_impl_.bytes_discarded_per_buffer_.MergeFrom(from._impl_.bytes_discarded_per_buffer_);
1595   cached_has_bits = from._impl_._has_bits_[0];
1596   if (cached_has_bits & 0x0000001fu) {
1597     if (cached_has_bits & 0x00000001u) {
1598       _this->_impl_.input_packets_ = from._impl_.input_packets_;
1599     }
1600     if (cached_has_bits & 0x00000002u) {
1601       _this->_impl_.input_bytes_ = from._impl_.input_bytes_;
1602     }
1603     if (cached_has_bits & 0x00000004u) {
1604       _this->_impl_.output_bytes_ = from._impl_.output_bytes_;
1605     }
1606     if (cached_has_bits & 0x00000008u) {
1607       _this->_impl_.errors_ = from._impl_.errors_;
1608     }
1609     if (cached_has_bits & 0x00000010u) {
1610       _this->_impl_.time_taken_ns_ = from._impl_.time_taken_ns_;
1611     }
1612     _this->_impl_._has_bits_[0] |= cached_has_bits;
1613   }
1614   _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1615 }
1616 
CopyFrom(const TraceStats_FilterStats & from)1617 void TraceStats_FilterStats::CopyFrom(const TraceStats_FilterStats& from) {
1618 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.TraceStats.FilterStats)
1619   if (&from == this) return;
1620   Clear();
1621   MergeFrom(from);
1622 }
1623 
IsInitialized() const1624 bool TraceStats_FilterStats::IsInitialized() const {
1625   return true;
1626 }
1627 
InternalSwap(TraceStats_FilterStats * other)1628 void TraceStats_FilterStats::InternalSwap(TraceStats_FilterStats* other) {
1629   using std::swap;
1630   _internal_metadata_.InternalSwap(&other->_internal_metadata_);
1631   swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
1632   _impl_.bytes_discarded_per_buffer_.InternalSwap(&other->_impl_.bytes_discarded_per_buffer_);
1633   ::PROTOBUF_NAMESPACE_ID::internal::memswap<
1634       PROTOBUF_FIELD_OFFSET(TraceStats_FilterStats, _impl_.time_taken_ns_)
1635       + sizeof(TraceStats_FilterStats::_impl_.time_taken_ns_)  // NOLINT
1636       - PROTOBUF_FIELD_OFFSET(TraceStats_FilterStats, _impl_.input_packets_)>(
1637           reinterpret_cast<char*>(&_impl_.input_packets_),
1638           reinterpret_cast<char*>(&other->_impl_.input_packets_));
1639 }
1640 
GetTypeName() const1641 std::string TraceStats_FilterStats::GetTypeName() const {
1642   return "perfetto.protos.TraceStats.FilterStats";
1643 }
1644 
1645 
1646 // ===================================================================
1647 
1648 class TraceStats::_Internal {
1649  public:
1650   using HasBits = decltype(std::declval<TraceStats>()._impl_._has_bits_);
set_has_producers_connected(HasBits * has_bits)1651   static void set_has_producers_connected(HasBits* has_bits) {
1652     (*has_bits)[0] |= 4u;
1653   }
set_has_producers_seen(HasBits * has_bits)1654   static void set_has_producers_seen(HasBits* has_bits) {
1655     (*has_bits)[0] |= 2u;
1656   }
set_has_data_sources_registered(HasBits * has_bits)1657   static void set_has_data_sources_registered(HasBits* has_bits) {
1658     (*has_bits)[0] |= 8u;
1659   }
set_has_data_sources_seen(HasBits * has_bits)1660   static void set_has_data_sources_seen(HasBits* has_bits) {
1661     (*has_bits)[0] |= 16u;
1662   }
set_has_tracing_sessions(HasBits * has_bits)1663   static void set_has_tracing_sessions(HasBits* has_bits) {
1664     (*has_bits)[0] |= 32u;
1665   }
set_has_total_buffers(HasBits * has_bits)1666   static void set_has_total_buffers(HasBits* has_bits) {
1667     (*has_bits)[0] |= 64u;
1668   }
set_has_chunks_discarded(HasBits * has_bits)1669   static void set_has_chunks_discarded(HasBits* has_bits) {
1670     (*has_bits)[0] |= 128u;
1671   }
set_has_patches_discarded(HasBits * has_bits)1672   static void set_has_patches_discarded(HasBits* has_bits) {
1673     (*has_bits)[0] |= 256u;
1674   }
set_has_invalid_packets(HasBits * has_bits)1675   static void set_has_invalid_packets(HasBits* has_bits) {
1676     (*has_bits)[0] |= 512u;
1677   }
1678   static const ::perfetto::protos::TraceStats_FilterStats& filter_stats(const TraceStats* msg);
set_has_filter_stats(HasBits * has_bits)1679   static void set_has_filter_stats(HasBits* has_bits) {
1680     (*has_bits)[0] |= 1u;
1681   }
set_has_flushes_requested(HasBits * has_bits)1682   static void set_has_flushes_requested(HasBits* has_bits) {
1683     (*has_bits)[0] |= 1024u;
1684   }
set_has_flushes_succeeded(HasBits * has_bits)1685   static void set_has_flushes_succeeded(HasBits* has_bits) {
1686     (*has_bits)[0] |= 2048u;
1687   }
set_has_flushes_failed(HasBits * has_bits)1688   static void set_has_flushes_failed(HasBits* has_bits) {
1689     (*has_bits)[0] |= 4096u;
1690   }
set_has_final_flush_outcome(HasBits * has_bits)1691   static void set_has_final_flush_outcome(HasBits* has_bits) {
1692     (*has_bits)[0] |= 8192u;
1693   }
1694 };
1695 
1696 const ::perfetto::protos::TraceStats_FilterStats&
filter_stats(const TraceStats * msg)1697 TraceStats::_Internal::filter_stats(const TraceStats* msg) {
1698   return *msg->_impl_.filter_stats_;
1699 }
TraceStats(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)1700 TraceStats::TraceStats(::PROTOBUF_NAMESPACE_ID::Arena* arena,
1701                          bool is_message_owned)
1702   : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
1703   SharedCtor(arena, is_message_owned);
1704   // @@protoc_insertion_point(arena_constructor:perfetto.protos.TraceStats)
1705 }
TraceStats(const TraceStats & from)1706 TraceStats::TraceStats(const TraceStats& from)
1707   : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
1708   TraceStats* const _this = this; (void)_this;
1709   new (&_impl_) Impl_{
1710       decltype(_impl_._has_bits_){from._impl_._has_bits_}
1711     , /*decltype(_impl_._cached_size_)*/{}
1712     , decltype(_impl_.buffer_stats_){from._impl_.buffer_stats_}
1713     , decltype(_impl_.chunk_payload_histogram_def_){from._impl_.chunk_payload_histogram_def_}
1714     , decltype(_impl_.writer_stats_){from._impl_.writer_stats_}
1715     , decltype(_impl_.filter_stats_){nullptr}
1716     , decltype(_impl_.producers_seen_){}
1717     , decltype(_impl_.producers_connected_){}
1718     , decltype(_impl_.data_sources_registered_){}
1719     , decltype(_impl_.data_sources_seen_){}
1720     , decltype(_impl_.tracing_sessions_){}
1721     , decltype(_impl_.total_buffers_){}
1722     , decltype(_impl_.chunks_discarded_){}
1723     , decltype(_impl_.patches_discarded_){}
1724     , decltype(_impl_.invalid_packets_){}
1725     , decltype(_impl_.flushes_requested_){}
1726     , decltype(_impl_.flushes_succeeded_){}
1727     , decltype(_impl_.flushes_failed_){}
1728     , decltype(_impl_.final_flush_outcome_){}};
1729 
1730   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1731   if (from._internal_has_filter_stats()) {
1732     _this->_impl_.filter_stats_ = new ::perfetto::protos::TraceStats_FilterStats(*from._impl_.filter_stats_);
1733   }
1734   ::memcpy(&_impl_.producers_seen_, &from._impl_.producers_seen_,
1735     static_cast<size_t>(reinterpret_cast<char*>(&_impl_.final_flush_outcome_) -
1736     reinterpret_cast<char*>(&_impl_.producers_seen_)) + sizeof(_impl_.final_flush_outcome_));
1737   // @@protoc_insertion_point(copy_constructor:perfetto.protos.TraceStats)
1738 }
1739 
SharedCtor(::_pb::Arena * arena,bool is_message_owned)1740 inline void TraceStats::SharedCtor(
1741     ::_pb::Arena* arena, bool is_message_owned) {
1742   (void)arena;
1743   (void)is_message_owned;
1744   new (&_impl_) Impl_{
1745       decltype(_impl_._has_bits_){}
1746     , /*decltype(_impl_._cached_size_)*/{}
1747     , decltype(_impl_.buffer_stats_){arena}
1748     , decltype(_impl_.chunk_payload_histogram_def_){arena}
1749     , decltype(_impl_.writer_stats_){arena}
1750     , decltype(_impl_.filter_stats_){nullptr}
1751     , decltype(_impl_.producers_seen_){::uint64_t{0u}}
1752     , decltype(_impl_.producers_connected_){0u}
1753     , decltype(_impl_.data_sources_registered_){0u}
1754     , decltype(_impl_.data_sources_seen_){::uint64_t{0u}}
1755     , decltype(_impl_.tracing_sessions_){0u}
1756     , decltype(_impl_.total_buffers_){0u}
1757     , decltype(_impl_.chunks_discarded_){::uint64_t{0u}}
1758     , decltype(_impl_.patches_discarded_){::uint64_t{0u}}
1759     , decltype(_impl_.invalid_packets_){::uint64_t{0u}}
1760     , decltype(_impl_.flushes_requested_){::uint64_t{0u}}
1761     , decltype(_impl_.flushes_succeeded_){::uint64_t{0u}}
1762     , decltype(_impl_.flushes_failed_){::uint64_t{0u}}
1763     , decltype(_impl_.final_flush_outcome_){0}
1764   };
1765 }
1766 
~TraceStats()1767 TraceStats::~TraceStats() {
1768   // @@protoc_insertion_point(destructor:perfetto.protos.TraceStats)
1769   if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
1770   (void)arena;
1771     return;
1772   }
1773   SharedDtor();
1774 }
1775 
SharedDtor()1776 inline void TraceStats::SharedDtor() {
1777   GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
1778   _impl_.buffer_stats_.~RepeatedPtrField();
1779   _impl_.chunk_payload_histogram_def_.~RepeatedField();
1780   _impl_.writer_stats_.~RepeatedPtrField();
1781   if (this != internal_default_instance()) delete _impl_.filter_stats_;
1782 }
1783 
SetCachedSize(int size) const1784 void TraceStats::SetCachedSize(int size) const {
1785   _impl_._cached_size_.Set(size);
1786 }
1787 
Clear()1788 void TraceStats::Clear() {
1789 // @@protoc_insertion_point(message_clear_start:perfetto.protos.TraceStats)
1790   ::uint32_t cached_has_bits = 0;
1791   // Prevent compiler warnings about cached_has_bits being unused
1792   (void) cached_has_bits;
1793 
1794   _impl_.buffer_stats_.Clear();
1795   _impl_.chunk_payload_histogram_def_.Clear();
1796   _impl_.writer_stats_.Clear();
1797   cached_has_bits = _impl_._has_bits_[0];
1798   if (cached_has_bits & 0x00000001u) {
1799     GOOGLE_DCHECK(_impl_.filter_stats_ != nullptr);
1800     _impl_.filter_stats_->Clear();
1801   }
1802   if (cached_has_bits & 0x000000feu) {
1803     ::memset(&_impl_.producers_seen_, 0, static_cast<size_t>(
1804         reinterpret_cast<char*>(&_impl_.chunks_discarded_) -
1805         reinterpret_cast<char*>(&_impl_.producers_seen_)) + sizeof(_impl_.chunks_discarded_));
1806   }
1807   if (cached_has_bits & 0x00003f00u) {
1808     ::memset(&_impl_.patches_discarded_, 0, static_cast<size_t>(
1809         reinterpret_cast<char*>(&_impl_.final_flush_outcome_) -
1810         reinterpret_cast<char*>(&_impl_.patches_discarded_)) + sizeof(_impl_.final_flush_outcome_));
1811   }
1812   _impl_._has_bits_.Clear();
1813   _internal_metadata_.Clear<std::string>();
1814 }
1815 
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)1816 const char* TraceStats::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
1817 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
1818   _Internal::HasBits has_bits{};
1819   while (!ctx->Done(&ptr)) {
1820     ::uint32_t tag;
1821     ptr = ::_pbi::ReadTag(ptr, &tag);
1822     switch (tag >> 3) {
1823       // repeated .perfetto.protos.TraceStats.BufferStats buffer_stats = 1;
1824       case 1:
1825         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
1826           ptr -= 1;
1827           do {
1828             ptr += 1;
1829             ptr = ctx->ParseMessage(_internal_add_buffer_stats(), ptr);
1830             CHK_(ptr);
1831             if (!ctx->DataAvailable(ptr)) break;
1832           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
1833         } else {
1834           goto handle_unusual;
1835         }
1836         continue;
1837       // optional uint32 producers_connected = 2;
1838       case 2:
1839         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
1840           _Internal::set_has_producers_connected(&has_bits);
1841           _impl_.producers_connected_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
1842           CHK_(ptr);
1843         } else {
1844           goto handle_unusual;
1845         }
1846         continue;
1847       // optional uint64 producers_seen = 3;
1848       case 3:
1849         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
1850           _Internal::set_has_producers_seen(&has_bits);
1851           _impl_.producers_seen_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
1852           CHK_(ptr);
1853         } else {
1854           goto handle_unusual;
1855         }
1856         continue;
1857       // optional uint32 data_sources_registered = 4;
1858       case 4:
1859         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
1860           _Internal::set_has_data_sources_registered(&has_bits);
1861           _impl_.data_sources_registered_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
1862           CHK_(ptr);
1863         } else {
1864           goto handle_unusual;
1865         }
1866         continue;
1867       // optional uint64 data_sources_seen = 5;
1868       case 5:
1869         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 40)) {
1870           _Internal::set_has_data_sources_seen(&has_bits);
1871           _impl_.data_sources_seen_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
1872           CHK_(ptr);
1873         } else {
1874           goto handle_unusual;
1875         }
1876         continue;
1877       // optional uint32 tracing_sessions = 6;
1878       case 6:
1879         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 48)) {
1880           _Internal::set_has_tracing_sessions(&has_bits);
1881           _impl_.tracing_sessions_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
1882           CHK_(ptr);
1883         } else {
1884           goto handle_unusual;
1885         }
1886         continue;
1887       // optional uint32 total_buffers = 7;
1888       case 7:
1889         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 56)) {
1890           _Internal::set_has_total_buffers(&has_bits);
1891           _impl_.total_buffers_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
1892           CHK_(ptr);
1893         } else {
1894           goto handle_unusual;
1895         }
1896         continue;
1897       // optional uint64 chunks_discarded = 8;
1898       case 8:
1899         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 64)) {
1900           _Internal::set_has_chunks_discarded(&has_bits);
1901           _impl_.chunks_discarded_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
1902           CHK_(ptr);
1903         } else {
1904           goto handle_unusual;
1905         }
1906         continue;
1907       // optional uint64 patches_discarded = 9;
1908       case 9:
1909         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 72)) {
1910           _Internal::set_has_patches_discarded(&has_bits);
1911           _impl_.patches_discarded_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
1912           CHK_(ptr);
1913         } else {
1914           goto handle_unusual;
1915         }
1916         continue;
1917       // optional uint64 invalid_packets = 10;
1918       case 10:
1919         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 80)) {
1920           _Internal::set_has_invalid_packets(&has_bits);
1921           _impl_.invalid_packets_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
1922           CHK_(ptr);
1923         } else {
1924           goto handle_unusual;
1925         }
1926         continue;
1927       // optional .perfetto.protos.TraceStats.FilterStats filter_stats = 11;
1928       case 11:
1929         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 90)) {
1930           ptr = ctx->ParseMessage(_internal_mutable_filter_stats(), ptr);
1931           CHK_(ptr);
1932         } else {
1933           goto handle_unusual;
1934         }
1935         continue;
1936       // optional uint64 flushes_requested = 12;
1937       case 12:
1938         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 96)) {
1939           _Internal::set_has_flushes_requested(&has_bits);
1940           _impl_.flushes_requested_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
1941           CHK_(ptr);
1942         } else {
1943           goto handle_unusual;
1944         }
1945         continue;
1946       // optional uint64 flushes_succeeded = 13;
1947       case 13:
1948         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 104)) {
1949           _Internal::set_has_flushes_succeeded(&has_bits);
1950           _impl_.flushes_succeeded_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
1951           CHK_(ptr);
1952         } else {
1953           goto handle_unusual;
1954         }
1955         continue;
1956       // optional uint64 flushes_failed = 14;
1957       case 14:
1958         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 112)) {
1959           _Internal::set_has_flushes_failed(&has_bits);
1960           _impl_.flushes_failed_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
1961           CHK_(ptr);
1962         } else {
1963           goto handle_unusual;
1964         }
1965         continue;
1966       // optional .perfetto.protos.TraceStats.FinalFlushOutcome final_flush_outcome = 15;
1967       case 15:
1968         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 120)) {
1969           ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
1970           CHK_(ptr);
1971           if (PROTOBUF_PREDICT_TRUE(::perfetto::protos::TraceStats_FinalFlushOutcome_IsValid(val))) {
1972             _internal_set_final_flush_outcome(static_cast<::perfetto::protos::TraceStats_FinalFlushOutcome>(val));
1973           } else {
1974             ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(15, val, mutable_unknown_fields());
1975           }
1976         } else {
1977           goto handle_unusual;
1978         }
1979         continue;
1980       // repeated int64 chunk_payload_histogram_def = 17;
1981       case 17:
1982         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 136)) {
1983           ptr -= 2;
1984           do {
1985             ptr += 2;
1986             _internal_add_chunk_payload_histogram_def(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
1987             CHK_(ptr);
1988             if (!ctx->DataAvailable(ptr)) break;
1989           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<136>(ptr));
1990         } else if (static_cast<::uint8_t>(tag) == 138) {
1991           ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt64Parser(_internal_mutable_chunk_payload_histogram_def(), ptr, ctx);
1992           CHK_(ptr);
1993         } else {
1994           goto handle_unusual;
1995         }
1996         continue;
1997       // repeated .perfetto.protos.TraceStats.WriterStats writer_stats = 18;
1998       case 18:
1999         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 146)) {
2000           ptr -= 2;
2001           do {
2002             ptr += 2;
2003             ptr = ctx->ParseMessage(_internal_add_writer_stats(), ptr);
2004             CHK_(ptr);
2005             if (!ctx->DataAvailable(ptr)) break;
2006           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<146>(ptr));
2007         } else {
2008           goto handle_unusual;
2009         }
2010         continue;
2011       default:
2012         goto handle_unusual;
2013     }  // switch
2014   handle_unusual:
2015     if ((tag == 0) || ((tag & 7) == 4)) {
2016       CHK_(ptr);
2017       ctx->SetLastTag(tag);
2018       goto message_done;
2019     }
2020     ptr = UnknownFieldParse(
2021         tag,
2022         _internal_metadata_.mutable_unknown_fields<std::string>(),
2023         ptr, ctx);
2024     CHK_(ptr != nullptr);
2025   }  // while
2026 message_done:
2027   _impl_._has_bits_.Or(has_bits);
2028   return ptr;
2029 failure:
2030   ptr = nullptr;
2031   goto message_done;
2032 #undef CHK_
2033 }
2034 
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const2035 ::uint8_t* TraceStats::_InternalSerialize(
2036     ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
2037   // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.TraceStats)
2038   ::uint32_t cached_has_bits = 0;
2039   (void) cached_has_bits;
2040 
2041   // repeated .perfetto.protos.TraceStats.BufferStats buffer_stats = 1;
2042   for (unsigned i = 0,
2043       n = static_cast<unsigned>(this->_internal_buffer_stats_size()); i < n; i++) {
2044     const auto& repfield = this->_internal_buffer_stats(i);
2045     target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
2046         InternalWriteMessage(1, repfield, repfield.GetCachedSize(), target, stream);
2047   }
2048 
2049   cached_has_bits = _impl_._has_bits_[0];
2050   // optional uint32 producers_connected = 2;
2051   if (cached_has_bits & 0x00000004u) {
2052     target = stream->EnsureSpace(target);
2053     target = ::_pbi::WireFormatLite::WriteUInt32ToArray(2, this->_internal_producers_connected(), target);
2054   }
2055 
2056   // optional uint64 producers_seen = 3;
2057   if (cached_has_bits & 0x00000002u) {
2058     target = stream->EnsureSpace(target);
2059     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(3, this->_internal_producers_seen(), target);
2060   }
2061 
2062   // optional uint32 data_sources_registered = 4;
2063   if (cached_has_bits & 0x00000008u) {
2064     target = stream->EnsureSpace(target);
2065     target = ::_pbi::WireFormatLite::WriteUInt32ToArray(4, this->_internal_data_sources_registered(), target);
2066   }
2067 
2068   // optional uint64 data_sources_seen = 5;
2069   if (cached_has_bits & 0x00000010u) {
2070     target = stream->EnsureSpace(target);
2071     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(5, this->_internal_data_sources_seen(), target);
2072   }
2073 
2074   // optional uint32 tracing_sessions = 6;
2075   if (cached_has_bits & 0x00000020u) {
2076     target = stream->EnsureSpace(target);
2077     target = ::_pbi::WireFormatLite::WriteUInt32ToArray(6, this->_internal_tracing_sessions(), target);
2078   }
2079 
2080   // optional uint32 total_buffers = 7;
2081   if (cached_has_bits & 0x00000040u) {
2082     target = stream->EnsureSpace(target);
2083     target = ::_pbi::WireFormatLite::WriteUInt32ToArray(7, this->_internal_total_buffers(), target);
2084   }
2085 
2086   // optional uint64 chunks_discarded = 8;
2087   if (cached_has_bits & 0x00000080u) {
2088     target = stream->EnsureSpace(target);
2089     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(8, this->_internal_chunks_discarded(), target);
2090   }
2091 
2092   // optional uint64 patches_discarded = 9;
2093   if (cached_has_bits & 0x00000100u) {
2094     target = stream->EnsureSpace(target);
2095     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(9, this->_internal_patches_discarded(), target);
2096   }
2097 
2098   // optional uint64 invalid_packets = 10;
2099   if (cached_has_bits & 0x00000200u) {
2100     target = stream->EnsureSpace(target);
2101     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(10, this->_internal_invalid_packets(), target);
2102   }
2103 
2104   // optional .perfetto.protos.TraceStats.FilterStats filter_stats = 11;
2105   if (cached_has_bits & 0x00000001u) {
2106     target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
2107       InternalWriteMessage(11, _Internal::filter_stats(this),
2108         _Internal::filter_stats(this).GetCachedSize(), target, stream);
2109   }
2110 
2111   // optional uint64 flushes_requested = 12;
2112   if (cached_has_bits & 0x00000400u) {
2113     target = stream->EnsureSpace(target);
2114     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(12, this->_internal_flushes_requested(), target);
2115   }
2116 
2117   // optional uint64 flushes_succeeded = 13;
2118   if (cached_has_bits & 0x00000800u) {
2119     target = stream->EnsureSpace(target);
2120     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(13, this->_internal_flushes_succeeded(), target);
2121   }
2122 
2123   // optional uint64 flushes_failed = 14;
2124   if (cached_has_bits & 0x00001000u) {
2125     target = stream->EnsureSpace(target);
2126     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(14, this->_internal_flushes_failed(), target);
2127   }
2128 
2129   // optional .perfetto.protos.TraceStats.FinalFlushOutcome final_flush_outcome = 15;
2130   if (cached_has_bits & 0x00002000u) {
2131     target = stream->EnsureSpace(target);
2132     target = ::_pbi::WireFormatLite::WriteEnumToArray(
2133       15, this->_internal_final_flush_outcome(), target);
2134   }
2135 
2136   // repeated int64 chunk_payload_histogram_def = 17;
2137   for (int i = 0, n = this->_internal_chunk_payload_histogram_def_size(); i < n; i++) {
2138     target = stream->EnsureSpace(target);
2139     target = ::_pbi::WireFormatLite::WriteInt64ToArray(17, this->_internal_chunk_payload_histogram_def(i), target);
2140   }
2141 
2142   // repeated .perfetto.protos.TraceStats.WriterStats writer_stats = 18;
2143   for (unsigned i = 0,
2144       n = static_cast<unsigned>(this->_internal_writer_stats_size()); i < n; i++) {
2145     const auto& repfield = this->_internal_writer_stats(i);
2146     target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
2147         InternalWriteMessage(18, repfield, repfield.GetCachedSize(), target, stream);
2148   }
2149 
2150   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
2151     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
2152         static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
2153   }
2154   // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.TraceStats)
2155   return target;
2156 }
2157 
ByteSizeLong() const2158 size_t TraceStats::ByteSizeLong() const {
2159 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.TraceStats)
2160   size_t total_size = 0;
2161 
2162   ::uint32_t cached_has_bits = 0;
2163   // Prevent compiler warnings about cached_has_bits being unused
2164   (void) cached_has_bits;
2165 
2166   // repeated .perfetto.protos.TraceStats.BufferStats buffer_stats = 1;
2167   total_size += 1UL * this->_internal_buffer_stats_size();
2168   for (const auto& msg : this->_impl_.buffer_stats_) {
2169     total_size +=
2170       ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
2171   }
2172 
2173   // repeated int64 chunk_payload_histogram_def = 17;
2174   {
2175     size_t data_size = ::_pbi::WireFormatLite::
2176       Int64Size(this->_impl_.chunk_payload_histogram_def_);
2177     total_size += 2 *
2178                   ::_pbi::FromIntSize(this->_internal_chunk_payload_histogram_def_size());
2179     total_size += data_size;
2180   }
2181 
2182   // repeated .perfetto.protos.TraceStats.WriterStats writer_stats = 18;
2183   total_size += 2UL * this->_internal_writer_stats_size();
2184   for (const auto& msg : this->_impl_.writer_stats_) {
2185     total_size +=
2186       ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
2187   }
2188 
2189   cached_has_bits = _impl_._has_bits_[0];
2190   if (cached_has_bits & 0x000000ffu) {
2191     // optional .perfetto.protos.TraceStats.FilterStats filter_stats = 11;
2192     if (cached_has_bits & 0x00000001u) {
2193       total_size += 1 +
2194         ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
2195           *_impl_.filter_stats_);
2196     }
2197 
2198     // optional uint64 producers_seen = 3;
2199     if (cached_has_bits & 0x00000002u) {
2200       total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_producers_seen());
2201     }
2202 
2203     // optional uint32 producers_connected = 2;
2204     if (cached_has_bits & 0x00000004u) {
2205       total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_producers_connected());
2206     }
2207 
2208     // optional uint32 data_sources_registered = 4;
2209     if (cached_has_bits & 0x00000008u) {
2210       total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_data_sources_registered());
2211     }
2212 
2213     // optional uint64 data_sources_seen = 5;
2214     if (cached_has_bits & 0x00000010u) {
2215       total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_data_sources_seen());
2216     }
2217 
2218     // optional uint32 tracing_sessions = 6;
2219     if (cached_has_bits & 0x00000020u) {
2220       total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_tracing_sessions());
2221     }
2222 
2223     // optional uint32 total_buffers = 7;
2224     if (cached_has_bits & 0x00000040u) {
2225       total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_total_buffers());
2226     }
2227 
2228     // optional uint64 chunks_discarded = 8;
2229     if (cached_has_bits & 0x00000080u) {
2230       total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_chunks_discarded());
2231     }
2232 
2233   }
2234   if (cached_has_bits & 0x00003f00u) {
2235     // optional uint64 patches_discarded = 9;
2236     if (cached_has_bits & 0x00000100u) {
2237       total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_patches_discarded());
2238     }
2239 
2240     // optional uint64 invalid_packets = 10;
2241     if (cached_has_bits & 0x00000200u) {
2242       total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_invalid_packets());
2243     }
2244 
2245     // optional uint64 flushes_requested = 12;
2246     if (cached_has_bits & 0x00000400u) {
2247       total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_flushes_requested());
2248     }
2249 
2250     // optional uint64 flushes_succeeded = 13;
2251     if (cached_has_bits & 0x00000800u) {
2252       total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_flushes_succeeded());
2253     }
2254 
2255     // optional uint64 flushes_failed = 14;
2256     if (cached_has_bits & 0x00001000u) {
2257       total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_flushes_failed());
2258     }
2259 
2260     // optional .perfetto.protos.TraceStats.FinalFlushOutcome final_flush_outcome = 15;
2261     if (cached_has_bits & 0x00002000u) {
2262       total_size += 1 +
2263         ::_pbi::WireFormatLite::EnumSize(this->_internal_final_flush_outcome());
2264     }
2265 
2266   }
2267   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
2268     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
2269   }
2270   int cached_size = ::_pbi::ToCachedSize(total_size);
2271   SetCachedSize(cached_size);
2272   return total_size;
2273 }
2274 
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)2275 void TraceStats::CheckTypeAndMergeFrom(
2276     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
2277   MergeFrom(*::_pbi::DownCast<const TraceStats*>(
2278       &from));
2279 }
2280 
MergeFrom(const TraceStats & from)2281 void TraceStats::MergeFrom(const TraceStats& from) {
2282   TraceStats* const _this = this;
2283   // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.TraceStats)
2284   GOOGLE_DCHECK_NE(&from, _this);
2285   ::uint32_t cached_has_bits = 0;
2286   (void) cached_has_bits;
2287 
2288   _this->_impl_.buffer_stats_.MergeFrom(from._impl_.buffer_stats_);
2289   _this->_impl_.chunk_payload_histogram_def_.MergeFrom(from._impl_.chunk_payload_histogram_def_);
2290   _this->_impl_.writer_stats_.MergeFrom(from._impl_.writer_stats_);
2291   cached_has_bits = from._impl_._has_bits_[0];
2292   if (cached_has_bits & 0x000000ffu) {
2293     if (cached_has_bits & 0x00000001u) {
2294       _this->_internal_mutable_filter_stats()->::perfetto::protos::TraceStats_FilterStats::MergeFrom(
2295           from._internal_filter_stats());
2296     }
2297     if (cached_has_bits & 0x00000002u) {
2298       _this->_impl_.producers_seen_ = from._impl_.producers_seen_;
2299     }
2300     if (cached_has_bits & 0x00000004u) {
2301       _this->_impl_.producers_connected_ = from._impl_.producers_connected_;
2302     }
2303     if (cached_has_bits & 0x00000008u) {
2304       _this->_impl_.data_sources_registered_ = from._impl_.data_sources_registered_;
2305     }
2306     if (cached_has_bits & 0x00000010u) {
2307       _this->_impl_.data_sources_seen_ = from._impl_.data_sources_seen_;
2308     }
2309     if (cached_has_bits & 0x00000020u) {
2310       _this->_impl_.tracing_sessions_ = from._impl_.tracing_sessions_;
2311     }
2312     if (cached_has_bits & 0x00000040u) {
2313       _this->_impl_.total_buffers_ = from._impl_.total_buffers_;
2314     }
2315     if (cached_has_bits & 0x00000080u) {
2316       _this->_impl_.chunks_discarded_ = from._impl_.chunks_discarded_;
2317     }
2318     _this->_impl_._has_bits_[0] |= cached_has_bits;
2319   }
2320   if (cached_has_bits & 0x00003f00u) {
2321     if (cached_has_bits & 0x00000100u) {
2322       _this->_impl_.patches_discarded_ = from._impl_.patches_discarded_;
2323     }
2324     if (cached_has_bits & 0x00000200u) {
2325       _this->_impl_.invalid_packets_ = from._impl_.invalid_packets_;
2326     }
2327     if (cached_has_bits & 0x00000400u) {
2328       _this->_impl_.flushes_requested_ = from._impl_.flushes_requested_;
2329     }
2330     if (cached_has_bits & 0x00000800u) {
2331       _this->_impl_.flushes_succeeded_ = from._impl_.flushes_succeeded_;
2332     }
2333     if (cached_has_bits & 0x00001000u) {
2334       _this->_impl_.flushes_failed_ = from._impl_.flushes_failed_;
2335     }
2336     if (cached_has_bits & 0x00002000u) {
2337       _this->_impl_.final_flush_outcome_ = from._impl_.final_flush_outcome_;
2338     }
2339     _this->_impl_._has_bits_[0] |= cached_has_bits;
2340   }
2341   _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
2342 }
2343 
CopyFrom(const TraceStats & from)2344 void TraceStats::CopyFrom(const TraceStats& from) {
2345 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.TraceStats)
2346   if (&from == this) return;
2347   Clear();
2348   MergeFrom(from);
2349 }
2350 
IsInitialized() const2351 bool TraceStats::IsInitialized() const {
2352   return true;
2353 }
2354 
InternalSwap(TraceStats * other)2355 void TraceStats::InternalSwap(TraceStats* other) {
2356   using std::swap;
2357   _internal_metadata_.InternalSwap(&other->_internal_metadata_);
2358   swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
2359   _impl_.buffer_stats_.InternalSwap(&other->_impl_.buffer_stats_);
2360   _impl_.chunk_payload_histogram_def_.InternalSwap(&other->_impl_.chunk_payload_histogram_def_);
2361   _impl_.writer_stats_.InternalSwap(&other->_impl_.writer_stats_);
2362   ::PROTOBUF_NAMESPACE_ID::internal::memswap<
2363       PROTOBUF_FIELD_OFFSET(TraceStats, _impl_.final_flush_outcome_)
2364       + sizeof(TraceStats::_impl_.final_flush_outcome_)  // NOLINT
2365       - PROTOBUF_FIELD_OFFSET(TraceStats, _impl_.filter_stats_)>(
2366           reinterpret_cast<char*>(&_impl_.filter_stats_),
2367           reinterpret_cast<char*>(&other->_impl_.filter_stats_));
2368 }
2369 
GetTypeName() const2370 std::string TraceStats::GetTypeName() const {
2371   return "perfetto.protos.TraceStats";
2372 }
2373 
2374 
2375 // @@protoc_insertion_point(namespace_scope)
2376 }  // namespace protos
2377 }  // namespace perfetto
2378 PROTOBUF_NAMESPACE_OPEN
2379 template<> PROTOBUF_NOINLINE ::perfetto::protos::TraceStats_BufferStats*
CreateMaybeMessage(Arena * arena)2380 Arena::CreateMaybeMessage< ::perfetto::protos::TraceStats_BufferStats >(Arena* arena) {
2381   return Arena::CreateMessageInternal< ::perfetto::protos::TraceStats_BufferStats >(arena);
2382 }
2383 template<> PROTOBUF_NOINLINE ::perfetto::protos::TraceStats_WriterStats*
CreateMaybeMessage(Arena * arena)2384 Arena::CreateMaybeMessage< ::perfetto::protos::TraceStats_WriterStats >(Arena* arena) {
2385   return Arena::CreateMessageInternal< ::perfetto::protos::TraceStats_WriterStats >(arena);
2386 }
2387 template<> PROTOBUF_NOINLINE ::perfetto::protos::TraceStats_FilterStats*
CreateMaybeMessage(Arena * arena)2388 Arena::CreateMaybeMessage< ::perfetto::protos::TraceStats_FilterStats >(Arena* arena) {
2389   return Arena::CreateMessageInternal< ::perfetto::protos::TraceStats_FilterStats >(arena);
2390 }
2391 template<> PROTOBUF_NOINLINE ::perfetto::protos::TraceStats*
CreateMaybeMessage(Arena * arena)2392 Arena::CreateMaybeMessage< ::perfetto::protos::TraceStats >(Arena* arena) {
2393   return Arena::CreateMessageInternal< ::perfetto::protos::TraceStats >(arena);
2394 }
2395 PROTOBUF_NAMESPACE_CLOSE
2396 
2397 // @@protoc_insertion_point(global_scope)
2398 #include <google/protobuf/port_undef.inc>
2399