• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (C) 2019 The Android Open Source Project
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //      http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 //
15 // This file is automatically generated by gen_amalgamated. Do not edit.
16 
17 // gen_amalgamated begin header: include/perfetto/tracing.h
18 // gen_amalgamated begin header: include/perfetto/tracing/buffer_exhausted_policy.h
19 /*
20  * Copyright (C) 2019 The Android Open Source Project
21  *
22  * Licensed under the Apache License, Version 2.0 (the "License");
23  * you may not use this file except in compliance with the License.
24  * You may obtain a copy of the License at
25  *
26  *      http://www.apache.org/licenses/LICENSE-2.0
27  *
28  * Unless required by applicable law or agreed to in writing, software
29  * distributed under the License is distributed on an "AS IS" BASIS,
30  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31  * See the License for the specific language governing permissions and
32  * limitations under the License.
33  */
34 
35 #ifndef INCLUDE_PERFETTO_TRACING_BUFFER_EXHAUSTED_POLICY_H_
36 #define INCLUDE_PERFETTO_TRACING_BUFFER_EXHAUSTED_POLICY_H_
37 
38 namespace perfetto {
39 
40 // Determines how SharedMemoryArbiterImpl::GetNewChunk() behaves when no free
41 // chunks are available.
42 enum class BufferExhaustedPolicy {
43   // SharedMemoryArbiterImpl::GetNewChunk() will stall if no free SMB chunk is
44   // available and wait for the tracing service to free one. Note that this
45   // requires that messages the arbiter sends to the tracing service (from any
46   // TraceWriter thread) will be received by it, even if all TraceWriter threads
47   // are stalled.
48   kStall,
49 
50   // SharedMemoryArbiterImpl::GetNewChunk() will return an invalid chunk if no
51   // free SMB chunk is available. In this case, the TraceWriter will fall back
52   // to a garbage chunk and drop written data until acquiring a future chunk
53   // succeeds again.
54   kDrop,
55 
56   // TODO(eseckler): Switch to kDrop by default and change the Android code to
57   // explicitly request kStall instead.
58   kDefault = kStall
59 };
60 
61 }  // namespace perfetto
62 
63 #endif  // INCLUDE_PERFETTO_TRACING_BUFFER_EXHAUSTED_POLICY_H_
64 // gen_amalgamated begin header: include/perfetto/tracing/core/data_source_config.h
65 // gen_amalgamated begin header: include/perfetto/tracing/core/forward_decls.h
66 /*
67  * Copyright (C) 2019 The Android Open Source Project
68  *
69  * Licensed under the Apache License, Version 2.0 (the "License");
70  * you may not use this file except in compliance with the License.
71  * You may obtain a copy of the License at
72  *
73  *      http://www.apache.org/licenses/LICENSE-2.0
74  *
75  * Unless required by applicable law or agreed to in writing, software
76  * distributed under the License is distributed on an "AS IS" BASIS,
77  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
78  * See the License for the specific language governing permissions and
79  * limitations under the License.
80  */
81 
82 #ifndef INCLUDE_PERFETTO_TRACING_CORE_FORWARD_DECLS_H_
83 #define INCLUDE_PERFETTO_TRACING_CORE_FORWARD_DECLS_H_
84 
85 // Forward declares classes that are generated at build-time from protos.
86 // First of all, why are we forward declaring at all?
87 //  1. Chromium diverges from the Google style guide on this, because forward
88 //     declarations typically make build times faster, and that's a desirable
89 //     property for a large and complex codebase.
90 //  2. Adding #include to build-time-generated headers from headers typically
91 //     creates subtle build errors that are hard to spot in GN. This is because
92 //     once a standard header (say foo.h) has an #include "protos/foo.gen.h",
93 //     the build target that depends on foo.h needs to depend on the genrule
94 //     that generates foo.gen.h. This is achievable using public_deps in GN but
95 //     is not testable / enforceable, hence too easy to get wrong.
96 
97 // Historically the classes below used to be generated from the corresponding
98 // .proto(s) at CL *check-in* time (!= build time) in the ::perfetto namespace.
99 // Nowadays we have code everywhere that assume the right class is
100 // ::perfetto::TraceConfig or the like. Back then other headers could just
101 // forward declared ::perfetto::TraceConfig. These days, the real class is
102 // ::perfetto::protos::gen::TraceConfig and core/trace_config.h aliases that as
103 // using ::perfetto::TraceConfig = ::perfetto::protos::gen::TraceConfig.
104 // In C++ one cannot forward declare a type alias (but only the aliased type).
105 // Hence this header, which should be used every time one wants to forward
106 // declare classes like TraceConfig.
107 
108 // The overall plan is that, when one of the classes below is needed:
109 // The .h file includes this file.
110 // The .cc file includes perfetto/tracing/core/trace_config.h (or equiv). That
111 // header will pull the full declaration from trace_config.gen.h and will also
112 // setup the alias in the ::perfetto namespace.
113 
114 namespace perfetto {
115 namespace protos {
116 namespace gen {
117 
118 class ChromeConfig;
119 class CommitDataRequest;
120 class DataSourceConfig;
121 class DataSourceDescriptor;
122 class ObservableEvents;
123 class TraceConfig;
124 class TraceStats;
125 class TracingServiceCapabilities;
126 class TracingServiceState;
127 
128 }  // namespace gen
129 }  // namespace protos
130 
131 using ChromeConfig = ::perfetto::protos::gen::ChromeConfig;
132 using CommitDataRequest = ::perfetto::protos::gen::CommitDataRequest;
133 using DataSourceConfig = ::perfetto::protos::gen::DataSourceConfig;
134 using DataSourceDescriptor = ::perfetto::protos::gen::DataSourceDescriptor;
135 using ObservableEvents = ::perfetto::protos::gen::ObservableEvents;
136 using TraceConfig = ::perfetto::protos::gen::TraceConfig;
137 using TraceStats = ::perfetto::protos::gen::TraceStats;
138 using TracingServiceCapabilities =
139     ::perfetto::protos::gen::TracingServiceCapabilities;
140 using TracingServiceState = ::perfetto::protos::gen::TracingServiceState;
141 
142 }  // namespace perfetto
143 
144 #endif  // INCLUDE_PERFETTO_TRACING_CORE_FORWARD_DECLS_H_
145 // gen_amalgamated begin header: gen/protos/perfetto/config/data_source_config.gen.h
146 // gen_amalgamated begin header: include/perfetto/protozero/cpp_message_obj.h
147 // gen_amalgamated begin header: include/perfetto/base/export.h
148 // gen_amalgamated begin header: include/perfetto/base/build_config.h
149 // gen_amalgamated begin header: gen/build_config/perfetto_build_flags.h
150 /*
151  * Copyright (C) 2019 The Android Open Source Project
152  *
153  * Licensed under the Apache License, Version 2.0 (the "License");
154  * you may not use this file except in compliance with the License.
155  * You may obtain a copy of the License at
156  *
157  *      http://www.apache.org/licenses/LICENSE-2.0
158  *
159  * Unless required by applicable law or agreed to in writing, software
160  * distributed under the License is distributed on an "AS IS" BASIS,
161  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
162  * See the License for the specific language governing permissions and
163  * limitations under the License.
164  */
165 
166 // Generated by ../../gn/write_buildflag_header.py
167 
168 // fix_include_guards: off
169 #ifndef GEN_BUILD_CONFIG_PERFETTO_BUILD_FLAGS_H_
170 #define GEN_BUILD_CONFIG_PERFETTO_BUILD_FLAGS_H_
171 
172 // clang-format off
173 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_ANDROID_BUILD() (0)
174 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_CHROMIUM_BUILD() (0)
175 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_STANDALONE_BUILD() (0)
176 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_START_DAEMONS() (1)
177 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_IPC() (1)
178 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_WATCHDOG() (0)
179 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_COMPONENT_BUILD() (0)
180 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_FORCE_DLOG_ON() (0)
181 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_FORCE_DLOG_OFF() (0)
182 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_VERBOSE_LOGS() (1)
183 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_VERSION_GEN() (0)
184 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_TP_PERCENTILE() (0)
185 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_TP_LINENOISE() (0)
186 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_TP_HTTPD() (0)
187 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_TP_JSON() (1)
188 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_LOCAL_SYMBOLIZER() (0)
189 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_ZLIB() (1)
190 
191 // clang-format on
192 #endif  // GEN_BUILD_CONFIG_PERFETTO_BUILD_FLAGS_H_
193 /*
194  * Copyright (C) 2017 The Android Open Source Project
195  *
196  * Licensed under the Apache License, Version 2.0 (the "License");
197  * you may not use this file except in compliance with the License.
198  * You may obtain a copy of the License at
199  *
200  *      http://www.apache.org/licenses/LICENSE-2.0
201  *
202  * Unless required by applicable law or agreed to in writing, software
203  * distributed under the License is distributed on an "AS IS" BASIS,
204  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
205  * See the License for the specific language governing permissions and
206  * limitations under the License.
207  */
208 
209 #ifndef INCLUDE_PERFETTO_BASE_BUILD_CONFIG_H_
210 #define INCLUDE_PERFETTO_BASE_BUILD_CONFIG_H_
211 
212 // Allows to define build flags that give a compiler error if the header that
213 // defined the flag is not included, instead of silently ignoring the #if block.
214 #define PERFETTO_BUILDFLAG_CAT_INDIRECT(a, b) a##b
215 #define PERFETTO_BUILDFLAG_CAT(a, b) PERFETTO_BUILDFLAG_CAT_INDIRECT(a, b)
216 #define PERFETTO_BUILDFLAG(flag) \
217   (PERFETTO_BUILDFLAG_CAT(PERFETTO_BUILDFLAG_DEFINE_, flag)())
218 
219 #if defined(__ANDROID__)
220 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_ANDROID() 1
221 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_LINUX() 0
222 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WIN() 0
223 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_APPLE() 0
224 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_MAC() 0
225 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_IOS() 0
226 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WASM() 0
227 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_FUCHSIA() 0
228 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_NACL() 0
229 #elif defined(__APPLE__)
230 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_ANDROID() 0
231 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_APPLE() 1
232 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_LINUX() 0
233 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WIN() 0
234 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WASM() 0
235 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_FUCHSIA() 0
236 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_NACL() 0
237 // Include TARGET_OS_IPHONE when on __APPLE__ systems.
238 #include <TargetConditionals.h>
239 #if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
240 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_MAC() 0
241 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_IOS() 1
242 #else
243 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_MAC() 1
244 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_IOS() 0
245 #endif
246 #elif defined(__linux__)
247 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_ANDROID() 0
248 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_LINUX() 1
249 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WIN() 0
250 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_APPLE() 0
251 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_MAC() 0
252 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_IOS() 0
253 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WASM() 0
254 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_FUCHSIA() 0
255 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_NACL() 0
256 #elif defined(_WIN32)
257 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_ANDROID() 0
258 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_LINUX() 0
259 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WIN() 1
260 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_APPLE() 0
261 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_MAC() 0
262 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_IOS() 0
263 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WASM() 0
264 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_FUCHSIA() 0
265 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_NACL() 0
266 #elif defined(__EMSCRIPTEN__)
267 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_ANDROID() 0
268 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_LINUX() 0
269 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WIN() 0
270 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_APPLE() 0
271 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_MAC() 0
272 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_IOS() 0
273 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WASM() 1
274 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_FUCHSIA() 0
275 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_NACL() 0
276 #elif defined(__Fuchsia__)
277 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_ANDROID() 0
278 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_APPLE() 0
279 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_MAC() 0
280 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_IOS() 0
281 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_LINUX() 0
282 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WIN() 0
283 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WASM() 0
284 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_FUCHSIA() 1
285 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_NACL() 0
286 #elif defined(__native_client__)
287 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_ANDROID() 0
288 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_LINUX() 0
289 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WIN() 0
290 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_APPLE() 0
291 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_MAC() 0
292 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_IOS() 0
293 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WASM() 0
294 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_FUCHSIA() 0
295 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_NACL() 1
296 #else
297 #error OS not supported (see build_config.h)
298 #endif
299 
300 #if defined(__clang__)
301 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_COMPILER_CLANG() 1
302 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_COMPILER_GCC() 0
303 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_COMPILER_MSVC() 0
304 #elif defined(__GNUC__) // Careful: Clang also defines this!
305 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_COMPILER_CLANG() 0
306 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_COMPILER_GCC() 1
307 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_COMPILER_MSVC() 0
308 #elif defined(_MSC_VER)
309 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_COMPILER_CLANG() 0
310 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_COMPILER_GCC() 0
311 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_COMPILER_MSVC() 1
312 #else
313 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_COMPILER_CLANG() 0
314 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_COMPILER_GCC() 0
315 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_COMPILER_MSVC() 0
316 #endif
317 
318 #if defined(PERFETTO_BUILD_WITH_ANDROID_USERDEBUG)
319 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_ANDROID_USERDEBUG_BUILD() 1
320 #else
321 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_ANDROID_USERDEBUG_BUILD() 0
322 #endif
323 
324 // perfetto_build_flags.h contains the tweakable build flags defined via GN.
325 // - In GN builds (e.g., standalone, chromium, v8) this file is generated at
326 //   build time via the gen_rule //gn/gen_buildflags.
327 // - In Android in-tree builds, this file is generated by tools/gen_android_bp
328 //   and checked in into include/perfetto/base/build_configs/android_tree/. The
329 //   default cflags add this path to the default include path.
330 // - Similarly, in bazel builds, this file is generated by tools/gen_bazel and
331 //   checked in into include/perfetto/base/build_configs/bazel/.
332 // - In amaglamated builds, this file is generated by tools/gen_amalgamated and
333 //   added to the amalgamated headers.
334 // gen_amalgamated expanded: #include "perfetto_build_flags.h"  // no-include-violation-check
335 
336 #endif  // INCLUDE_PERFETTO_BASE_BUILD_CONFIG_H_
337 /*
338  * Copyright (C) 2018 The Android Open Source Project
339  *
340  * Licensed under the Apache License, Version 2.0 (the "License");
341  * you may not use this file except in compliance with the License.
342  * You may obtain a copy of the License at
343  *
344  *      http://www.apache.org/licenses/LICENSE-2.0
345  *
346  * Unless required by applicable law or agreed to in writing, software
347  * distributed under the License is distributed on an "AS IS" BASIS,
348  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
349  * See the License for the specific language governing permissions and
350  * limitations under the License.
351  */
352 
353 #ifndef INCLUDE_PERFETTO_BASE_EXPORT_H_
354 #define INCLUDE_PERFETTO_BASE_EXPORT_H_
355 
356 // gen_amalgamated expanded: #include "perfetto/base/build_config.h"
357 
358 #if PERFETTO_BUILDFLAG(PERFETTO_COMPONENT_BUILD)
359 
360 #if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
361 
362 #if defined(PERFETTO_IMPLEMENTATION)
363 #define PERFETTO_EXPORT __declspec(dllexport)
364 #else
365 #define PERFETTO_EXPORT __declspec(dllimport)
366 #endif
367 
368 #else  // PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
369 
370 #if defined(PERFETTO_IMPLEMENTATION)
371 #define PERFETTO_EXPORT __attribute__((visibility("default")))
372 #else
373 #define PERFETTO_EXPORT
374 #endif
375 
376 #endif  // PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
377 
378 #else  // !PERFETTO_BUILDFLAG(PERFETTO_COMPONENT_BUILD)
379 
380 #define PERFETTO_EXPORT
381 
382 #endif  // PERFETTO_BUILDFLAG(PERFETTO_COMPONENT_BUILD)
383 
384 #endif  // INCLUDE_PERFETTO_BASE_EXPORT_H_
385 /*
386  * Copyright (C) 2019 The Android Open Source Project
387  *
388  * Licensed under the Apache License, Version 2.0 (the "License");
389  * you may not use this file except in compliance with the License.
390  * You may obtain a copy of the License at
391  *
392  *      http://www.apache.org/licenses/LICENSE-2.0
393  *
394  * Unless required by applicable law or agreed to in writing, software
395  * distributed under the License is distributed on an "AS IS" BASIS,
396  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
397  * See the License for the specific language governing permissions and
398  * limitations under the License.
399  */
400 
401 #ifndef INCLUDE_PERFETTO_PROTOZERO_CPP_MESSAGE_OBJ_H_
402 #define INCLUDE_PERFETTO_PROTOZERO_CPP_MESSAGE_OBJ_H_
403 
404 #include <stdint.h>
405 
406 #include <string>
407 #include <vector>
408 
409 // gen_amalgamated expanded: #include "perfetto/base/export.h"
410 
411 namespace protozero {
412 
413 // Base class for generated .gen.h classes, which are full C++ objects that
414 // support both ser and deserialization (but are not zero-copy).
415 // This is only used by the "cpp" targets not the "pbzero" ones.
416 class PERFETTO_EXPORT CppMessageObj {
417  public:
418   virtual ~CppMessageObj();
419   virtual std::string SerializeAsString() const = 0;
420   virtual std::vector<uint8_t> SerializeAsArray() const = 0;
421   virtual bool ParseFromArray(const void*, size_t) = 0;
422 
ParseFromString(const std::string & str)423   bool ParseFromString(const std::string& str) {
424     return ParseFromArray(str.data(), str.size());
425   }
426 };
427 
428 }  // namespace protozero
429 
430 #endif  // INCLUDE_PERFETTO_PROTOZERO_CPP_MESSAGE_OBJ_H_
431 // gen_amalgamated begin header: include/perfetto/protozero/copyable_ptr.h
432 /*
433  * Copyright (C) 2019 The Android Open Source Project
434  *
435  * Licensed under the Apache License, Version 2.0 (the "License");
436  * you may not use this file except in compliance with the License.
437  * You may obtain a copy of the License at
438  *
439  *      http://www.apache.org/licenses/LICENSE-2.0
440  *
441  * Unless required by applicable law or agreed to in writing, software
442  * distributed under the License is distributed on an "AS IS" BASIS,
443  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
444  * See the License for the specific language governing permissions and
445  * limitations under the License.
446  */
447 
448 #ifndef INCLUDE_PERFETTO_PROTOZERO_COPYABLE_PTR_H_
449 #define INCLUDE_PERFETTO_PROTOZERO_COPYABLE_PTR_H_
450 
451 #include <memory>
452 
453 namespace protozero {
454 
455 // This class is essentially a std::vector<T> of fixed size = 1.
456 // It's a pointer wrapper with deep copying and deep equality comparison.
457 // At all effects this wrapper behaves like the underlying T, with the exception
458 // of the heap indirection.
459 // Conversely to a std::unique_ptr, the pointer will be always valid, never
460 // null. The problem it solves is the following: when generating C++ classes
461 // from proto files, we want to keep each header hermetic (i.e. not #include
462 // headers of dependent types). As such we can't directly instantiate T
463 // field members but we can instead rely on pointers, so only the .cc file needs
464 // to see the actual definition of T. If the generated classes were move-only we
465 // could just use a unique_ptr there. But they aren't, hence this wrapper.
466 // Converesely to unique_ptr, this wrapper:
467 // - Default constructs the T instance in its constructor.
468 // - Implements deep comparison in operator== instead of pointer comparison.
469 template <typename T>
470 class CopyablePtr {
471  public:
CopyablePtr()472   CopyablePtr() : ptr_(new T()) {}
473   ~CopyablePtr() = default;
474 
475   // Copy operators.
CopyablePtr(const CopyablePtr & other)476   CopyablePtr(const CopyablePtr& other) : ptr_(new T(*other.ptr_)) {}
477   CopyablePtr& operator=(const CopyablePtr& other) {
478     *ptr_ = *other.ptr_;
479     return *this;
480   }
481 
482   // Move operators.
CopyablePtr(CopyablePtr && other)483   CopyablePtr(CopyablePtr&& other) noexcept : ptr_(std::move(other.ptr_)) {
484     other.ptr_.reset(new T());
485   }
486 
487   CopyablePtr& operator=(CopyablePtr&& other) {
488     ptr_ = std::move(other.ptr_);
489     other.ptr_.reset(new T());
490     return *this;
491   }
492 
get()493   T* get() { return ptr_.get(); }
get()494   const T* get() const { return ptr_.get(); }
495 
496   T* operator->() { return ptr_.get(); }
497   const T* operator->() const { return ptr_.get(); }
498 
499   T& operator*() { return *ptr_; }
500   const T& operator*() const { return *ptr_; }
501 
502   friend bool operator==(const CopyablePtr& lhs, const CopyablePtr& rhs) {
503     return *lhs == *rhs;
504   }
505 
506   friend bool operator!=(const CopyablePtr& lhs, const CopyablePtr& rhs) {
507     // In theory the underlying type might have a special operator!=
508     // implementation which is not just !(x == y). Respect that.
509     return *lhs != *rhs;
510   }
511 
512  private:
513   std::unique_ptr<T> ptr_;
514 };
515 
516 }  // namespace protozero
517 
518 #endif  // INCLUDE_PERFETTO_PROTOZERO_COPYABLE_PTR_H_
519 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
520 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_DATA_SOURCE_CONFIG_PROTO_CPP_H_
521 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_DATA_SOURCE_CONFIG_PROTO_CPP_H_
522 
523 #include <stdint.h>
524 #include <bitset>
525 #include <vector>
526 #include <string>
527 #include <type_traits>
528 
529 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
530 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
531 // gen_amalgamated expanded: #include "perfetto/base/export.h"
532 
533 namespace perfetto {
534 namespace protos {
535 namespace gen {
536 class DataSourceConfig;
537 class TestConfig;
538 class TestConfig_DummyFields;
539 class ChromeConfig;
540 }  // namespace perfetto
541 }  // namespace protos
542 }  // namespace gen
543 
544 namespace protozero {
545 class Message;
546 }  // namespace protozero
547 
548 namespace perfetto {
549 namespace protos {
550 namespace gen {
551 
552 class PERFETTO_EXPORT DataSourceConfig : public ::protozero::CppMessageObj {
553  public:
554   enum FieldNumbers {
555     kNameFieldNumber = 1,
556     kTargetBufferFieldNumber = 2,
557     kTraceDurationMsFieldNumber = 3,
558     kStopTimeoutMsFieldNumber = 7,
559     kEnableExtraGuardrailsFieldNumber = 6,
560     kTracingSessionIdFieldNumber = 4,
561     kFtraceConfigFieldNumber = 100,
562     kInodeFileConfigFieldNumber = 102,
563     kProcessStatsConfigFieldNumber = 103,
564     kSysStatsConfigFieldNumber = 104,
565     kHeapprofdConfigFieldNumber = 105,
566     kJavaHprofConfigFieldNumber = 110,
567     kAndroidPowerConfigFieldNumber = 106,
568     kAndroidLogConfigFieldNumber = 107,
569     kGpuCounterConfigFieldNumber = 108,
570     kPackagesListConfigFieldNumber = 109,
571     kPerfEventConfigFieldNumber = 111,
572     kVulkanMemoryConfigFieldNumber = 112,
573     kTrackEventConfigFieldNumber = 113,
574     kAndroidPolledStateConfigFieldNumber = 114,
575     kChromeConfigFieldNumber = 101,
576     kLegacyConfigFieldNumber = 1000,
577     kForTestingFieldNumber = 1001,
578   };
579 
580   DataSourceConfig();
581   ~DataSourceConfig() override;
582   DataSourceConfig(DataSourceConfig&&) noexcept;
583   DataSourceConfig& operator=(DataSourceConfig&&);
584   DataSourceConfig(const DataSourceConfig&);
585   DataSourceConfig& operator=(const DataSourceConfig&);
586   bool operator==(const DataSourceConfig&) const;
587   bool operator!=(const DataSourceConfig& other) const { return !(*this == other); }
588 
589   bool ParseFromArray(const void*, size_t) override;
590   std::string SerializeAsString() const override;
591   std::vector<uint8_t> SerializeAsArray() const override;
592   void Serialize(::protozero::Message*) const;
593 
has_name()594   bool has_name() const { return _has_field_[1]; }
name()595   const std::string& name() const { return name_; }
set_name(const std::string & value)596   void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
597 
has_target_buffer()598   bool has_target_buffer() const { return _has_field_[2]; }
target_buffer()599   uint32_t target_buffer() const { return target_buffer_; }
set_target_buffer(uint32_t value)600   void set_target_buffer(uint32_t value) { target_buffer_ = value; _has_field_.set(2); }
601 
has_trace_duration_ms()602   bool has_trace_duration_ms() const { return _has_field_[3]; }
trace_duration_ms()603   uint32_t trace_duration_ms() const { return trace_duration_ms_; }
set_trace_duration_ms(uint32_t value)604   void set_trace_duration_ms(uint32_t value) { trace_duration_ms_ = value; _has_field_.set(3); }
605 
has_stop_timeout_ms()606   bool has_stop_timeout_ms() const { return _has_field_[7]; }
stop_timeout_ms()607   uint32_t stop_timeout_ms() const { return stop_timeout_ms_; }
set_stop_timeout_ms(uint32_t value)608   void set_stop_timeout_ms(uint32_t value) { stop_timeout_ms_ = value; _has_field_.set(7); }
609 
has_enable_extra_guardrails()610   bool has_enable_extra_guardrails() const { return _has_field_[6]; }
enable_extra_guardrails()611   bool enable_extra_guardrails() const { return enable_extra_guardrails_; }
set_enable_extra_guardrails(bool value)612   void set_enable_extra_guardrails(bool value) { enable_extra_guardrails_ = value; _has_field_.set(6); }
613 
has_tracing_session_id()614   bool has_tracing_session_id() const { return _has_field_[4]; }
tracing_session_id()615   uint64_t tracing_session_id() const { return tracing_session_id_; }
set_tracing_session_id(uint64_t value)616   void set_tracing_session_id(uint64_t value) { tracing_session_id_ = value; _has_field_.set(4); }
617 
ftrace_config_raw()618   const std::string& ftrace_config_raw() const { return ftrace_config_; }
set_ftrace_config_raw(const std::string & raw)619   void set_ftrace_config_raw(const std::string& raw) { ftrace_config_ = raw; _has_field_.set(100); }
620 
inode_file_config_raw()621   const std::string& inode_file_config_raw() const { return inode_file_config_; }
set_inode_file_config_raw(const std::string & raw)622   void set_inode_file_config_raw(const std::string& raw) { inode_file_config_ = raw; _has_field_.set(102); }
623 
process_stats_config_raw()624   const std::string& process_stats_config_raw() const { return process_stats_config_; }
set_process_stats_config_raw(const std::string & raw)625   void set_process_stats_config_raw(const std::string& raw) { process_stats_config_ = raw; _has_field_.set(103); }
626 
sys_stats_config_raw()627   const std::string& sys_stats_config_raw() const { return sys_stats_config_; }
set_sys_stats_config_raw(const std::string & raw)628   void set_sys_stats_config_raw(const std::string& raw) { sys_stats_config_ = raw; _has_field_.set(104); }
629 
heapprofd_config_raw()630   const std::string& heapprofd_config_raw() const { return heapprofd_config_; }
set_heapprofd_config_raw(const std::string & raw)631   void set_heapprofd_config_raw(const std::string& raw) { heapprofd_config_ = raw; _has_field_.set(105); }
632 
java_hprof_config_raw()633   const std::string& java_hprof_config_raw() const { return java_hprof_config_; }
set_java_hprof_config_raw(const std::string & raw)634   void set_java_hprof_config_raw(const std::string& raw) { java_hprof_config_ = raw; _has_field_.set(110); }
635 
android_power_config_raw()636   const std::string& android_power_config_raw() const { return android_power_config_; }
set_android_power_config_raw(const std::string & raw)637   void set_android_power_config_raw(const std::string& raw) { android_power_config_ = raw; _has_field_.set(106); }
638 
android_log_config_raw()639   const std::string& android_log_config_raw() const { return android_log_config_; }
set_android_log_config_raw(const std::string & raw)640   void set_android_log_config_raw(const std::string& raw) { android_log_config_ = raw; _has_field_.set(107); }
641 
gpu_counter_config_raw()642   const std::string& gpu_counter_config_raw() const { return gpu_counter_config_; }
set_gpu_counter_config_raw(const std::string & raw)643   void set_gpu_counter_config_raw(const std::string& raw) { gpu_counter_config_ = raw; _has_field_.set(108); }
644 
packages_list_config_raw()645   const std::string& packages_list_config_raw() const { return packages_list_config_; }
set_packages_list_config_raw(const std::string & raw)646   void set_packages_list_config_raw(const std::string& raw) { packages_list_config_ = raw; _has_field_.set(109); }
647 
perf_event_config_raw()648   const std::string& perf_event_config_raw() const { return perf_event_config_; }
set_perf_event_config_raw(const std::string & raw)649   void set_perf_event_config_raw(const std::string& raw) { perf_event_config_ = raw; _has_field_.set(111); }
650 
vulkan_memory_config_raw()651   const std::string& vulkan_memory_config_raw() const { return vulkan_memory_config_; }
set_vulkan_memory_config_raw(const std::string & raw)652   void set_vulkan_memory_config_raw(const std::string& raw) { vulkan_memory_config_ = raw; _has_field_.set(112); }
653 
track_event_config_raw()654   const std::string& track_event_config_raw() const { return track_event_config_; }
set_track_event_config_raw(const std::string & raw)655   void set_track_event_config_raw(const std::string& raw) { track_event_config_ = raw; _has_field_.set(113); }
656 
android_polled_state_config_raw()657   const std::string& android_polled_state_config_raw() const { return android_polled_state_config_; }
set_android_polled_state_config_raw(const std::string & raw)658   void set_android_polled_state_config_raw(const std::string& raw) { android_polled_state_config_ = raw; _has_field_.set(114); }
659 
has_chrome_config()660   bool has_chrome_config() const { return _has_field_[101]; }
chrome_config()661   const ChromeConfig& chrome_config() const { return *chrome_config_; }
mutable_chrome_config()662   ChromeConfig* mutable_chrome_config() { _has_field_.set(101); return chrome_config_.get(); }
663 
has_legacy_config()664   bool has_legacy_config() const { return _has_field_[1000]; }
legacy_config()665   const std::string& legacy_config() const { return legacy_config_; }
set_legacy_config(const std::string & value)666   void set_legacy_config(const std::string& value) { legacy_config_ = value; _has_field_.set(1000); }
667 
has_for_testing()668   bool has_for_testing() const { return _has_field_[1001]; }
for_testing()669   const TestConfig& for_testing() const { return *for_testing_; }
mutable_for_testing()670   TestConfig* mutable_for_testing() { _has_field_.set(1001); return for_testing_.get(); }
671 
672  private:
673   std::string name_{};
674   uint32_t target_buffer_{};
675   uint32_t trace_duration_ms_{};
676   uint32_t stop_timeout_ms_{};
677   bool enable_extra_guardrails_{};
678   uint64_t tracing_session_id_{};
679   std::string ftrace_config_;  // [lazy=true]
680   std::string inode_file_config_;  // [lazy=true]
681   std::string process_stats_config_;  // [lazy=true]
682   std::string sys_stats_config_;  // [lazy=true]
683   std::string heapprofd_config_;  // [lazy=true]
684   std::string java_hprof_config_;  // [lazy=true]
685   std::string android_power_config_;  // [lazy=true]
686   std::string android_log_config_;  // [lazy=true]
687   std::string gpu_counter_config_;  // [lazy=true]
688   std::string packages_list_config_;  // [lazy=true]
689   std::string perf_event_config_;  // [lazy=true]
690   std::string vulkan_memory_config_;  // [lazy=true]
691   std::string track_event_config_;  // [lazy=true]
692   std::string android_polled_state_config_;  // [lazy=true]
693   ::protozero::CopyablePtr<ChromeConfig> chrome_config_;
694   std::string legacy_config_{};
695   ::protozero::CopyablePtr<TestConfig> for_testing_;
696 
697   // Allows to preserve unknown protobuf fields for compatibility
698   // with future versions of .proto files.
699   std::string unknown_fields_;
700 
701   std::bitset<1002> _has_field_{};
702 };
703 
704 }  // namespace perfetto
705 }  // namespace protos
706 }  // namespace gen
707 
708 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_DATA_SOURCE_CONFIG_PROTO_CPP_H_
709 /*
710  * Copyright (C) 2017 The Android Open Source Project
711  *
712  * Licensed under the Apache License, Version 2.0 (the "License");
713  * you may not use this file except in compliance with the License.
714  * You may obtain a copy of the License at
715  *
716  *      http://www.apache.org/licenses/LICENSE-2.0
717  *
718  * Unless required by applicable law or agreed to in writing, software
719  * distributed under the License is distributed on an "AS IS" BASIS,
720  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
721  * See the License for the specific language governing permissions and
722  * limitations under the License.
723  */
724 
725 #ifndef INCLUDE_PERFETTO_TRACING_CORE_DATA_SOURCE_CONFIG_H_
726 #define INCLUDE_PERFETTO_TRACING_CORE_DATA_SOURCE_CONFIG_H_
727 
728 // Creates the aliases in the ::perfetto namespace, doing things like:
729 // using ::perfetto::Foo = ::perfetto::protos::gen::Foo.
730 // See comments in forward_decls.h for the historical reasons of this
731 // indirection layer.
732 // gen_amalgamated expanded: #include "perfetto/tracing/core/forward_decls.h"
733 
734 // gen_amalgamated expanded: #include "protos/perfetto/config/data_source_config.gen.h"
735 
736 #endif  // INCLUDE_PERFETTO_TRACING_CORE_DATA_SOURCE_CONFIG_H_
737 // gen_amalgamated begin header: include/perfetto/tracing/core/data_source_descriptor.h
738 // gen_amalgamated begin header: gen/protos/perfetto/common/data_source_descriptor.gen.h
739 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
740 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_DATA_SOURCE_DESCRIPTOR_PROTO_CPP_H_
741 #define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_DATA_SOURCE_DESCRIPTOR_PROTO_CPP_H_
742 
743 #include <stdint.h>
744 #include <bitset>
745 #include <vector>
746 #include <string>
747 #include <type_traits>
748 
749 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
750 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
751 // gen_amalgamated expanded: #include "perfetto/base/export.h"
752 
753 namespace perfetto {
754 namespace protos {
755 namespace gen {
756 class DataSourceDescriptor;
757 }  // namespace perfetto
758 }  // namespace protos
759 }  // namespace gen
760 
761 namespace protozero {
762 class Message;
763 }  // namespace protozero
764 
765 namespace perfetto {
766 namespace protos {
767 namespace gen {
768 
769 class PERFETTO_EXPORT DataSourceDescriptor : public ::protozero::CppMessageObj {
770  public:
771   enum FieldNumbers {
772     kNameFieldNumber = 1,
773     kWillNotifyOnStopFieldNumber = 2,
774     kWillNotifyOnStartFieldNumber = 3,
775     kHandlesIncrementalStateClearFieldNumber = 4,
776     kGpuCounterDescriptorFieldNumber = 5,
777     kTrackEventDescriptorFieldNumber = 6,
778   };
779 
780   DataSourceDescriptor();
781   ~DataSourceDescriptor() override;
782   DataSourceDescriptor(DataSourceDescriptor&&) noexcept;
783   DataSourceDescriptor& operator=(DataSourceDescriptor&&);
784   DataSourceDescriptor(const DataSourceDescriptor&);
785   DataSourceDescriptor& operator=(const DataSourceDescriptor&);
786   bool operator==(const DataSourceDescriptor&) const;
787   bool operator!=(const DataSourceDescriptor& other) const { return !(*this == other); }
788 
789   bool ParseFromArray(const void*, size_t) override;
790   std::string SerializeAsString() const override;
791   std::vector<uint8_t> SerializeAsArray() const override;
792   void Serialize(::protozero::Message*) const;
793 
has_name()794   bool has_name() const { return _has_field_[1]; }
name()795   const std::string& name() const { return name_; }
set_name(const std::string & value)796   void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
797 
has_will_notify_on_stop()798   bool has_will_notify_on_stop() const { return _has_field_[2]; }
will_notify_on_stop()799   bool will_notify_on_stop() const { return will_notify_on_stop_; }
set_will_notify_on_stop(bool value)800   void set_will_notify_on_stop(bool value) { will_notify_on_stop_ = value; _has_field_.set(2); }
801 
has_will_notify_on_start()802   bool has_will_notify_on_start() const { return _has_field_[3]; }
will_notify_on_start()803   bool will_notify_on_start() const { return will_notify_on_start_; }
set_will_notify_on_start(bool value)804   void set_will_notify_on_start(bool value) { will_notify_on_start_ = value; _has_field_.set(3); }
805 
has_handles_incremental_state_clear()806   bool has_handles_incremental_state_clear() const { return _has_field_[4]; }
handles_incremental_state_clear()807   bool handles_incremental_state_clear() const { return handles_incremental_state_clear_; }
set_handles_incremental_state_clear(bool value)808   void set_handles_incremental_state_clear(bool value) { handles_incremental_state_clear_ = value; _has_field_.set(4); }
809 
gpu_counter_descriptor_raw()810   const std::string& gpu_counter_descriptor_raw() const { return gpu_counter_descriptor_; }
set_gpu_counter_descriptor_raw(const std::string & raw)811   void set_gpu_counter_descriptor_raw(const std::string& raw) { gpu_counter_descriptor_ = raw; _has_field_.set(5); }
812 
track_event_descriptor_raw()813   const std::string& track_event_descriptor_raw() const { return track_event_descriptor_; }
set_track_event_descriptor_raw(const std::string & raw)814   void set_track_event_descriptor_raw(const std::string& raw) { track_event_descriptor_ = raw; _has_field_.set(6); }
815 
816  private:
817   std::string name_{};
818   bool will_notify_on_stop_{};
819   bool will_notify_on_start_{};
820   bool handles_incremental_state_clear_{};
821   std::string gpu_counter_descriptor_;  // [lazy=true]
822   std::string track_event_descriptor_;  // [lazy=true]
823 
824   // Allows to preserve unknown protobuf fields for compatibility
825   // with future versions of .proto files.
826   std::string unknown_fields_;
827 
828   std::bitset<7> _has_field_{};
829 };
830 
831 }  // namespace perfetto
832 }  // namespace protos
833 }  // namespace gen
834 
835 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_DATA_SOURCE_DESCRIPTOR_PROTO_CPP_H_
836 /*
837  * Copyright (C) 2017 The Android Open Source Project
838  *
839  * Licensed under the Apache License, Version 2.0 (the "License");
840  * you may not use this file except in compliance with the License.
841  * You may obtain a copy of the License at
842  *
843  *      http://www.apache.org/licenses/LICENSE-2.0
844  *
845  * Unless required by applicable law or agreed to in writing, software
846  * distributed under the License is distributed on an "AS IS" BASIS,
847  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
848  * See the License for the specific language governing permissions and
849  * limitations under the License.
850  */
851 
852 #ifndef INCLUDE_PERFETTO_TRACING_CORE_DATA_SOURCE_DESCRIPTOR_H_
853 #define INCLUDE_PERFETTO_TRACING_CORE_DATA_SOURCE_DESCRIPTOR_H_
854 
855 // Creates the aliases in the ::perfetto namespace, doing things like:
856 // using ::perfetto::Foo = ::perfetto::protos::gen::Foo.
857 // See comments in forward_decls.h for the historical reasons of this
858 // indirection layer.
859 // gen_amalgamated expanded: #include "perfetto/tracing/core/forward_decls.h"
860 
861 // gen_amalgamated expanded: #include "protos/perfetto/common/data_source_descriptor.gen.h"
862 
863 #endif  // INCLUDE_PERFETTO_TRACING_CORE_DATA_SOURCE_DESCRIPTOR_H_
864 // gen_amalgamated begin header: include/perfetto/tracing/core/trace_config.h
865 // gen_amalgamated begin header: gen/protos/perfetto/config/trace_config.gen.h
866 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
867 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TRACE_CONFIG_PROTO_CPP_H_
868 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TRACE_CONFIG_PROTO_CPP_H_
869 
870 #include <stdint.h>
871 #include <bitset>
872 #include <vector>
873 #include <string>
874 #include <type_traits>
875 
876 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
877 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
878 // gen_amalgamated expanded: #include "perfetto/base/export.h"
879 
880 namespace perfetto {
881 namespace protos {
882 namespace gen {
883 class TraceConfig;
884 class TraceConfig_IncidentReportConfig;
885 class TraceConfig_IncrementalStateConfig;
886 class TraceConfig_TriggerConfig;
887 class TraceConfig_TriggerConfig_Trigger;
888 class TraceConfig_GuardrailOverrides;
889 class TraceConfig_StatsdMetadata;
890 class TraceConfig_ProducerConfig;
891 class TraceConfig_BuiltinDataSource;
892 class TraceConfig_DataSource;
893 class DataSourceConfig;
894 class TestConfig;
895 class TestConfig_DummyFields;
896 class ChromeConfig;
897 class TraceConfig_BufferConfig;
898 enum TraceConfig_LockdownModeOperation : int;
899 enum TraceConfig_CompressionType : int;
900 enum TraceConfig_TriggerConfig_TriggerMode : int;
901 enum BuiltinClock : int;
902 enum TraceConfig_BufferConfig_FillPolicy : int;
903 }  // namespace perfetto
904 }  // namespace protos
905 }  // namespace gen
906 
907 namespace protozero {
908 class Message;
909 }  // namespace protozero
910 
911 namespace perfetto {
912 namespace protos {
913 namespace gen {
914 enum TraceConfig_LockdownModeOperation : int {
915   TraceConfig_LockdownModeOperation_LOCKDOWN_UNCHANGED = 0,
916   TraceConfig_LockdownModeOperation_LOCKDOWN_CLEAR = 1,
917   TraceConfig_LockdownModeOperation_LOCKDOWN_SET = 2,
918 };
919 enum TraceConfig_CompressionType : int {
920   TraceConfig_CompressionType_COMPRESSION_TYPE_UNSPECIFIED = 0,
921   TraceConfig_CompressionType_COMPRESSION_TYPE_DEFLATE = 1,
922 };
923 enum TraceConfig_TriggerConfig_TriggerMode : int {
924   TraceConfig_TriggerConfig_TriggerMode_UNSPECIFIED = 0,
925   TraceConfig_TriggerConfig_TriggerMode_START_TRACING = 1,
926   TraceConfig_TriggerConfig_TriggerMode_STOP_TRACING = 2,
927 };
928 enum TraceConfig_BufferConfig_FillPolicy : int {
929   TraceConfig_BufferConfig_FillPolicy_UNSPECIFIED = 0,
930   TraceConfig_BufferConfig_FillPolicy_RING_BUFFER = 1,
931   TraceConfig_BufferConfig_FillPolicy_DISCARD = 2,
932 };
933 
934 class PERFETTO_EXPORT TraceConfig : public ::protozero::CppMessageObj {
935  public:
936   using BufferConfig = TraceConfig_BufferConfig;
937   using DataSource = TraceConfig_DataSource;
938   using BuiltinDataSource = TraceConfig_BuiltinDataSource;
939   using ProducerConfig = TraceConfig_ProducerConfig;
940   using StatsdMetadata = TraceConfig_StatsdMetadata;
941   using GuardrailOverrides = TraceConfig_GuardrailOverrides;
942   using TriggerConfig = TraceConfig_TriggerConfig;
943   using IncrementalStateConfig = TraceConfig_IncrementalStateConfig;
944   using IncidentReportConfig = TraceConfig_IncidentReportConfig;
945   using LockdownModeOperation = TraceConfig_LockdownModeOperation;
946   static constexpr auto LOCKDOWN_UNCHANGED = TraceConfig_LockdownModeOperation_LOCKDOWN_UNCHANGED;
947   static constexpr auto LOCKDOWN_CLEAR = TraceConfig_LockdownModeOperation_LOCKDOWN_CLEAR;
948   static constexpr auto LOCKDOWN_SET = TraceConfig_LockdownModeOperation_LOCKDOWN_SET;
949   static constexpr auto LockdownModeOperation_MIN = TraceConfig_LockdownModeOperation_LOCKDOWN_UNCHANGED;
950   static constexpr auto LockdownModeOperation_MAX = TraceConfig_LockdownModeOperation_LOCKDOWN_SET;
951   using CompressionType = TraceConfig_CompressionType;
952   static constexpr auto COMPRESSION_TYPE_UNSPECIFIED = TraceConfig_CompressionType_COMPRESSION_TYPE_UNSPECIFIED;
953   static constexpr auto COMPRESSION_TYPE_DEFLATE = TraceConfig_CompressionType_COMPRESSION_TYPE_DEFLATE;
954   static constexpr auto CompressionType_MIN = TraceConfig_CompressionType_COMPRESSION_TYPE_UNSPECIFIED;
955   static constexpr auto CompressionType_MAX = TraceConfig_CompressionType_COMPRESSION_TYPE_DEFLATE;
956   enum FieldNumbers {
957     kBuffersFieldNumber = 1,
958     kDataSourcesFieldNumber = 2,
959     kBuiltinDataSourcesFieldNumber = 20,
960     kDurationMsFieldNumber = 3,
961     kEnableExtraGuardrailsFieldNumber = 4,
962     kLockdownModeFieldNumber = 5,
963     kProducersFieldNumber = 6,
964     kStatsdMetadataFieldNumber = 7,
965     kWriteIntoFileFieldNumber = 8,
966     kOutputPathFieldNumber = 29,
967     kFileWritePeriodMsFieldNumber = 9,
968     kMaxFileSizeBytesFieldNumber = 10,
969     kGuardrailOverridesFieldNumber = 11,
970     kDeferredStartFieldNumber = 12,
971     kFlushPeriodMsFieldNumber = 13,
972     kFlushTimeoutMsFieldNumber = 14,
973     kDataSourceStopTimeoutMsFieldNumber = 23,
974     kNotifyTraceurFieldNumber = 16,
975     kTriggerConfigFieldNumber = 17,
976     kActivateTriggersFieldNumber = 18,
977     kIncrementalStateConfigFieldNumber = 21,
978     kAllowUserBuildTracingFieldNumber = 19,
979     kUniqueSessionNameFieldNumber = 22,
980     kCompressionTypeFieldNumber = 24,
981     kIncidentReportConfigFieldNumber = 25,
982     kTraceUuidMsbFieldNumber = 27,
983     kTraceUuidLsbFieldNumber = 28,
984   };
985 
986   TraceConfig();
987   ~TraceConfig() override;
988   TraceConfig(TraceConfig&&) noexcept;
989   TraceConfig& operator=(TraceConfig&&);
990   TraceConfig(const TraceConfig&);
991   TraceConfig& operator=(const TraceConfig&);
992   bool operator==(const TraceConfig&) const;
993   bool operator!=(const TraceConfig& other) const { return !(*this == other); }
994 
995   bool ParseFromArray(const void*, size_t) override;
996   std::string SerializeAsString() const override;
997   std::vector<uint8_t> SerializeAsArray() const override;
998   void Serialize(::protozero::Message*) const;
999 
buffers_size()1000   int buffers_size() const { return static_cast<int>(buffers_.size()); }
buffers()1001   const std::vector<TraceConfig_BufferConfig>& buffers() const { return buffers_; }
mutable_buffers()1002   std::vector<TraceConfig_BufferConfig>* mutable_buffers() { return &buffers_; }
clear_buffers()1003   void clear_buffers() { buffers_.clear(); }
add_buffers()1004   TraceConfig_BufferConfig* add_buffers() { buffers_.emplace_back(); return &buffers_.back(); }
1005 
data_sources_size()1006   int data_sources_size() const { return static_cast<int>(data_sources_.size()); }
data_sources()1007   const std::vector<TraceConfig_DataSource>& data_sources() const { return data_sources_; }
mutable_data_sources()1008   std::vector<TraceConfig_DataSource>* mutable_data_sources() { return &data_sources_; }
clear_data_sources()1009   void clear_data_sources() { data_sources_.clear(); }
add_data_sources()1010   TraceConfig_DataSource* add_data_sources() { data_sources_.emplace_back(); return &data_sources_.back(); }
1011 
has_builtin_data_sources()1012   bool has_builtin_data_sources() const { return _has_field_[20]; }
builtin_data_sources()1013   const TraceConfig_BuiltinDataSource& builtin_data_sources() const { return *builtin_data_sources_; }
mutable_builtin_data_sources()1014   TraceConfig_BuiltinDataSource* mutable_builtin_data_sources() { _has_field_.set(20); return builtin_data_sources_.get(); }
1015 
has_duration_ms()1016   bool has_duration_ms() const { return _has_field_[3]; }
duration_ms()1017   uint32_t duration_ms() const { return duration_ms_; }
set_duration_ms(uint32_t value)1018   void set_duration_ms(uint32_t value) { duration_ms_ = value; _has_field_.set(3); }
1019 
has_enable_extra_guardrails()1020   bool has_enable_extra_guardrails() const { return _has_field_[4]; }
enable_extra_guardrails()1021   bool enable_extra_guardrails() const { return enable_extra_guardrails_; }
set_enable_extra_guardrails(bool value)1022   void set_enable_extra_guardrails(bool value) { enable_extra_guardrails_ = value; _has_field_.set(4); }
1023 
has_lockdown_mode()1024   bool has_lockdown_mode() const { return _has_field_[5]; }
lockdown_mode()1025   TraceConfig_LockdownModeOperation lockdown_mode() const { return lockdown_mode_; }
set_lockdown_mode(TraceConfig_LockdownModeOperation value)1026   void set_lockdown_mode(TraceConfig_LockdownModeOperation value) { lockdown_mode_ = value; _has_field_.set(5); }
1027 
producers_size()1028   int producers_size() const { return static_cast<int>(producers_.size()); }
producers()1029   const std::vector<TraceConfig_ProducerConfig>& producers() const { return producers_; }
mutable_producers()1030   std::vector<TraceConfig_ProducerConfig>* mutable_producers() { return &producers_; }
clear_producers()1031   void clear_producers() { producers_.clear(); }
add_producers()1032   TraceConfig_ProducerConfig* add_producers() { producers_.emplace_back(); return &producers_.back(); }
1033 
has_statsd_metadata()1034   bool has_statsd_metadata() const { return _has_field_[7]; }
statsd_metadata()1035   const TraceConfig_StatsdMetadata& statsd_metadata() const { return *statsd_metadata_; }
mutable_statsd_metadata()1036   TraceConfig_StatsdMetadata* mutable_statsd_metadata() { _has_field_.set(7); return statsd_metadata_.get(); }
1037 
has_write_into_file()1038   bool has_write_into_file() const { return _has_field_[8]; }
write_into_file()1039   bool write_into_file() const { return write_into_file_; }
set_write_into_file(bool value)1040   void set_write_into_file(bool value) { write_into_file_ = value; _has_field_.set(8); }
1041 
has_output_path()1042   bool has_output_path() const { return _has_field_[29]; }
output_path()1043   const std::string& output_path() const { return output_path_; }
set_output_path(const std::string & value)1044   void set_output_path(const std::string& value) { output_path_ = value; _has_field_.set(29); }
1045 
has_file_write_period_ms()1046   bool has_file_write_period_ms() const { return _has_field_[9]; }
file_write_period_ms()1047   uint32_t file_write_period_ms() const { return file_write_period_ms_; }
set_file_write_period_ms(uint32_t value)1048   void set_file_write_period_ms(uint32_t value) { file_write_period_ms_ = value; _has_field_.set(9); }
1049 
has_max_file_size_bytes()1050   bool has_max_file_size_bytes() const { return _has_field_[10]; }
max_file_size_bytes()1051   uint64_t max_file_size_bytes() const { return max_file_size_bytes_; }
set_max_file_size_bytes(uint64_t value)1052   void set_max_file_size_bytes(uint64_t value) { max_file_size_bytes_ = value; _has_field_.set(10); }
1053 
has_guardrail_overrides()1054   bool has_guardrail_overrides() const { return _has_field_[11]; }
guardrail_overrides()1055   const TraceConfig_GuardrailOverrides& guardrail_overrides() const { return *guardrail_overrides_; }
mutable_guardrail_overrides()1056   TraceConfig_GuardrailOverrides* mutable_guardrail_overrides() { _has_field_.set(11); return guardrail_overrides_.get(); }
1057 
has_deferred_start()1058   bool has_deferred_start() const { return _has_field_[12]; }
deferred_start()1059   bool deferred_start() const { return deferred_start_; }
set_deferred_start(bool value)1060   void set_deferred_start(bool value) { deferred_start_ = value; _has_field_.set(12); }
1061 
has_flush_period_ms()1062   bool has_flush_period_ms() const { return _has_field_[13]; }
flush_period_ms()1063   uint32_t flush_period_ms() const { return flush_period_ms_; }
set_flush_period_ms(uint32_t value)1064   void set_flush_period_ms(uint32_t value) { flush_period_ms_ = value; _has_field_.set(13); }
1065 
has_flush_timeout_ms()1066   bool has_flush_timeout_ms() const { return _has_field_[14]; }
flush_timeout_ms()1067   uint32_t flush_timeout_ms() const { return flush_timeout_ms_; }
set_flush_timeout_ms(uint32_t value)1068   void set_flush_timeout_ms(uint32_t value) { flush_timeout_ms_ = value; _has_field_.set(14); }
1069 
has_data_source_stop_timeout_ms()1070   bool has_data_source_stop_timeout_ms() const { return _has_field_[23]; }
data_source_stop_timeout_ms()1071   uint32_t data_source_stop_timeout_ms() const { return data_source_stop_timeout_ms_; }
set_data_source_stop_timeout_ms(uint32_t value)1072   void set_data_source_stop_timeout_ms(uint32_t value) { data_source_stop_timeout_ms_ = value; _has_field_.set(23); }
1073 
has_notify_traceur()1074   bool has_notify_traceur() const { return _has_field_[16]; }
notify_traceur()1075   bool notify_traceur() const { return notify_traceur_; }
set_notify_traceur(bool value)1076   void set_notify_traceur(bool value) { notify_traceur_ = value; _has_field_.set(16); }
1077 
has_trigger_config()1078   bool has_trigger_config() const { return _has_field_[17]; }
trigger_config()1079   const TraceConfig_TriggerConfig& trigger_config() const { return *trigger_config_; }
mutable_trigger_config()1080   TraceConfig_TriggerConfig* mutable_trigger_config() { _has_field_.set(17); return trigger_config_.get(); }
1081 
activate_triggers_size()1082   int activate_triggers_size() const { return static_cast<int>(activate_triggers_.size()); }
activate_triggers()1083   const std::vector<std::string>& activate_triggers() const { return activate_triggers_; }
mutable_activate_triggers()1084   std::vector<std::string>* mutable_activate_triggers() { return &activate_triggers_; }
clear_activate_triggers()1085   void clear_activate_triggers() { activate_triggers_.clear(); }
add_activate_triggers(std::string value)1086   void add_activate_triggers(std::string value) { activate_triggers_.emplace_back(value); }
add_activate_triggers()1087   std::string* add_activate_triggers() { activate_triggers_.emplace_back(); return &activate_triggers_.back(); }
1088 
has_incremental_state_config()1089   bool has_incremental_state_config() const { return _has_field_[21]; }
incremental_state_config()1090   const TraceConfig_IncrementalStateConfig& incremental_state_config() const { return *incremental_state_config_; }
mutable_incremental_state_config()1091   TraceConfig_IncrementalStateConfig* mutable_incremental_state_config() { _has_field_.set(21); return incremental_state_config_.get(); }
1092 
has_allow_user_build_tracing()1093   bool has_allow_user_build_tracing() const { return _has_field_[19]; }
allow_user_build_tracing()1094   bool allow_user_build_tracing() const { return allow_user_build_tracing_; }
set_allow_user_build_tracing(bool value)1095   void set_allow_user_build_tracing(bool value) { allow_user_build_tracing_ = value; _has_field_.set(19); }
1096 
has_unique_session_name()1097   bool has_unique_session_name() const { return _has_field_[22]; }
unique_session_name()1098   const std::string& unique_session_name() const { return unique_session_name_; }
set_unique_session_name(const std::string & value)1099   void set_unique_session_name(const std::string& value) { unique_session_name_ = value; _has_field_.set(22); }
1100 
has_compression_type()1101   bool has_compression_type() const { return _has_field_[24]; }
compression_type()1102   TraceConfig_CompressionType compression_type() const { return compression_type_; }
set_compression_type(TraceConfig_CompressionType value)1103   void set_compression_type(TraceConfig_CompressionType value) { compression_type_ = value; _has_field_.set(24); }
1104 
has_incident_report_config()1105   bool has_incident_report_config() const { return _has_field_[25]; }
incident_report_config()1106   const TraceConfig_IncidentReportConfig& incident_report_config() const { return *incident_report_config_; }
mutable_incident_report_config()1107   TraceConfig_IncidentReportConfig* mutable_incident_report_config() { _has_field_.set(25); return incident_report_config_.get(); }
1108 
has_trace_uuid_msb()1109   bool has_trace_uuid_msb() const { return _has_field_[27]; }
trace_uuid_msb()1110   int64_t trace_uuid_msb() const { return trace_uuid_msb_; }
set_trace_uuid_msb(int64_t value)1111   void set_trace_uuid_msb(int64_t value) { trace_uuid_msb_ = value; _has_field_.set(27); }
1112 
has_trace_uuid_lsb()1113   bool has_trace_uuid_lsb() const { return _has_field_[28]; }
trace_uuid_lsb()1114   int64_t trace_uuid_lsb() const { return trace_uuid_lsb_; }
set_trace_uuid_lsb(int64_t value)1115   void set_trace_uuid_lsb(int64_t value) { trace_uuid_lsb_ = value; _has_field_.set(28); }
1116 
1117  private:
1118   std::vector<TraceConfig_BufferConfig> buffers_;
1119   std::vector<TraceConfig_DataSource> data_sources_;
1120   ::protozero::CopyablePtr<TraceConfig_BuiltinDataSource> builtin_data_sources_;
1121   uint32_t duration_ms_{};
1122   bool enable_extra_guardrails_{};
1123   TraceConfig_LockdownModeOperation lockdown_mode_{};
1124   std::vector<TraceConfig_ProducerConfig> producers_;
1125   ::protozero::CopyablePtr<TraceConfig_StatsdMetadata> statsd_metadata_;
1126   bool write_into_file_{};
1127   std::string output_path_{};
1128   uint32_t file_write_period_ms_{};
1129   uint64_t max_file_size_bytes_{};
1130   ::protozero::CopyablePtr<TraceConfig_GuardrailOverrides> guardrail_overrides_;
1131   bool deferred_start_{};
1132   uint32_t flush_period_ms_{};
1133   uint32_t flush_timeout_ms_{};
1134   uint32_t data_source_stop_timeout_ms_{};
1135   bool notify_traceur_{};
1136   ::protozero::CopyablePtr<TraceConfig_TriggerConfig> trigger_config_;
1137   std::vector<std::string> activate_triggers_;
1138   ::protozero::CopyablePtr<TraceConfig_IncrementalStateConfig> incremental_state_config_;
1139   bool allow_user_build_tracing_{};
1140   std::string unique_session_name_{};
1141   TraceConfig_CompressionType compression_type_{};
1142   ::protozero::CopyablePtr<TraceConfig_IncidentReportConfig> incident_report_config_;
1143   int64_t trace_uuid_msb_{};
1144   int64_t trace_uuid_lsb_{};
1145 
1146   // Allows to preserve unknown protobuf fields for compatibility
1147   // with future versions of .proto files.
1148   std::string unknown_fields_;
1149 
1150   std::bitset<30> _has_field_{};
1151 };
1152 
1153 
1154 class PERFETTO_EXPORT TraceConfig_IncidentReportConfig : public ::protozero::CppMessageObj {
1155  public:
1156   enum FieldNumbers {
1157     kDestinationPackageFieldNumber = 1,
1158     kDestinationClassFieldNumber = 2,
1159     kPrivacyLevelFieldNumber = 3,
1160     kSkipDropboxFieldNumber = 4,
1161   };
1162 
1163   TraceConfig_IncidentReportConfig();
1164   ~TraceConfig_IncidentReportConfig() override;
1165   TraceConfig_IncidentReportConfig(TraceConfig_IncidentReportConfig&&) noexcept;
1166   TraceConfig_IncidentReportConfig& operator=(TraceConfig_IncidentReportConfig&&);
1167   TraceConfig_IncidentReportConfig(const TraceConfig_IncidentReportConfig&);
1168   TraceConfig_IncidentReportConfig& operator=(const TraceConfig_IncidentReportConfig&);
1169   bool operator==(const TraceConfig_IncidentReportConfig&) const;
1170   bool operator!=(const TraceConfig_IncidentReportConfig& other) const { return !(*this == other); }
1171 
1172   bool ParseFromArray(const void*, size_t) override;
1173   std::string SerializeAsString() const override;
1174   std::vector<uint8_t> SerializeAsArray() const override;
1175   void Serialize(::protozero::Message*) const;
1176 
has_destination_package()1177   bool has_destination_package() const { return _has_field_[1]; }
destination_package()1178   const std::string& destination_package() const { return destination_package_; }
set_destination_package(const std::string & value)1179   void set_destination_package(const std::string& value) { destination_package_ = value; _has_field_.set(1); }
1180 
has_destination_class()1181   bool has_destination_class() const { return _has_field_[2]; }
destination_class()1182   const std::string& destination_class() const { return destination_class_; }
set_destination_class(const std::string & value)1183   void set_destination_class(const std::string& value) { destination_class_ = value; _has_field_.set(2); }
1184 
has_privacy_level()1185   bool has_privacy_level() const { return _has_field_[3]; }
privacy_level()1186   int32_t privacy_level() const { return privacy_level_; }
set_privacy_level(int32_t value)1187   void set_privacy_level(int32_t value) { privacy_level_ = value; _has_field_.set(3); }
1188 
has_skip_dropbox()1189   bool has_skip_dropbox() const { return _has_field_[4]; }
skip_dropbox()1190   bool skip_dropbox() const { return skip_dropbox_; }
set_skip_dropbox(bool value)1191   void set_skip_dropbox(bool value) { skip_dropbox_ = value; _has_field_.set(4); }
1192 
1193  private:
1194   std::string destination_package_{};
1195   std::string destination_class_{};
1196   int32_t privacy_level_{};
1197   bool skip_dropbox_{};
1198 
1199   // Allows to preserve unknown protobuf fields for compatibility
1200   // with future versions of .proto files.
1201   std::string unknown_fields_;
1202 
1203   std::bitset<5> _has_field_{};
1204 };
1205 
1206 
1207 class PERFETTO_EXPORT TraceConfig_IncrementalStateConfig : public ::protozero::CppMessageObj {
1208  public:
1209   enum FieldNumbers {
1210     kClearPeriodMsFieldNumber = 1,
1211   };
1212 
1213   TraceConfig_IncrementalStateConfig();
1214   ~TraceConfig_IncrementalStateConfig() override;
1215   TraceConfig_IncrementalStateConfig(TraceConfig_IncrementalStateConfig&&) noexcept;
1216   TraceConfig_IncrementalStateConfig& operator=(TraceConfig_IncrementalStateConfig&&);
1217   TraceConfig_IncrementalStateConfig(const TraceConfig_IncrementalStateConfig&);
1218   TraceConfig_IncrementalStateConfig& operator=(const TraceConfig_IncrementalStateConfig&);
1219   bool operator==(const TraceConfig_IncrementalStateConfig&) const;
1220   bool operator!=(const TraceConfig_IncrementalStateConfig& other) const { return !(*this == other); }
1221 
1222   bool ParseFromArray(const void*, size_t) override;
1223   std::string SerializeAsString() const override;
1224   std::vector<uint8_t> SerializeAsArray() const override;
1225   void Serialize(::protozero::Message*) const;
1226 
has_clear_period_ms()1227   bool has_clear_period_ms() const { return _has_field_[1]; }
clear_period_ms()1228   uint32_t clear_period_ms() const { return clear_period_ms_; }
set_clear_period_ms(uint32_t value)1229   void set_clear_period_ms(uint32_t value) { clear_period_ms_ = value; _has_field_.set(1); }
1230 
1231  private:
1232   uint32_t clear_period_ms_{};
1233 
1234   // Allows to preserve unknown protobuf fields for compatibility
1235   // with future versions of .proto files.
1236   std::string unknown_fields_;
1237 
1238   std::bitset<2> _has_field_{};
1239 };
1240 
1241 
1242 class PERFETTO_EXPORT TraceConfig_TriggerConfig : public ::protozero::CppMessageObj {
1243  public:
1244   using Trigger = TraceConfig_TriggerConfig_Trigger;
1245   using TriggerMode = TraceConfig_TriggerConfig_TriggerMode;
1246   static constexpr auto UNSPECIFIED = TraceConfig_TriggerConfig_TriggerMode_UNSPECIFIED;
1247   static constexpr auto START_TRACING = TraceConfig_TriggerConfig_TriggerMode_START_TRACING;
1248   static constexpr auto STOP_TRACING = TraceConfig_TriggerConfig_TriggerMode_STOP_TRACING;
1249   static constexpr auto TriggerMode_MIN = TraceConfig_TriggerConfig_TriggerMode_UNSPECIFIED;
1250   static constexpr auto TriggerMode_MAX = TraceConfig_TriggerConfig_TriggerMode_STOP_TRACING;
1251   enum FieldNumbers {
1252     kTriggerModeFieldNumber = 1,
1253     kTriggersFieldNumber = 2,
1254     kTriggerTimeoutMsFieldNumber = 3,
1255   };
1256 
1257   TraceConfig_TriggerConfig();
1258   ~TraceConfig_TriggerConfig() override;
1259   TraceConfig_TriggerConfig(TraceConfig_TriggerConfig&&) noexcept;
1260   TraceConfig_TriggerConfig& operator=(TraceConfig_TriggerConfig&&);
1261   TraceConfig_TriggerConfig(const TraceConfig_TriggerConfig&);
1262   TraceConfig_TriggerConfig& operator=(const TraceConfig_TriggerConfig&);
1263   bool operator==(const TraceConfig_TriggerConfig&) const;
1264   bool operator!=(const TraceConfig_TriggerConfig& other) const { return !(*this == other); }
1265 
1266   bool ParseFromArray(const void*, size_t) override;
1267   std::string SerializeAsString() const override;
1268   std::vector<uint8_t> SerializeAsArray() const override;
1269   void Serialize(::protozero::Message*) const;
1270 
has_trigger_mode()1271   bool has_trigger_mode() const { return _has_field_[1]; }
trigger_mode()1272   TraceConfig_TriggerConfig_TriggerMode trigger_mode() const { return trigger_mode_; }
set_trigger_mode(TraceConfig_TriggerConfig_TriggerMode value)1273   void set_trigger_mode(TraceConfig_TriggerConfig_TriggerMode value) { trigger_mode_ = value; _has_field_.set(1); }
1274 
triggers_size()1275   int triggers_size() const { return static_cast<int>(triggers_.size()); }
triggers()1276   const std::vector<TraceConfig_TriggerConfig_Trigger>& triggers() const { return triggers_; }
mutable_triggers()1277   std::vector<TraceConfig_TriggerConfig_Trigger>* mutable_triggers() { return &triggers_; }
clear_triggers()1278   void clear_triggers() { triggers_.clear(); }
add_triggers()1279   TraceConfig_TriggerConfig_Trigger* add_triggers() { triggers_.emplace_back(); return &triggers_.back(); }
1280 
has_trigger_timeout_ms()1281   bool has_trigger_timeout_ms() const { return _has_field_[3]; }
trigger_timeout_ms()1282   uint32_t trigger_timeout_ms() const { return trigger_timeout_ms_; }
set_trigger_timeout_ms(uint32_t value)1283   void set_trigger_timeout_ms(uint32_t value) { trigger_timeout_ms_ = value; _has_field_.set(3); }
1284 
1285  private:
1286   TraceConfig_TriggerConfig_TriggerMode trigger_mode_{};
1287   std::vector<TraceConfig_TriggerConfig_Trigger> triggers_;
1288   uint32_t trigger_timeout_ms_{};
1289 
1290   // Allows to preserve unknown protobuf fields for compatibility
1291   // with future versions of .proto files.
1292   std::string unknown_fields_;
1293 
1294   std::bitset<4> _has_field_{};
1295 };
1296 
1297 
1298 class PERFETTO_EXPORT TraceConfig_TriggerConfig_Trigger : public ::protozero::CppMessageObj {
1299  public:
1300   enum FieldNumbers {
1301     kNameFieldNumber = 1,
1302     kProducerNameRegexFieldNumber = 2,
1303     kStopDelayMsFieldNumber = 3,
1304   };
1305 
1306   TraceConfig_TriggerConfig_Trigger();
1307   ~TraceConfig_TriggerConfig_Trigger() override;
1308   TraceConfig_TriggerConfig_Trigger(TraceConfig_TriggerConfig_Trigger&&) noexcept;
1309   TraceConfig_TriggerConfig_Trigger& operator=(TraceConfig_TriggerConfig_Trigger&&);
1310   TraceConfig_TriggerConfig_Trigger(const TraceConfig_TriggerConfig_Trigger&);
1311   TraceConfig_TriggerConfig_Trigger& operator=(const TraceConfig_TriggerConfig_Trigger&);
1312   bool operator==(const TraceConfig_TriggerConfig_Trigger&) const;
1313   bool operator!=(const TraceConfig_TriggerConfig_Trigger& other) const { return !(*this == other); }
1314 
1315   bool ParseFromArray(const void*, size_t) override;
1316   std::string SerializeAsString() const override;
1317   std::vector<uint8_t> SerializeAsArray() const override;
1318   void Serialize(::protozero::Message*) const;
1319 
has_name()1320   bool has_name() const { return _has_field_[1]; }
name()1321   const std::string& name() const { return name_; }
set_name(const std::string & value)1322   void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
1323 
has_producer_name_regex()1324   bool has_producer_name_regex() const { return _has_field_[2]; }
producer_name_regex()1325   const std::string& producer_name_regex() const { return producer_name_regex_; }
set_producer_name_regex(const std::string & value)1326   void set_producer_name_regex(const std::string& value) { producer_name_regex_ = value; _has_field_.set(2); }
1327 
has_stop_delay_ms()1328   bool has_stop_delay_ms() const { return _has_field_[3]; }
stop_delay_ms()1329   uint32_t stop_delay_ms() const { return stop_delay_ms_; }
set_stop_delay_ms(uint32_t value)1330   void set_stop_delay_ms(uint32_t value) { stop_delay_ms_ = value; _has_field_.set(3); }
1331 
1332  private:
1333   std::string name_{};
1334   std::string producer_name_regex_{};
1335   uint32_t stop_delay_ms_{};
1336 
1337   // Allows to preserve unknown protobuf fields for compatibility
1338   // with future versions of .proto files.
1339   std::string unknown_fields_;
1340 
1341   std::bitset<4> _has_field_{};
1342 };
1343 
1344 
1345 class PERFETTO_EXPORT TraceConfig_GuardrailOverrides : public ::protozero::CppMessageObj {
1346  public:
1347   enum FieldNumbers {
1348     kMaxUploadPerDayBytesFieldNumber = 1,
1349   };
1350 
1351   TraceConfig_GuardrailOverrides();
1352   ~TraceConfig_GuardrailOverrides() override;
1353   TraceConfig_GuardrailOverrides(TraceConfig_GuardrailOverrides&&) noexcept;
1354   TraceConfig_GuardrailOverrides& operator=(TraceConfig_GuardrailOverrides&&);
1355   TraceConfig_GuardrailOverrides(const TraceConfig_GuardrailOverrides&);
1356   TraceConfig_GuardrailOverrides& operator=(const TraceConfig_GuardrailOverrides&);
1357   bool operator==(const TraceConfig_GuardrailOverrides&) const;
1358   bool operator!=(const TraceConfig_GuardrailOverrides& other) const { return !(*this == other); }
1359 
1360   bool ParseFromArray(const void*, size_t) override;
1361   std::string SerializeAsString() const override;
1362   std::vector<uint8_t> SerializeAsArray() const override;
1363   void Serialize(::protozero::Message*) const;
1364 
has_max_upload_per_day_bytes()1365   bool has_max_upload_per_day_bytes() const { return _has_field_[1]; }
max_upload_per_day_bytes()1366   uint64_t max_upload_per_day_bytes() const { return max_upload_per_day_bytes_; }
set_max_upload_per_day_bytes(uint64_t value)1367   void set_max_upload_per_day_bytes(uint64_t value) { max_upload_per_day_bytes_ = value; _has_field_.set(1); }
1368 
1369  private:
1370   uint64_t max_upload_per_day_bytes_{};
1371 
1372   // Allows to preserve unknown protobuf fields for compatibility
1373   // with future versions of .proto files.
1374   std::string unknown_fields_;
1375 
1376   std::bitset<2> _has_field_{};
1377 };
1378 
1379 
1380 class PERFETTO_EXPORT TraceConfig_StatsdMetadata : public ::protozero::CppMessageObj {
1381  public:
1382   enum FieldNumbers {
1383     kTriggeringAlertIdFieldNumber = 1,
1384     kTriggeringConfigUidFieldNumber = 2,
1385     kTriggeringConfigIdFieldNumber = 3,
1386     kTriggeringSubscriptionIdFieldNumber = 4,
1387   };
1388 
1389   TraceConfig_StatsdMetadata();
1390   ~TraceConfig_StatsdMetadata() override;
1391   TraceConfig_StatsdMetadata(TraceConfig_StatsdMetadata&&) noexcept;
1392   TraceConfig_StatsdMetadata& operator=(TraceConfig_StatsdMetadata&&);
1393   TraceConfig_StatsdMetadata(const TraceConfig_StatsdMetadata&);
1394   TraceConfig_StatsdMetadata& operator=(const TraceConfig_StatsdMetadata&);
1395   bool operator==(const TraceConfig_StatsdMetadata&) const;
1396   bool operator!=(const TraceConfig_StatsdMetadata& other) const { return !(*this == other); }
1397 
1398   bool ParseFromArray(const void*, size_t) override;
1399   std::string SerializeAsString() const override;
1400   std::vector<uint8_t> SerializeAsArray() const override;
1401   void Serialize(::protozero::Message*) const;
1402 
has_triggering_alert_id()1403   bool has_triggering_alert_id() const { return _has_field_[1]; }
triggering_alert_id()1404   int64_t triggering_alert_id() const { return triggering_alert_id_; }
set_triggering_alert_id(int64_t value)1405   void set_triggering_alert_id(int64_t value) { triggering_alert_id_ = value; _has_field_.set(1); }
1406 
has_triggering_config_uid()1407   bool has_triggering_config_uid() const { return _has_field_[2]; }
triggering_config_uid()1408   int32_t triggering_config_uid() const { return triggering_config_uid_; }
set_triggering_config_uid(int32_t value)1409   void set_triggering_config_uid(int32_t value) { triggering_config_uid_ = value; _has_field_.set(2); }
1410 
has_triggering_config_id()1411   bool has_triggering_config_id() const { return _has_field_[3]; }
triggering_config_id()1412   int64_t triggering_config_id() const { return triggering_config_id_; }
set_triggering_config_id(int64_t value)1413   void set_triggering_config_id(int64_t value) { triggering_config_id_ = value; _has_field_.set(3); }
1414 
has_triggering_subscription_id()1415   bool has_triggering_subscription_id() const { return _has_field_[4]; }
triggering_subscription_id()1416   int64_t triggering_subscription_id() const { return triggering_subscription_id_; }
set_triggering_subscription_id(int64_t value)1417   void set_triggering_subscription_id(int64_t value) { triggering_subscription_id_ = value; _has_field_.set(4); }
1418 
1419  private:
1420   int64_t triggering_alert_id_{};
1421   int32_t triggering_config_uid_{};
1422   int64_t triggering_config_id_{};
1423   int64_t triggering_subscription_id_{};
1424 
1425   // Allows to preserve unknown protobuf fields for compatibility
1426   // with future versions of .proto files.
1427   std::string unknown_fields_;
1428 
1429   std::bitset<5> _has_field_{};
1430 };
1431 
1432 
1433 class PERFETTO_EXPORT TraceConfig_ProducerConfig : public ::protozero::CppMessageObj {
1434  public:
1435   enum FieldNumbers {
1436     kProducerNameFieldNumber = 1,
1437     kShmSizeKbFieldNumber = 2,
1438     kPageSizeKbFieldNumber = 3,
1439   };
1440 
1441   TraceConfig_ProducerConfig();
1442   ~TraceConfig_ProducerConfig() override;
1443   TraceConfig_ProducerConfig(TraceConfig_ProducerConfig&&) noexcept;
1444   TraceConfig_ProducerConfig& operator=(TraceConfig_ProducerConfig&&);
1445   TraceConfig_ProducerConfig(const TraceConfig_ProducerConfig&);
1446   TraceConfig_ProducerConfig& operator=(const TraceConfig_ProducerConfig&);
1447   bool operator==(const TraceConfig_ProducerConfig&) const;
1448   bool operator!=(const TraceConfig_ProducerConfig& other) const { return !(*this == other); }
1449 
1450   bool ParseFromArray(const void*, size_t) override;
1451   std::string SerializeAsString() const override;
1452   std::vector<uint8_t> SerializeAsArray() const override;
1453   void Serialize(::protozero::Message*) const;
1454 
has_producer_name()1455   bool has_producer_name() const { return _has_field_[1]; }
producer_name()1456   const std::string& producer_name() const { return producer_name_; }
set_producer_name(const std::string & value)1457   void set_producer_name(const std::string& value) { producer_name_ = value; _has_field_.set(1); }
1458 
has_shm_size_kb()1459   bool has_shm_size_kb() const { return _has_field_[2]; }
shm_size_kb()1460   uint32_t shm_size_kb() const { return shm_size_kb_; }
set_shm_size_kb(uint32_t value)1461   void set_shm_size_kb(uint32_t value) { shm_size_kb_ = value; _has_field_.set(2); }
1462 
has_page_size_kb()1463   bool has_page_size_kb() const { return _has_field_[3]; }
page_size_kb()1464   uint32_t page_size_kb() const { return page_size_kb_; }
set_page_size_kb(uint32_t value)1465   void set_page_size_kb(uint32_t value) { page_size_kb_ = value; _has_field_.set(3); }
1466 
1467  private:
1468   std::string producer_name_{};
1469   uint32_t shm_size_kb_{};
1470   uint32_t page_size_kb_{};
1471 
1472   // Allows to preserve unknown protobuf fields for compatibility
1473   // with future versions of .proto files.
1474   std::string unknown_fields_;
1475 
1476   std::bitset<4> _has_field_{};
1477 };
1478 
1479 
1480 class PERFETTO_EXPORT TraceConfig_BuiltinDataSource : public ::protozero::CppMessageObj {
1481  public:
1482   enum FieldNumbers {
1483     kDisableClockSnapshottingFieldNumber = 1,
1484     kDisableTraceConfigFieldNumber = 2,
1485     kDisableSystemInfoFieldNumber = 3,
1486     kDisableServiceEventsFieldNumber = 4,
1487     kPrimaryTraceClockFieldNumber = 5,
1488     kSnapshotIntervalMsFieldNumber = 6,
1489   };
1490 
1491   TraceConfig_BuiltinDataSource();
1492   ~TraceConfig_BuiltinDataSource() override;
1493   TraceConfig_BuiltinDataSource(TraceConfig_BuiltinDataSource&&) noexcept;
1494   TraceConfig_BuiltinDataSource& operator=(TraceConfig_BuiltinDataSource&&);
1495   TraceConfig_BuiltinDataSource(const TraceConfig_BuiltinDataSource&);
1496   TraceConfig_BuiltinDataSource& operator=(const TraceConfig_BuiltinDataSource&);
1497   bool operator==(const TraceConfig_BuiltinDataSource&) const;
1498   bool operator!=(const TraceConfig_BuiltinDataSource& other) const { return !(*this == other); }
1499 
1500   bool ParseFromArray(const void*, size_t) override;
1501   std::string SerializeAsString() const override;
1502   std::vector<uint8_t> SerializeAsArray() const override;
1503   void Serialize(::protozero::Message*) const;
1504 
has_disable_clock_snapshotting()1505   bool has_disable_clock_snapshotting() const { return _has_field_[1]; }
disable_clock_snapshotting()1506   bool disable_clock_snapshotting() const { return disable_clock_snapshotting_; }
set_disable_clock_snapshotting(bool value)1507   void set_disable_clock_snapshotting(bool value) { disable_clock_snapshotting_ = value; _has_field_.set(1); }
1508 
has_disable_trace_config()1509   bool has_disable_trace_config() const { return _has_field_[2]; }
disable_trace_config()1510   bool disable_trace_config() const { return disable_trace_config_; }
set_disable_trace_config(bool value)1511   void set_disable_trace_config(bool value) { disable_trace_config_ = value; _has_field_.set(2); }
1512 
has_disable_system_info()1513   bool has_disable_system_info() const { return _has_field_[3]; }
disable_system_info()1514   bool disable_system_info() const { return disable_system_info_; }
set_disable_system_info(bool value)1515   void set_disable_system_info(bool value) { disable_system_info_ = value; _has_field_.set(3); }
1516 
has_disable_service_events()1517   bool has_disable_service_events() const { return _has_field_[4]; }
disable_service_events()1518   bool disable_service_events() const { return disable_service_events_; }
set_disable_service_events(bool value)1519   void set_disable_service_events(bool value) { disable_service_events_ = value; _has_field_.set(4); }
1520 
has_primary_trace_clock()1521   bool has_primary_trace_clock() const { return _has_field_[5]; }
primary_trace_clock()1522   BuiltinClock primary_trace_clock() const { return primary_trace_clock_; }
set_primary_trace_clock(BuiltinClock value)1523   void set_primary_trace_clock(BuiltinClock value) { primary_trace_clock_ = value; _has_field_.set(5); }
1524 
has_snapshot_interval_ms()1525   bool has_snapshot_interval_ms() const { return _has_field_[6]; }
snapshot_interval_ms()1526   uint32_t snapshot_interval_ms() const { return snapshot_interval_ms_; }
set_snapshot_interval_ms(uint32_t value)1527   void set_snapshot_interval_ms(uint32_t value) { snapshot_interval_ms_ = value; _has_field_.set(6); }
1528 
1529  private:
1530   bool disable_clock_snapshotting_{};
1531   bool disable_trace_config_{};
1532   bool disable_system_info_{};
1533   bool disable_service_events_{};
1534   BuiltinClock primary_trace_clock_{};
1535   uint32_t snapshot_interval_ms_{};
1536 
1537   // Allows to preserve unknown protobuf fields for compatibility
1538   // with future versions of .proto files.
1539   std::string unknown_fields_;
1540 
1541   std::bitset<7> _has_field_{};
1542 };
1543 
1544 
1545 class PERFETTO_EXPORT TraceConfig_DataSource : public ::protozero::CppMessageObj {
1546  public:
1547   enum FieldNumbers {
1548     kConfigFieldNumber = 1,
1549     kProducerNameFilterFieldNumber = 2,
1550     kProducerNameRegexFilterFieldNumber = 3,
1551   };
1552 
1553   TraceConfig_DataSource();
1554   ~TraceConfig_DataSource() override;
1555   TraceConfig_DataSource(TraceConfig_DataSource&&) noexcept;
1556   TraceConfig_DataSource& operator=(TraceConfig_DataSource&&);
1557   TraceConfig_DataSource(const TraceConfig_DataSource&);
1558   TraceConfig_DataSource& operator=(const TraceConfig_DataSource&);
1559   bool operator==(const TraceConfig_DataSource&) const;
1560   bool operator!=(const TraceConfig_DataSource& other) const { return !(*this == other); }
1561 
1562   bool ParseFromArray(const void*, size_t) override;
1563   std::string SerializeAsString() const override;
1564   std::vector<uint8_t> SerializeAsArray() const override;
1565   void Serialize(::protozero::Message*) const;
1566 
has_config()1567   bool has_config() const { return _has_field_[1]; }
config()1568   const DataSourceConfig& config() const { return *config_; }
mutable_config()1569   DataSourceConfig* mutable_config() { _has_field_.set(1); return config_.get(); }
1570 
producer_name_filter_size()1571   int producer_name_filter_size() const { return static_cast<int>(producer_name_filter_.size()); }
producer_name_filter()1572   const std::vector<std::string>& producer_name_filter() const { return producer_name_filter_; }
mutable_producer_name_filter()1573   std::vector<std::string>* mutable_producer_name_filter() { return &producer_name_filter_; }
clear_producer_name_filter()1574   void clear_producer_name_filter() { producer_name_filter_.clear(); }
add_producer_name_filter(std::string value)1575   void add_producer_name_filter(std::string value) { producer_name_filter_.emplace_back(value); }
add_producer_name_filter()1576   std::string* add_producer_name_filter() { producer_name_filter_.emplace_back(); return &producer_name_filter_.back(); }
1577 
producer_name_regex_filter_size()1578   int producer_name_regex_filter_size() const { return static_cast<int>(producer_name_regex_filter_.size()); }
producer_name_regex_filter()1579   const std::vector<std::string>& producer_name_regex_filter() const { return producer_name_regex_filter_; }
mutable_producer_name_regex_filter()1580   std::vector<std::string>* mutable_producer_name_regex_filter() { return &producer_name_regex_filter_; }
clear_producer_name_regex_filter()1581   void clear_producer_name_regex_filter() { producer_name_regex_filter_.clear(); }
add_producer_name_regex_filter(std::string value)1582   void add_producer_name_regex_filter(std::string value) { producer_name_regex_filter_.emplace_back(value); }
add_producer_name_regex_filter()1583   std::string* add_producer_name_regex_filter() { producer_name_regex_filter_.emplace_back(); return &producer_name_regex_filter_.back(); }
1584 
1585  private:
1586   ::protozero::CopyablePtr<DataSourceConfig> config_;
1587   std::vector<std::string> producer_name_filter_;
1588   std::vector<std::string> producer_name_regex_filter_;
1589 
1590   // Allows to preserve unknown protobuf fields for compatibility
1591   // with future versions of .proto files.
1592   std::string unknown_fields_;
1593 
1594   std::bitset<4> _has_field_{};
1595 };
1596 
1597 
1598 class PERFETTO_EXPORT TraceConfig_BufferConfig : public ::protozero::CppMessageObj {
1599  public:
1600   using FillPolicy = TraceConfig_BufferConfig_FillPolicy;
1601   static constexpr auto UNSPECIFIED = TraceConfig_BufferConfig_FillPolicy_UNSPECIFIED;
1602   static constexpr auto RING_BUFFER = TraceConfig_BufferConfig_FillPolicy_RING_BUFFER;
1603   static constexpr auto DISCARD = TraceConfig_BufferConfig_FillPolicy_DISCARD;
1604   static constexpr auto FillPolicy_MIN = TraceConfig_BufferConfig_FillPolicy_UNSPECIFIED;
1605   static constexpr auto FillPolicy_MAX = TraceConfig_BufferConfig_FillPolicy_DISCARD;
1606   enum FieldNumbers {
1607     kSizeKbFieldNumber = 1,
1608     kFillPolicyFieldNumber = 4,
1609   };
1610 
1611   TraceConfig_BufferConfig();
1612   ~TraceConfig_BufferConfig() override;
1613   TraceConfig_BufferConfig(TraceConfig_BufferConfig&&) noexcept;
1614   TraceConfig_BufferConfig& operator=(TraceConfig_BufferConfig&&);
1615   TraceConfig_BufferConfig(const TraceConfig_BufferConfig&);
1616   TraceConfig_BufferConfig& operator=(const TraceConfig_BufferConfig&);
1617   bool operator==(const TraceConfig_BufferConfig&) const;
1618   bool operator!=(const TraceConfig_BufferConfig& other) const { return !(*this == other); }
1619 
1620   bool ParseFromArray(const void*, size_t) override;
1621   std::string SerializeAsString() const override;
1622   std::vector<uint8_t> SerializeAsArray() const override;
1623   void Serialize(::protozero::Message*) const;
1624 
has_size_kb()1625   bool has_size_kb() const { return _has_field_[1]; }
size_kb()1626   uint32_t size_kb() const { return size_kb_; }
set_size_kb(uint32_t value)1627   void set_size_kb(uint32_t value) { size_kb_ = value; _has_field_.set(1); }
1628 
has_fill_policy()1629   bool has_fill_policy() const { return _has_field_[4]; }
fill_policy()1630   TraceConfig_BufferConfig_FillPolicy fill_policy() const { return fill_policy_; }
set_fill_policy(TraceConfig_BufferConfig_FillPolicy value)1631   void set_fill_policy(TraceConfig_BufferConfig_FillPolicy value) { fill_policy_ = value; _has_field_.set(4); }
1632 
1633  private:
1634   uint32_t size_kb_{};
1635   TraceConfig_BufferConfig_FillPolicy fill_policy_{};
1636 
1637   // Allows to preserve unknown protobuf fields for compatibility
1638   // with future versions of .proto files.
1639   std::string unknown_fields_;
1640 
1641   std::bitset<5> _has_field_{};
1642 };
1643 
1644 }  // namespace perfetto
1645 }  // namespace protos
1646 }  // namespace gen
1647 
1648 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TRACE_CONFIG_PROTO_CPP_H_
1649 /*
1650  * Copyright (C) 2017 The Android Open Source Project
1651  *
1652  * Licensed under the Apache License, Version 2.0 (the "License");
1653  * you may not use this file except in compliance with the License.
1654  * You may obtain a copy of the License at
1655  *
1656  *      http://www.apache.org/licenses/LICENSE-2.0
1657  *
1658  * Unless required by applicable law or agreed to in writing, software
1659  * distributed under the License is distributed on an "AS IS" BASIS,
1660  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1661  * See the License for the specific language governing permissions and
1662  * limitations under the License.
1663  */
1664 
1665 #ifndef INCLUDE_PERFETTO_TRACING_CORE_TRACE_CONFIG_H_
1666 #define INCLUDE_PERFETTO_TRACING_CORE_TRACE_CONFIG_H_
1667 
1668 // Creates the aliases in the ::perfetto namespace, doing things like:
1669 // using ::perfetto::Foo = ::perfetto::protos::gen::Foo.
1670 // See comments in forward_decls.h for the historical reasons of this
1671 // indirection layer.
1672 // gen_amalgamated expanded: #include "perfetto/tracing/core/forward_decls.h"
1673 
1674 // gen_amalgamated expanded: #include "protos/perfetto/config/trace_config.gen.h"
1675 
1676 #endif  // INCLUDE_PERFETTO_TRACING_CORE_TRACE_CONFIG_H_
1677 // gen_amalgamated begin header: include/perfetto/tracing/data_source.h
1678 // gen_amalgamated begin header: include/perfetto/base/compiler.h
1679 /*
1680  * Copyright (C) 2019 The Android Open Source Project
1681  *
1682  * Licensed under the Apache License, Version 2.0 (the "License");
1683  * you may not use this file except in compliance with the License.
1684  * You may obtain a copy of the License at
1685  *
1686  *      http://www.apache.org/licenses/LICENSE-2.0
1687  *
1688  * Unless required by applicable law or agreed to in writing, software
1689  * distributed under the License is distributed on an "AS IS" BASIS,
1690  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1691  * See the License for the specific language governing permissions and
1692  * limitations under the License.
1693  */
1694 
1695 #ifndef INCLUDE_PERFETTO_BASE_COMPILER_H_
1696 #define INCLUDE_PERFETTO_BASE_COMPILER_H_
1697 
1698 #include <type_traits>
1699 
1700 // gen_amalgamated expanded: #include "perfetto/base/build_config.h"
1701 
1702 #define PERFETTO_LIKELY(_x) __builtin_expect(!!(_x), 1)
1703 #define PERFETTO_UNLIKELY(_x) __builtin_expect(!!(_x), 0)
1704 
1705 #if defined(__GNUC__) || defined(__clang__)
1706 #define PERFETTO_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
1707 #else
1708 #define PERFETTO_WARN_UNUSED_RESULT
1709 #endif
1710 
1711 #if defined(__clang__)
1712 #define PERFETTO_ALWAYS_INLINE __attribute__((__always_inline__))
1713 #define PERFETTO_NO_INLINE __attribute__((__noinline__))
1714 #else
1715 // GCC is too pedantic and often fails with the error:
1716 // "always_inline function might not be inlinable"
1717 #define PERFETTO_ALWAYS_INLINE
1718 #define PERFETTO_NO_INLINE
1719 #endif
1720 
1721 #if defined(__GNUC__) || defined(__clang__)
1722 #define PERFETTO_DEBUG_FUNCTION_IDENTIFIER() __PRETTY_FUNCTION__
1723 #elif defined(_MSC_VER)
1724 #define PERFETTO_DEBUG_FUNCTION_IDENTIFIER() __FUNCSIG__
1725 #else
1726 #define PERFETTO_DEBUG_FUNCTION_IDENTIFIER() \
1727   static_assert(false, "Not implemented for this compiler")
1728 #endif
1729 
1730 #if defined(__GNUC__) || defined(__clang__)
1731 #define PERFETTO_PRINTF_FORMAT(x, y) \
1732   __attribute__((__format__(__printf__, x, y)))
1733 #else
1734 #define PERFETTO_PRINTF_FORMAT(x, y)
1735 #endif
1736 
1737 #if PERFETTO_BUILDFLAG(PERFETTO_OS_IOS)
1738 // TODO(b/158814068): For iOS builds, thread_local is only supported since iOS
1739 // 8. We'd have to use pthread for thread local data instead here. For now, just
1740 // define it to nothing since we don't support running perfetto or the client
1741 // lib on iOS right now.
1742 #define PERFETTO_THREAD_LOCAL
1743 #else
1744 #define PERFETTO_THREAD_LOCAL thread_local
1745 #endif
1746 
1747 #if defined(__clang__)
1748 #if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
1749 extern "C" void __asan_poison_memory_region(void const volatile*, size_t);
1750 extern "C" void __asan_unpoison_memory_region(void const volatile*, size_t);
1751 #define PERFETTO_ASAN_POISON(a, s) __asan_poison_memory_region((a), (s))
1752 #define PERFETTO_ASAN_UNPOISON(a, s) __asan_unpoison_memory_region((a), (s))
1753 #else
1754 #define PERFETTO_ASAN_POISON(addr, size)
1755 #define PERFETTO_ASAN_UNPOISON(addr, size)
1756 #endif  // __has_feature(address_sanitizer)
1757 #else
1758 #define PERFETTO_ASAN_POISON(addr, size)
1759 #define PERFETTO_ASAN_UNPOISON(addr, size)
1760 #endif  // __clang__
1761 
1762 namespace perfetto {
1763 namespace base {
1764 
1765 template <typename... T>
ignore_result(const T &...)1766 inline void ignore_result(const T&...) {}
1767 
1768 }  // namespace base
1769 }  // namespace perfetto
1770 
1771 #endif  // INCLUDE_PERFETTO_BASE_COMPILER_H_
1772 // gen_amalgamated begin header: include/perfetto/protozero/message.h
1773 // gen_amalgamated begin header: include/perfetto/base/logging.h
1774 /*
1775  * Copyright (C) 2017 The Android Open Source Project
1776  *
1777  * Licensed under the Apache License, Version 2.0 (the "License");
1778  * you may not use this file except in compliance with the License.
1779  * You may obtain a copy of the License at
1780  *
1781  *      http://www.apache.org/licenses/LICENSE-2.0
1782  *
1783  * Unless required by applicable law or agreed to in writing, software
1784  * distributed under the License is distributed on an "AS IS" BASIS,
1785  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1786  * See the License for the specific language governing permissions and
1787  * limitations under the License.
1788  */
1789 
1790 #ifndef INCLUDE_PERFETTO_BASE_LOGGING_H_
1791 #define INCLUDE_PERFETTO_BASE_LOGGING_H_
1792 
1793 #include <errno.h>
1794 #include <string.h>  // For strerror.
1795 
1796 // gen_amalgamated expanded: #include "perfetto/base/build_config.h"
1797 // gen_amalgamated expanded: #include "perfetto/base/compiler.h"
1798 // gen_amalgamated expanded: #include "perfetto/base/export.h"
1799 
1800 // Ignore GCC warning about a missing argument for a variadic macro parameter.
1801 #pragma GCC system_header
1802 
1803 // TODO(primiano): move this to base/build_config.h, turn into
1804 // PERFETTO_BUILDFLAG(DCHECK_IS_ON) and update call sites to use that instead.
1805 #if defined(NDEBUG) && !defined(DCHECK_ALWAYS_ON)
1806 #define PERFETTO_DCHECK_IS_ON() 0
1807 #else
1808 #define PERFETTO_DCHECK_IS_ON() 1
1809 #endif
1810 
1811 #if PERFETTO_BUILDFLAG(PERFETTO_FORCE_DLOG_ON)
1812 #define PERFETTO_DLOG_IS_ON() 1
1813 #elif PERFETTO_BUILDFLAG(PERFETTO_FORCE_DLOG_OFF)
1814 #define PERFETTO_DLOG_IS_ON() 0
1815 #else
1816 #define PERFETTO_DLOG_IS_ON() PERFETTO_DCHECK_IS_ON()
1817 #endif
1818 
1819 #if defined(PERFETTO_ANDROID_ASYNC_SAFE_LOG)
1820 #if !PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID) || \
1821     !PERFETTO_BUILDFLAG(PERFETTO_ANDROID_BUILD)
1822 #error "Async-safe logging is limited to Android tree builds"
1823 #endif
1824 // For binaries which need a very lightweight logging implementation.
1825 // Note that this header is incompatible with android/log.h.
1826 #include <async_safe/log.h>
1827 #elif PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
1828 // Normal android logging.
1829 #include <android/log.h>
1830 #endif
1831 
1832 namespace perfetto {
1833 namespace base {
1834 
1835 // Constexpr functions to extract basename(__FILE__), e.g.: ../foo/f.c -> f.c .
StrEnd(const char * s)1836 constexpr const char* StrEnd(const char* s) {
1837   return *s ? StrEnd(s + 1) : s;
1838 }
1839 
BasenameRecursive(const char * s,const char * begin,const char * end)1840 constexpr const char* BasenameRecursive(const char* s,
1841                                         const char* begin,
1842                                         const char* end) {
1843   return (*s == '/' && s < end)
1844              ? (s + 1)
1845              : ((s > begin) ? BasenameRecursive(s - 1, begin, end) : s);
1846 }
1847 
Basename(const char * str)1848 constexpr const char* Basename(const char* str) {
1849   return BasenameRecursive(StrEnd(str), str, StrEnd(str));
1850 }
1851 
1852 enum LogLev { kLogDebug = 0, kLogInfo, kLogImportant, kLogError };
1853 
1854 PERFETTO_EXPORT void LogMessage(LogLev,
1855                                 const char* fname,
1856                                 int line,
1857                                 const char* fmt,
1858                                 ...) PERFETTO_PRINTF_FORMAT(4, 5);
1859 
1860 #if defined(PERFETTO_ANDROID_ASYNC_SAFE_LOG)
1861 #define PERFETTO_XLOG(level, fmt, ...)                                        \
1862   do {                                                                        \
1863     async_safe_format_log((ANDROID_LOG_DEBUG + level), "perfetto",            \
1864                           "%s:%d " fmt, ::perfetto::base::Basename(__FILE__), \
1865                           __LINE__, ##__VA_ARGS__);                           \
1866   } while (0)
1867 #elif defined(PERFETTO_DISABLE_LOG)
1868 #define PERFETTO_XLOG(...) ::perfetto::base::ignore_result(__VA_ARGS__)
1869 #else
1870 #define PERFETTO_XLOG(level, fmt, ...)                                      \
1871   ::perfetto::base::LogMessage(level, ::perfetto::base::Basename(__FILE__), \
1872                                __LINE__, fmt, ##__VA_ARGS__)
1873 #endif
1874 
1875 #define PERFETTO_IMMEDIATE_CRASH() \
1876   do {                             \
1877     __builtin_trap();              \
1878     __builtin_unreachable();       \
1879   } while (0)
1880 
1881 #if PERFETTO_BUILDFLAG(PERFETTO_VERBOSE_LOGS)
1882 #define PERFETTO_LOG(fmt, ...) \
1883   PERFETTO_XLOG(::perfetto::base::kLogInfo, fmt, ##__VA_ARGS__)
1884 #else  // PERFETTO_BUILDFLAG(PERFETTO_VERBOSE_LOGS)
1885 #define PERFETTO_LOG(...) ::perfetto::base::ignore_result(__VA_ARGS__)
1886 #endif  // PERFETTO_BUILDFLAG(PERFETTO_VERBOSE_LOGS)
1887 
1888 #define PERFETTO_ILOG(fmt, ...) \
1889   PERFETTO_XLOG(::perfetto::base::kLogImportant, fmt, ##__VA_ARGS__)
1890 #define PERFETTO_ELOG(fmt, ...) \
1891   PERFETTO_XLOG(::perfetto::base::kLogError, fmt, ##__VA_ARGS__)
1892 #define PERFETTO_FATAL(fmt, ...)       \
1893   do {                                 \
1894     PERFETTO_PLOG(fmt, ##__VA_ARGS__); \
1895     PERFETTO_IMMEDIATE_CRASH();        \
1896   } while (0)
1897 
1898 #define PERFETTO_PLOG(x, ...) \
1899   PERFETTO_ELOG(x " (errno: %d, %s)", ##__VA_ARGS__, errno, strerror(errno))
1900 
1901 #define PERFETTO_CHECK(x)                            \
1902   do {                                               \
1903     if (PERFETTO_UNLIKELY(!(x))) {                   \
1904       PERFETTO_PLOG("%s", "PERFETTO_CHECK(" #x ")"); \
1905       PERFETTO_IMMEDIATE_CRASH();                    \
1906     }                                                \
1907   } while (0)
1908 
1909 #if PERFETTO_DLOG_IS_ON()
1910 
1911 #define PERFETTO_DLOG(fmt, ...) \
1912   PERFETTO_XLOG(::perfetto::base::kLogDebug, fmt, ##__VA_ARGS__)
1913 
1914 #define PERFETTO_DPLOG(x, ...) \
1915   PERFETTO_DLOG(x " (errno: %d, %s)", ##__VA_ARGS__, errno, strerror(errno))
1916 
1917 #else  // PERFETTO_DLOG_IS_ON()
1918 
1919 #define PERFETTO_DLOG(...) ::perfetto::base::ignore_result(__VA_ARGS__)
1920 #define PERFETTO_DPLOG(...) ::perfetto::base::ignore_result(__VA_ARGS__)
1921 
1922 #endif  // PERFETTO_DLOG_IS_ON()
1923 
1924 #if PERFETTO_DCHECK_IS_ON()
1925 
1926 #define PERFETTO_DCHECK(x) PERFETTO_CHECK(x)
1927 #define PERFETTO_DFATAL(...) PERFETTO_FATAL(__VA_ARGS__)
1928 #define PERFETTO_DFATAL_OR_ELOG(...) PERFETTO_DFATAL(__VA_ARGS__)
1929 
1930 #else  // PERFETTO_DCHECK_IS_ON()
1931 
1932 #define PERFETTO_DCHECK(x) \
1933   do {                     \
1934   } while (false && (x))
1935 
1936 #define PERFETTO_DFATAL(...) ::perfetto::base::ignore_result(__VA_ARGS__)
1937 #define PERFETTO_DFATAL_OR_ELOG(...) PERFETTO_ELOG(__VA_ARGS__)
1938 
1939 #endif  // PERFETTO_DCHECK_IS_ON()
1940 
1941 }  // namespace base
1942 }  // namespace perfetto
1943 
1944 #endif  // INCLUDE_PERFETTO_BASE_LOGGING_H_
1945 // gen_amalgamated begin header: include/perfetto/protozero/contiguous_memory_range.h
1946 /*
1947  * Copyright (C) 2017 The Android Open Source Project
1948  *
1949  * Licensed under the Apache License, Version 2.0 (the "License");
1950  * you may not use this file except in compliance with the License.
1951  * You may obtain a copy of the License at
1952  *
1953  *      http://www.apache.org/licenses/LICENSE-2.0
1954  *
1955  * Unless required by applicable law or agreed to in writing, software
1956  * distributed under the License is distributed on an "AS IS" BASIS,
1957  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1958  * See the License for the specific language governing permissions and
1959  * limitations under the License.
1960  */
1961 
1962 #ifndef INCLUDE_PERFETTO_PROTOZERO_CONTIGUOUS_MEMORY_RANGE_H_
1963 #define INCLUDE_PERFETTO_PROTOZERO_CONTIGUOUS_MEMORY_RANGE_H_
1964 
1965 #include <assert.h>
1966 #include <stddef.h>
1967 #include <stdint.h>
1968 
1969 namespace protozero {
1970 
1971 // Keep this struct trivially constructible (no ctors, no default initializers).
1972 struct ContiguousMemoryRange {
1973   uint8_t* begin;
1974   uint8_t* end;  // STL style: one byte past the end of the buffer.
1975 
is_validContiguousMemoryRange1976   inline bool is_valid() const { return begin != nullptr; }
resetContiguousMemoryRange1977   inline void reset() { begin = nullptr; }
sizeContiguousMemoryRange1978   inline size_t size() const { return static_cast<size_t>(end - begin); }
1979 };
1980 
1981 }  // namespace protozero
1982 
1983 #endif  // INCLUDE_PERFETTO_PROTOZERO_CONTIGUOUS_MEMORY_RANGE_H_
1984 // gen_amalgamated begin header: include/perfetto/protozero/proto_utils.h
1985 /*
1986  * Copyright (C) 2017 The Android Open Source Project
1987  *
1988  * Licensed under the Apache License, Version 2.0 (the "License");
1989  * you may not use this file except in compliance with the License.
1990  * You may obtain a copy of the License at
1991  *
1992  *      http://www.apache.org/licenses/LICENSE-2.0
1993  *
1994  * Unless required by applicable law or agreed to in writing, software
1995  * distributed under the License is distributed on an "AS IS" BASIS,
1996  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1997  * See the License for the specific language governing permissions and
1998  * limitations under the License.
1999  */
2000 
2001 #ifndef INCLUDE_PERFETTO_PROTOZERO_PROTO_UTILS_H_
2002 #define INCLUDE_PERFETTO_PROTOZERO_PROTO_UTILS_H_
2003 
2004 #include <inttypes.h>
2005 #include <stddef.h>
2006 
2007 #include <type_traits>
2008 
2009 // gen_amalgamated expanded: #include "perfetto/base/logging.h"
2010 
2011 namespace protozero {
2012 namespace proto_utils {
2013 
2014 // See https://developers.google.com/protocol-buffers/docs/encoding wire types.
2015 // This is a type encoded into the proto that provides just enough info to
2016 // find the length of the following value.
2017 enum class ProtoWireType : uint32_t {
2018   kVarInt = 0,
2019   kFixed64 = 1,
2020   kLengthDelimited = 2,
2021   kFixed32 = 5,
2022 };
2023 
2024 // This is the type defined in the proto for each field. This information
2025 // is used to decide the translation strategy when writing the trace.
2026 enum class ProtoSchemaType {
2027   kUnknown = 0,
2028   kDouble,
2029   kFloat,
2030   kInt64,
2031   kUint64,
2032   kInt32,
2033   kFixed64,
2034   kFixed32,
2035   kBool,
2036   kString,
2037   kGroup,  // Deprecated (proto2 only)
2038   kMessage,
2039   kBytes,
2040   kUint32,
2041   kEnum,
2042   kSfixed32,
2043   kSfixed64,
2044   kSint32,
2045   kSint64,
2046 };
2047 
ProtoSchemaToString(ProtoSchemaType v)2048 inline const char* ProtoSchemaToString(ProtoSchemaType v) {
2049   switch (v) {
2050     case ProtoSchemaType::kUnknown:
2051       return "unknown";
2052     case ProtoSchemaType::kDouble:
2053       return "double";
2054     case ProtoSchemaType::kFloat:
2055       return "float";
2056     case ProtoSchemaType::kInt64:
2057       return "int64";
2058     case ProtoSchemaType::kUint64:
2059       return "uint64";
2060     case ProtoSchemaType::kInt32:
2061       return "int32";
2062     case ProtoSchemaType::kFixed64:
2063       return "fixed64";
2064     case ProtoSchemaType::kFixed32:
2065       return "fixed32";
2066     case ProtoSchemaType::kBool:
2067       return "bool";
2068     case ProtoSchemaType::kString:
2069       return "string";
2070     case ProtoSchemaType::kGroup:
2071       return "group";
2072     case ProtoSchemaType::kMessage:
2073       return "message";
2074     case ProtoSchemaType::kBytes:
2075       return "bytes";
2076     case ProtoSchemaType::kUint32:
2077       return "uint32";
2078     case ProtoSchemaType::kEnum:
2079       return "enum";
2080     case ProtoSchemaType::kSfixed32:
2081       return "sfixed32";
2082     case ProtoSchemaType::kSfixed64:
2083       return "sfixed64";
2084     case ProtoSchemaType::kSint32:
2085       return "sint32";
2086     case ProtoSchemaType::kSint64:
2087       return "sint64";
2088   }
2089   // For gcc:
2090   PERFETTO_DCHECK(false);
2091   return "";
2092 }
2093 
2094 // Maximum message size supported: 256 MiB (4 x 7-bit due to varint encoding).
2095 constexpr size_t kMessageLengthFieldSize = 4;
2096 constexpr size_t kMaxMessageLength = (1u << (kMessageLengthFieldSize * 7)) - 1;
2097 
2098 // Field tag is encoded as 32-bit varint (5 bytes at most).
2099 // Largest value of simple (not length-delimited) field is 64-bit varint
2100 // (10 bytes at most). 15 bytes buffer is enough to store a simple field.
2101 constexpr size_t kMaxTagEncodedSize = 5;
2102 constexpr size_t kMaxSimpleFieldEncodedSize = kMaxTagEncodedSize + 10;
2103 
2104 // Proto types: (int|uint|sint)(32|64), bool, enum.
MakeTagVarInt(uint32_t field_id)2105 constexpr uint32_t MakeTagVarInt(uint32_t field_id) {
2106   return (field_id << 3) | static_cast<uint32_t>(ProtoWireType::kVarInt);
2107 }
2108 
2109 // Proto types: fixed64, sfixed64, fixed32, sfixed32, double, float.
2110 template <typename T>
MakeTagFixed(uint32_t field_id)2111 constexpr uint32_t MakeTagFixed(uint32_t field_id) {
2112   static_assert(sizeof(T) == 8 || sizeof(T) == 4, "Value must be 4 or 8 bytes");
2113   return (field_id << 3) |
2114          static_cast<uint32_t>((sizeof(T) == 8 ? ProtoWireType::kFixed64
2115                                                : ProtoWireType::kFixed32));
2116 }
2117 
2118 // Proto types: string, bytes, embedded messages.
MakeTagLengthDelimited(uint32_t field_id)2119 constexpr uint32_t MakeTagLengthDelimited(uint32_t field_id) {
2120   return (field_id << 3) |
2121          static_cast<uint32_t>(ProtoWireType::kLengthDelimited);
2122 }
2123 
2124 // Proto types: sint64, sint32.
2125 template <typename T>
ZigZagEncode(T value)2126 inline typename std::make_unsigned<T>::type ZigZagEncode(T value) {
2127   using UnsignedType = typename std::make_unsigned<T>::type;
2128 
2129   // Right-shift of negative values is implementation specific.
2130   // Assert the implementation does what we expect, which is that shifting any
2131   // positive value by sizeof(T) * 8 - 1 gives an all 0 bitmap, and a negative
2132   // value gives and all 1 bitmap.
2133   constexpr uint64_t kUnsignedZero = 0u;
2134   constexpr int64_t kNegativeOne = -1;
2135   constexpr int64_t kPositiveOne = 1;
2136   static_assert(static_cast<uint64_t>(kNegativeOne >> 63) == ~kUnsignedZero,
2137                 "implementation does not support assumed rightshift");
2138   static_assert(static_cast<uint64_t>(kPositiveOne >> 63) == kUnsignedZero,
2139                 "implementation does not support assumed rightshift");
2140 
2141   return (static_cast<UnsignedType>(value) << 1) ^
2142          static_cast<UnsignedType>(value >> (sizeof(T) * 8 - 1));
2143 }
2144 
2145 // Proto types: sint64, sint32.
2146 template <typename T>
ZigZagDecode(T value)2147 inline typename std::make_signed<T>::type ZigZagDecode(T value) {
2148   using UnsignedType = typename std::make_unsigned<T>::type;
2149   auto u_value = static_cast<UnsignedType>(value);
2150   return static_cast<typename std::make_signed<T>::type>(
2151       ((u_value >> 1) ^ -(u_value & 1)));
2152 }
2153 
2154 template <typename T>
WriteVarInt(T value,uint8_t * target)2155 inline uint8_t* WriteVarInt(T value, uint8_t* target) {
2156   // If value is <= 0 we must first sign extend to int64_t (see [1]).
2157   // Finally we always cast to an unsigned value to to avoid arithmetic
2158   // (sign expanding) shifts in the while loop.
2159   // [1]: "If you use int32 or int64 as the type for a negative number, the
2160   // resulting varint is always ten bytes long".
2161   // - developers.google.com/protocol-buffers/docs/encoding
2162   // So for each input type we do the following casts:
2163   // uintX_t -> uintX_t -> uintX_t
2164   // int8_t  -> int64_t -> uint64_t
2165   // int16_t -> int64_t -> uint64_t
2166   // int32_t -> int64_t -> uint64_t
2167   // int64_t -> int64_t -> uint64_t
2168   using MaybeExtendedType =
2169       typename std::conditional<std::is_unsigned<T>::value, T, int64_t>::type;
2170   using UnsignedType = typename std::make_unsigned<MaybeExtendedType>::type;
2171 
2172   MaybeExtendedType extended_value = static_cast<MaybeExtendedType>(value);
2173   UnsignedType unsigned_value = static_cast<UnsignedType>(extended_value);
2174 
2175   while (unsigned_value >= 0x80) {
2176     *target++ = static_cast<uint8_t>(unsigned_value) | 0x80;
2177     unsigned_value >>= 7;
2178   }
2179   *target = static_cast<uint8_t>(unsigned_value);
2180   return target + 1;
2181 }
2182 
2183 // Writes a fixed-size redundant encoding of the given |value|. This is
2184 // used to backfill fixed-size reservations for the length field using a
2185 // non-canonical varint encoding (e.g. \x81\x80\x80\x00 instead of \x01).
2186 // See https://github.com/google/protobuf/issues/1530.
2187 // In particular, this is used for nested messages. The size of a nested message
2188 // is not known until all its field have been written. |kMessageLengthFieldSize|
2189 // bytes are reserved to encode the size field and backfilled at the end.
WriteRedundantVarInt(uint32_t value,uint8_t * buf)2190 inline void WriteRedundantVarInt(uint32_t value, uint8_t* buf) {
2191   for (size_t i = 0; i < kMessageLengthFieldSize; ++i) {
2192     const uint8_t msb = (i < kMessageLengthFieldSize - 1) ? 0x80 : 0;
2193     buf[i] = static_cast<uint8_t>(value) | msb;
2194     value >>= 7;
2195   }
2196 }
2197 
2198 template <uint32_t field_id>
StaticAssertSingleBytePreamble()2199 void StaticAssertSingleBytePreamble() {
2200   static_assert(field_id < 16,
2201                 "Proto field id too big to fit in a single byte preamble");
2202 }
2203 
2204 // Parses a VarInt from the encoded buffer [start, end). |end| is STL-style and
2205 // points one byte past the end of buffer.
2206 // The parsed int value is stored in the output arg |value|. Returns a pointer
2207 // to the next unconsumed byte (so start < retval <= end) or |start| if the
2208 // VarInt could not be fully parsed because there was not enough space in the
2209 // buffer.
ParseVarInt(const uint8_t * start,const uint8_t * end,uint64_t * out_value)2210 inline const uint8_t* ParseVarInt(const uint8_t* start,
2211                                   const uint8_t* end,
2212                                   uint64_t* out_value) {
2213   const uint8_t* pos = start;
2214   uint64_t value = 0;
2215   for (uint32_t shift = 0; pos < end && shift < 64u; shift += 7) {
2216     // Cache *pos into |cur_byte| to prevent that the compiler dereferences the
2217     // pointer twice (here and in the if() below) due to char* aliasing rules.
2218     uint8_t cur_byte = *pos++;
2219     value |= static_cast<uint64_t>(cur_byte & 0x7f) << shift;
2220     if ((cur_byte & 0x80) == 0) {
2221       // In valid cases we get here.
2222       *out_value = value;
2223       return pos;
2224     }
2225   }
2226   *out_value = 0;
2227   return start;
2228 }
2229 
2230 }  // namespace proto_utils
2231 }  // namespace protozero
2232 
2233 #endif  // INCLUDE_PERFETTO_PROTOZERO_PROTO_UTILS_H_
2234 // gen_amalgamated begin header: include/perfetto/protozero/scattered_stream_writer.h
2235 /*
2236  * Copyright (C) 2017 The Android Open Source Project
2237  *
2238  * Licensed under the Apache License, Version 2.0 (the "License");
2239  * you may not use this file except in compliance with the License.
2240  * You may obtain a copy of the License at
2241  *
2242  *      http://www.apache.org/licenses/LICENSE-2.0
2243  *
2244  * Unless required by applicable law or agreed to in writing, software
2245  * distributed under the License is distributed on an "AS IS" BASIS,
2246  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2247  * See the License for the specific language governing permissions and
2248  * limitations under the License.
2249  */
2250 
2251 #ifndef INCLUDE_PERFETTO_PROTOZERO_SCATTERED_STREAM_WRITER_H_
2252 #define INCLUDE_PERFETTO_PROTOZERO_SCATTERED_STREAM_WRITER_H_
2253 
2254 #include <assert.h>
2255 #include <stddef.h>
2256 #include <stdint.h>
2257 #include <string.h>
2258 
2259 // gen_amalgamated expanded: #include "perfetto/base/compiler.h"
2260 // gen_amalgamated expanded: #include "perfetto/base/export.h"
2261 // gen_amalgamated expanded: #include "perfetto/protozero/contiguous_memory_range.h"
2262 
2263 namespace protozero {
2264 
2265 // This class deals with the following problem: append-only proto messages want
2266 // to write a stream of bytes, without caring about the implementation of the
2267 // underlying buffer (which concretely will be either the trace ring buffer
2268 // or a heap-allocated buffer). The main deal is: proto messages don't know in
2269 // advance what their size will be.
2270 // Due to the tracing buffer being split into fixed-size chunks, on some
2271 // occasions, these writes need to be spread over two (or more) non-contiguous
2272 // chunks of memory. Similarly, when the buffer is backed by the heap, we want
2273 // to avoid realloc() calls, as they might cause a full copy of the contents
2274 // of the buffer.
2275 // The purpose of this class is to abstract away the non-contiguous write logic.
2276 // This class knows how to deal with writes as long as they fall in the same
2277 // ContiguousMemoryRange and defers the chunk-chaining logic to the Delegate.
2278 class PERFETTO_EXPORT ScatteredStreamWriter {
2279  public:
2280   class PERFETTO_EXPORT Delegate {
2281    public:
2282     virtual ~Delegate();
2283     virtual ContiguousMemoryRange GetNewBuffer() = 0;
2284   };
2285 
2286   explicit ScatteredStreamWriter(Delegate* delegate);
2287   ~ScatteredStreamWriter();
2288 
WriteByte(uint8_t value)2289   inline void WriteByte(uint8_t value) {
2290     if (write_ptr_ >= cur_range_.end)
2291       Extend();
2292     *write_ptr_++ = value;
2293   }
2294 
2295   // Assumes that the caller checked that there is enough headroom.
2296   // TODO(primiano): perf optimization, this is a tracing hot path. The
2297   // compiler can make strong optimization on memcpy if the size arg is a
2298   // constexpr. Make a templated variant of this for fixed-size writes.
2299   // TODO(primiano): restrict / noalias might also help.
WriteBytesUnsafe(const uint8_t * src,size_t size)2300   inline void WriteBytesUnsafe(const uint8_t* src, size_t size) {
2301     uint8_t* const end = write_ptr_ + size;
2302     assert(end <= cur_range_.end);
2303     memcpy(write_ptr_, src, size);
2304     write_ptr_ = end;
2305   }
2306 
WriteBytes(const uint8_t * src,size_t size)2307   inline void WriteBytes(const uint8_t* src, size_t size) {
2308     uint8_t* const end = write_ptr_ + size;
2309     if (PERFETTO_LIKELY(end <= cur_range_.end))
2310       return WriteBytesUnsafe(src, size);
2311     WriteBytesSlowPath(src, size);
2312   }
2313 
2314   void WriteBytesSlowPath(const uint8_t* src, size_t size);
2315 
2316   // Reserves a fixed amount of bytes to be backfilled later. The reserved range
2317   // is guaranteed to be contiguous and not span across chunks. |size| has to be
2318   // <= than the size of a new buffer returned by the Delegate::GetNewBuffer().
2319   uint8_t* ReserveBytes(size_t size);
2320 
2321   // Fast (but unsafe) version of the above. The caller must have previously
2322   // checked that there are at least |size| contiguous bytes available.
2323   // Returns only the start pointer of the reservation.
ReserveBytesUnsafe(size_t size)2324   uint8_t* ReserveBytesUnsafe(size_t size) {
2325     uint8_t* begin = write_ptr_;
2326     write_ptr_ += size;
2327     assert(write_ptr_ <= cur_range_.end);
2328     return begin;
2329   }
2330 
2331   // Resets the buffer boundaries and the write pointer to the given |range|.
2332   // Subsequent WriteByte(s) will write into |range|.
2333   void Reset(ContiguousMemoryRange range);
2334 
2335   // Number of contiguous free bytes in |cur_range_| that can be written without
2336   // requesting a new buffer.
bytes_available()2337   size_t bytes_available() const {
2338     return static_cast<size_t>(cur_range_.end - write_ptr_);
2339   }
2340 
write_ptr()2341   uint8_t* write_ptr() const { return write_ptr_; }
2342 
written()2343   uint64_t written() const {
2344     return written_previously_ +
2345            static_cast<uint64_t>(write_ptr_ - cur_range_.begin);
2346   }
2347 
2348  private:
2349   ScatteredStreamWriter(const ScatteredStreamWriter&) = delete;
2350   ScatteredStreamWriter& operator=(const ScatteredStreamWriter&) = delete;
2351 
2352   void Extend();
2353 
2354   Delegate* const delegate_;
2355   ContiguousMemoryRange cur_range_;
2356   uint8_t* write_ptr_;
2357   uint64_t written_previously_ = 0;
2358 };
2359 
2360 }  // namespace protozero
2361 
2362 #endif  // INCLUDE_PERFETTO_PROTOZERO_SCATTERED_STREAM_WRITER_H_
2363 /*
2364  * Copyright (C) 2017 The Android Open Source Project
2365  *
2366  * Licensed under the Apache License, Version 2.0 (the "License");
2367  * you may not use this file except in compliance with the License.
2368  * You may obtain a copy of the License at
2369  *
2370  *      http://www.apache.org/licenses/LICENSE-2.0
2371  *
2372  * Unless required by applicable law or agreed to in writing, software
2373  * distributed under the License is distributed on an "AS IS" BASIS,
2374  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2375  * See the License for the specific language governing permissions and
2376  * limitations under the License.
2377  */
2378 
2379 #ifndef INCLUDE_PERFETTO_PROTOZERO_MESSAGE_H_
2380 #define INCLUDE_PERFETTO_PROTOZERO_MESSAGE_H_
2381 
2382 #include <assert.h>
2383 #include <stdint.h>
2384 #include <string.h>
2385 
2386 #include <string>
2387 #include <type_traits>
2388 
2389 // gen_amalgamated expanded: #include "perfetto/base/export.h"
2390 // gen_amalgamated expanded: #include "perfetto/base/logging.h"
2391 // gen_amalgamated expanded: #include "perfetto/protozero/contiguous_memory_range.h"
2392 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
2393 // gen_amalgamated expanded: #include "perfetto/protozero/scattered_stream_writer.h"
2394 
2395 namespace perfetto {
2396 namespace shm_fuzz {
2397 class FakeProducer;
2398 }  // namespace shm_fuzz
2399 }  // namespace perfetto
2400 
2401 namespace protozero {
2402 
2403 class MessageArena;
2404 class MessageHandleBase;
2405 
2406 // Base class extended by the proto C++ stubs generated by the ProtoZero
2407 // compiler. This class provides the minimal runtime required to support
2408 // append-only operations and is designed for performance. None of the methods
2409 // require any dynamic memory allocation, unless more than 16 nested messages
2410 // are created via BeginNestedMessage() calls.
2411 class PERFETTO_EXPORT Message {
2412  public:
2413   friend class MessageHandleBase;
2414 
2415   // The ctor is deliberately a no-op to avoid forwarding args from all
2416   // subclasses. The real initialization is performed by Reset().
2417   // Nested messages are allocated via placement new by MessageArena and
2418   // implictly destroyed when the RootMessage's arena goes away. This is
2419   // fine as long as all the fields are PODs, which is checked by the
2420   // static_assert()s in the Reset() method.
2421   Message() = default;
2422 
2423   // Clears up the state, allowing the message to be reused as a fresh one.
2424   void Reset(ScatteredStreamWriter*, MessageArena*);
2425 
2426   // Commits all the changes to the buffer (backfills the size field of this and
2427   // all nested messages) and seals the message. Returns the size of the message
2428   // (and all nested sub-messages), without taking into account any chunking.
2429   // Finalize is idempotent and can be called several times w/o side effects.
2430   uint32_t Finalize();
2431 
2432   // Optional. If is_valid() == true, the corresponding memory region (its
2433   // length == proto_utils::kMessageLengthFieldSize) is backfilled with the size
2434   // of this message (minus |size_already_written| below). This is the mechanism
2435   // used by messages to backfill their corresponding size field in the parent
2436   // message.
size_field()2437   uint8_t* size_field() const { return size_field_; }
set_size_field(uint8_t * size_field)2438   void set_size_field(uint8_t* size_field) { size_field_ = size_field; }
2439 
2440   // This is to deal with case of backfilling the size of a root (non-nested)
2441   // message which is split into multiple chunks. Upon finalization only the
2442   // partial size that lies in the last chunk has to be backfilled.
inc_size_already_written(uint32_t sz)2443   void inc_size_already_written(uint32_t sz) { size_already_written_ += sz; }
2444 
nested_message()2445   Message* nested_message() { return nested_message_; }
2446 
is_finalized()2447   bool is_finalized() const { return finalized_; }
2448 
2449 #if PERFETTO_DCHECK_IS_ON()
set_handle(MessageHandleBase * handle)2450   void set_handle(MessageHandleBase* handle) { handle_ = handle; }
2451 #endif
2452 
2453   // Proto types: uint64, uint32, int64, int32, bool, enum.
2454   template <typename T>
AppendVarInt(uint32_t field_id,T value)2455   void AppendVarInt(uint32_t field_id, T value) {
2456     if (nested_message_)
2457       EndNestedMessage();
2458 
2459     uint8_t buffer[proto_utils::kMaxSimpleFieldEncodedSize];
2460     uint8_t* pos = buffer;
2461 
2462     pos = proto_utils::WriteVarInt(proto_utils::MakeTagVarInt(field_id), pos);
2463     // WriteVarInt encodes signed values in two's complement form.
2464     pos = proto_utils::WriteVarInt(value, pos);
2465     WriteToStream(buffer, pos);
2466   }
2467 
2468   // Proto types: sint64, sint32.
2469   template <typename T>
AppendSignedVarInt(uint32_t field_id,T value)2470   void AppendSignedVarInt(uint32_t field_id, T value) {
2471     AppendVarInt(field_id, proto_utils::ZigZagEncode(value));
2472   }
2473 
2474   // Proto types: bool, enum (small).
2475   // Faster version of AppendVarInt for tiny numbers.
AppendTinyVarInt(uint32_t field_id,int32_t value)2476   void AppendTinyVarInt(uint32_t field_id, int32_t value) {
2477     PERFETTO_DCHECK(0 <= value && value < 0x80);
2478     if (nested_message_)
2479       EndNestedMessage();
2480 
2481     uint8_t buffer[proto_utils::kMaxSimpleFieldEncodedSize];
2482     uint8_t* pos = buffer;
2483     // MakeTagVarInt gets super optimized here for constexpr.
2484     pos = proto_utils::WriteVarInt(proto_utils::MakeTagVarInt(field_id), pos);
2485     *pos++ = static_cast<uint8_t>(value);
2486     WriteToStream(buffer, pos);
2487   }
2488 
2489   // Proto types: fixed64, sfixed64, fixed32, sfixed32, double, float.
2490   template <typename T>
AppendFixed(uint32_t field_id,T value)2491   void AppendFixed(uint32_t field_id, T value) {
2492     if (nested_message_)
2493       EndNestedMessage();
2494 
2495     uint8_t buffer[proto_utils::kMaxSimpleFieldEncodedSize];
2496     uint8_t* pos = buffer;
2497 
2498     pos = proto_utils::WriteVarInt(proto_utils::MakeTagFixed<T>(field_id), pos);
2499     memcpy(pos, &value, sizeof(T));
2500     pos += sizeof(T);
2501     // TODO: Optimize memcpy performance, see http://crbug.com/624311 .
2502     WriteToStream(buffer, pos);
2503   }
2504 
2505   void AppendString(uint32_t field_id, const char* str);
2506 
AppendString(uint32_t field_id,const std::string & str)2507   void AppendString(uint32_t field_id, const std::string& str) {
2508     AppendBytes(field_id, str.data(), str.size());
2509   }
2510 
2511   void AppendBytes(uint32_t field_id, const void* value, size_t size);
2512 
2513   // Append raw bytes for a field, using the supplied |ranges| to
2514   // copy from |num_ranges| individual buffers.
2515   size_t AppendScatteredBytes(uint32_t field_id,
2516                               ContiguousMemoryRange* ranges,
2517                               size_t num_ranges);
2518 
2519   // Begins a nested message. The returned object is owned by the MessageArena
2520   // of the root message. The nested message ends either when Finalize() is
2521   // called or when any other Append* method is called in the parent class.
2522   // The template argument T is supposed to be a stub class auto generated from
2523   // a .proto, hence a subclass of Message.
2524   template <class T>
BeginNestedMessage(uint32_t field_id)2525   T* BeginNestedMessage(uint32_t field_id) {
2526     // This is to prevent subclasses (which should be autogenerated, though), to
2527     // introduce extra state fields (which wouldn't be initialized by Reset()).
2528     static_assert(std::is_base_of<Message, T>::value,
2529                   "T must be a subclass of Message");
2530     static_assert(sizeof(T) == sizeof(Message),
2531                   "Message subclasses cannot introduce extra state.");
2532     return static_cast<T*>(BeginNestedMessageInternal(field_id));
2533   }
2534 
stream_writer_for_testing()2535   ScatteredStreamWriter* stream_writer_for_testing() { return stream_writer_; }
2536 
2537   // Appends some raw bytes to the message. The use-case for this is preserving
2538   // unknown fields in the decode -> re-encode path of xxx.gen.cc classes
2539   // generated by the cppgen_plugin.cc.
2540   // The caller needs to guarantee that the appended data is properly
2541   // proto-encoded and each field has a proto preamble.
AppendRawProtoBytes(const void * data,size_t size)2542   void AppendRawProtoBytes(const void* data, size_t size) {
2543     const uint8_t* src = reinterpret_cast<const uint8_t*>(data);
2544     WriteToStream(src, src + size);
2545   }
2546 
2547  private:
2548   Message(const Message&) = delete;
2549   Message& operator=(const Message&) = delete;
2550 
2551   Message* BeginNestedMessageInternal(uint32_t field_id);
2552 
2553   // Called by Finalize and Append* methods.
2554   void EndNestedMessage();
2555 
WriteToStream(const uint8_t * src_begin,const uint8_t * src_end)2556   void WriteToStream(const uint8_t* src_begin, const uint8_t* src_end) {
2557     PERFETTO_DCHECK(!finalized_);
2558     PERFETTO_DCHECK(src_begin <= src_end);
2559     const uint32_t size = static_cast<uint32_t>(src_end - src_begin);
2560     stream_writer_->WriteBytes(src_begin, size);
2561     size_ += size;
2562   }
2563 
2564   // Only POD fields are allowed. This class's dtor is never called.
2565   // See the comment on the static_assert in the corresponding .cc file.
2566 
2567   // The stream writer interface used for the serialization.
2568   ScatteredStreamWriter* stream_writer_;
2569 
2570   // The storage used to allocate nested Message objects.
2571   // This is owned by RootMessage<T>.
2572   MessageArena* arena_;
2573 
2574   // Pointer to the last child message created through BeginNestedMessage(), if
2575   // any, nullptr otherwise. There is no need to keep track of more than one
2576   // message per nesting level as the proto-zero API contract mandates that
2577   // nested fields can be filled only in a stacked fashion. In other words,
2578   // nested messages are finalized and sealed when any other field is set in the
2579   // parent message (or the parent message itself is finalized) and cannot be
2580   // accessed anymore afterwards.
2581   Message* nested_message_;
2582 
2583   // [optional] Pointer to a non-aligned pre-reserved var-int slot of
2584   // kMessageLengthFieldSize bytes. When set, the Finalize() method will write
2585   // the size of proto-encoded message in the pointed memory region.
2586   uint8_t* size_field_;
2587 
2588   // Keeps track of the size of the current message.
2589   uint32_t size_;
2590 
2591   // See comment for inc_size_already_written().
2592   uint32_t size_already_written_;
2593 
2594   // When true, no more changes to the message are allowed. This is to DCHECK
2595   // attempts of writing to a message which has been Finalize()-d.
2596   bool finalized_;
2597 
2598 #if PERFETTO_DCHECK_IS_ON()
2599   // Current generation of message. Incremented on Reset.
2600   // Used to detect stale handles.
2601   uint32_t generation_;
2602 
2603   MessageHandleBase* handle_;
2604 #endif
2605 };
2606 
2607 }  // namespace protozero
2608 
2609 #endif  // INCLUDE_PERFETTO_PROTOZERO_MESSAGE_H_
2610 // gen_amalgamated begin header: include/perfetto/protozero/message_handle.h
2611 /*
2612  * Copyright (C) 2017 The Android Open Source Project
2613  *
2614  * Licensed under the Apache License, Version 2.0 (the "License");
2615  * you may not use this file except in compliance with the License.
2616  * You may obtain a copy of the License at
2617  *
2618  *      http://www.apache.org/licenses/LICENSE-2.0
2619  *
2620  * Unless required by applicable law or agreed to in writing, software
2621  * distributed under the License is distributed on an "AS IS" BASIS,
2622  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2623  * See the License for the specific language governing permissions and
2624  * limitations under the License.
2625  */
2626 
2627 #ifndef INCLUDE_PERFETTO_PROTOZERO_MESSAGE_HANDLE_H_
2628 #define INCLUDE_PERFETTO_PROTOZERO_MESSAGE_HANDLE_H_
2629 
2630 #include <functional>
2631 
2632 // gen_amalgamated expanded: #include "perfetto/base/export.h"
2633 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
2634 
2635 namespace protozero {
2636 
2637 class Message;
2638 
2639 // MessageHandle allows to decouple the lifetime of a proto message
2640 // from the underlying storage. It gives the following guarantees:
2641 // - The underlying message is finalized (if still alive) if the handle goes
2642 //   out of scope.
2643 // - In Debug / DCHECK_ALWAYS_ON builds, the handle becomes null once the
2644 //   message is finalized. This is to enforce the append-only API. For instance
2645 //   when adding two repeated messages, the addition of the 2nd one forces
2646 //   the finalization of the first.
2647 // Think about this as a WeakPtr<Message> which calls
2648 // Message::Finalize() when going out of scope.
2649 
2650 class PERFETTO_EXPORT MessageHandleBase {
2651  public:
2652   ~MessageHandleBase();
2653 
2654   // Move-only type.
2655   MessageHandleBase(MessageHandleBase&&) noexcept;
2656   MessageHandleBase& operator=(MessageHandleBase&&);
2657   explicit operator bool() const {
2658 #if PERFETTO_DCHECK_IS_ON()
2659     PERFETTO_DCHECK(!message_ || generation_ == message_->generation_);
2660 #endif
2661     return !!message_;
2662   }
2663 
2664  protected:
2665   explicit MessageHandleBase(Message* = nullptr);
2666   Message* operator->() const {
2667 #if PERFETTO_DCHECK_IS_ON()
2668     PERFETTO_DCHECK(!message_ || generation_ == message_->generation_);
2669 #endif
2670     return message_;
2671   }
2672   Message& operator*() const { return *(operator->()); }
2673 
2674  private:
2675   friend class Message;
2676   MessageHandleBase(const MessageHandleBase&) = delete;
2677   MessageHandleBase& operator=(const MessageHandleBase&) = delete;
2678 
reset_message()2679   void reset_message() {
2680     // This is called by Message::Finalize().
2681     PERFETTO_DCHECK(message_->is_finalized());
2682     message_ = nullptr;
2683   }
2684 
2685   void Move(MessageHandleBase&&);
2686 
FinalizeMessage()2687   void FinalizeMessage() { message_->Finalize(); }
2688 
2689   Message* message_;
2690 #if PERFETTO_DCHECK_IS_ON()
2691   uint32_t generation_;
2692 #endif
2693 };
2694 
2695 template <typename T>
2696 class MessageHandle : public MessageHandleBase {
2697  public:
MessageHandle()2698   MessageHandle() : MessageHandle(nullptr) {}
MessageHandle(T * message)2699   explicit MessageHandle(T* message) : MessageHandleBase(message) {}
2700 
2701   explicit operator bool() const { return MessageHandleBase::operator bool(); }
2702 
2703   T& operator*() const {
2704     return static_cast<T&>(MessageHandleBase::operator*());
2705   }
2706 
2707   T* operator->() const {
2708     return static_cast<T*>(MessageHandleBase::operator->());
2709   }
2710 
get()2711   T* get() const { return static_cast<T*>(MessageHandleBase::operator->()); }
2712 };
2713 
2714 }  // namespace protozero
2715 
2716 #endif  // INCLUDE_PERFETTO_PROTOZERO_MESSAGE_HANDLE_H_
2717 // gen_amalgamated begin header: include/perfetto/tracing/internal/basic_types.h
2718 /*
2719  * Copyright (C) 2019 The Android Open Source Project
2720  *
2721  * Licensed under the Apache License, Version 2.0 (the "License");
2722  * you may not use this file except in compliance with the License.
2723  * You may obtain a copy of the License at
2724  *
2725  *      http://www.apache.org/licenses/LICENSE-2.0
2726  *
2727  * Unless required by applicable law or agreed to in writing, software
2728  * distributed under the License is distributed on an "AS IS" BASIS,
2729  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2730  * See the License for the specific language governing permissions and
2731  * limitations under the License.
2732  */
2733 
2734 #ifndef INCLUDE_PERFETTO_TRACING_INTERNAL_BASIC_TYPES_H_
2735 #define INCLUDE_PERFETTO_TRACING_INTERNAL_BASIC_TYPES_H_
2736 
2737 #include <stddef.h>
2738 #include <stdint.h>
2739 
2740 namespace perfetto {
2741 namespace internal {
2742 
2743 // A static_assert in tracing_muxer_impl.cc guarantees that this stays in sync
2744 // with the definition in tracing/core/basic_types.h
2745 using BufferId = uint16_t;
2746 
2747 // This is a direct index in the TracingMuxer::backends_ vector.
2748 // Backends are only added and never removed.
2749 using TracingBackendId = size_t;
2750 
2751 // Max numbers of data sources that can be registered in a process.
2752 constexpr size_t kMaxDataSources = 32;
2753 
2754 // Max instances for each data source type. This typically matches the
2755 // "max number of concurrent tracing sessions". However remember that a data
2756 // source can be instantiated more than once within one tracing session by
2757 // creating two entries for it in the trace config.
2758 constexpr size_t kMaxDataSourceInstances = 8;
2759 
2760 }  // namespace internal
2761 }  // namespace perfetto
2762 
2763 #endif  // INCLUDE_PERFETTO_TRACING_INTERNAL_BASIC_TYPES_H_
2764 // gen_amalgamated begin header: include/perfetto/tracing/internal/data_source_internal.h
2765 // gen_amalgamated begin header: include/perfetto/tracing/trace_writer_base.h
2766 /*
2767  * Copyright (C) 2019 The Android Open Source Project
2768  *
2769  * Licensed under the Apache License, Version 2.0 (the "License");
2770  * you may not use this file except in compliance with the License.
2771  * You may obtain a copy of the License at
2772  *
2773  *      http://www.apache.org/licenses/LICENSE-2.0
2774  *
2775  * Unless required by applicable law or agreed to in writing, software
2776  * distributed under the License is distributed on an "AS IS" BASIS,
2777  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2778  * See the License for the specific language governing permissions and
2779  * limitations under the License.
2780  */
2781 
2782 #ifndef INCLUDE_PERFETTO_TRACING_TRACE_WRITER_BASE_H_
2783 #define INCLUDE_PERFETTO_TRACING_TRACE_WRITER_BASE_H_
2784 
2785 // gen_amalgamated expanded: #include "perfetto/protozero/message_handle.h"
2786 
2787 namespace perfetto {
2788 
2789 namespace protos {
2790 namespace pbzero {
2791 class TracePacket;
2792 }  // namespace pbzero
2793 }  // namespace protos
2794 
2795 // The bare-minimum subset of the TraceWriter interface that is exposed as a
2796 // fully public API.
2797 // See comments in /include/perfetto/ext/tracing/core/trace_writer.h.
2798 class TraceWriterBase {
2799  public:
2800   virtual ~TraceWriterBase();
2801 
2802   virtual protozero::MessageHandle<protos::pbzero::TracePacket>
2803   NewTracePacket() = 0;
2804 
2805   virtual void Flush(std::function<void()> callback = {}) = 0;
2806   virtual uint64_t written() const = 0;
2807 };
2808 
2809 }  // namespace perfetto
2810 
2811 #endif  // INCLUDE_PERFETTO_TRACING_TRACE_WRITER_BASE_H_
2812 /*
2813  * Copyright (C) 2019 The Android Open Source Project
2814  *
2815  * Licensed under the Apache License, Version 2.0 (the "License");
2816  * you may not use this file except in compliance with the License.
2817  * You may obtain a copy of the License at
2818  *
2819  *      http://www.apache.org/licenses/LICENSE-2.0
2820  *
2821  * Unless required by applicable law or agreed to in writing, software
2822  * distributed under the License is distributed on an "AS IS" BASIS,
2823  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2824  * See the License for the specific language governing permissions and
2825  * limitations under the License.
2826  */
2827 
2828 #ifndef INCLUDE_PERFETTO_TRACING_INTERNAL_DATA_SOURCE_INTERNAL_H_
2829 #define INCLUDE_PERFETTO_TRACING_INTERNAL_DATA_SOURCE_INTERNAL_H_
2830 
2831 #include <stddef.h>
2832 #include <stdint.h>
2833 
2834 #include <array>
2835 #include <atomic>
2836 #include <functional>
2837 #include <memory>
2838 #include <mutex>
2839 
2840 // No perfetto headers (other than tracing/api and protozero) should be here.
2841 // gen_amalgamated expanded: #include "perfetto/tracing/buffer_exhausted_policy.h"
2842 // gen_amalgamated expanded: #include "perfetto/tracing/internal/basic_types.h"
2843 // gen_amalgamated expanded: #include "perfetto/tracing/trace_writer_base.h"
2844 
2845 namespace perfetto {
2846 
2847 class DataSourceBase;
2848 class TraceWriterBase;
2849 
2850 namespace internal {
2851 
2852 class TracingTLS;
2853 
2854 // This maintains the internal state of a data source instance that is used only
2855 // to implement the tracing mechanics and is not exposed to the API client.
2856 // There is one of these object per DataSource instance (up to
2857 // kMaxDataSourceInstances).
2858 struct DataSourceState {
2859   // This boolean flag determines whether the DataSource::Trace() method should
2860   // do something or be a no-op. This flag doesn't give the full guarantee
2861   // that tracing data will be visible in the trace, it just makes it so that
2862   // the client attemps writing trace data and interacting with the service.
2863   // For instance, when a tracing session ends the service will reject data
2864   // commits that arrive too late even if the producer hasn't received the stop
2865   // IPC message.
2866   // This flag is set right before calling OnStart() and cleared right before
2867   // calling OnStop(), unless using HandleStopAsynchronously() (see comments
2868   // in data_source.h).
2869   // Keep this flag as the first field. This allows the compiler to directly
2870   // dereference the DataSourceState* pointer in the trace fast-path without
2871   // doing extra pointr arithmetic.
2872   bool trace_lambda_enabled = false;
2873 
2874   // The central buffer id that all TraceWriter(s) created by this data source
2875   // must target.
2876   BufferId buffer_id = 0;
2877 
2878   // The index within TracingMuxerImpl.backends_. Practically it allows to
2879   // lookup the Producer object, and hence the IPC channel, for this data
2880   // source.
2881   TracingBackendId backend_id = 0;
2882 
2883   // The instance id as assigned by the tracing service. Note that because a
2884   // process can be connected to >1 services, this ID is not globally unique but
2885   // is only unique within the scope of its backend.
2886   // Only the tuple (backend_id, data_source_instance_id) is globally unique.
2887   uint64_t data_source_instance_id = 0;
2888 
2889   // A hash of the trace config used by this instance. This is used to
2890   // de-duplicate instances for data sources with identical names (e.g., track
2891   // event).
2892   uint64_t config_hash = 0;
2893 
2894   // This lock is not held to implement Trace() and it's used only if the trace
2895   // code wants to access its own data source state.
2896   // This is to prevent that accessing the data source on an arbitrary embedder
2897   // thread races with the internal IPC thread destroying the data source
2898   // because of a end-of-tracing notification from the service.
2899   std::recursive_mutex lock;
2900   std::unique_ptr<DataSourceBase> data_source;
2901 };
2902 
2903 // This is to allow lazy-initialization and avoid static initializers and
2904 // at-exit destructors. All the entries are initialized via placement-new when
2905 // DataSource::Register() is called, see TracingMuxerImpl::RegisterDataSource().
2906 struct DataSourceStateStorage {
2907   alignas(DataSourceState) char storage[sizeof(DataSourceState)]{};
2908 };
2909 
2910 // Per-DataSource-type global state.
2911 struct DataSourceStaticState {
2912   // Unique index of the data source, assigned at registration time.
2913   uint32_t index = kMaxDataSources;
2914 
2915   // A bitmap that tells about the validity of each |instances| entry. When the
2916   // i-th bit of the bitmap it's set, instances[i] is valid.
2917   std::atomic<uint32_t> valid_instances{};
2918   std::array<DataSourceStateStorage, kMaxDataSourceInstances> instances{};
2919 
2920   // Can be used with a cached |valid_instances| bitmap.
TryGetCachedDataSourceStaticState2921   DataSourceState* TryGetCached(uint32_t cached_bitmap, size_t n) {
2922     return cached_bitmap & (1 << n)
2923                ? reinterpret_cast<DataSourceState*>(&instances[n])
2924                : nullptr;
2925   }
2926 
TryGetDataSourceStaticState2927   DataSourceState* TryGet(size_t n) {
2928     return TryGetCached(valid_instances.load(std::memory_order_acquire), n);
2929   }
2930 
CompilerAssertsDataSourceStaticState2931   void CompilerAsserts() {
2932     static_assert(sizeof(valid_instances.load()) * 8 >= kMaxDataSourceInstances,
2933                   "kMaxDataSourceInstances too high");
2934   }
2935 };
2936 
2937 // Per-DataSource-instance thread-local state.
2938 struct DataSourceInstanceThreadLocalState {
2939   using IncrementalStatePointer = std::unique_ptr<void, void (*)(void*)>;
2940 
ResetDataSourceInstanceThreadLocalState2941   void Reset() {
2942     trace_writer.reset();
2943     incremental_state.reset();
2944     backend_id = 0;
2945     buffer_id = 0;
2946   }
2947 
2948   std::unique_ptr<TraceWriterBase> trace_writer;
2949   IncrementalStatePointer incremental_state = {nullptr, [](void*) {}};
2950   TracingBackendId backend_id;
2951   BufferId buffer_id;
2952 };
2953 
2954 // Per-DataSource-type thread-local state.
2955 struct DataSourceThreadLocalState {
2956   DataSourceStaticState* static_state = nullptr;
2957 
2958   // Pointer to the parent tls object that holds us. Used to retrieve the
2959   // generation, which is per-global-TLS and not per data-source.
2960   TracingTLS* root_tls = nullptr;
2961 
2962   // One entry per each data source instance.
2963   std::array<DataSourceInstanceThreadLocalState, kMaxDataSourceInstances>
2964       per_instance{};
2965 };
2966 
2967 }  // namespace internal
2968 }  // namespace perfetto
2969 
2970 #endif  // INCLUDE_PERFETTO_TRACING_INTERNAL_DATA_SOURCE_INTERNAL_H_
2971 // gen_amalgamated begin header: include/perfetto/tracing/internal/tracing_muxer.h
2972 // gen_amalgamated begin header: include/perfetto/tracing/internal/tracing_tls.h
2973 // gen_amalgamated begin header: include/perfetto/tracing/platform.h
2974 /*
2975  * Copyright (C) 2019 The Android Open Source Project
2976  *
2977  * Licensed under the Apache License, Version 2.0 (the "License");
2978  * you may not use this file except in compliance with the License.
2979  * You may obtain a copy of the License at
2980  *
2981  *      http://www.apache.org/licenses/LICENSE-2.0
2982  *
2983  * Unless required by applicable law or agreed to in writing, software
2984  * distributed under the License is distributed on an "AS IS" BASIS,
2985  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2986  * See the License for the specific language governing permissions and
2987  * limitations under the License.
2988  */
2989 
2990 #ifndef INCLUDE_PERFETTO_TRACING_PLATFORM_H_
2991 #define INCLUDE_PERFETTO_TRACING_PLATFORM_H_
2992 
2993 #include <stddef.h>
2994 #include <stdint.h>
2995 
2996 #include <functional>
2997 #include <memory>
2998 
2999 // gen_amalgamated expanded: #include "perfetto/base/export.h"
3000 
3001 namespace perfetto {
3002 
3003 namespace base {
3004 class TaskRunner;
3005 }  // namespace base
3006 
3007 // This abstract class is used to abstract dependencies on platform-specific
3008 // primitives that cannot be implemented by the perfetto codebase and must be
3009 // provided or overridden by the embedder.
3010 // This is, for instance, for cases where we want to use some particular
3011 // base:: class in Chrome and provide instead POSIX fallbacks for other
3012 // embedders.
3013 
3014 // Base class for thread-local objects. This is to get a basic object vtable and
3015 // delegate destruction to the embedder. See Platform::CreateThreadLocalObject.
3016 class PERFETTO_EXPORT PlatformThreadLocalObject {
3017  public:
3018   // Implemented by perfetto internal code. The embedder must call this when
3019   // implementing GetOrCreateThreadLocalObject() to create an instance for the
3020   // first time on each thread.
3021   static std::unique_ptr<PlatformThreadLocalObject> CreateInstance();
3022   virtual ~PlatformThreadLocalObject();
3023 };
3024 
3025 class PERFETTO_EXPORT Platform {
3026  public:
3027   // Embedders can use this unless they have custom needs (e.g. Chrome wanting
3028   // to use its own base class for TLS).
3029   static Platform* GetDefaultPlatform();
3030 
3031   virtual ~Platform();
3032 
3033   // Creates a thread-local object. The embedder must:
3034   // - Create an instance per-thread calling ThreadLocalObject::CreateInstance.
3035   // - Own the lifetime of the returned object as long as the thread is alive.
3036   // - Destroy it when the thread exits.
3037   // Perfetto requires only one thread-local object overall (obviously, one
3038   // instance per-thread) from the embedder.
3039   using ThreadLocalObject = ::perfetto::PlatformThreadLocalObject;
3040   virtual ThreadLocalObject* GetOrCreateThreadLocalObject() = 0;
3041 
3042   // Creates a sequenced task runner. The easiest implementation is to create
3043   // a new thread (e.g. use base::ThreadTaskRunner) but this can also be
3044   // implemented in some more clever way (e.g. using chromiums's scheduler).
3045   struct CreateTaskRunnerArgs {};
3046   virtual std::unique_ptr<base::TaskRunner> CreateTaskRunner(
3047       const CreateTaskRunnerArgs&) = 0;
3048 
3049   // Used to derive the producer name. Mostly relevant when using the
3050   // kSystemBackend mode. It can be an arbitrary string when using the
3051   // in-process mode.
3052   virtual std::string GetCurrentProcessName() = 0;
3053 };
3054 
3055 }  // namespace perfetto
3056 
3057 #endif  // INCLUDE_PERFETTO_TRACING_PLATFORM_H_
3058 /*
3059  * Copyright (C) 2019 The Android Open Source Project
3060  *
3061  * Licensed under the Apache License, Version 2.0 (the "License");
3062  * you may not use this file except in compliance with the License.
3063  * You may obtain a copy of the License at
3064  *
3065  *      http://www.apache.org/licenses/LICENSE-2.0
3066  *
3067  * Unless required by applicable law or agreed to in writing, software
3068  * distributed under the License is distributed on an "AS IS" BASIS,
3069  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3070  * See the License for the specific language governing permissions and
3071  * limitations under the License.
3072  */
3073 
3074 #ifndef INCLUDE_PERFETTO_TRACING_INTERNAL_TRACING_TLS_H_
3075 #define INCLUDE_PERFETTO_TRACING_INTERNAL_TRACING_TLS_H_
3076 
3077 #include <array>
3078 #include <memory>
3079 
3080 // gen_amalgamated expanded: #include "perfetto/tracing/internal/basic_types.h"
3081 // gen_amalgamated expanded: #include "perfetto/tracing/internal/data_source_internal.h"
3082 // gen_amalgamated expanded: #include "perfetto/tracing/platform.h"
3083 
3084 namespace perfetto {
3085 
3086 class TraceWriterBase;
3087 
3088 namespace internal {
3089 
3090 // Organization of the thread-local storage
3091 // ----------------------------------------
3092 // First of all, remember the cardinality of the problem: at any point in time
3093 // there are M data sources registered (i.e. number of subclasses of DataSource)
3094 // and up to N concurrent instances for each data source, so up to M * N total
3095 // data source instances around.
3096 // Each data source instance can be accessed by T threads (no upper bound).
3097 // We can safely put hard limits both to M and N (i.e. say that we support at
3098 // most 32 data source types per process and up to 8 concurrent instances).
3099 //
3100 // We want to make it so from the Platform viewpoint, we use only one global
3101 // TLS object, so T instances in total, one per thread, regardless of M and N.
3102 // This allows to deal with at-thread-exit destruction only in one place, rather
3103 // than N, M or M * N.
3104 //
3105 // Visually:
3106 //                     [    Thread 1   ] [    Thread 2   ] [    Thread T   ]
3107 //                     +---------------+ +---------------+ +---------------+
3108 // Data source Foo     |               | |               | |               |
3109 //  Instance 1         |     TLS       | |     TLS       | |     TLS       |
3110 //  Instance 2         |    Object     | |    Object     | |    Object     |
3111 //  Instance 3         |               | |               | |               |
3112 //                     |               | |               | |               |
3113 // Data source Bar     |               | |               | |               |
3114 //  Instance 1         |               | |               | |               |
3115 //  Instance 2         |               | |               | |               |
3116 //                     +---------------+ +---------------+ +---------------+
3117 //
3118 // Each TLS Object is organized as an array of M DataSourceThreadLocalState.
3119 // Each DSTLS itself is an array of up to N per-instance objects.
3120 // The only per-instance object for now is the TraceWriter.
3121 // So for each data source, for each instance, for each thread we keep one
3122 // TraceWriter.
3123 // The lookup is O(1): Given the TLS object, the TraceWriter is just tls[M][N].
3124 class TracingTLS : public Platform::ThreadLocalObject {
3125  public:
3126   ~TracingTLS() override;
3127 
3128   // This is checked against TraceMuxerImpl's global generation counter to
3129   // handle destruction of TraceWriter(s) that belong to data sources that
3130   // have been stopped. When the two numbers diverge, a scan of all the
3131   // thread-local TraceWriter(s) is issued.
3132   uint32_t generation = 0;
3133 
3134   // By default all data source instances have independent thread-local state
3135   // (see above).
3136   std::array<DataSourceThreadLocalState, kMaxDataSources> data_sources_tls{};
3137 
3138   // Track event data sources, however, share the same thread-local state in
3139   // order to be able to share trace writers and interning state across all
3140   // track event categories.
3141   DataSourceThreadLocalState track_event_tls{};
3142 };
3143 
3144 }  // namespace internal
3145 }  // namespace perfetto
3146 
3147 #endif  // INCLUDE_PERFETTO_TRACING_INTERNAL_TRACING_TLS_H_
3148 /*
3149  * Copyright (C) 2019 The Android Open Source Project
3150  *
3151  * Licensed under the Apache License, Version 2.0 (the "License");
3152  * you may not use this file except in compliance with the License.
3153  * You may obtain a copy of the License at
3154  *
3155  *      http://www.apache.org/licenses/LICENSE-2.0
3156  *
3157  * Unless required by applicable law or agreed to in writing, software
3158  * distributed under the License is distributed on an "AS IS" BASIS,
3159  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3160  * See the License for the specific language governing permissions and
3161  * limitations under the License.
3162  */
3163 
3164 #ifndef INCLUDE_PERFETTO_TRACING_INTERNAL_TRACING_MUXER_H_
3165 #define INCLUDE_PERFETTO_TRACING_INTERNAL_TRACING_MUXER_H_
3166 
3167 #include <atomic>
3168 #include <memory>
3169 
3170 // gen_amalgamated expanded: #include "perfetto/base/export.h"
3171 // gen_amalgamated expanded: #include "perfetto/tracing/core/forward_decls.h"
3172 // gen_amalgamated expanded: #include "perfetto/tracing/internal/basic_types.h"
3173 // gen_amalgamated expanded: #include "perfetto/tracing/internal/tracing_tls.h"
3174 // gen_amalgamated expanded: #include "perfetto/tracing/platform.h"
3175 namespace perfetto {
3176 
3177 class DataSourceBase;
3178 class TraceWriterBase;
3179 struct TracingInitArgs;
3180 class TracingSession;
3181 
3182 namespace internal {
3183 
3184 struct DataSourceStaticState;
3185 
3186 // This class acts as a bridge between the public API methods and the
3187 // TracingBackend(s). It exposes a simplified view of the world to the API
3188 // methods, so that they don't have to care about the multiplicity of backends.
3189 // It handles all the bookkeeping to map data source instances and trace writers
3190 // to the various backends.
3191 // See tracing_muxer_impl.h for the full picture. This class contains only the
3192 // fewer fields and methods that need to be exposed to public/ headers. Fields
3193 // and methods that are required to implement them should go into
3194 // src/tracing/internal/tracing_muxer_impl.h instead: that one can pull in
3195 // perfetto headers outside of public, this one cannot.
3196 class PERFETTO_EXPORT TracingMuxer {
3197  public:
Get()3198   static TracingMuxer* Get() { return instance_; }
3199 
3200   virtual ~TracingMuxer();
3201 
GetOrCreateTracingTLS()3202   TracingTLS* GetOrCreateTracingTLS() {
3203     return static_cast<TracingTLS*>(platform_->GetOrCreateThreadLocalObject());
3204   }
3205 
3206   // This method can fail and return false if trying to register more than
3207   // kMaxDataSources types.
3208   using DataSourceFactory = std::function<std::unique_ptr<DataSourceBase>()>;
3209   virtual bool RegisterDataSource(const DataSourceDescriptor&,
3210                                   DataSourceFactory,
3211                                   DataSourceStaticState*) = 0;
3212 
3213   // It identifies the right backend and forwards the call to it.
3214   // The returned TraceWriter must be used within the same sequence (for most
3215   // projects this means "same thread"). Alternatively the client needs to take
3216   // care of using synchronization primitives to prevent concurrent accesses.
3217   virtual std::unique_ptr<TraceWriterBase> CreateTraceWriter(
3218       DataSourceState*,
3219       BufferExhaustedPolicy buffer_exhausted_policy) = 0;
3220 
3221   virtual void DestroyStoppedTraceWritersForCurrentThread() = 0;
3222 
generation(std::memory_order ord)3223   uint32_t generation(std::memory_order ord) { return generation_.load(ord); }
3224 
3225  protected:
TracingMuxer(Platform * platform)3226   explicit TracingMuxer(Platform* platform) : platform_(platform) {}
3227 
3228   static TracingMuxer* instance_;
3229   Platform* const platform_ = nullptr;
3230 
3231   // Incremented every time a data source is destroyed. See tracing_tls.h.
3232   std::atomic<uint32_t> generation_{};
3233 };
3234 
3235 }  // namespace internal
3236 }  // namespace perfetto
3237 
3238 #endif  // INCLUDE_PERFETTO_TRACING_INTERNAL_TRACING_MUXER_H_
3239 // gen_amalgamated begin header: include/perfetto/tracing/locked_handle.h
3240 /*
3241  * Copyright (C) 2019 The Android Open Source Project
3242  *
3243  * Licensed under the Apache License, Version 2.0 (the "License");
3244  * you may not use this file except in compliance with the License.
3245  * You may obtain a copy of the License at
3246  *
3247  *      http://www.apache.org/licenses/LICENSE-2.0
3248  *
3249  * Unless required by applicable law or agreed to in writing, software
3250  * distributed under the License is distributed on an "AS IS" BASIS,
3251  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3252  * See the License for the specific language governing permissions and
3253  * limitations under the License.
3254  */
3255 
3256 #ifndef INCLUDE_PERFETTO_TRACING_LOCKED_HANDLE_H_
3257 #define INCLUDE_PERFETTO_TRACING_LOCKED_HANDLE_H_
3258 
3259 #include <mutex>
3260 
3261 namespace perfetto {
3262 
3263 // This is used for GetDataSourceLocked(), in the (rare) case where the
3264 // tracing code wants to access the state of its data source from the Trace()
3265 // method.
3266 template <typename T>
3267 class LockedHandle {
3268  public:
LockedHandle(std::recursive_mutex * mtx,T * obj)3269   LockedHandle(std::recursive_mutex* mtx, T* obj) : lock_(*mtx), obj_(obj) {}
3270   LockedHandle() = default;  // For the invalid case.
3271   LockedHandle(LockedHandle&&) = default;
3272   LockedHandle& operator=(LockedHandle&&) = default;
3273 
valid()3274   bool valid() const { return obj_; }
3275   explicit operator bool() const { return valid(); }
3276 
3277   T* operator->() {
3278     assert(valid());
3279     return obj_;
3280   }
3281 
3282   T& operator*() { return *(this->operator->()); }
3283 
3284  private:
3285   std::unique_lock<std::recursive_mutex> lock_;
3286   T* obj_ = nullptr;
3287 };
3288 
3289 }  // namespace perfetto
3290 
3291 #endif  // INCLUDE_PERFETTO_TRACING_LOCKED_HANDLE_H_
3292 // gen_amalgamated begin header: gen/protos/perfetto/trace/trace_packet.pbzero.h
3293 // gen_amalgamated begin header: include/perfetto/protozero/packed_repeated_fields.h
3294 /*
3295  * Copyright (C) 2019 The Android Open Source Project
3296  *
3297  * Licensed under the Apache License, Version 2.0 (the "License");
3298  * you may not use this file except in compliance with the License.
3299  * You may obtain a copy of the License at
3300  *
3301  *      http://www.apache.org/licenses/LICENSE-2.0
3302  *
3303  * Unless required by applicable law or agreed to in writing, software
3304  * distributed under the License is distributed on an "AS IS" BASIS,
3305  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3306  * See the License for the specific language governing permissions and
3307  * limitations under the License.
3308  */
3309 
3310 #ifndef INCLUDE_PERFETTO_PROTOZERO_PACKED_REPEATED_FIELDS_H_
3311 #define INCLUDE_PERFETTO_PROTOZERO_PACKED_REPEATED_FIELDS_H_
3312 
3313 #include <stdint.h>
3314 
3315 #include <array>
3316 #include <memory>
3317 #include <type_traits>
3318 
3319 // gen_amalgamated expanded: #include "perfetto/base/logging.h"
3320 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
3321 
3322 namespace protozero {
3323 
3324 // This file contains classes used when encoding packed repeated fields.
3325 // To encode such a field, the caller is first expected to accumulate all of the
3326 // values in one of the following types (depending on the wire type of the
3327 // individual elements), defined below:
3328 // * protozero::PackedVarInt
3329 // * protozero::PackedFixedSizeInt</*element_type=*/ uint32_t>
3330 // Then that buffer is passed to the protozero-generated setters as an argument.
3331 // After calling the setter, the buffer can be destroyed.
3332 //
3333 // An example of encoding a packed field:
3334 //   protozero::HeapBuffered<protozero::Message> msg;
3335 //   protozero::PackedVarInt buf;
3336 //   buf.Append(42);
3337 //   buf.Append(-1);
3338 //   msg->set_fieldname(buf);
3339 //   msg.SerializeAsString();
3340 
3341 class PackedBufferBase {
3342  public:
PackedBufferBase()3343   PackedBufferBase() { Reset(); }
3344 
3345   // Copy or move is disabled due to pointers to stack addresses.
3346   PackedBufferBase(const PackedBufferBase&) = delete;
3347   PackedBufferBase(PackedBufferBase&&) = delete;
3348   PackedBufferBase& operator=(const PackedBufferBase&) = delete;
3349   PackedBufferBase& operator=(PackedBufferBase&&) = delete;
3350 
3351   void Reset();
3352 
data()3353   const uint8_t* data() const { return storage_begin_; }
3354 
size()3355   size_t size() const {
3356     return static_cast<size_t>(write_ptr_ - storage_begin_);
3357   }
3358 
3359  protected:
GrowIfNeeded()3360   void GrowIfNeeded() {
3361     PERFETTO_DCHECK(write_ptr_ >= storage_begin_ && write_ptr_ <= storage_end_);
3362     if (PERFETTO_UNLIKELY(write_ptr_ + kMaxElementSize > storage_end_)) {
3363       GrowSlowpath();
3364     }
3365   }
3366 
3367   void GrowSlowpath();
3368 
3369   // max(uint64_t varint encoding, biggest fixed type (uint64)).
3370   static constexpr size_t kMaxElementSize = 10;
3371 
3372   // So sizeof(this) == 8k.
3373   static constexpr size_t kOnStackStorageSize = 8192 - 32;
3374 
3375   uint8_t* storage_begin_;
3376   uint8_t* storage_end_;
3377   uint8_t* write_ptr_;
3378   std::unique_ptr<uint8_t[]> heap_buf_;
3379   alignas(uint64_t) uint8_t stack_buf_[kOnStackStorageSize];
3380 };
3381 
3382 class PackedVarInt : public PackedBufferBase {
3383  public:
3384   template <typename T>
Append(T value)3385   void Append(T value) {
3386     GrowIfNeeded();
3387     write_ptr_ = proto_utils::WriteVarInt(value, write_ptr_);
3388   }
3389 };
3390 
3391 template <typename T /* e.g. uint32_t for Fixed32 */>
3392 class PackedFixedSizeInt : public PackedBufferBase {
3393  public:
Append(T value)3394   void Append(T value) {
3395     static_assert(sizeof(T) == 4 || sizeof(T) == 8,
3396                   "PackedFixedSizeInt should be used only with 32/64-bit ints");
3397     static_assert(sizeof(T) <= kMaxElementSize,
3398                   "kMaxElementSize needs to be updated");
3399     GrowIfNeeded();
3400     PERFETTO_DCHECK(reinterpret_cast<size_t>(write_ptr_) % alignof(T) == 0);
3401     memcpy(reinterpret_cast<T*>(write_ptr_), &value, sizeof(T));
3402     write_ptr_ += sizeof(T);
3403   }
3404 };
3405 
3406 }  // namespace protozero
3407 
3408 #endif  // INCLUDE_PERFETTO_PROTOZERO_PACKED_REPEATED_FIELDS_H_
3409 // gen_amalgamated begin header: include/perfetto/protozero/proto_decoder.h
3410 // gen_amalgamated begin header: include/perfetto/protozero/field.h
3411 /*
3412  * Copyright (C) 2019 The Android Open Source Project
3413  *
3414  * Licensed under the Apache License, Version 2.0 (the "License");
3415  * you may not use this file except in compliance with the License.
3416  * You may obtain a copy of the License at
3417  *
3418  *      http://www.apache.org/licenses/LICENSE-2.0
3419  *
3420  * Unless required by applicable law or agreed to in writing, software
3421  * distributed under the License is distributed on an "AS IS" BASIS,
3422  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3423  * See the License for the specific language governing permissions and
3424  * limitations under the License.
3425  */
3426 
3427 #ifndef INCLUDE_PERFETTO_PROTOZERO_FIELD_H_
3428 #define INCLUDE_PERFETTO_PROTOZERO_FIELD_H_
3429 
3430 #include <stdint.h>
3431 
3432 #include <string>
3433 #include <vector>
3434 
3435 // gen_amalgamated expanded: #include "perfetto/base/logging.h"
3436 // gen_amalgamated expanded: #include "perfetto/protozero/contiguous_memory_range.h"
3437 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
3438 
3439 namespace protozero {
3440 
3441 struct ConstBytes {
ToStdStringConstBytes3442   std::string ToStdString() const {
3443     return std::string(reinterpret_cast<const char*>(data), size);
3444   }
3445 
3446   const uint8_t* data;
3447   size_t size;
3448 };
3449 
3450 struct ConstChars {
3451   // Allow implicit conversion to perfetto's base::StringView without depending
3452   // on perfetto/base or viceversa.
3453   static constexpr bool kConvertibleToStringView = true;
ToStdStringConstChars3454   std::string ToStdString() const { return std::string(data, size); }
3455 
3456   const char* data;
3457   size_t size;
3458 };
3459 
3460 // A protobuf field decoded by the protozero proto decoders. It exposes
3461 // convenience accessors with minimal debug checks.
3462 // This class is used both by the iterator-based ProtoDecoder and by the
3463 // one-shot TypedProtoDecoder.
3464 // If the field is not valid the accessors consistently return zero-integers or
3465 // null strings.
3466 class Field {
3467  public:
valid()3468   bool valid() const { return id_ != 0; }
id()3469   uint16_t id() const { return id_; }
3470   explicit operator bool() const { return valid(); }
3471 
type()3472   proto_utils::ProtoWireType type() const {
3473     auto res = static_cast<proto_utils::ProtoWireType>(type_);
3474     PERFETTO_DCHECK(res == proto_utils::ProtoWireType::kVarInt ||
3475                     res == proto_utils::ProtoWireType::kLengthDelimited ||
3476                     res == proto_utils::ProtoWireType::kFixed32 ||
3477                     res == proto_utils::ProtoWireType::kFixed64);
3478     return res;
3479   }
3480 
as_bool()3481   bool as_bool() const {
3482     PERFETTO_DCHECK(!valid() || type() == proto_utils::ProtoWireType::kVarInt);
3483     return static_cast<bool>(int_value_);
3484   }
3485 
as_uint32()3486   uint32_t as_uint32() const {
3487     PERFETTO_DCHECK(!valid() || type() == proto_utils::ProtoWireType::kVarInt ||
3488                     type() == proto_utils::ProtoWireType::kFixed32);
3489     return static_cast<uint32_t>(int_value_);
3490   }
3491 
as_int32()3492   int32_t as_int32() const {
3493     PERFETTO_DCHECK(!valid() || type() == proto_utils::ProtoWireType::kVarInt ||
3494                     type() == proto_utils::ProtoWireType::kFixed32);
3495     return static_cast<int32_t>(int_value_);
3496   }
3497 
as_sint32()3498   int32_t as_sint32() const {
3499     PERFETTO_DCHECK(!valid() || type() == proto_utils::ProtoWireType::kVarInt);
3500     return proto_utils::ZigZagDecode(static_cast<uint32_t>(int_value_));
3501   }
3502 
as_uint64()3503   uint64_t as_uint64() const {
3504     PERFETTO_DCHECK(!valid() || type() == proto_utils::ProtoWireType::kVarInt ||
3505                     type() == proto_utils::ProtoWireType::kFixed32 ||
3506                     type() == proto_utils::ProtoWireType::kFixed64);
3507     return int_value_;
3508   }
3509 
as_int64()3510   int64_t as_int64() const {
3511     PERFETTO_DCHECK(!valid() || type() == proto_utils::ProtoWireType::kVarInt ||
3512                     type() == proto_utils::ProtoWireType::kFixed32 ||
3513                     type() == proto_utils::ProtoWireType::kFixed64);
3514     return static_cast<int64_t>(int_value_);
3515   }
3516 
as_sint64()3517   int64_t as_sint64() const {
3518     PERFETTO_DCHECK(!valid() || type() == proto_utils::ProtoWireType::kVarInt);
3519     return proto_utils::ZigZagDecode(static_cast<uint64_t>(int_value_));
3520   }
3521 
as_float()3522   float as_float() const {
3523     PERFETTO_DCHECK(!valid() || type() == proto_utils::ProtoWireType::kFixed32);
3524     float res;
3525     uint32_t value32 = static_cast<uint32_t>(int_value_);
3526     memcpy(&res, &value32, sizeof(res));
3527     return res;
3528   }
3529 
as_double()3530   double as_double() const {
3531     PERFETTO_DCHECK(!valid() || type() == proto_utils::ProtoWireType::kFixed64);
3532     double res;
3533     memcpy(&res, &int_value_, sizeof(res));
3534     return res;
3535   }
3536 
as_string()3537   ConstChars as_string() const {
3538     PERFETTO_DCHECK(!valid() ||
3539                     type() == proto_utils::ProtoWireType::kLengthDelimited);
3540     return ConstChars{reinterpret_cast<const char*>(data()), size_};
3541   }
3542 
as_std_string()3543   std::string as_std_string() const { return as_string().ToStdString(); }
3544 
as_bytes()3545   ConstBytes as_bytes() const {
3546     PERFETTO_DCHECK(!valid() ||
3547                     type() == proto_utils::ProtoWireType::kLengthDelimited);
3548     return ConstBytes{data(), size_};
3549   }
3550 
data()3551   const uint8_t* data() const {
3552     PERFETTO_DCHECK(!valid() ||
3553                     type() == proto_utils::ProtoWireType::kLengthDelimited);
3554     return reinterpret_cast<const uint8_t*>(int_value_);
3555   }
3556 
size()3557   size_t size() const {
3558     PERFETTO_DCHECK(!valid() ||
3559                     type() == proto_utils::ProtoWireType::kLengthDelimited);
3560     return size_;
3561   }
3562 
raw_int_value()3563   uint64_t raw_int_value() const { return int_value_; }
3564 
initialize(uint16_t id,uint8_t type,uint64_t int_value,uint32_t size)3565   void initialize(uint16_t id,
3566                   uint8_t type,
3567                   uint64_t int_value,
3568                   uint32_t size) {
3569     id_ = id;
3570     type_ = type;
3571     int_value_ = int_value;
3572     size_ = size;
3573   }
3574 
3575   // For use with templates. This is used by RepeatedFieldIterator::operator*().
get(bool * val)3576   void get(bool* val) const { *val = as_bool(); }
get(uint32_t * val)3577   void get(uint32_t* val) const { *val = as_uint32(); }
get(int32_t * val)3578   void get(int32_t* val) const { *val = as_int32(); }
get(uint64_t * val)3579   void get(uint64_t* val) const { *val = as_uint64(); }
get(int64_t * val)3580   void get(int64_t* val) const { *val = as_int64(); }
get(float * val)3581   void get(float* val) const { *val = as_float(); }
get(double * val)3582   void get(double* val) const { *val = as_double(); }
get(std::string * val)3583   void get(std::string* val) const { *val = as_std_string(); }
get(ConstChars * val)3584   void get(ConstChars* val) const { *val = as_string(); }
get(ConstBytes * val)3585   void get(ConstBytes* val) const { *val = as_bytes(); }
get_signed(int32_t * val)3586   void get_signed(int32_t* val) const { *val = as_sint32(); }
get_signed(int64_t * val)3587   void get_signed(int64_t* val) const { *val = as_sint64(); }
3588 
3589   // For enum types.
3590   template <typename T,
3591             typename = typename std::enable_if<std::is_enum<T>::value, T>::type>
get(T * val)3592   void get(T* val) const {
3593     *val = static_cast<T>(as_int32());
3594   }
3595 
3596   // Serializes the field back into a proto-encoded byte stream and appends it
3597   // to |dst|. |dst| is resized accordingly.
3598   void SerializeAndAppendTo(std::string* dst) const;
3599 
3600   // Serializes the field back into a proto-encoded byte stream and appends it
3601   // to |dst|. |dst| is resized accordingly.
3602   void SerializeAndAppendTo(std::vector<uint8_t>* dst) const;
3603 
3604  private:
3605   template <typename Container>
3606   void SerializeAndAppendToInternal(Container* dst) const;
3607 
3608   // Fields are deliberately not initialized to keep the class trivially
3609   // constructible. It makes a large perf difference for ProtoDecoder.
3610 
3611   uint64_t int_value_;  // In kLengthDelimited this contains the data() addr.
3612   uint32_t size_;       // Only valid when when type == kLengthDelimited.
3613   uint16_t id_;         // Proto field ordinal.
3614   uint8_t type_;        // proto_utils::ProtoWireType.
3615 };
3616 
3617 // The Field struct is used in a lot of perf-sensitive contexts.
3618 static_assert(sizeof(Field) == 16, "Field struct too big");
3619 
3620 }  // namespace protozero
3621 
3622 #endif  // INCLUDE_PERFETTO_PROTOZERO_FIELD_H_
3623 /*
3624  * Copyright (C) 2018 The Android Open Source Project
3625  *
3626  * Licensed under the Apache License, Version 2.0 (the "License");
3627  * you may not use this file except in compliance with the License.
3628  * You may obtain a copy of the License at
3629  *
3630  *      http://www.apache.org/licenses/LICENSE-2.0
3631  *
3632  * Unless required by applicable law or agreed to in writing, software
3633  * distributed under the License is distributed on an "AS IS" BASIS,
3634  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3635  * See the License for the specific language governing permissions and
3636  * limitations under the License.
3637  */
3638 
3639 #ifndef INCLUDE_PERFETTO_PROTOZERO_PROTO_DECODER_H_
3640 #define INCLUDE_PERFETTO_PROTOZERO_PROTO_DECODER_H_
3641 
3642 #include <stdint.h>
3643 #include <array>
3644 #include <memory>
3645 #include <vector>
3646 
3647 // gen_amalgamated expanded: #include "perfetto/base/compiler.h"
3648 // gen_amalgamated expanded: #include "perfetto/base/logging.h"
3649 // gen_amalgamated expanded: #include "perfetto/protozero/field.h"
3650 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
3651 
3652 namespace protozero {
3653 
3654 // A generic protobuf decoder. Doesn't require any knowledge about the proto
3655 // schema. It tokenizes fields, retrieves their ID and type and exposes
3656 // accessors to retrieve its values.
3657 // It does NOT recurse in nested submessages, instead it just computes their
3658 // boundaries, recursion is left to the caller.
3659 // This class is designed to be used in perf-sensitive contexts. It does not
3660 // allocate and does not perform any proto semantic checks (e.g. repeated /
3661 // required / optional). It's supposedly safe wrt out-of-bounds memory accesses
3662 // (see proto_decoder_fuzzer.cc).
3663 // This class serves also as a building block for TypedProtoDecoder, used when
3664 // the schema is known at compile time.
3665 class PERFETTO_EXPORT ProtoDecoder {
3666  public:
3667   // Creates a ProtoDecoder using the given |buffer| with size |length| bytes.
ProtoDecoder(const void * buffer,size_t length)3668   ProtoDecoder(const void* buffer, size_t length)
3669       : begin_(reinterpret_cast<const uint8_t*>(buffer)),
3670         end_(begin_ + length),
3671         read_ptr_(begin_) {}
ProtoDecoder(const std::string & str)3672   ProtoDecoder(const std::string& str) : ProtoDecoder(str.data(), str.size()) {}
ProtoDecoder(const ConstBytes & cb)3673   ProtoDecoder(const ConstBytes& cb) : ProtoDecoder(cb.data, cb.size) {}
3674 
3675   // Reads the next field from the buffer and advances the read cursor. If a
3676   // full field cannot be read, the returned Field will be invalid (i.e.
3677   // field.valid() == false).
3678   Field ReadField();
3679 
3680   // Finds the first field with the given id. Doesn't affect the read cursor.
3681   Field FindField(uint32_t field_id);
3682 
3683   // Resets the read cursor to the start of the buffer.
Reset()3684   void Reset() { read_ptr_ = begin_; }
3685 
3686   // Resets the read cursor to the given position (must be within the buffer).
Reset(const uint8_t * pos)3687   void Reset(const uint8_t* pos) {
3688     PERFETTO_DCHECK(pos >= begin_ && pos < end_);
3689     read_ptr_ = pos;
3690   }
3691 
3692   // Returns the position of read cursor, relative to the start of the buffer.
read_offset()3693   size_t read_offset() const { return static_cast<size_t>(read_ptr_ - begin_); }
3694 
bytes_left()3695   size_t bytes_left() const {
3696     PERFETTO_DCHECK(read_ptr_ <= end_);
3697     return static_cast<size_t>(end_ - read_ptr_);
3698   }
3699 
begin()3700   const uint8_t* begin() const { return begin_; }
end()3701   const uint8_t* end() const { return end_; }
3702 
3703  protected:
3704   const uint8_t* const begin_;
3705   const uint8_t* const end_;
3706   const uint8_t* read_ptr_ = nullptr;
3707 };
3708 
3709 // An iterator-like class used to iterate through repeated fields. Used by
3710 // TypedProtoDecoder. The iteration sequence is a bit counter-intuitive due to
3711 // the fact that fields_[field_id] holds the *last* value of the field, not the
3712 // first, but the remaining storage holds repeated fields in FIFO order.
3713 // Assume that we push the 10,11,12 into a repeated field with ID=1.
3714 //
3715 // Decoder memory layout:  [  fields storage  ] [ repeated fields storage ]
3716 // 1st iteration:           10
3717 // 2nd iteration:           11                   10
3718 // 3rd iteration:           12                   10 11
3719 //
3720 // We start the iteration @ fields_[num_fields], which is the start of the
3721 // repeated fields storage, proceed until the end and lastly jump @ fields_[id].
3722 template <typename T>
3723 class RepeatedFieldIterator {
3724  public:
RepeatedFieldIterator(uint32_t field_id,const Field * begin,const Field * end,const Field * last)3725   RepeatedFieldIterator(uint32_t field_id,
3726                         const Field* begin,
3727                         const Field* end,
3728                         const Field* last)
3729       : field_id_(field_id), iter_(begin), end_(end), last_(last) {
3730     FindNextMatchingId();
3731   }
3732 
3733   // Constructs an invalid iterator.
RepeatedFieldIterator()3734   RepeatedFieldIterator()
3735       : field_id_(0u), iter_(nullptr), end_(nullptr), last_(nullptr) {}
3736 
3737   explicit operator bool() const { return iter_ != end_; }
field()3738   const Field& field() const { return *iter_; }
3739 
3740   T operator*() const {
3741     T val{};
3742     iter_->get(&val);
3743     return val;
3744   }
3745   const Field* operator->() const { return iter_; }
3746 
3747   RepeatedFieldIterator& operator++() {
3748     PERFETTO_DCHECK(iter_ != end_);
3749     if (iter_ == last_) {
3750       iter_ = end_;
3751       return *this;
3752     }
3753     ++iter_;
3754     FindNextMatchingId();
3755     return *this;
3756   }
3757 
3758   RepeatedFieldIterator operator++(int) {
3759     PERFETTO_DCHECK(iter_ != end_);
3760     RepeatedFieldIterator it(*this);
3761     ++(*this);
3762     return it;
3763   }
3764 
3765  private:
FindNextMatchingId()3766   void FindNextMatchingId() {
3767     PERFETTO_DCHECK(iter_ != last_);
3768     for (; iter_ != end_; ++iter_) {
3769       if (iter_->id() == field_id_)
3770         return;
3771     }
3772     iter_ = last_->valid() ? last_ : end_;
3773   }
3774 
3775   uint32_t field_id_;
3776 
3777   // Initially points to the beginning of the repeated field storage, then is
3778   // incremented as we call operator++().
3779   const Field* iter_;
3780 
3781   // Always points to fields_[size_], i.e. past the end of the storage.
3782   const Field* end_;
3783 
3784   // Always points to fields_[field_id].
3785   const Field* last_;
3786 };
3787 
3788 // As RepeatedFieldIterator, but allows iterating over a packed repeated field
3789 // (which will be initially stored as a single length-delimited field).
3790 // See |GetPackedRepeatedField| for details.
3791 //
3792 // Assumes little endianness, and that the input buffers are well formed -
3793 // containing an exact multiple of encoded elements.
3794 template <proto_utils::ProtoWireType wire_type, typename CppType>
3795 class PackedRepeatedFieldIterator {
3796  public:
PackedRepeatedFieldIterator(const uint8_t * data_begin,size_t size,bool * parse_error_ptr)3797   PackedRepeatedFieldIterator(const uint8_t* data_begin,
3798                               size_t size,
3799                               bool* parse_error_ptr)
3800       : data_end_(data_begin ? data_begin + size : nullptr),
3801         read_ptr_(data_begin),
3802         parse_error_(parse_error_ptr) {
3803     using proto_utils::ProtoWireType;
3804     static_assert(wire_type == ProtoWireType::kVarInt ||
3805                       wire_type == ProtoWireType::kFixed32 ||
3806                       wire_type == ProtoWireType::kFixed64,
3807                   "invalid type");
3808 
3809     PERFETTO_DCHECK(parse_error_ptr);
3810 
3811     // Either the field is unset (and there are no data pointer), or the field
3812     // is set with a zero length payload. Mark the iterator as invalid in both
3813     // cases.
3814     if (size == 0) {
3815       curr_value_valid_ = false;
3816       return;
3817     }
3818 
3819     if ((wire_type == ProtoWireType::kFixed32 && (size % 4) != 0) ||
3820         (wire_type == ProtoWireType::kFixed64 && (size % 8) != 0)) {
3821       *parse_error_ = true;
3822       curr_value_valid_ = false;
3823       return;
3824     }
3825 
3826     ++(*this);
3827   }
3828 
3829   const CppType operator*() const { return curr_value_; }
3830   explicit operator bool() const { return curr_value_valid_; }
3831 
3832   PackedRepeatedFieldIterator& operator++() {
3833     using proto_utils::ProtoWireType;
3834 
3835     if (PERFETTO_UNLIKELY(!curr_value_valid_))
3836       return *this;
3837 
3838     if (PERFETTO_UNLIKELY(read_ptr_ == data_end_)) {
3839       curr_value_valid_ = false;
3840       return *this;
3841     }
3842 
3843     if (wire_type == ProtoWireType::kVarInt) {
3844       uint64_t new_value = 0;
3845       const uint8_t* new_pos =
3846           proto_utils::ParseVarInt(read_ptr_, data_end_, &new_value);
3847 
3848       if (PERFETTO_UNLIKELY(new_pos == read_ptr_)) {
3849         // Failed to decode the varint (probably incomplete buffer).
3850         *parse_error_ = true;
3851         curr_value_valid_ = false;
3852       } else {
3853         read_ptr_ = new_pos;
3854         curr_value_ = static_cast<CppType>(new_value);
3855       }
3856     } else {  // kFixed32 or kFixed64
3857       constexpr size_t kStep = wire_type == ProtoWireType::kFixed32 ? 4 : 8;
3858 
3859       // NB: the raw buffer is not guaranteed to be aligned, so neither are
3860       // these copies.
3861       memcpy(&curr_value_, read_ptr_, sizeof(CppType));
3862       read_ptr_ += kStep;
3863     }
3864 
3865     return *this;
3866   }
3867 
3868   PackedRepeatedFieldIterator operator++(int) {
3869     PackedRepeatedFieldIterator it(*this);
3870     ++(*this);
3871     return it;
3872   }
3873 
3874  private:
3875   // Might be null if the backing proto field isn't set.
3876   const uint8_t* const data_end_;
3877 
3878   // The iterator looks ahead by an element, so |curr_value| holds the value
3879   // to be returned when the caller dereferences the iterator, and |read_ptr_|
3880   // points at the start of the next element to be decoded.
3881   // |read_ptr_| might be null if the backing proto field isn't set.
3882   const uint8_t* read_ptr_;
3883   CppType curr_value_ = 0;
3884 
3885   // Set to false once we've exhausted the iterator, or encountered an error.
3886   bool curr_value_valid_ = true;
3887 
3888   // Where to set parsing errors, supplied by the caller.
3889   bool* const parse_error_;
3890 };
3891 
3892 // This decoder loads all fields upfront, without recursing in nested messages.
3893 // It is used as a base class for typed decoders generated by the pbzero plugin.
3894 // The split between TypedProtoDecoderBase and TypedProtoDecoder<> is to have
3895 // unique definition of functions like ParseAllFields() and ExpandHeapStorage().
3896 // The storage (either on-stack or on-heap) for this class is organized as
3897 // follows:
3898 // |-------------------------- fields_ ----------------------|
3899 // [ field 0 (invalid) ] [ fields 1 .. N ] [ repeated fields ]
3900 //                                        ^                  ^
3901 //                                        num_fields_        size_
3902 class PERFETTO_EXPORT TypedProtoDecoderBase : public ProtoDecoder {
3903  public:
3904   // If the field |id| is known at compile time, prefer the templated
3905   // specialization at<kFieldNumber>().
Get(uint32_t id)3906   const Field& Get(uint32_t id) const {
3907     return PERFETTO_LIKELY(id < num_fields_) ? fields_[id] : fields_[0];
3908   }
3909 
3910   // Returns an object that allows to iterate over all instances of a repeated
3911   // field given its id. Example usage:
3912   //   for (auto it = decoder.GetRepeated<int32_t>(N); it; ++it) { ... }
3913   template <typename T>
GetRepeated(uint32_t field_id)3914   RepeatedFieldIterator<T> GetRepeated(uint32_t field_id) const {
3915     return RepeatedFieldIterator<T>(field_id, &fields_[num_fields_],
3916                                     &fields_[size_], &fields_[field_id]);
3917   }
3918 
3919   // Returns an objects that allows to iterate over all entries of a packed
3920   // repeated field given its id and type. The |wire_type| is necessary for
3921   // decoding the packed field, the |cpp_type| is for convenience & stronger
3922   // typing.
3923   //
3924   // The caller must also supply a pointer to a bool that is set to true if the
3925   // packed buffer is found to be malformed while iterating (so you need to
3926   // exhaust the iterator if you want to check the full extent of the buffer).
3927   //
3928   // Note that unlike standard protobuf parsers, protozero does not allow
3929   // treating of packed repeated fields as non-packed and vice-versa (therefore
3930   // not making the packed option forwards and backwards compatible). So
3931   // the caller needs to use the right accessor for correct results.
3932   template <proto_utils::ProtoWireType wire_type, typename cpp_type>
GetPackedRepeated(uint32_t field_id,bool * parse_error_location)3933   PackedRepeatedFieldIterator<wire_type, cpp_type> GetPackedRepeated(
3934       uint32_t field_id,
3935       bool* parse_error_location) const {
3936     const Field& field = Get(field_id);
3937     if (field.valid()) {
3938       return PackedRepeatedFieldIterator<wire_type, cpp_type>(
3939           field.data(), field.size(), parse_error_location);
3940     } else {
3941       return PackedRepeatedFieldIterator<wire_type, cpp_type>(
3942           nullptr, 0, parse_error_location);
3943     }
3944   }
3945 
3946  protected:
TypedProtoDecoderBase(Field * storage,uint32_t num_fields,uint32_t capacity,const uint8_t * buffer,size_t length)3947   TypedProtoDecoderBase(Field* storage,
3948                         uint32_t num_fields,
3949                         uint32_t capacity,
3950                         const uint8_t* buffer,
3951                         size_t length)
3952       : ProtoDecoder(buffer, length),
3953         fields_(storage),
3954         num_fields_(num_fields),
3955         size_(num_fields),
3956         capacity_(capacity) {
3957     // The reason why Field needs to be trivially de/constructible is to avoid
3958     // implicit initializers on all the ~1000 entries. We need it to initialize
3959     // only on the first |max_field_id| fields, the remaining capacity doesn't
3960     // require initialization.
3961     static_assert(std::is_trivially_constructible<Field>::value &&
3962                       std::is_trivially_destructible<Field>::value &&
3963                       std::is_trivial<Field>::value,
3964                   "Field must be a trivial aggregate type");
3965     memset(fields_, 0, sizeof(Field) * num_fields_);
3966   }
3967 
3968   void ParseAllFields();
3969 
3970   // Called when the default on-stack storage is exhausted and new repeated
3971   // fields need to be pushed.
3972   void ExpandHeapStorage();
3973 
3974   // Used only in presence of a large number of repeated fields, when the
3975   // default on-stack storage is exhausted.
3976   std::unique_ptr<Field[]> heap_storage_;
3977 
3978   // Points to the storage, either on-stack (default, provided by the template
3979   // specialization) or |heap_storage_| after ExpandHeapStorage() is called, in
3980   // case of a large number of repeated fields.
3981   Field* fields_;
3982 
3983   // Number of fields without accounting repeated storage. This is equal to
3984   // MAX_FIELD_ID + 1 (to account for the invalid 0th field).
3985   // This value is always <= size_ (and hence <= capacity);
3986   uint32_t num_fields_;
3987 
3988   // Number of active |fields_| entries. This is initially equal to the highest
3989   // number of fields for the message (num_fields_ == MAX_FIELD_ID + 1) and can
3990   // grow up to |capacity_| in the case of repeated fields.
3991   uint32_t size_;
3992 
3993   // Initially equal to kFieldsCapacity of the TypedProtoDecoder
3994   // specialization. Can grow when falling back on heap-based storage, in which
3995   // case it represents the size (#fields with each entry of a repeated field
3996   // counted individually) of the |heap_storage_| array.
3997   uint32_t capacity_;
3998 };
3999 
4000 // Template class instantiated by the auto-generated decoder classes declared in
4001 // xxx.pbzero.h files.
4002 template <int MAX_FIELD_ID, bool HAS_NONPACKED_REPEATED_FIELDS>
4003 class TypedProtoDecoder : public TypedProtoDecoderBase {
4004  public:
TypedProtoDecoder(const uint8_t * buffer,size_t length)4005   TypedProtoDecoder(const uint8_t* buffer, size_t length)
4006       : TypedProtoDecoderBase(on_stack_storage_,
4007                               /*num_fields=*/MAX_FIELD_ID + 1,
4008                               kCapacity,
4009                               buffer,
4010                               length) {
4011     static_assert(MAX_FIELD_ID <= kMaxDecoderFieldId, "Field ordinal too high");
4012     TypedProtoDecoderBase::ParseAllFields();
4013   }
4014 
4015   template <uint32_t FIELD_ID>
at()4016   const Field& at() const {
4017     static_assert(FIELD_ID <= MAX_FIELD_ID, "FIELD_ID > MAX_FIELD_ID");
4018     return fields_[FIELD_ID];
4019   }
4020 
TypedProtoDecoder(TypedProtoDecoder && other)4021   TypedProtoDecoder(TypedProtoDecoder&& other) noexcept
4022       : TypedProtoDecoderBase(std::move(other)) {
4023     // If the moved-from decoder was using on-stack storage, we need to update
4024     // our pointer to point to this decoder's on-stack storage.
4025     if (fields_ == other.on_stack_storage_) {
4026       fields_ = on_stack_storage_;
4027       memcpy(on_stack_storage_, other.on_stack_storage_,
4028              sizeof(on_stack_storage_));
4029     }
4030   }
4031 
4032  private:
4033   // In the case of non-repeated fields, this constant defines the highest field
4034   // id we are able to decode. This is to limit the on-stack storage.
4035   // In the case of repeated fields, this constant defines the max number of
4036   // repeated fields that we'll be able to store before falling back on the
4037   // heap. Keep this value in sync with the one in protozero_generator.cc.
4038   static constexpr size_t kMaxDecoderFieldId = 999;
4039 
4040   // If we the message has no repeated fields we need at most N Field entries
4041   // in the on-stack storage, where N is the highest field id.
4042   // Otherwise we need some room to store repeated fields.
4043   static constexpr size_t kCapacity =
4044       1 + (HAS_NONPACKED_REPEATED_FIELDS ? kMaxDecoderFieldId : MAX_FIELD_ID);
4045 
4046   Field on_stack_storage_[kCapacity];
4047 };
4048 
4049 }  // namespace protozero
4050 
4051 #endif  // INCLUDE_PERFETTO_PROTOZERO_PROTO_DECODER_H_
4052 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
4053 
4054 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACE_PACKET_PROTO_H_
4055 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACE_PACKET_PROTO_H_
4056 
4057 #include <stddef.h>
4058 #include <stdint.h>
4059 
4060 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
4061 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
4062 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
4063 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
4064 
4065 namespace perfetto {
4066 namespace protos {
4067 namespace pbzero {
4068 
4069 class AndroidLogPacket;
4070 class BatteryCounters;
4071 class ChromeBenchmarkMetadata;
4072 class ChromeEventBundle;
4073 class ChromeMetadataPacket;
4074 class ClockSnapshot;
4075 class CpuInfo;
4076 class DeobfuscationMapping;
4077 class ExtensionDescriptor;
4078 class FtraceEventBundle;
4079 class FtraceStats;
4080 class GpuCounterEvent;
4081 class GpuLog;
4082 class GpuMemTotalEvent;
4083 class GpuRenderStageEvent;
4084 class GraphicsFrameEvent;
4085 class HeapGraph;
4086 class InitialDisplayState;
4087 class InodeFileMap;
4088 class InternedData;
4089 class MemoryTrackerSnapshot;
4090 class ModuleSymbols;
4091 class PackagesList;
4092 class PerfSample;
4093 class PerfettoMetatrace;
4094 class PowerRails;
4095 class ProcessDescriptor;
4096 class ProcessStats;
4097 class ProcessTree;
4098 class ProfilePacket;
4099 class ProfiledFrameSymbols;
4100 class SmapsPacket;
4101 class StreamingProfilePacket;
4102 class SysStats;
4103 class SystemInfo;
4104 class TestEvent;
4105 class ThreadDescriptor;
4106 class TraceConfig;
4107 class TracePacketDefaults;
4108 class TraceStats;
4109 class TracingServiceEvent;
4110 class TrackDescriptor;
4111 class TrackEvent;
4112 class Trigger;
4113 class VulkanApiEvent;
4114 class VulkanMemoryEvent;
4115 
4116 enum TracePacket_SequenceFlags : int32_t {
4117   TracePacket_SequenceFlags_SEQ_UNSPECIFIED = 0,
4118   TracePacket_SequenceFlags_SEQ_INCREMENTAL_STATE_CLEARED = 1,
4119   TracePacket_SequenceFlags_SEQ_NEEDS_INCREMENTAL_STATE = 2,
4120 };
4121 
4122 const TracePacket_SequenceFlags TracePacket_SequenceFlags_MIN = TracePacket_SequenceFlags_SEQ_UNSPECIFIED;
4123 const TracePacket_SequenceFlags TracePacket_SequenceFlags_MAX = TracePacket_SequenceFlags_SEQ_NEEDS_INCREMENTAL_STATE;
4124 
4125 class TracePacket_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/900, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
4126  public:
TracePacket_Decoder(const uint8_t * data,size_t len)4127   TracePacket_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
TracePacket_Decoder(const std::string & raw)4128   explicit TracePacket_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
TracePacket_Decoder(const::protozero::ConstBytes & raw)4129   explicit TracePacket_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
has_timestamp()4130   bool has_timestamp() const { return at<8>().valid(); }
timestamp()4131   uint64_t timestamp() const { return at<8>().as_uint64(); }
has_timestamp_clock_id()4132   bool has_timestamp_clock_id() const { return at<58>().valid(); }
timestamp_clock_id()4133   uint32_t timestamp_clock_id() const { return at<58>().as_uint32(); }
has_process_tree()4134   bool has_process_tree() const { return at<2>().valid(); }
process_tree()4135   ::protozero::ConstBytes process_tree() const { return at<2>().as_bytes(); }
has_process_stats()4136   bool has_process_stats() const { return at<9>().valid(); }
process_stats()4137   ::protozero::ConstBytes process_stats() const { return at<9>().as_bytes(); }
has_inode_file_map()4138   bool has_inode_file_map() const { return at<4>().valid(); }
inode_file_map()4139   ::protozero::ConstBytes inode_file_map() const { return at<4>().as_bytes(); }
has_chrome_events()4140   bool has_chrome_events() const { return at<5>().valid(); }
chrome_events()4141   ::protozero::ConstBytes chrome_events() const { return at<5>().as_bytes(); }
has_clock_snapshot()4142   bool has_clock_snapshot() const { return at<6>().valid(); }
clock_snapshot()4143   ::protozero::ConstBytes clock_snapshot() const { return at<6>().as_bytes(); }
has_sys_stats()4144   bool has_sys_stats() const { return at<7>().valid(); }
sys_stats()4145   ::protozero::ConstBytes sys_stats() const { return at<7>().as_bytes(); }
has_track_event()4146   bool has_track_event() const { return at<11>().valid(); }
track_event()4147   ::protozero::ConstBytes track_event() const { return at<11>().as_bytes(); }
has_trace_config()4148   bool has_trace_config() const { return at<33>().valid(); }
trace_config()4149   ::protozero::ConstBytes trace_config() const { return at<33>().as_bytes(); }
has_ftrace_stats()4150   bool has_ftrace_stats() const { return at<34>().valid(); }
ftrace_stats()4151   ::protozero::ConstBytes ftrace_stats() const { return at<34>().as_bytes(); }
has_trace_stats()4152   bool has_trace_stats() const { return at<35>().valid(); }
trace_stats()4153   ::protozero::ConstBytes trace_stats() const { return at<35>().as_bytes(); }
has_profile_packet()4154   bool has_profile_packet() const { return at<37>().valid(); }
profile_packet()4155   ::protozero::ConstBytes profile_packet() const { return at<37>().as_bytes(); }
has_battery()4156   bool has_battery() const { return at<38>().valid(); }
battery()4157   ::protozero::ConstBytes battery() const { return at<38>().as_bytes(); }
has_power_rails()4158   bool has_power_rails() const { return at<40>().valid(); }
power_rails()4159   ::protozero::ConstBytes power_rails() const { return at<40>().as_bytes(); }
has_android_log()4160   bool has_android_log() const { return at<39>().valid(); }
android_log()4161   ::protozero::ConstBytes android_log() const { return at<39>().as_bytes(); }
has_system_info()4162   bool has_system_info() const { return at<45>().valid(); }
system_info()4163   ::protozero::ConstBytes system_info() const { return at<45>().as_bytes(); }
has_trigger()4164   bool has_trigger() const { return at<46>().valid(); }
trigger()4165   ::protozero::ConstBytes trigger() const { return at<46>().as_bytes(); }
has_packages_list()4166   bool has_packages_list() const { return at<47>().valid(); }
packages_list()4167   ::protozero::ConstBytes packages_list() const { return at<47>().as_bytes(); }
has_chrome_benchmark_metadata()4168   bool has_chrome_benchmark_metadata() const { return at<48>().valid(); }
chrome_benchmark_metadata()4169   ::protozero::ConstBytes chrome_benchmark_metadata() const { return at<48>().as_bytes(); }
has_perfetto_metatrace()4170   bool has_perfetto_metatrace() const { return at<49>().valid(); }
perfetto_metatrace()4171   ::protozero::ConstBytes perfetto_metatrace() const { return at<49>().as_bytes(); }
has_chrome_metadata()4172   bool has_chrome_metadata() const { return at<51>().valid(); }
chrome_metadata()4173   ::protozero::ConstBytes chrome_metadata() const { return at<51>().as_bytes(); }
has_gpu_counter_event()4174   bool has_gpu_counter_event() const { return at<52>().valid(); }
gpu_counter_event()4175   ::protozero::ConstBytes gpu_counter_event() const { return at<52>().as_bytes(); }
has_gpu_render_stage_event()4176   bool has_gpu_render_stage_event() const { return at<53>().valid(); }
gpu_render_stage_event()4177   ::protozero::ConstBytes gpu_render_stage_event() const { return at<53>().as_bytes(); }
has_streaming_profile_packet()4178   bool has_streaming_profile_packet() const { return at<54>().valid(); }
streaming_profile_packet()4179   ::protozero::ConstBytes streaming_profile_packet() const { return at<54>().as_bytes(); }
has_heap_graph()4180   bool has_heap_graph() const { return at<56>().valid(); }
heap_graph()4181   ::protozero::ConstBytes heap_graph() const { return at<56>().as_bytes(); }
has_graphics_frame_event()4182   bool has_graphics_frame_event() const { return at<57>().valid(); }
graphics_frame_event()4183   ::protozero::ConstBytes graphics_frame_event() const { return at<57>().as_bytes(); }
has_vulkan_memory_event()4184   bool has_vulkan_memory_event() const { return at<62>().valid(); }
vulkan_memory_event()4185   ::protozero::ConstBytes vulkan_memory_event() const { return at<62>().as_bytes(); }
has_gpu_log()4186   bool has_gpu_log() const { return at<63>().valid(); }
gpu_log()4187   ::protozero::ConstBytes gpu_log() const { return at<63>().as_bytes(); }
has_vulkan_api_event()4188   bool has_vulkan_api_event() const { return at<65>().valid(); }
vulkan_api_event()4189   ::protozero::ConstBytes vulkan_api_event() const { return at<65>().as_bytes(); }
has_perf_sample()4190   bool has_perf_sample() const { return at<66>().valid(); }
perf_sample()4191   ::protozero::ConstBytes perf_sample() const { return at<66>().as_bytes(); }
has_cpu_info()4192   bool has_cpu_info() const { return at<67>().valid(); }
cpu_info()4193   ::protozero::ConstBytes cpu_info() const { return at<67>().as_bytes(); }
has_smaps_packet()4194   bool has_smaps_packet() const { return at<68>().valid(); }
smaps_packet()4195   ::protozero::ConstBytes smaps_packet() const { return at<68>().as_bytes(); }
has_service_event()4196   bool has_service_event() const { return at<69>().valid(); }
service_event()4197   ::protozero::ConstBytes service_event() const { return at<69>().as_bytes(); }
has_initial_display_state()4198   bool has_initial_display_state() const { return at<70>().valid(); }
initial_display_state()4199   ::protozero::ConstBytes initial_display_state() const { return at<70>().as_bytes(); }
has_gpu_mem_total_event()4200   bool has_gpu_mem_total_event() const { return at<71>().valid(); }
gpu_mem_total_event()4201   ::protozero::ConstBytes gpu_mem_total_event() const { return at<71>().as_bytes(); }
has_memory_tracker_snapshot()4202   bool has_memory_tracker_snapshot() const { return at<73>().valid(); }
memory_tracker_snapshot()4203   ::protozero::ConstBytes memory_tracker_snapshot() const { return at<73>().as_bytes(); }
has_profiled_frame_symbols()4204   bool has_profiled_frame_symbols() const { return at<55>().valid(); }
profiled_frame_symbols()4205   ::protozero::ConstBytes profiled_frame_symbols() const { return at<55>().as_bytes(); }
has_module_symbols()4206   bool has_module_symbols() const { return at<61>().valid(); }
module_symbols()4207   ::protozero::ConstBytes module_symbols() const { return at<61>().as_bytes(); }
has_deobfuscation_mapping()4208   bool has_deobfuscation_mapping() const { return at<64>().valid(); }
deobfuscation_mapping()4209   ::protozero::ConstBytes deobfuscation_mapping() const { return at<64>().as_bytes(); }
has_track_descriptor()4210   bool has_track_descriptor() const { return at<60>().valid(); }
track_descriptor()4211   ::protozero::ConstBytes track_descriptor() const { return at<60>().as_bytes(); }
has_process_descriptor()4212   bool has_process_descriptor() const { return at<43>().valid(); }
process_descriptor()4213   ::protozero::ConstBytes process_descriptor() const { return at<43>().as_bytes(); }
has_thread_descriptor()4214   bool has_thread_descriptor() const { return at<44>().valid(); }
thread_descriptor()4215   ::protozero::ConstBytes thread_descriptor() const { return at<44>().as_bytes(); }
has_ftrace_events()4216   bool has_ftrace_events() const { return at<1>().valid(); }
ftrace_events()4217   ::protozero::ConstBytes ftrace_events() const { return at<1>().as_bytes(); }
has_synchronization_marker()4218   bool has_synchronization_marker() const { return at<36>().valid(); }
synchronization_marker()4219   ::protozero::ConstBytes synchronization_marker() const { return at<36>().as_bytes(); }
has_compressed_packets()4220   bool has_compressed_packets() const { return at<50>().valid(); }
compressed_packets()4221   ::protozero::ConstBytes compressed_packets() const { return at<50>().as_bytes(); }
has_extension_descriptor()4222   bool has_extension_descriptor() const { return at<72>().valid(); }
extension_descriptor()4223   ::protozero::ConstBytes extension_descriptor() const { return at<72>().as_bytes(); }
has_for_testing()4224   bool has_for_testing() const { return at<900>().valid(); }
for_testing()4225   ::protozero::ConstBytes for_testing() const { return at<900>().as_bytes(); }
has_trusted_uid()4226   bool has_trusted_uid() const { return at<3>().valid(); }
trusted_uid()4227   int32_t trusted_uid() const { return at<3>().as_int32(); }
has_trusted_packet_sequence_id()4228   bool has_trusted_packet_sequence_id() const { return at<10>().valid(); }
trusted_packet_sequence_id()4229   uint32_t trusted_packet_sequence_id() const { return at<10>().as_uint32(); }
has_interned_data()4230   bool has_interned_data() const { return at<12>().valid(); }
interned_data()4231   ::protozero::ConstBytes interned_data() const { return at<12>().as_bytes(); }
has_sequence_flags()4232   bool has_sequence_flags() const { return at<13>().valid(); }
sequence_flags()4233   uint32_t sequence_flags() const { return at<13>().as_uint32(); }
has_incremental_state_cleared()4234   bool has_incremental_state_cleared() const { return at<41>().valid(); }
incremental_state_cleared()4235   bool incremental_state_cleared() const { return at<41>().as_bool(); }
has_trace_packet_defaults()4236   bool has_trace_packet_defaults() const { return at<59>().valid(); }
trace_packet_defaults()4237   ::protozero::ConstBytes trace_packet_defaults() const { return at<59>().as_bytes(); }
has_previous_packet_dropped()4238   bool has_previous_packet_dropped() const { return at<42>().valid(); }
previous_packet_dropped()4239   bool previous_packet_dropped() const { return at<42>().as_bool(); }
4240 };
4241 
4242 class TracePacket : public ::protozero::Message {
4243  public:
4244   using Decoder = TracePacket_Decoder;
4245   enum : int32_t {
4246     kTimestampFieldNumber = 8,
4247     kTimestampClockIdFieldNumber = 58,
4248     kProcessTreeFieldNumber = 2,
4249     kProcessStatsFieldNumber = 9,
4250     kInodeFileMapFieldNumber = 4,
4251     kChromeEventsFieldNumber = 5,
4252     kClockSnapshotFieldNumber = 6,
4253     kSysStatsFieldNumber = 7,
4254     kTrackEventFieldNumber = 11,
4255     kTraceConfigFieldNumber = 33,
4256     kFtraceStatsFieldNumber = 34,
4257     kTraceStatsFieldNumber = 35,
4258     kProfilePacketFieldNumber = 37,
4259     kBatteryFieldNumber = 38,
4260     kPowerRailsFieldNumber = 40,
4261     kAndroidLogFieldNumber = 39,
4262     kSystemInfoFieldNumber = 45,
4263     kTriggerFieldNumber = 46,
4264     kPackagesListFieldNumber = 47,
4265     kChromeBenchmarkMetadataFieldNumber = 48,
4266     kPerfettoMetatraceFieldNumber = 49,
4267     kChromeMetadataFieldNumber = 51,
4268     kGpuCounterEventFieldNumber = 52,
4269     kGpuRenderStageEventFieldNumber = 53,
4270     kStreamingProfilePacketFieldNumber = 54,
4271     kHeapGraphFieldNumber = 56,
4272     kGraphicsFrameEventFieldNumber = 57,
4273     kVulkanMemoryEventFieldNumber = 62,
4274     kGpuLogFieldNumber = 63,
4275     kVulkanApiEventFieldNumber = 65,
4276     kPerfSampleFieldNumber = 66,
4277     kCpuInfoFieldNumber = 67,
4278     kSmapsPacketFieldNumber = 68,
4279     kServiceEventFieldNumber = 69,
4280     kInitialDisplayStateFieldNumber = 70,
4281     kGpuMemTotalEventFieldNumber = 71,
4282     kMemoryTrackerSnapshotFieldNumber = 73,
4283     kProfiledFrameSymbolsFieldNumber = 55,
4284     kModuleSymbolsFieldNumber = 61,
4285     kDeobfuscationMappingFieldNumber = 64,
4286     kTrackDescriptorFieldNumber = 60,
4287     kProcessDescriptorFieldNumber = 43,
4288     kThreadDescriptorFieldNumber = 44,
4289     kFtraceEventsFieldNumber = 1,
4290     kSynchronizationMarkerFieldNumber = 36,
4291     kCompressedPacketsFieldNumber = 50,
4292     kExtensionDescriptorFieldNumber = 72,
4293     kForTestingFieldNumber = 900,
4294     kTrustedUidFieldNumber = 3,
4295     kTrustedPacketSequenceIdFieldNumber = 10,
4296     kInternedDataFieldNumber = 12,
4297     kSequenceFlagsFieldNumber = 13,
4298     kIncrementalStateClearedFieldNumber = 41,
4299     kTracePacketDefaultsFieldNumber = 59,
4300     kPreviousPacketDroppedFieldNumber = 42,
4301   };
4302   using SequenceFlags = ::perfetto::protos::pbzero::TracePacket_SequenceFlags;
4303   static const SequenceFlags SEQ_UNSPECIFIED = TracePacket_SequenceFlags_SEQ_UNSPECIFIED;
4304   static const SequenceFlags SEQ_INCREMENTAL_STATE_CLEARED = TracePacket_SequenceFlags_SEQ_INCREMENTAL_STATE_CLEARED;
4305   static const SequenceFlags SEQ_NEEDS_INCREMENTAL_STATE = TracePacket_SequenceFlags_SEQ_NEEDS_INCREMENTAL_STATE;
set_timestamp(uint64_t value)4306   void set_timestamp(uint64_t value) {
4307     AppendVarInt(8, value);
4308   }
set_timestamp_clock_id(uint32_t value)4309   void set_timestamp_clock_id(uint32_t value) {
4310     AppendVarInt(58, value);
4311   }
set_process_tree()4312   template <typename T = ProcessTree> T* set_process_tree() {
4313     return BeginNestedMessage<T>(2);
4314   }
4315 
set_process_stats()4316   template <typename T = ProcessStats> T* set_process_stats() {
4317     return BeginNestedMessage<T>(9);
4318   }
4319 
set_inode_file_map()4320   template <typename T = InodeFileMap> T* set_inode_file_map() {
4321     return BeginNestedMessage<T>(4);
4322   }
4323 
set_chrome_events()4324   template <typename T = ChromeEventBundle> T* set_chrome_events() {
4325     return BeginNestedMessage<T>(5);
4326   }
4327 
set_clock_snapshot()4328   template <typename T = ClockSnapshot> T* set_clock_snapshot() {
4329     return BeginNestedMessage<T>(6);
4330   }
4331 
set_sys_stats()4332   template <typename T = SysStats> T* set_sys_stats() {
4333     return BeginNestedMessage<T>(7);
4334   }
4335 
set_track_event()4336   template <typename T = TrackEvent> T* set_track_event() {
4337     return BeginNestedMessage<T>(11);
4338   }
4339 
set_trace_config()4340   template <typename T = TraceConfig> T* set_trace_config() {
4341     return BeginNestedMessage<T>(33);
4342   }
4343 
set_ftrace_stats()4344   template <typename T = FtraceStats> T* set_ftrace_stats() {
4345     return BeginNestedMessage<T>(34);
4346   }
4347 
set_trace_stats()4348   template <typename T = TraceStats> T* set_trace_stats() {
4349     return BeginNestedMessage<T>(35);
4350   }
4351 
set_profile_packet()4352   template <typename T = ProfilePacket> T* set_profile_packet() {
4353     return BeginNestedMessage<T>(37);
4354   }
4355 
set_battery()4356   template <typename T = BatteryCounters> T* set_battery() {
4357     return BeginNestedMessage<T>(38);
4358   }
4359 
set_power_rails()4360   template <typename T = PowerRails> T* set_power_rails() {
4361     return BeginNestedMessage<T>(40);
4362   }
4363 
set_android_log()4364   template <typename T = AndroidLogPacket> T* set_android_log() {
4365     return BeginNestedMessage<T>(39);
4366   }
4367 
set_system_info()4368   template <typename T = SystemInfo> T* set_system_info() {
4369     return BeginNestedMessage<T>(45);
4370   }
4371 
set_trigger()4372   template <typename T = Trigger> T* set_trigger() {
4373     return BeginNestedMessage<T>(46);
4374   }
4375 
set_packages_list()4376   template <typename T = PackagesList> T* set_packages_list() {
4377     return BeginNestedMessage<T>(47);
4378   }
4379 
set_chrome_benchmark_metadata()4380   template <typename T = ChromeBenchmarkMetadata> T* set_chrome_benchmark_metadata() {
4381     return BeginNestedMessage<T>(48);
4382   }
4383 
set_perfetto_metatrace()4384   template <typename T = PerfettoMetatrace> T* set_perfetto_metatrace() {
4385     return BeginNestedMessage<T>(49);
4386   }
4387 
set_chrome_metadata()4388   template <typename T = ChromeMetadataPacket> T* set_chrome_metadata() {
4389     return BeginNestedMessage<T>(51);
4390   }
4391 
set_gpu_counter_event()4392   template <typename T = GpuCounterEvent> T* set_gpu_counter_event() {
4393     return BeginNestedMessage<T>(52);
4394   }
4395 
set_gpu_render_stage_event()4396   template <typename T = GpuRenderStageEvent> T* set_gpu_render_stage_event() {
4397     return BeginNestedMessage<T>(53);
4398   }
4399 
set_streaming_profile_packet()4400   template <typename T = StreamingProfilePacket> T* set_streaming_profile_packet() {
4401     return BeginNestedMessage<T>(54);
4402   }
4403 
set_heap_graph()4404   template <typename T = HeapGraph> T* set_heap_graph() {
4405     return BeginNestedMessage<T>(56);
4406   }
4407 
set_graphics_frame_event()4408   template <typename T = GraphicsFrameEvent> T* set_graphics_frame_event() {
4409     return BeginNestedMessage<T>(57);
4410   }
4411 
set_vulkan_memory_event()4412   template <typename T = VulkanMemoryEvent> T* set_vulkan_memory_event() {
4413     return BeginNestedMessage<T>(62);
4414   }
4415 
set_gpu_log()4416   template <typename T = GpuLog> T* set_gpu_log() {
4417     return BeginNestedMessage<T>(63);
4418   }
4419 
set_vulkan_api_event()4420   template <typename T = VulkanApiEvent> T* set_vulkan_api_event() {
4421     return BeginNestedMessage<T>(65);
4422   }
4423 
set_perf_sample()4424   template <typename T = PerfSample> T* set_perf_sample() {
4425     return BeginNestedMessage<T>(66);
4426   }
4427 
set_cpu_info()4428   template <typename T = CpuInfo> T* set_cpu_info() {
4429     return BeginNestedMessage<T>(67);
4430   }
4431 
set_smaps_packet()4432   template <typename T = SmapsPacket> T* set_smaps_packet() {
4433     return BeginNestedMessage<T>(68);
4434   }
4435 
set_service_event()4436   template <typename T = TracingServiceEvent> T* set_service_event() {
4437     return BeginNestedMessage<T>(69);
4438   }
4439 
set_initial_display_state()4440   template <typename T = InitialDisplayState> T* set_initial_display_state() {
4441     return BeginNestedMessage<T>(70);
4442   }
4443 
set_gpu_mem_total_event()4444   template <typename T = GpuMemTotalEvent> T* set_gpu_mem_total_event() {
4445     return BeginNestedMessage<T>(71);
4446   }
4447 
set_memory_tracker_snapshot()4448   template <typename T = MemoryTrackerSnapshot> T* set_memory_tracker_snapshot() {
4449     return BeginNestedMessage<T>(73);
4450   }
4451 
set_profiled_frame_symbols()4452   template <typename T = ProfiledFrameSymbols> T* set_profiled_frame_symbols() {
4453     return BeginNestedMessage<T>(55);
4454   }
4455 
set_module_symbols()4456   template <typename T = ModuleSymbols> T* set_module_symbols() {
4457     return BeginNestedMessage<T>(61);
4458   }
4459 
set_deobfuscation_mapping()4460   template <typename T = DeobfuscationMapping> T* set_deobfuscation_mapping() {
4461     return BeginNestedMessage<T>(64);
4462   }
4463 
set_track_descriptor()4464   template <typename T = TrackDescriptor> T* set_track_descriptor() {
4465     return BeginNestedMessage<T>(60);
4466   }
4467 
set_process_descriptor()4468   template <typename T = ProcessDescriptor> T* set_process_descriptor() {
4469     return BeginNestedMessage<T>(43);
4470   }
4471 
set_thread_descriptor()4472   template <typename T = ThreadDescriptor> T* set_thread_descriptor() {
4473     return BeginNestedMessage<T>(44);
4474   }
4475 
set_ftrace_events()4476   template <typename T = FtraceEventBundle> T* set_ftrace_events() {
4477     return BeginNestedMessage<T>(1);
4478   }
4479 
set_synchronization_marker(const std::string & value)4480   void set_synchronization_marker(const std::string& value) {
4481     AppendBytes(36, value.data(), value.size());
4482   }
set_synchronization_marker(const uint8_t * data,size_t size)4483   void set_synchronization_marker(const uint8_t* data, size_t size) {
4484     AppendBytes(36, data, size);
4485   }
set_compressed_packets(const std::string & value)4486   void set_compressed_packets(const std::string& value) {
4487     AppendBytes(50, value.data(), value.size());
4488   }
set_compressed_packets(const uint8_t * data,size_t size)4489   void set_compressed_packets(const uint8_t* data, size_t size) {
4490     AppendBytes(50, data, size);
4491   }
set_extension_descriptor()4492   template <typename T = ExtensionDescriptor> T* set_extension_descriptor() {
4493     return BeginNestedMessage<T>(72);
4494   }
4495 
set_for_testing()4496   template <typename T = TestEvent> T* set_for_testing() {
4497     return BeginNestedMessage<T>(900);
4498   }
4499 
set_trusted_uid(int32_t value)4500   void set_trusted_uid(int32_t value) {
4501     AppendVarInt(3, value);
4502   }
set_trusted_packet_sequence_id(uint32_t value)4503   void set_trusted_packet_sequence_id(uint32_t value) {
4504     AppendVarInt(10, value);
4505   }
set_interned_data()4506   template <typename T = InternedData> T* set_interned_data() {
4507     return BeginNestedMessage<T>(12);
4508   }
4509 
set_sequence_flags(uint32_t value)4510   void set_sequence_flags(uint32_t value) {
4511     AppendVarInt(13, value);
4512   }
set_incremental_state_cleared(bool value)4513   void set_incremental_state_cleared(bool value) {
4514     AppendTinyVarInt(41, value);
4515   }
set_trace_packet_defaults()4516   template <typename T = TracePacketDefaults> T* set_trace_packet_defaults() {
4517     return BeginNestedMessage<T>(59);
4518   }
4519 
set_previous_packet_dropped(bool value)4520   void set_previous_packet_dropped(bool value) {
4521     AppendTinyVarInt(42, value);
4522   }
4523 };
4524 
4525 } // Namespace.
4526 } // Namespace.
4527 } // Namespace.
4528 #endif  // Include guard.
4529 /*
4530  * Copyright (C) 2019 The Android Open Source Project
4531  *
4532  * Licensed under the Apache License, Version 2.0 (the "License");
4533  * you may not use this file except in compliance with the License.
4534  * You may obtain a copy of the License at
4535  *
4536  *      http://www.apache.org/licenses/LICENSE-2.0
4537  *
4538  * Unless required by applicable law or agreed to in writing, software
4539  * distributed under the License is distributed on an "AS IS" BASIS,
4540  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4541  * See the License for the specific language governing permissions and
4542  * limitations under the License.
4543  */
4544 
4545 #ifndef INCLUDE_PERFETTO_TRACING_DATA_SOURCE_H_
4546 #define INCLUDE_PERFETTO_TRACING_DATA_SOURCE_H_
4547 
4548 // This header contains the key class (DataSource) that a producer app should
4549 // override in order to create a custom data source that gets tracing Start/Stop
4550 // notifications and emits tracing data.
4551 
4552 #include <assert.h>
4553 #include <stddef.h>
4554 #include <stdint.h>
4555 
4556 #include <array>
4557 #include <atomic>
4558 #include <functional>
4559 #include <memory>
4560 #include <mutex>
4561 
4562 // gen_amalgamated expanded: #include "perfetto/base/build_config.h"
4563 // gen_amalgamated expanded: #include "perfetto/base/compiler.h"
4564 // gen_amalgamated expanded: #include "perfetto/base/export.h"
4565 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
4566 // gen_amalgamated expanded: #include "perfetto/protozero/message_handle.h"
4567 // gen_amalgamated expanded: #include "perfetto/tracing/buffer_exhausted_policy.h"
4568 // gen_amalgamated expanded: #include "perfetto/tracing/core/forward_decls.h"
4569 // gen_amalgamated expanded: #include "perfetto/tracing/internal/basic_types.h"
4570 // gen_amalgamated expanded: #include "perfetto/tracing/internal/data_source_internal.h"
4571 // gen_amalgamated expanded: #include "perfetto/tracing/internal/tracing_muxer.h"
4572 // gen_amalgamated expanded: #include "perfetto/tracing/locked_handle.h"
4573 // gen_amalgamated expanded: #include "perfetto/tracing/trace_writer_base.h"
4574 
4575 // gen_amalgamated expanded: #include "protos/perfetto/trace/trace_packet.pbzero.h"
4576 
4577 // PERFETTO_COMPONENT_EXPORT is used to mark symbols in Perfetto's headers
4578 // (typically templates) that are defined by the user outside of Perfetto and
4579 // should be made visible outside the current module. (e.g., in Chrome's
4580 // component build).
4581 #if !defined(PERFETTO_COMPONENT_EXPORT)
4582 #define PERFETTO_COMPONENT_EXPORT
4583 #endif
4584 
4585 namespace perfetto {
4586 namespace internal {
4587 class TracingMuxerImpl;
4588 class TrackEventCategoryRegistry;
4589 template <typename, const internal::TrackEventCategoryRegistry*>
4590 class TrackEventDataSource;
4591 }  // namespace internal
4592 
4593 // Base class with the virtual methods to get start/stop notifications.
4594 // Embedders are supposed to derive the templated version below, not this one.
4595 class PERFETTO_EXPORT DataSourceBase {
4596  public:
4597   virtual ~DataSourceBase();
4598 
4599   // TODO(primiano): change the const& args below to be pointers instead. It
4600   // makes it more awkward to handle output arguments and require mutable(s).
4601   // This requires synchronizing a breaking API change for existing embedders.
4602 
4603   // OnSetup() is invoked when tracing is configured. In most cases this happens
4604   // just before starting the trace. In the case of deferred start (see
4605   // deferred_start in trace_config.proto) start might happen later.
4606   class SetupArgs {
4607    public:
4608     // This is valid only within the scope of the OnSetup() call and must not
4609     // be retained.
4610     const DataSourceConfig* config = nullptr;
4611 
4612     // The index of this data source instance (0..kMaxDataSourceInstances - 1).
4613     uint32_t internal_instance_index = 0;
4614   };
4615   virtual void OnSetup(const SetupArgs&);
4616 
4617   class StartArgs {
4618    public:
4619     // The index of this data source instance (0..kMaxDataSourceInstances - 1).
4620     uint32_t internal_instance_index = 0;
4621   };
4622   virtual void OnStart(const StartArgs&);
4623 
4624   class StopArgs {
4625    public:
4626     virtual ~StopArgs();
4627 
4628     // HandleAsynchronously() can optionally be called to defer the tracing
4629     // session stop and write tracing data just before stopping.
4630     // This function returns a closure that must be invoked after the last
4631     // trace events have been emitted. The returned closure can be called from
4632     // any thread. The caller also needs to explicitly call TraceContext.Flush()
4633     // from the last Trace() lambda invocation because no other implicit flushes
4634     // will happen after the stop signal.
4635     // When this function is called, the tracing service will defer the stop of
4636     // the tracing session until the returned closure is invoked.
4637     // However, the caller cannot hang onto this closure for too long. The
4638     // tracing service will forcefully stop the tracing session without waiting
4639     // for pending producers after TraceConfig.data_source_stop_timeout_ms
4640     // (default: 5s, can be overridden by Consumers when starting a trace).
4641     // If the closure is called after this timeout an error will be logged and
4642     // the trace data emitted will not be present in the trace. No other
4643     // functional side effects (e.g. crashes or corruptions) will happen. In
4644     // other words, it is fine to accidentally hold onto this closure for too
4645     // long but, if that happens, some tracing data will be lost.
4646     virtual std::function<void()> HandleStopAsynchronously() const = 0;
4647 
4648     // The index of this data source instance (0..kMaxDataSourceInstances - 1).
4649     uint32_t internal_instance_index = 0;
4650   };
4651   virtual void OnStop(const StopArgs&);
4652 };
4653 
4654 struct DefaultDataSourceTraits {
4655   // |IncrementalStateType| can optionally be used store custom per-sequence
4656   // incremental data (e.g., interning tables). It should have a Clear() method
4657   // for when incremental state needs to be cleared. See
4658   // TraceContext::GetIncrementalState().
4659   using IncrementalStateType = void;
4660 
4661   // Allows overriding what type of thread-local state configuration the data
4662   // source uses. By default every data source gets independent thread-local
4663   // state, which means every instance uses separate trace writers and
4664   // incremental state even on the same thread. Some data sources (most notably
4665   // the track event data source) want to share trace writers and incremental
4666   // state on the same thread.
GetDataSourceTLSDefaultDataSourceTraits4667   static internal::DataSourceThreadLocalState* GetDataSourceTLS(
4668       internal::DataSourceStaticState* static_state,
4669       internal::TracingTLS* root_tls) {
4670     auto* ds_tls = &root_tls->data_sources_tls[static_state->index];
4671     // The per-type TLS is either zero-initialized or must have been initialized
4672     // for this specific data source type.
4673     assert(!ds_tls->static_state ||
4674            ds_tls->static_state->index == static_state->index);
4675     return ds_tls;
4676   }
4677 };
4678 
4679 // Templated base class meant to be derived by embedders to create a custom data
4680 // source. DataSourceType must be the type of the derived class itself, e.g.:
4681 // class MyDataSource : public DataSourceBase<MyDataSource> {...}.
4682 //
4683 // |DataSourceTraits| allows customizing the behavior of the data source. See
4684 // |DefaultDataSourceTraits|.
4685 template <typename DataSourceType,
4686           typename DataSourceTraits = DefaultDataSourceTraits>
4687 class DataSource : public DataSourceBase {
4688   struct DefaultTracePointTraits;
4689 
4690  public:
4691   // The BufferExhaustedPolicy to use for TraceWriters of this DataSource.
4692   // Override this in your DataSource class to change the default, which is to
4693   // drop data on shared memory overruns.
4694   constexpr static BufferExhaustedPolicy kBufferExhaustedPolicy =
4695       BufferExhaustedPolicy::kDrop;
4696 
4697   // Argument passed to the lambda function passed to Trace() (below).
4698   class TraceContext {
4699    public:
4700     using TracePacketHandle =
4701         ::protozero::MessageHandle<::perfetto::protos::pbzero::TracePacket>;
4702 
4703     TraceContext(TraceContext&&) noexcept = default;
4704     ~TraceContext() = default;
4705 
NewTracePacket()4706     TracePacketHandle NewTracePacket() {
4707       return tls_inst_->trace_writer->NewTracePacket();
4708     }
4709 
4710     // Forces a commit of the thread-local tracing data written so far to the
4711     // service. This is almost never required (tracing data is periodically
4712     // committed as trace pages are filled up) and has a non-negligible
4713     // performance hit (requires an IPC + refresh of the current thread-local
4714     // chunk). The only case when this should be used is when handling OnStop()
4715     // asynchronously, to ensure sure that the data is committed before the
4716     // Stop timeout expires.
4717     // The TracePacketHandle obtained by the last NewTracePacket() call must be
4718     // finalized before calling Flush() (either implicitly by going out of scope
4719     // or by explicitly calling Finalize()).
4720     // |cb| is an optional callback. When non-null it will request the
4721     // service to ACK the flush and will be invoked on an internal thread after
4722     // the service has  acknowledged it. The callback might be NEVER INVOKED if
4723     // the service crashes or the IPC connection is dropped.
4724     void Flush(std::function<void()> cb = {}) {
4725       tls_inst_->trace_writer->Flush(cb);
4726     }
4727 
4728     // Returns the number of bytes written on the current thread by the current
4729     // data-source since its creation.
4730     // This can be useful for splitting protos that might grow very large.
written()4731     uint64_t written() { return tls_inst_->trace_writer->written(); }
4732 
4733     // Returns a RAII handle to access the data source instance, guaranteeing
4734     // that it won't be deleted on another thread (because of trace stopping)
4735     // while accessing it from within the Trace() lambda.
4736     // The returned handle can be invalid (nullptr) if tracing is stopped
4737     // immediately before calling this. The caller is supposed to check for its
4738     // validity before using it. After checking, the handle is guaranteed to
4739     // remain valid until the handle goes out of scope.
GetDataSourceLocked()4740     LockedHandle<DataSourceType> GetDataSourceLocked() {
4741       auto* internal_state = static_state_.TryGet(instance_index_);
4742       if (!internal_state)
4743         return LockedHandle<DataSourceType>();
4744       return LockedHandle<DataSourceType>(
4745           &internal_state->lock,
4746           static_cast<DataSourceType*>(internal_state->data_source.get()));
4747     }
4748 
GetIncrementalState()4749     typename DataSourceTraits::IncrementalStateType* GetIncrementalState() {
4750       return reinterpret_cast<typename DataSourceTraits::IncrementalStateType*>(
4751           tls_inst_->incremental_state.get());
4752     }
4753 
4754    private:
4755     friend class DataSource;
4756     template <typename, const internal::TrackEventCategoryRegistry*>
4757     friend class internal::TrackEventDataSource;
TraceContext(internal::DataSourceInstanceThreadLocalState * tls_inst,uint32_t instance_index)4758     TraceContext(internal::DataSourceInstanceThreadLocalState* tls_inst,
4759                  uint32_t instance_index)
4760         : tls_inst_(tls_inst), instance_index_(instance_index) {}
4761     TraceContext(const TraceContext&) = delete;
4762     TraceContext& operator=(const TraceContext&) = delete;
4763 
4764     internal::DataSourceInstanceThreadLocalState* const tls_inst_;
4765     uint32_t const instance_index_;
4766   };
4767 
4768   // The main tracing method. Tracing code should call this passing a lambda as
4769   // argument, with the following signature: void(TraceContext).
4770   // The lambda will be called synchronously (i.e., always before Trace()
4771   // returns) only if tracing is enabled and the data source has been enabled in
4772   // the tracing config.
4773   // The lambda can be called more than once per Trace() call, in the case of
4774   // concurrent tracing sessions (or even if the data source is instantiated
4775   // twice within the same trace config).
4776   template <typename Lambda>
Trace(Lambda tracing_fn)4777   static void Trace(Lambda tracing_fn) {
4778     CallIfEnabled<DefaultTracePointTraits>([&tracing_fn](uint32_t instances) {
4779       TraceWithInstances<DefaultTracePointTraits>(instances,
4780                                                   std::move(tracing_fn));
4781     });
4782   }
4783 
4784   // An efficient trace point guard for checking if this data source is active.
4785   // |callback| is a function which will only be called if there are active
4786   // instances. It is given an instance state parameter, which should be passed
4787   // to TraceWithInstances() to actually record trace data.
4788   template <typename Traits = DefaultTracePointTraits, typename Callback>
CallIfEnabled(Callback callback)4789   static void CallIfEnabled(Callback callback) PERFETTO_ALWAYS_INLINE {
4790     // |instances| is a per-class bitmap that tells:
4791     // 1. If the data source is enabled at all.
4792     // 2. The index of the slot within |static_state_| that holds the instance
4793     //    state. In turn this allows to map the data source to the tracing
4794     //    session and buffers.
4795     // memory_order_relaxed is okay because:
4796     // - |instances| is re-read with an acquire barrier below if this succeeds.
4797     // - The code between this point and the acquire-load is based on static
4798     //    storage which has indefinite lifetime.
4799     uint32_t instances =
4800         Traits::GetActiveInstances()->load(std::memory_order_relaxed);
4801 
4802     // This is the tracing fast-path. Bail out immediately if tracing is not
4803     // enabled (or tracing is enabled but not for this data source).
4804     if (PERFETTO_LIKELY(!instances))
4805       return;
4806     callback(instances);
4807   }
4808 
4809   // The "lower half" of a trace point which actually performs tracing after
4810   // this data source has been determined to be active.
4811   // |instances| must be the instance state value retrieved through
4812   // CallIfEnabled().
4813   // |tracing_fn| will be called to record trace data as in Trace().
4814   //
4815   // TODO(primiano): all the stuff below should be outlined from the trace
4816   // point. Or at least we should have some compile-time traits like
4817   // kOptimizeBinarySize / kOptimizeTracingLatency.
4818   template <typename Traits = DefaultTracePointTraits, typename Lambda>
TraceWithInstances(uint32_t instances,Lambda tracing_fn)4819   static void TraceWithInstances(uint32_t instances, Lambda tracing_fn) {
4820     PERFETTO_DCHECK(instances);
4821     constexpr auto kMaxDataSourceInstances = internal::kMaxDataSourceInstances;
4822 
4823     // See tracing_muxer.h for the structure of the TLS.
4824     auto* tracing_impl = internal::TracingMuxer::Get();
4825     if (PERFETTO_UNLIKELY(!tls_state_))
4826       tls_state_ = GetOrCreateDataSourceTLS(&static_state_);
4827 
4828     // TracingTLS::generation is a global monotonic counter that is incremented
4829     // every time a tracing session is stopped. We use that as a signal to force
4830     // a slow-path garbage collection of all the trace writers for the current
4831     // thread and to destroy the ones that belong to tracing sessions that have
4832     // ended. This is to avoid having too many TraceWriter instances alive, each
4833     // holding onto one chunk of the shared memory buffer.
4834     // Rationale why memory_order_relaxed should be fine:
4835     // - The TraceWriter object that we use is always constructed and destructed
4836     //   on the current thread. There is no risk of accessing a half-initialized
4837     //   TraceWriter (which would be really bad).
4838     // - In the worst case, in the case of a race on the generation check, we
4839     //   might end up using a TraceWriter for the same data source that belongs
4840     //   to a stopped session. This is not really wrong, as we don't give any
4841     //   guarantee on the global atomicity of the stop. In the worst case the
4842     //   service will reject the data commit if this arrives too late.
4843 
4844     if (PERFETTO_UNLIKELY(
4845             tls_state_->root_tls->generation !=
4846             tracing_impl->generation(std::memory_order_relaxed))) {
4847       // Will update root_tls->generation.
4848       tracing_impl->DestroyStoppedTraceWritersForCurrentThread();
4849     }
4850 
4851     for (uint32_t i = 0; i < kMaxDataSourceInstances; i++) {
4852       internal::DataSourceState* instance_state =
4853           static_state_.TryGetCached(instances, i);
4854       if (!instance_state)
4855         continue;
4856 
4857       // Even if we passed the check above, the DataSourceInstance might be
4858       // still destroyed concurrently while this code runs. The code below is
4859       // designed to deal with such race, as follows:
4860       // - We don't access the user-defined data source instance state. The only
4861       //   bits of state we use are |backend_id| and |buffer_id|.
4862       // - Beyond those two integers, we access only the TraceWriter here. The
4863       //   TraceWriter is always safe because it lives on the TLS.
4864       // - |instance_state| is backed by static storage, so the pointer is
4865       //   always valid, even after the data source instance is destroyed.
4866       // - In the case of a race-on-destruction, we'll still see the latest
4867       //   backend_id and buffer_id and in the worst case keep trying writing
4868       //   into the tracing shared memory buffer after stopped. But this isn't
4869       //   really any worse than the case of the stop IPC being delayed by the
4870       //   kernel scheduler. The tracing service is robust against data commit
4871       //   attemps made after tracing is stopped.
4872       // There is a theoretical race that would case the wrong behavior w.r.t
4873       // writing data in the wrong buffer, but it's so rare that we ignore it:
4874       // if the data source is stopped and started kMaxDataSourceInstances
4875       // times (so that the same id is recycled) while we are in this function,
4876       // we might end up reusing the old data source's backend_id and buffer_id
4877       // for the new one, because we don't see the generation change past this
4878       // point. But stopping and starting tracing (even once) takes so much
4879       // handshaking to make this extremely unrealistic.
4880 
4881       auto& tls_inst = tls_state_->per_instance[i];
4882       if (PERFETTO_UNLIKELY(!tls_inst.trace_writer)) {
4883         // Here we need an acquire barrier, which matches the release-store made
4884         // by TracingMuxerImpl::SetupDataSource(), to ensure that the backend_id
4885         // and buffer_id are consistent.
4886         instances =
4887             Traits::GetActiveInstances()->load(std::memory_order_acquire);
4888         instance_state = static_state_.TryGetCached(instances, i);
4889         if (!instance_state || !instance_state->trace_lambda_enabled)
4890           return;
4891         tls_inst.backend_id = instance_state->backend_id;
4892         tls_inst.buffer_id = instance_state->buffer_id;
4893         tls_inst.trace_writer = tracing_impl->CreateTraceWriter(
4894             instance_state, DataSourceType::kBufferExhaustedPolicy);
4895         CreateIncrementalState(
4896             &tls_inst,
4897             static_cast<typename DataSourceTraits::IncrementalStateType*>(
4898                 nullptr));
4899 
4900         // Even in the case of out-of-IDs, SharedMemoryArbiterImpl returns a
4901         // NullTraceWriter. The returned pointer should never be null.
4902         assert(tls_inst.trace_writer);
4903       }
4904 
4905       tracing_fn(TraceContext(&tls_inst, i));
4906     }
4907   }
4908 
4909   // Registers the data source on all tracing backends, including ones that
4910   // connect after the registration. Doing so enables the data source to receive
4911   // Setup/Start/Stop notifications and makes the Trace() method work when
4912   // tracing is enabled and the data source is selected.
4913   // This must be called after Tracing::Initialize().
4914   // Can return false to signal failure if attemping to register more than
4915   // kMaxDataSources (32) data sources types or if tracing hasn't been
4916   // initialized.
Register(const DataSourceDescriptor & descriptor)4917   static bool Register(const DataSourceDescriptor& descriptor) {
4918     // Silences -Wunused-variable warning in case the trace method is not used
4919     // by the translation unit that declares the data source.
4920     (void)static_state_;
4921     (void)tls_state_;
4922 
4923     auto factory = [] {
4924       return std::unique_ptr<DataSourceBase>(new DataSourceType());
4925     };
4926     auto* tracing_impl = internal::TracingMuxer::Get();
4927     if (!tracing_impl)
4928       return false;
4929     return tracing_impl->RegisterDataSource(descriptor, factory,
4930                                             &static_state_);
4931   }
4932 
4933  private:
4934   // Traits for customizing the behavior of a specific trace point.
4935   struct DefaultTracePointTraits {
4936     // By default, every call to DataSource::Trace() will record trace events
4937     // for every active instance of that data source. A single trace point can,
4938     // however, use a custom set of enable flags for more fine grained control
4939     // of when that trace point is active.
4940     //
4941     // DANGER: when doing this, the data source must use the appropriate memory
4942     // fences when changing the state of the bitmap.
GetActiveInstancesDefaultTracePointTraits4943     static constexpr std::atomic<uint32_t>* GetActiveInstances() {
4944       return &static_state_.valid_instances;
4945     }
4946   };
4947 
4948   // Create the user provided incremental state in the given thread-local
4949   // storage. Note: The second parameter here is used to specialize the case
4950   // where there is no incremental state type.
4951   template <typename T>
CreateIncrementalState(internal::DataSourceInstanceThreadLocalState * tls_inst,const T *)4952   static void CreateIncrementalState(
4953       internal::DataSourceInstanceThreadLocalState* tls_inst,
4954       const T*) {
4955     PERFETTO_DCHECK(!tls_inst->incremental_state);
4956     tls_inst->incremental_state =
4957         internal::DataSourceInstanceThreadLocalState::IncrementalStatePointer(
4958             reinterpret_cast<void*>(new T()),
4959             [](void* p) { delete reinterpret_cast<T*>(p); });
4960   }
CreateIncrementalState(internal::DataSourceInstanceThreadLocalState *,const void *)4961   static void CreateIncrementalState(
4962       internal::DataSourceInstanceThreadLocalState*,
4963       const void*) {}
4964 
4965   // Note that the returned object is one per-thread per-data-source-type, NOT
4966   // per data-source *instance*.
GetOrCreateDataSourceTLS(internal::DataSourceStaticState * static_state)4967   static internal::DataSourceThreadLocalState* GetOrCreateDataSourceTLS(
4968       internal::DataSourceStaticState* static_state) {
4969 #if PERFETTO_BUILDFLAG(PERFETTO_OS_IOS)
4970     PERFETTO_FATAL("Data source TLS not supported on iOS, see b/158814068");
4971 #endif
4972     auto* tracing_impl = internal::TracingMuxer::Get();
4973     internal::TracingTLS* root_tls = tracing_impl->GetOrCreateTracingTLS();
4974     internal::DataSourceThreadLocalState* ds_tls =
4975         DataSourceTraits::GetDataSourceTLS(static_state, root_tls);
4976     // We keep re-initializing as the initialization is idempotent and not worth
4977     // the code for extra checks.
4978     ds_tls->static_state = static_state;
4979     assert(!ds_tls->root_tls || ds_tls->root_tls == root_tls);
4980     ds_tls->root_tls = root_tls;
4981     return ds_tls;
4982   }
4983 
4984   // Static state. Accessed by the static Trace() method fastpaths.
4985   static internal::DataSourceStaticState static_state_;
4986 
4987   // This TLS object is a cached raw pointer and has deliberately no destructor.
4988   // The Platform implementation is supposed to create and manage the lifetime
4989   // of the Platform::ThreadLocalObject and take care of destroying it.
4990   // This is because non-POD thread_local variables have subtleties (global
4991   // destructors) that we need to defer to the embedder. In chromium's platform
4992   // implementation, for instance, the tls slot is implemented using
4993   // chromium's base::ThreadLocalStorage.
4994   static PERFETTO_THREAD_LOCAL internal::DataSourceThreadLocalState* tls_state_;
4995 };
4996 
4997 // static
4998 template <typename T, typename D>
4999 internal::DataSourceStaticState DataSource<T, D>::static_state_;
5000 // static
5001 template <typename T, typename D>
5002 PERFETTO_THREAD_LOCAL internal::DataSourceThreadLocalState*
5003     DataSource<T, D>::tls_state_;
5004 
5005 }  // namespace perfetto
5006 
5007 // If placed at the end of a macro declaration, eats the semicolon at the end of
5008 // the macro invocation (e.g., "MACRO(...);") to avoid warnings about extra
5009 // semicolons.
5010 #define PERFETTO_INTERNAL_SWALLOW_SEMICOLON() \
5011   extern int perfetto_internal_unused
5012 
5013 // This macro must be used once for each data source next to the data source's
5014 // declaration.
5015 #define PERFETTO_DECLARE_DATA_SOURCE_STATIC_MEMBERS(...)              \
5016   template <>                                                         \
5017   PERFETTO_COMPONENT_EXPORT perfetto::internal::DataSourceStaticState \
5018       perfetto::DataSource<__VA_ARGS__>::static_state_;               \
5019   template <>                                                         \
5020   PERFETTO_COMPONENT_EXPORT thread_local perfetto::internal::         \
5021       DataSourceThreadLocalState*                                     \
5022           perfetto::DataSource<__VA_ARGS__>::tls_state_
5023 
5024 // This macro must be used once for each data source in one source file to
5025 // allocate static storage for the data source's static state.
5026 #define PERFETTO_DEFINE_DATA_SOURCE_STATIC_MEMBERS(...)               \
5027   template <>                                                         \
5028   PERFETTO_COMPONENT_EXPORT perfetto::internal::DataSourceStaticState \
5029       perfetto::DataSource<__VA_ARGS__>::static_state_{};             \
5030   template <>                                                         \
5031   PERFETTO_COMPONENT_EXPORT thread_local perfetto::internal::         \
5032       DataSourceThreadLocalState*                                     \
5033           perfetto::DataSource<__VA_ARGS__>::tls_state_ = nullptr
5034 
5035 #endif  // INCLUDE_PERFETTO_TRACING_DATA_SOURCE_H_
5036 // gen_amalgamated begin header: include/perfetto/tracing/tracing.h
5037 // gen_amalgamated begin header: include/perfetto/tracing/internal/in_process_tracing_backend.h
5038 // gen_amalgamated begin header: include/perfetto/tracing/tracing_backend.h
5039 /*
5040  * Copyright (C) 2019 The Android Open Source Project
5041  *
5042  * Licensed under the Apache License, Version 2.0 (the "License");
5043  * you may not use this file except in compliance with the License.
5044  * You may obtain a copy of the License at
5045  *
5046  *      http://www.apache.org/licenses/LICENSE-2.0
5047  *
5048  * Unless required by applicable law or agreed to in writing, software
5049  * distributed under the License is distributed on an "AS IS" BASIS,
5050  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5051  * See the License for the specific language governing permissions and
5052  * limitations under the License.
5053  */
5054 
5055 #ifndef INCLUDE_PERFETTO_TRACING_TRACING_BACKEND_H_
5056 #define INCLUDE_PERFETTO_TRACING_TRACING_BACKEND_H_
5057 
5058 #include <memory>
5059 #include <string>
5060 
5061 // gen_amalgamated expanded: #include "perfetto/base/export.h"
5062 
5063 // The embedder can (but doesn't have to) extend the TracingBackend class and
5064 // pass as an argument to Tracing::Initialize(kCustomBackend) to override the
5065 // way to reach the service. This is for peculiar cases where the embedder has
5066 // a multi-process architecture and wants to override the IPC transport. The
5067 // real use-case for this at the time of writing is chromium (+ Mojo IPC).
5068 // Extending this class requires depending on the full set of perfetto headers
5069 // (not just /public/). Contact the team before doing so as the non-public
5070 // headers are not guaranteed to be API stable.
5071 
5072 namespace perfetto {
5073 
5074 namespace base {
5075 class TaskRunner;
5076 }
5077 
5078 // These classes are declared in headers outside of /public/.
5079 class Consumer;
5080 class ConsumerEndpoint;
5081 class Producer;
5082 class ProducerEndpoint;
5083 
5084 class PERFETTO_EXPORT TracingBackend {
5085  public:
5086   virtual ~TracingBackend();
5087 
5088   // Connects a Producer instance and obtains a ProducerEndpoint, which is
5089   // essentially a 1:1 channel between one Producer and the Service.
5090   // To disconnect just destroy the returned endpoint object. It is safe to
5091   // destroy the Producer once Producer::OnDisconnect() has been invoked.
5092   struct ConnectProducerArgs {
5093     std::string producer_name;
5094 
5095     // The Producer object that will receive calls like Start/StopDataSource().
5096     // The caller has to guarantee that this object is valid as long as the
5097     // returned ProducerEndpoint is alive.
5098     Producer* producer = nullptr;
5099 
5100     // The task runner where the Producer methods will be called onto.
5101     // The caller has to guarantee that the passed TaskRunner is valid as long
5102     // as the returned ProducerEndpoint is alive.
5103     ::perfetto::base::TaskRunner* task_runner = nullptr;
5104 
5105     // These get propagated from TracingInitArgs and are optionally provided by
5106     // the client when calling Tracing::Initialize().
5107     uint32_t shmem_size_hint_bytes = 0;
5108     uint32_t shmem_page_size_hint_bytes = 0;
5109   };
5110 
5111   virtual std::unique_ptr<ProducerEndpoint> ConnectProducer(
5112       const ConnectProducerArgs&) = 0;
5113 
5114   // As above, for the Consumer-side.
5115   struct ConnectConsumerArgs {
5116     // The Consumer object that will receive calls like OnTracingDisabled(),
5117     // OnTraceData().
5118     Consumer* consumer{};
5119 
5120     // The task runner where the Consumer methods will be called onto.
5121     ::perfetto::base::TaskRunner* task_runner{};
5122   };
5123   virtual std::unique_ptr<ConsumerEndpoint> ConnectConsumer(
5124       const ConnectConsumerArgs&) = 0;
5125 };
5126 
5127 }  // namespace perfetto
5128 
5129 #endif  // INCLUDE_PERFETTO_TRACING_TRACING_BACKEND_H_
5130 /*
5131  * Copyright (C) 2019 The Android Open Source Project
5132  *
5133  * Licensed under the Apache License, Version 2.0 (the "License");
5134  * you may not use this file except in compliance with the License.
5135  * You may obtain a copy of the License at
5136  *
5137  *      http://www.apache.org/licenses/LICENSE-2.0
5138  *
5139  * Unless required by applicable law or agreed to in writing, software
5140  * distributed under the License is distributed on an "AS IS" BASIS,
5141  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5142  * See the License for the specific language governing permissions and
5143  * limitations under the License.
5144  */
5145 
5146 #ifndef INCLUDE_PERFETTO_TRACING_INTERNAL_IN_PROCESS_TRACING_BACKEND_H_
5147 #define INCLUDE_PERFETTO_TRACING_INTERNAL_IN_PROCESS_TRACING_BACKEND_H_
5148 
5149 // gen_amalgamated expanded: #include "perfetto/base/export.h"
5150 // gen_amalgamated expanded: #include "perfetto/tracing/tracing_backend.h"
5151 
5152 namespace perfetto {
5153 
5154 namespace base {
5155 class TaskRunner;
5156 }
5157 
5158 class Producer;
5159 class TracingService;
5160 
5161 namespace internal {
5162 
5163 // A built-in implementation of TracingBackend that creates a tracing service
5164 // instance in-process. Instantiated when the embedder calls
5165 // Tracing::Initialize(kInProcessBackend). Solves most in-app-only tracing
5166 // use-cases.
5167 class PERFETTO_EXPORT InProcessTracingBackend : public TracingBackend {
5168  public:
5169   static TracingBackend* GetInstance();
5170 
5171   // TracingBackend implementation.
5172   std::unique_ptr<ProducerEndpoint> ConnectProducer(
5173       const ConnectProducerArgs&) override;
5174   std::unique_ptr<ConsumerEndpoint> ConnectConsumer(
5175       const ConnectConsumerArgs&) override;
5176 
5177  private:
5178   InProcessTracingBackend();
5179   TracingService* GetOrCreateService(base::TaskRunner*);
5180 
5181   std::unique_ptr<TracingService> service_;
5182 };
5183 
5184 }  // namespace internal
5185 }  // namespace perfetto
5186 
5187 #endif  // INCLUDE_PERFETTO_TRACING_INTERNAL_IN_PROCESS_TRACING_BACKEND_H_
5188 // gen_amalgamated begin header: include/perfetto/tracing/internal/system_tracing_backend.h
5189 /*
5190  * Copyright (C) 2019 The Android Open Source Project
5191  *
5192  * Licensed under the Apache License, Version 2.0 (the "License");
5193  * you may not use this file except in compliance with the License.
5194  * You may obtain a copy of the License at
5195  *
5196  *      http://www.apache.org/licenses/LICENSE-2.0
5197  *
5198  * Unless required by applicable law or agreed to in writing, software
5199  * distributed under the License is distributed on an "AS IS" BASIS,
5200  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5201  * See the License for the specific language governing permissions and
5202  * limitations under the License.
5203  */
5204 
5205 #ifndef INCLUDE_PERFETTO_TRACING_INTERNAL_SYSTEM_TRACING_BACKEND_H_
5206 #define INCLUDE_PERFETTO_TRACING_INTERNAL_SYSTEM_TRACING_BACKEND_H_
5207 
5208 // gen_amalgamated expanded: #include "perfetto/base/export.h"
5209 // gen_amalgamated expanded: #include "perfetto/tracing/tracing_backend.h"
5210 
5211 namespace perfetto {
5212 
5213 namespace base {
5214 class TaskRunner;
5215 }
5216 
5217 class Producer;
5218 
5219 // A built-in implementation of TracingBackend that connects to the system
5220 // tracing daemon (traced) via a UNIX socket using the perfetto built-in
5221 // proto-based IPC mechanism. Instantiated when the embedder calls
5222 // Tracing::Initialize(kSystemBackend). It allows to get app-traces fused
5223 // together with system traces, useful to correlate on the timeline system
5224 // events (e.g. scheduling slices from the kernel) with in-app events.
5225 namespace internal {
5226 class PERFETTO_EXPORT SystemTracingBackend : public TracingBackend {
5227  public:
5228   static TracingBackend* GetInstance();
5229 
5230   // TracingBackend implementation.
5231   std::unique_ptr<ProducerEndpoint> ConnectProducer(
5232       const ConnectProducerArgs&) override;
5233   std::unique_ptr<ConsumerEndpoint> ConnectConsumer(
5234       const ConnectConsumerArgs&) override;
5235 
5236  private:
5237   SystemTracingBackend();
5238 };
5239 
5240 }  // namespace internal
5241 }  // namespace perfetto
5242 
5243 #endif  // INCLUDE_PERFETTO_TRACING_INTERNAL_SYSTEM_TRACING_BACKEND_H_
5244 /*
5245  * Copyright (C) 2019 The Android Open Source Project
5246  *
5247  * Licensed under the Apache License, Version 2.0 (the "License");
5248  * you may not use this file except in compliance with the License.
5249  * You may obtain a copy of the License at
5250  *
5251  *      http://www.apache.org/licenses/LICENSE-2.0
5252  *
5253  * Unless required by applicable law or agreed to in writing, software
5254  * distributed under the License is distributed on an "AS IS" BASIS,
5255  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5256  * See the License for the specific language governing permissions and
5257  * limitations under the License.
5258  */
5259 
5260 #ifndef INCLUDE_PERFETTO_TRACING_TRACING_H_
5261 #define INCLUDE_PERFETTO_TRACING_TRACING_H_
5262 
5263 #include <stddef.h>
5264 #include <stdint.h>
5265 
5266 #include <functional>
5267 #include <memory>
5268 #include <string>
5269 #include <vector>
5270 
5271 // gen_amalgamated expanded: #include "perfetto/base/compiler.h"
5272 // gen_amalgamated expanded: #include "perfetto/base/export.h"
5273 // gen_amalgamated expanded: #include "perfetto/base/logging.h"
5274 // gen_amalgamated expanded: #include "perfetto/tracing/core/forward_decls.h"
5275 // gen_amalgamated expanded: #include "perfetto/tracing/internal/in_process_tracing_backend.h"
5276 // gen_amalgamated expanded: #include "perfetto/tracing/internal/system_tracing_backend.h"
5277 
5278 namespace perfetto {
5279 
5280 namespace internal {
5281 class TracingMuxerImpl;
5282 }
5283 
5284 class TracingBackend;
5285 class Platform;
5286 class TracingSession;  // Declared below.
5287 
5288 enum BackendType : uint32_t {
5289   kUnspecifiedBackend = 0,
5290 
5291   // Connects to a previously-initialized perfetto tracing backend for
5292   // in-process. If the in-process backend has not been previously initialized
5293   // it will do so and create the tracing service on a dedicated thread.
5294   kInProcessBackend = 1 << 0,
5295 
5296   // Connects to the system tracing service (e.g. on Linux/Android/Mac uses a
5297   // named UNIX socket).
5298   kSystemBackend = 1 << 1,
5299 
5300   // Used to provide a custom IPC transport to connect to the service.
5301   // TracingInitArgs::custom_backend must be non-null and point to an
5302   // indefinitely lived instance.
5303   kCustomBackend = 1 << 2,
5304 };
5305 
5306 struct TracingInitArgs {
5307   uint32_t backends = 0;                     // One or more BackendFlags.
5308   TracingBackend* custom_backend = nullptr;  // [Optional].
5309 
5310   // [Optional] Platform implementation. It allows the embedder to take control
5311   // of platform-specific bits like thread creation and TLS slot handling. If
5312   // not set it will use Platform::GetDefaultPlatform().
5313   Platform* platform = nullptr;
5314 
5315   // [Optional] Tune the size of the shared memory buffer between the current
5316   // process and the service backend(s). This is a trade-off between memory
5317   // footprint and the ability to sustain bursts of trace writes (see comments
5318   // in shared_memory_abi.h).
5319   // If set, the value must be a multiple of 4KB. The value can be ignored if
5320   // larger than kMaxShmSize (32MB) or not a multiple of 4KB.
5321   uint32_t shmem_size_hint_kb = 0;
5322 
5323   // [Optional] Specifies the preferred size of each page in the shmem buffer.
5324   // This is a trade-off between IPC overhead and fragmentation/efficiency of
5325   // the shmem buffer in presence of multiple writer threads.
5326   // Must be one of [4, 8, 16, 32].
5327   uint32_t shmem_page_size_hint_kb = 0;
5328 
5329   // [Optional] The length of the period during which shared-memory-buffer
5330   // chunks that have been filled with data are accumulated (batched) on the
5331   // producer side, before the service is notified of them over an out-of-band
5332   // IPC call. If, while this period lasts, the shared memory buffer gets too
5333   // full, the IPC call will be sent immediately. The value of this parameter is
5334   // a trade-off between IPC traffic overhead and the ability to sustain bursts
5335   // of trace writes. The higher the value, the more chunks will be batched and
5336   // the less buffer space will be available to hide the latency of the service,
5337   // and vice versa. For more details, see the SetBatchCommitsDuration method in
5338   // shared_memory_arbiter.h.
5339   //
5340   // Note: With the default value of 0ms, batching still happens but with a zero
5341   // delay, i.e. commits will be sent to the service at the next opportunity.
5342   uint32_t shmem_batch_commits_duration_ms = 0;
5343 
5344  protected:
5345   friend class Tracing;
5346   friend class internal::TracingMuxerImpl;
5347 
5348   // Used only by the DCHECK in tracing.cc, to check that the config is the
5349   // same in case of re-initialization.
5350   bool operator==(const TracingInitArgs& other) const {
5351     return std::tie(backends, custom_backend, platform, shmem_size_hint_kb,
5352                     shmem_page_size_hint_kb, in_process_backend_factory_,
5353                     system_backend_factory_, dcheck_is_on_) ==
5354            std::tie(other.backends, other.custom_backend, other.platform,
5355                     other.shmem_size_hint_kb, other.shmem_page_size_hint_kb,
5356                     other.in_process_backend_factory_,
5357                     other.system_backend_factory_, other.dcheck_is_on_);
5358   }
5359 
5360   using BackendFactoryFunction = TracingBackend* (*)();
5361   BackendFactoryFunction in_process_backend_factory_ = nullptr;
5362   BackendFactoryFunction system_backend_factory_ = nullptr;
5363   bool dcheck_is_on_ = PERFETTO_DCHECK_IS_ON();
5364 };
5365 
5366 // The entry-point for using perfetto.
5367 class PERFETTO_EXPORT Tracing {
5368  public:
5369   // Initializes Perfetto with the given backends in the calling process and/or
5370   // with a user-provided backend. No-op if called more than once.
Initialize(const TracingInitArgs & args)5371   static inline void Initialize(const TracingInitArgs& args)
5372       PERFETTO_ALWAYS_INLINE {
5373     TracingInitArgs args_copy(args);
5374     // This code is inlined to allow dead-code elimination for unused backends.
5375     // This saves ~200 KB when not using the in-process backend (b/148198993).
5376     // The logic behind it is the following:
5377     // Nothing other than the code below references the two GetInstance()
5378     // methods. From a linker-graph viewpoint, those GetInstance() pull in many
5379     // other pieces of the codebase (e.g. InProcessTracingBackend pulls the
5380     // whole TracingServiceImpl, SystemTracingBackend pulls the whole //ipc
5381     // layer). Due to the inline, the compiler can see through the code and
5382     // realize that some branches are always not taken. When that happens, no
5383     // reference to the backends' GetInstance() is emitted and that allows the
5384     // linker GC to get rid of the entire set of dependencies.
5385     if (args.backends & kInProcessBackend) {
5386       args_copy.in_process_backend_factory_ =
5387           &internal::InProcessTracingBackend::GetInstance;
5388     }
5389     if (args.backends & kSystemBackend) {
5390       args_copy.system_backend_factory_ =
5391           &internal::SystemTracingBackend::GetInstance;
5392     }
5393     InitializeInternal(args_copy);
5394   }
5395 
5396   // Start a new tracing session using the given tracing backend. Use
5397   // |kUnspecifiedBackend| to select an available backend automatically.
5398   // For the moment this can be used only when initializing tracing in
5399   // kInProcess mode. For the system mode use the 'bin/perfetto' cmdline client.
5400   static std::unique_ptr<TracingSession> NewTrace(
5401       BackendType = kUnspecifiedBackend);
5402 
5403  private:
5404   static void InitializeInternal(const TracingInitArgs&);
5405 
5406   Tracing() = delete;
5407 };
5408 
5409 class PERFETTO_EXPORT TracingSession {
5410  public:
5411   virtual ~TracingSession();
5412 
5413   // Configure the session passing the trace config.
5414   // If a writable file handle is given through |fd|, the trace will
5415   // automatically written to that file. Otherwise you should call ReadTrace()
5416   // to retrieve the trace data. This call does not take ownership of |fd|.
5417   // TODO(primiano): add an error callback.
5418   virtual void Setup(const TraceConfig&, int fd = -1) = 0;
5419 
5420   // Enable tracing asynchronously. Use SetOnStartCallback() to get a
5421   // notification when the session has fully started.
5422   virtual void Start() = 0;
5423 
5424   // Enable tracing and block until tracing has started. Note that if data
5425   // sources are registered after this call was initiated, the call may return
5426   // before the additional data sources have started. Also, if other producers
5427   // (e.g., with system-wide tracing) have registered data sources without start
5428   // notification support, this call may return before those data sources have
5429   // started.
5430   virtual void StartBlocking() = 0;
5431 
5432   // This callback will be invoked when all data sources have acknowledged that
5433   // tracing has started. This callback will be invoked on an internal perfetto
5434   // thread.
5435   virtual void SetOnStartCallback(std::function<void()>) = 0;
5436 
5437   // Disable tracing asynchronously.
5438   // Use SetOnStopCallback() to get a notification when the tracing session is
5439   // fully stopped and all data sources have acked.
5440   virtual void Stop() = 0;
5441 
5442   // Disable tracing and block until tracing has stopped.
5443   virtual void StopBlocking() = 0;
5444 
5445   // This callback will be invoked when tracing is disabled.
5446   // This can happen either when explicitly calling TracingSession.Stop() or
5447   // when the trace reaches its |duration_ms| time limit.
5448   // This callback will be invoked on an internal perfetto thread.
5449   virtual void SetOnStopCallback(std::function<void()>) = 0;
5450 
5451   // Struct passed as argument to the callback passed to ReadTrace().
5452   // [data, size] is guaranteed to contain 1 or more full trace packets, which
5453   // can be decoded using trace.proto. No partial or truncated packets are
5454   // exposed. If the trace is empty this returns a zero-sized nullptr with
5455   // |has_more| == true to signal EOF.
5456   // This callback will be invoked on an internal perfetto thread.
5457   struct ReadTraceCallbackArgs {
5458     const char* data = nullptr;
5459     size_t size = 0;
5460 
5461     // When false, this will be the last invocation of the callback for this
5462     // read cycle.
5463     bool has_more = false;
5464   };
5465 
5466   // Reads back the trace data (raw protobuf-encoded bytes) asynchronously.
5467   // Can be called at any point during the trace, typically but not necessarily,
5468   // after stopping. Reading the trace data is a destructive operation w.r.t.
5469   // contents of the trace buffer and is not idempotent.
5470   // A single ReadTrace() call can yield >1 callback invocations, until
5471   // |has_more| is false.
5472   using ReadTraceCallback = std::function<void(ReadTraceCallbackArgs)>;
5473   virtual void ReadTrace(ReadTraceCallback) = 0;
5474 
5475   // Synchronous version of ReadTrace(). It blocks the calling thread until all
5476   // the trace contents are read. This is slow and inefficient (involves more
5477   // copies) and is mainly intended for testing.
5478   std::vector<char> ReadTraceBlocking();
5479 
5480   // Struct passed as an argument to the callback for GetTraceStats(). Contains
5481   // statistics about the tracing session.
5482   struct GetTraceStatsCallbackArgs {
5483     // Whether or not querying statistics succeeded.
5484     bool success = false;
5485     // Serialized TraceStats protobuf message. To decode:
5486     //
5487     //   perfetto::protos::gen::TraceStats trace_stats;
5488     //   trace_stats.ParseFromArray(args.trace_stats_data.data(),
5489     //                              args.trace_stats_data.size());
5490     //
5491     std::vector<uint8_t> trace_stats_data;
5492   };
5493 
5494   // Requests a snapshot of statistical data for this tracing session. Only one
5495   // query may be active at a time. This callback will be invoked on an internal
5496   // perfetto thread.
5497   using GetTraceStatsCallback = std::function<void(GetTraceStatsCallbackArgs)>;
5498   virtual void GetTraceStats(GetTraceStatsCallback) = 0;
5499 
5500   // Synchronous version of GetTraceStats() for convenience.
5501   GetTraceStatsCallbackArgs GetTraceStatsBlocking();
5502 };
5503 
5504 }  // namespace perfetto
5505 
5506 #endif  // INCLUDE_PERFETTO_TRACING_TRACING_H_
5507 // gen_amalgamated begin header: include/perfetto/tracing/track_event.h
5508 // gen_amalgamated begin header: include/perfetto/base/time.h
5509 /*
5510  * Copyright (C) 2018 The Android Open Source Project
5511  *
5512  * Licensed under the Apache License, Version 2.0 (the "License");
5513  * you may not use this file except in compliance with the License.
5514  * You may obtain a copy of the License at
5515  *
5516  *      http://www.apache.org/licenses/LICENSE-2.0
5517  *
5518  * Unless required by applicable law or agreed to in writing, software
5519  * distributed under the License is distributed on an "AS IS" BASIS,
5520  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5521  * See the License for the specific language governing permissions and
5522  * limitations under the License.
5523  */
5524 
5525 #ifndef INCLUDE_PERFETTO_BASE_TIME_H_
5526 #define INCLUDE_PERFETTO_BASE_TIME_H_
5527 
5528 #include <time.h>
5529 
5530 #include <chrono>
5531 
5532 // gen_amalgamated expanded: #include "perfetto/base/build_config.h"
5533 // gen_amalgamated expanded: #include "perfetto/base/logging.h"
5534 
5535 #if PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
5536 #include <mach/mach_init.h>
5537 #include <mach/mach_port.h>
5538 #include <mach/mach_time.h>
5539 #include <mach/thread_act.h>
5540 #endif
5541 
5542 #if PERFETTO_BUILDFLAG(PERFETTO_OS_WASM)
5543 #include <emscripten/emscripten.h>
5544 #endif
5545 
5546 namespace perfetto {
5547 namespace base {
5548 
5549 using TimeSeconds = std::chrono::seconds;
5550 using TimeMillis = std::chrono::milliseconds;
5551 using TimeNanos = std::chrono::nanoseconds;
5552 
FromPosixTimespec(const struct timespec & ts)5553 inline TimeNanos FromPosixTimespec(const struct timespec& ts) {
5554   return TimeNanos(ts.tv_sec * 1000000000LL + ts.tv_nsec);
5555 }
5556 
5557 void SleepMicroseconds(unsigned interval_us);
5558 
5559 #if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
5560 
5561 TimeNanos GetWallTimeNs();
5562 TimeNanos GetThreadCPUTimeNs();
5563 
5564 // TODO: Clock that counts time during suspend is not implemented on Windows.
GetBootTimeNs()5565 inline TimeNanos GetBootTimeNs() {
5566   return GetWallTimeNs();
5567 }
5568 
5569 #elif PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
5570 
GetWallTimeNs()5571 inline TimeNanos GetWallTimeNs() {
5572   auto init_time_factor = []() -> uint64_t {
5573     mach_timebase_info_data_t timebase_info;
5574     mach_timebase_info(&timebase_info);
5575     return timebase_info.numer / timebase_info.denom;
5576   };
5577 
5578   static uint64_t monotonic_timebase_factor = init_time_factor();
5579   return TimeNanos(mach_absolute_time() * monotonic_timebase_factor);
5580 }
5581 
5582 // TODO: Clock that counts time during suspend is not implemented on Mac.
GetBootTimeNs()5583 inline TimeNanos GetBootTimeNs() {
5584   return GetWallTimeNs();
5585 }
5586 
GetThreadCPUTimeNs()5587 inline TimeNanos GetThreadCPUTimeNs() {
5588   mach_port_t this_thread = mach_thread_self();
5589   mach_msg_type_number_t count = THREAD_BASIC_INFO_COUNT;
5590   thread_basic_info_data_t info{};
5591   kern_return_t kr =
5592       thread_info(this_thread, THREAD_BASIC_INFO,
5593                   reinterpret_cast<thread_info_t>(&info), &count);
5594   mach_port_deallocate(mach_task_self(), this_thread);
5595 
5596   if (kr != KERN_SUCCESS) {
5597     PERFETTO_DFATAL("Failed to get CPU time.");
5598     return TimeNanos(0);
5599   }
5600   return TimeNanos(info.user_time.seconds * 1000000000LL +
5601                    info.user_time.microseconds * 1000LL +
5602                    info.system_time.seconds * 1000000000LL +
5603                    info.system_time.microseconds * 1000LL);
5604 }
5605 
5606 #elif PERFETTO_BUILDFLAG(PERFETTO_OS_WASM)
5607 
GetWallTimeNs()5608 inline TimeNanos GetWallTimeNs() {
5609   return TimeNanos(static_cast<uint64_t>(emscripten_get_now()) * 1000000);
5610 }
5611 
GetThreadCPUTimeNs()5612 inline TimeNanos GetThreadCPUTimeNs() {
5613   return TimeNanos(0);
5614 }
5615 
5616 // TODO: Clock that counts time during suspend is not implemented on WASM.
GetBootTimeNs()5617 inline TimeNanos GetBootTimeNs() {
5618   return GetWallTimeNs();
5619 }
5620 
5621 #elif PERFETTO_BUILDFLAG(PERFETTO_OS_NACL)
5622 
5623 // Tracing time doesn't need to work on NaCl since its going away shortly. We
5624 // just need to compile on it. The only function NaCl could support is
5625 // GetWallTimeNs(), but to prevent false hope we leave it unimplemented.
5626 
GetWallTimeNs()5627 inline TimeNanos GetWallTimeNs() {
5628   return TimeNanos(0);
5629 }
5630 
GetThreadCPUTimeNs()5631 inline TimeNanos GetThreadCPUTimeNs() {
5632   return TimeNanos(0);
5633 }
5634 
GetBootTimeNs()5635 inline TimeNanos GetBootTimeNs() {
5636   return TimeNanos(0);
5637 }
5638 
5639 #else  // posix
5640 
5641 constexpr clockid_t kWallTimeClockSource = CLOCK_MONOTONIC;
5642 
GetTimeInternalNs(clockid_t clk_id)5643 inline TimeNanos GetTimeInternalNs(clockid_t clk_id) {
5644   struct timespec ts = {};
5645   PERFETTO_CHECK(clock_gettime(clk_id, &ts) == 0);
5646   return FromPosixTimespec(ts);
5647 }
5648 
5649 // Return ns from boot. Conversely to GetWallTimeNs, this clock counts also time
5650 // during suspend (when supported).
GetBootTimeNs()5651 inline TimeNanos GetBootTimeNs() {
5652   // Determine if CLOCK_BOOTTIME is available on the first call.
5653   static const clockid_t kBootTimeClockSource = [] {
5654     struct timespec ts = {};
5655     int res = clock_gettime(CLOCK_BOOTTIME, &ts);
5656     return res == 0 ? CLOCK_BOOTTIME : kWallTimeClockSource;
5657   }();
5658   return GetTimeInternalNs(kBootTimeClockSource);
5659 }
5660 
GetWallTimeNs()5661 inline TimeNanos GetWallTimeNs() {
5662   return GetTimeInternalNs(kWallTimeClockSource);
5663 }
5664 
GetThreadCPUTimeNs()5665 inline TimeNanos GetThreadCPUTimeNs() {
5666   return GetTimeInternalNs(CLOCK_THREAD_CPUTIME_ID);
5667 }
5668 #endif
5669 
GetBootTimeS()5670 inline TimeSeconds GetBootTimeS() {
5671   return std::chrono::duration_cast<TimeSeconds>(GetBootTimeNs());
5672 }
5673 
GetWallTimeMs()5674 inline TimeMillis GetWallTimeMs() {
5675   return std::chrono::duration_cast<TimeMillis>(GetWallTimeNs());
5676 }
5677 
GetWallTimeS()5678 inline TimeSeconds GetWallTimeS() {
5679   return std::chrono::duration_cast<TimeSeconds>(GetWallTimeNs());
5680 }
5681 
ToPosixTimespec(TimeMillis time)5682 inline struct timespec ToPosixTimespec(TimeMillis time) {
5683   struct timespec ts {};
5684   const long time_s = static_cast<long>(time.count() / 1000);
5685   ts.tv_sec = time_s;
5686   ts.tv_nsec = (static_cast<long>(time.count()) - time_s * 1000L) * 1000000L;
5687   return ts;
5688 }
5689 
5690 }  // namespace base
5691 }  // namespace perfetto
5692 
5693 #endif  // INCLUDE_PERFETTO_BASE_TIME_H_
5694 // gen_amalgamated begin header: include/perfetto/tracing/internal/track_event_data_source.h
5695 // gen_amalgamated begin header: include/perfetto/tracing/event_context.h
5696 // gen_amalgamated begin header: include/perfetto/tracing/internal/track_event_internal.h
5697 // gen_amalgamated begin header: include/perfetto/base/flat_set.h
5698 /*
5699  * Copyright (C) 2019 The Android Open Source Project
5700  *
5701  * Licensed under the Apache License, Version 2.0 (the "License");
5702  * you may not use this file except in compliance with the License.
5703  * You may obtain a copy of the License at
5704  *
5705  *      http://www.apache.org/licenses/LICENSE-2.0
5706  *
5707  * Unless required by applicable law or agreed to in writing, software
5708  * distributed under the License is distributed on an "AS IS" BASIS,
5709  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5710  * See the License for the specific language governing permissions and
5711  * limitations under the License.
5712  */
5713 
5714 #ifndef INCLUDE_PERFETTO_BASE_FLAT_SET_H_
5715 #define INCLUDE_PERFETTO_BASE_FLAT_SET_H_
5716 
5717 #include <algorithm>
5718 #include <vector>
5719 
5720 // A vector-based set::set-like container.
5721 // It's more cache friendly than std::*set and performs for cases where:
5722 // 1. A high number of dupes is expected (e.g. pid tracking in ftrace).
5723 // 2. The working set is small (hundreds of elements).
5724 
5725 // Performance characteristics (for uniformly random insertion order):
5726 // - For smaller insertions (up to ~500), it outperforms both std::set<int> and
5727 //   std::unordered_set<int> by ~3x.
5728 // - Up until 4k insertions, it is always faster than std::set<int>.
5729 // - unordered_set<int> is faster with more than 2k insertions.
5730 // - unordered_set, however, it's less memory efficient and has more caveats
5731 //   (see chromium's base/containers/README.md).
5732 //
5733 // See flat_set_benchmark.cc and the charts in go/perfetto-int-set-benchmark.
5734 
5735 namespace perfetto {
5736 namespace base {
5737 
5738 template <typename T>
5739 class FlatSet {
5740  public:
5741   using value_type = T;
5742   using const_pointer = const T*;
5743   using iterator = typename std::vector<T>::iterator;
5744   using const_iterator = typename std::vector<T>::const_iterator;
5745 
5746   FlatSet() = default;
5747 
5748   // Mainly for tests. Deliberately not marked as "expicit".
FlatSet(std::initializer_list<T> initial)5749   FlatSet(std::initializer_list<T> initial) : entries_(initial) {
5750     std::sort(entries_.begin(), entries_.end());
5751     entries_.erase(std::unique(entries_.begin(), entries_.end()),
5752                    entries_.end());
5753   }
5754 
find(T value)5755   const_iterator find(T value) const {
5756     auto entries_end = entries_.end();
5757     auto it = std::lower_bound(entries_.begin(), entries_end, value);
5758     return (it != entries_end && *it == value) ? it : entries_end;
5759   }
5760 
count(T value)5761   size_t count(T value) const { return find(value) == entries_.end() ? 0 : 1; }
5762 
insert(T value)5763   std::pair<iterator, bool> insert(T value) {
5764     auto entries_end = entries_.end();
5765     auto it = std::lower_bound(entries_.begin(), entries_end, value);
5766     if (it != entries_end && *it == value)
5767       return std::make_pair(it, false);
5768     // If the value is not found |it| is either end() or the next item strictly
5769     // greater than |value|. In both cases we want to insert just before that.
5770     it = entries_.insert(it, std::move(value));
5771     return std::make_pair(it, true);
5772   }
5773 
erase(T value)5774   size_t erase(T value) {
5775     auto it = find(value);
5776     if (it == entries_.end())
5777       return 0;
5778     entries_.erase(it);
5779     return 1;
5780   }
5781 
clear()5782   void clear() { entries_.clear(); }
5783 
empty()5784   bool empty() const { return entries_.empty(); }
reserve(size_t n)5785   void reserve(size_t n) { entries_.reserve(n); }
size()5786   size_t size() const { return entries_.size(); }
begin()5787   const_iterator begin() const { return entries_.begin(); }
end()5788   const_iterator end() const { return entries_.end(); }
5789 
5790  private:
5791   std::vector<T> entries_;
5792 };
5793 
5794 }  // namespace base
5795 }  // namespace perfetto
5796 
5797 #endif  // INCLUDE_PERFETTO_BASE_FLAT_SET_H_
5798 // gen_amalgamated begin header: include/perfetto/protozero/scattered_heap_buffer.h
5799 // gen_amalgamated begin header: include/perfetto/protozero/root_message.h
5800 // gen_amalgamated begin header: include/perfetto/protozero/message_arena.h
5801 /*
5802  * Copyright (C) 2020 The Android Open Source Project
5803  *
5804  * Licensed under the Apache License, Version 2.0 (the "License");
5805  * you may not use this file except in compliance with the License.
5806  * You may obtain a copy of the License at
5807  *
5808  *      http://www.apache.org/licenses/LICENSE-2.0
5809  *
5810  * Unless required by applicable law or agreed to in writing, software
5811  * distributed under the License is distributed on an "AS IS" BASIS,
5812  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5813  * See the License for the specific language governing permissions and
5814  * limitations under the License.
5815  */
5816 
5817 #ifndef INCLUDE_PERFETTO_PROTOZERO_MESSAGE_ARENA_H_
5818 #define INCLUDE_PERFETTO_PROTOZERO_MESSAGE_ARENA_H_
5819 
5820 #include <stdint.h>
5821 
5822 #include <list>
5823 #include <type_traits>
5824 
5825 // gen_amalgamated expanded: #include "perfetto/base/export.h"
5826 // gen_amalgamated expanded: #include "perfetto/base/logging.h"
5827 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
5828 
5829 namespace protozero {
5830 
5831 class Message;
5832 
5833 // Object allocator for fixed-sized protozero::Message objects.
5834 // It's a simple bump-pointer allocator which leverages the stack-alike
5835 // usage pattern of protozero nested messages. It avoids hitting the system
5836 // allocator in most cases, by reusing the same block, and falls back on
5837 // allocating new blocks only when using deeply nested messages (which are
5838 // extremely rare).
5839 // This is used by RootMessage<T> to handle the storage for root-level messages.
5840 class PERFETTO_EXPORT MessageArena {
5841  public:
5842   MessageArena();
5843   ~MessageArena();
5844 
5845   // Strictly no copies or moves as this is used to hand out pointers.
5846   MessageArena(const MessageArena&) = delete;
5847   MessageArena& operator=(const MessageArena&) = delete;
5848   MessageArena(MessageArena&&) = delete;
5849   MessageArena& operator=(MessageArena&&) = delete;
5850 
5851   // Allocates a new Message object.
5852   Message* NewMessage();
5853 
5854   // Deletes the last message allocated. The |msg| argument is used only for
5855   // DCHECKs, it MUST be the pointer obtained by the last NewMessage() call.
DeleteLastMessage(Message * msg)5856   void DeleteLastMessage(Message* msg) {
5857     PERFETTO_DCHECK(!blocks_.empty() && blocks_.back().entries > 0);
5858     PERFETTO_DCHECK(&blocks_.back().storage[blocks_.back().entries - 1] ==
5859                     static_cast<void*>(msg));
5860     DeleteLastMessageInternal();
5861   }
5862 
5863   // Resets the state of the arena, clearing up all but one block. This is used
5864   // to avoid leaking outstanding unfinished sub-messages while recycling the
5865   // RootMessage object (this is extremely rare due to the RAII scoped handles
5866   // but could happen if some client does some overly clever std::move() trick).
Reset()5867   void Reset() {
5868     PERFETTO_DCHECK(!blocks_.empty());
5869     blocks_.resize(1);
5870     auto& block = blocks_.back();
5871     block.entries = 0;
5872     PERFETTO_ASAN_POISON(block.storage, sizeof(block.storage));
5873   }
5874 
5875  private:
5876   void DeleteLastMessageInternal();
5877 
5878   struct Block {
5879     static constexpr size_t kCapacity = 16;
5880 
BlockBlock5881     Block() { PERFETTO_ASAN_POISON(storage, sizeof(storage)); }
5882 
5883     std::aligned_storage<sizeof(Message), alignof(Message)>::type
5884         storage[kCapacity];
5885     uint32_t entries = 0;  // # Message entries used (<= kCapacity).
5886   };
5887 
5888   // blocks are used to hand out pointers and must not be moved. Hence why
5889   // std::list rather than std::vector.
5890   std::list<Block> blocks_;
5891 };
5892 
5893 }  // namespace protozero
5894 
5895 #endif  // INCLUDE_PERFETTO_PROTOZERO_MESSAGE_ARENA_H_
5896 /*
5897  * Copyright (C) 2020 The Android Open Source Project
5898  *
5899  * Licensed under the Apache License, Version 2.0 (the "License");
5900  * you may not use this file except in compliance with the License.
5901  * You may obtain a copy of the License at
5902  *
5903  *      http://www.apache.org/licenses/LICENSE-2.0
5904  *
5905  * Unless required by applicable law or agreed to in writing, software
5906  * distributed under the License is distributed on an "AS IS" BASIS,
5907  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5908  * See the License for the specific language governing permissions and
5909  * limitations under the License.
5910  */
5911 
5912 #ifndef INCLUDE_PERFETTO_PROTOZERO_ROOT_MESSAGE_H_
5913 #define INCLUDE_PERFETTO_PROTOZERO_ROOT_MESSAGE_H_
5914 
5915 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
5916 // gen_amalgamated expanded: #include "perfetto/protozero/message_arena.h"
5917 
5918 namespace protozero {
5919 
5920 // Helper class to hand out messages using the default MessageArena.
5921 // Usage:
5922 // RootMessage<perfetto::protos::zero::MyMessage> msg;
5923 // msg.Reset(stream_writer);
5924 // msg.set_foo(...);
5925 // auto* nested = msg.set_nested();
5926 template <typename T = Message>
5927 class RootMessage : public T {
5928  public:
RootMessage()5929   RootMessage() { T::Reset(nullptr, &root_arena_); }
5930 
5931   // Disallow copy and move.
5932   RootMessage(const RootMessage&) = delete;
5933   RootMessage& operator=(const RootMessage&) = delete;
5934   RootMessage(RootMessage&&) = delete;
5935   RootMessage& operator=(RootMessage&&) = delete;
5936 
Reset(ScatteredStreamWriter * writer)5937   void Reset(ScatteredStreamWriter* writer) {
5938     root_arena_.Reset();
5939     Message::Reset(writer, &root_arena_);
5940   }
5941 
5942  private:
5943   MessageArena root_arena_;
5944 };
5945 
5946 }  // namespace protozero
5947 
5948 #endif  // INCLUDE_PERFETTO_PROTOZERO_ROOT_MESSAGE_H_
5949 /*
5950  * Copyright (C) 2017 The Android Open Source Project
5951  *
5952  * Licensed under the Apache License, Version 2.0 (the "License");
5953  * you may not use this file except in compliance with the License.
5954  * You may obtain a copy of the License at
5955  *
5956  *      http://www.apache.org/licenses/LICENSE-2.0
5957  *
5958  * Unless required by applicable law or agreed to in writing, software
5959  * distributed under the License is distributed on an "AS IS" BASIS,
5960  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5961  * See the License for the specific language governing permissions and
5962  * limitations under the License.
5963  */
5964 
5965 #ifndef INCLUDE_PERFETTO_PROTOZERO_SCATTERED_HEAP_BUFFER_H_
5966 #define INCLUDE_PERFETTO_PROTOZERO_SCATTERED_HEAP_BUFFER_H_
5967 
5968 #include <memory>
5969 #include <string>
5970 #include <vector>
5971 
5972 // gen_amalgamated expanded: #include "perfetto/base/export.h"
5973 // gen_amalgamated expanded: #include "perfetto/base/logging.h"
5974 // gen_amalgamated expanded: #include "perfetto/protozero/root_message.h"
5975 // gen_amalgamated expanded: #include "perfetto/protozero/scattered_stream_writer.h"
5976 
5977 namespace protozero {
5978 
5979 class Message;
5980 
5981 class PERFETTO_EXPORT ScatteredHeapBuffer
5982     : public protozero::ScatteredStreamWriter::Delegate {
5983  public:
5984   class PERFETTO_EXPORT Slice {
5985    public:
5986     Slice();
5987     explicit Slice(size_t size);
5988     Slice(Slice&& slice) noexcept;
5989     ~Slice();
5990     Slice& operator=(Slice&&);
5991 
GetTotalRange()5992     inline protozero::ContiguousMemoryRange GetTotalRange() const {
5993       return {buffer_.get(), buffer_.get() + size_};
5994     }
5995 
GetUsedRange()5996     inline protozero::ContiguousMemoryRange GetUsedRange() const {
5997       return {buffer_.get(), buffer_.get() + size_ - unused_bytes_};
5998     }
5999 
start()6000     uint8_t* start() const { return buffer_.get(); }
size()6001     size_t size() const { return size_; }
unused_bytes()6002     size_t unused_bytes() const { return unused_bytes_; }
set_unused_bytes(size_t unused_bytes)6003     void set_unused_bytes(size_t unused_bytes) {
6004       PERFETTO_DCHECK(unused_bytes_ <= size_);
6005       unused_bytes_ = unused_bytes;
6006     }
6007 
6008     void Clear();
6009 
6010    private:
6011     std::unique_ptr<uint8_t[]> buffer_;
6012     size_t size_;
6013     size_t unused_bytes_;
6014   };
6015 
6016   ScatteredHeapBuffer(size_t initial_slice_size_bytes = 128,
6017                       size_t maximum_slice_size_bytes = 128 * 1024);
6018   ~ScatteredHeapBuffer() override;
6019 
6020   // protozero::ScatteredStreamWriter::Delegate implementation.
6021   protozero::ContiguousMemoryRange GetNewBuffer() override;
6022 
6023   // Stitch all the slices into a single contiguous buffer.
6024   std::vector<uint8_t> StitchSlices();
6025 
6026   // Note that the returned ranges point back to this buffer and thus cannot
6027   // outlive it.
6028   std::vector<protozero::ContiguousMemoryRange> GetRanges();
6029 
slices()6030   const std::vector<Slice>& slices() const { return slices_; }
6031 
set_writer(protozero::ScatteredStreamWriter * writer)6032   void set_writer(protozero::ScatteredStreamWriter* writer) {
6033     writer_ = writer;
6034   }
6035 
6036   // Update unused_bytes() of the current |Slice| based on the writer's state.
6037   void AdjustUsedSizeOfCurrentSlice();
6038 
6039   // Returns the total size the slices occupy in heap memory (including unused).
6040   size_t GetTotalSize();
6041 
6042   // Reset the contents of this buffer but retain one slice allocation (if it
6043   // exists) to be reused for future writes.
6044   void Reset();
6045 
6046  private:
6047   size_t next_slice_size_;
6048   const size_t maximum_slice_size_;
6049   protozero::ScatteredStreamWriter* writer_ = nullptr;
6050   std::vector<Slice> slices_;
6051 
6052   // Used to keep an allocated slice around after this buffer is reset.
6053   Slice cached_slice_;
6054 };
6055 
6056 // Helper function to create heap-based protozero messages in one line.
6057 // Useful when manually serializing a protozero message (primarily in
6058 // tests/utilities). So instead of the following:
6059 //   protozero::MyMessage msg;
6060 //   protozero::ScatteredHeapBuffer shb;
6061 //   protozero::ScatteredStreamWriter writer(&shb);
6062 //   shb.set_writer(&writer);
6063 //   msg.Reset(&writer);
6064 //   ...
6065 // You can write:
6066 //   protozero::HeapBuffered<protozero::MyMessage> msg;
6067 //   msg->set_stuff(...);
6068 //   msg.SerializeAsString();
6069 template <typename T = ::protozero::Message>
6070 class HeapBuffered {
6071  public:
HeapBuffered()6072   HeapBuffered() : HeapBuffered(4096, 4096) {}
HeapBuffered(size_t initial_slice_size_bytes,size_t maximum_slice_size_bytes)6073   HeapBuffered(size_t initial_slice_size_bytes, size_t maximum_slice_size_bytes)
6074       : shb_(initial_slice_size_bytes, maximum_slice_size_bytes),
6075         writer_(&shb_) {
6076     shb_.set_writer(&writer_);
6077     msg_.Reset(&writer_);
6078   }
6079 
6080   // This can't be neither copied nor moved because Message hands out pointers
6081   // to itself when creating submessages.
6082   HeapBuffered(const HeapBuffered&) = delete;
6083   HeapBuffered& operator=(const HeapBuffered&) = delete;
6084   HeapBuffered(HeapBuffered&&) = delete;
6085   HeapBuffered& operator=(HeapBuffered&&) = delete;
6086 
get()6087   T* get() { return &msg_; }
6088   T* operator->() { return &msg_; }
6089 
empty()6090   bool empty() const { return shb_.slices().empty(); }
6091 
SerializeAsArray()6092   std::vector<uint8_t> SerializeAsArray() {
6093     msg_.Finalize();
6094     return shb_.StitchSlices();
6095   }
6096 
SerializeAsString()6097   std::string SerializeAsString() {
6098     auto vec = SerializeAsArray();
6099     return std::string(reinterpret_cast<const char*>(vec.data()), vec.size());
6100   }
6101 
GetRanges()6102   std::vector<protozero::ContiguousMemoryRange> GetRanges() {
6103     msg_.Finalize();
6104     return shb_.GetRanges();
6105   }
6106 
Reset()6107   void Reset() {
6108     shb_.Reset();
6109     writer_.Reset(protozero::ContiguousMemoryRange{});
6110     msg_.Reset(&writer_);
6111     PERFETTO_DCHECK(empty());
6112   }
6113 
6114  private:
6115   ScatteredHeapBuffer shb_;
6116   ScatteredStreamWriter writer_;
6117   RootMessage<T> msg_;
6118 };
6119 
6120 }  // namespace protozero
6121 
6122 #endif  // INCLUDE_PERFETTO_PROTOZERO_SCATTERED_HEAP_BUFFER_H_
6123 // gen_amalgamated begin header: include/perfetto/tracing/debug_annotation.h
6124 // gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/debug_annotation.pbzero.h
6125 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
6126 
6127 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_DEBUG_ANNOTATION_PROTO_H_
6128 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_DEBUG_ANNOTATION_PROTO_H_
6129 
6130 #include <stddef.h>
6131 #include <stdint.h>
6132 
6133 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
6134 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
6135 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
6136 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
6137 
6138 namespace perfetto {
6139 namespace protos {
6140 namespace pbzero {
6141 
6142 class DebugAnnotation_NestedValue;
6143 enum DebugAnnotation_NestedValue_NestedType : int32_t;
6144 
6145 enum DebugAnnotation_NestedValue_NestedType : int32_t {
6146   DebugAnnotation_NestedValue_NestedType_UNSPECIFIED = 0,
6147   DebugAnnotation_NestedValue_NestedType_DICT = 1,
6148   DebugAnnotation_NestedValue_NestedType_ARRAY = 2,
6149 };
6150 
6151 const DebugAnnotation_NestedValue_NestedType DebugAnnotation_NestedValue_NestedType_MIN = DebugAnnotation_NestedValue_NestedType_UNSPECIFIED;
6152 const DebugAnnotation_NestedValue_NestedType DebugAnnotation_NestedValue_NestedType_MAX = DebugAnnotation_NestedValue_NestedType_ARRAY;
6153 
6154 class DebugAnnotationName_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
6155  public:
DebugAnnotationName_Decoder(const uint8_t * data,size_t len)6156   DebugAnnotationName_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
DebugAnnotationName_Decoder(const std::string & raw)6157   explicit DebugAnnotationName_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
DebugAnnotationName_Decoder(const::protozero::ConstBytes & raw)6158   explicit DebugAnnotationName_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
has_iid()6159   bool has_iid() const { return at<1>().valid(); }
iid()6160   uint64_t iid() const { return at<1>().as_uint64(); }
has_name()6161   bool has_name() const { return at<2>().valid(); }
name()6162   ::protozero::ConstChars name() const { return at<2>().as_string(); }
6163 };
6164 
6165 class DebugAnnotationName : public ::protozero::Message {
6166  public:
6167   using Decoder = DebugAnnotationName_Decoder;
6168   enum : int32_t {
6169     kIidFieldNumber = 1,
6170     kNameFieldNumber = 2,
6171   };
set_iid(uint64_t value)6172   void set_iid(uint64_t value) {
6173     AppendVarInt(1, value);
6174   }
set_name(const std::string & value)6175   void set_name(const std::string& value) {
6176     AppendBytes(2, value.data(), value.size());
6177   }
set_name(const char * data,size_t size)6178   void set_name(const char* data, size_t size) {
6179     AppendBytes(2, data, size);
6180   }
6181 };
6182 
6183 class DebugAnnotation_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/10, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
6184  public:
DebugAnnotation_Decoder(const uint8_t * data,size_t len)6185   DebugAnnotation_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
DebugAnnotation_Decoder(const std::string & raw)6186   explicit DebugAnnotation_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
DebugAnnotation_Decoder(const::protozero::ConstBytes & raw)6187   explicit DebugAnnotation_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
has_name_iid()6188   bool has_name_iid() const { return at<1>().valid(); }
name_iid()6189   uint64_t name_iid() const { return at<1>().as_uint64(); }
has_name()6190   bool has_name() const { return at<10>().valid(); }
name()6191   ::protozero::ConstChars name() const { return at<10>().as_string(); }
has_bool_value()6192   bool has_bool_value() const { return at<2>().valid(); }
bool_value()6193   bool bool_value() const { return at<2>().as_bool(); }
has_uint_value()6194   bool has_uint_value() const { return at<3>().valid(); }
uint_value()6195   uint64_t uint_value() const { return at<3>().as_uint64(); }
has_int_value()6196   bool has_int_value() const { return at<4>().valid(); }
int_value()6197   int64_t int_value() const { return at<4>().as_int64(); }
has_double_value()6198   bool has_double_value() const { return at<5>().valid(); }
double_value()6199   double double_value() const { return at<5>().as_double(); }
has_string_value()6200   bool has_string_value() const { return at<6>().valid(); }
string_value()6201   ::protozero::ConstChars string_value() const { return at<6>().as_string(); }
has_pointer_value()6202   bool has_pointer_value() const { return at<7>().valid(); }
pointer_value()6203   uint64_t pointer_value() const { return at<7>().as_uint64(); }
has_nested_value()6204   bool has_nested_value() const { return at<8>().valid(); }
nested_value()6205   ::protozero::ConstBytes nested_value() const { return at<8>().as_bytes(); }
has_legacy_json_value()6206   bool has_legacy_json_value() const { return at<9>().valid(); }
legacy_json_value()6207   ::protozero::ConstChars legacy_json_value() const { return at<9>().as_string(); }
6208 };
6209 
6210 class DebugAnnotation : public ::protozero::Message {
6211  public:
6212   using Decoder = DebugAnnotation_Decoder;
6213   enum : int32_t {
6214     kNameIidFieldNumber = 1,
6215     kNameFieldNumber = 10,
6216     kBoolValueFieldNumber = 2,
6217     kUintValueFieldNumber = 3,
6218     kIntValueFieldNumber = 4,
6219     kDoubleValueFieldNumber = 5,
6220     kStringValueFieldNumber = 6,
6221     kPointerValueFieldNumber = 7,
6222     kNestedValueFieldNumber = 8,
6223     kLegacyJsonValueFieldNumber = 9,
6224   };
6225   using NestedValue = ::perfetto::protos::pbzero::DebugAnnotation_NestedValue;
set_name_iid(uint64_t value)6226   void set_name_iid(uint64_t value) {
6227     AppendVarInt(1, value);
6228   }
set_name(const std::string & value)6229   void set_name(const std::string& value) {
6230     AppendBytes(10, value.data(), value.size());
6231   }
set_name(const char * data,size_t size)6232   void set_name(const char* data, size_t size) {
6233     AppendBytes(10, data, size);
6234   }
set_bool_value(bool value)6235   void set_bool_value(bool value) {
6236     AppendTinyVarInt(2, value);
6237   }
set_uint_value(uint64_t value)6238   void set_uint_value(uint64_t value) {
6239     AppendVarInt(3, value);
6240   }
set_int_value(int64_t value)6241   void set_int_value(int64_t value) {
6242     AppendVarInt(4, value);
6243   }
set_double_value(double value)6244   void set_double_value(double value) {
6245     AppendFixed(5, value);
6246   }
set_string_value(const std::string & value)6247   void set_string_value(const std::string& value) {
6248     AppendBytes(6, value.data(), value.size());
6249   }
set_string_value(const char * data,size_t size)6250   void set_string_value(const char* data, size_t size) {
6251     AppendBytes(6, data, size);
6252   }
set_pointer_value(uint64_t value)6253   void set_pointer_value(uint64_t value) {
6254     AppendVarInt(7, value);
6255   }
set_nested_value()6256   template <typename T = DebugAnnotation_NestedValue> T* set_nested_value() {
6257     return BeginNestedMessage<T>(8);
6258   }
6259 
set_legacy_json_value(const std::string & value)6260   void set_legacy_json_value(const std::string& value) {
6261     AppendBytes(9, value.data(), value.size());
6262   }
set_legacy_json_value(const char * data,size_t size)6263   void set_legacy_json_value(const char* data, size_t size) {
6264     AppendBytes(9, data, size);
6265   }
6266 };
6267 
6268 class DebugAnnotation_NestedValue_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
6269  public:
DebugAnnotation_NestedValue_Decoder(const uint8_t * data,size_t len)6270   DebugAnnotation_NestedValue_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
DebugAnnotation_NestedValue_Decoder(const std::string & raw)6271   explicit DebugAnnotation_NestedValue_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
DebugAnnotation_NestedValue_Decoder(const::protozero::ConstBytes & raw)6272   explicit DebugAnnotation_NestedValue_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
has_nested_type()6273   bool has_nested_type() const { return at<1>().valid(); }
nested_type()6274   int32_t nested_type() const { return at<1>().as_int32(); }
has_dict_keys()6275   bool has_dict_keys() const { return at<2>().valid(); }
dict_keys()6276   ::protozero::RepeatedFieldIterator<::protozero::ConstChars> dict_keys() const { return GetRepeated<::protozero::ConstChars>(2); }
has_dict_values()6277   bool has_dict_values() const { return at<3>().valid(); }
dict_values()6278   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> dict_values() const { return GetRepeated<::protozero::ConstBytes>(3); }
has_array_values()6279   bool has_array_values() const { return at<4>().valid(); }
array_values()6280   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> array_values() const { return GetRepeated<::protozero::ConstBytes>(4); }
has_int_value()6281   bool has_int_value() const { return at<5>().valid(); }
int_value()6282   int64_t int_value() const { return at<5>().as_int64(); }
has_double_value()6283   bool has_double_value() const { return at<6>().valid(); }
double_value()6284   double double_value() const { return at<6>().as_double(); }
has_bool_value()6285   bool has_bool_value() const { return at<7>().valid(); }
bool_value()6286   bool bool_value() const { return at<7>().as_bool(); }
has_string_value()6287   bool has_string_value() const { return at<8>().valid(); }
string_value()6288   ::protozero::ConstChars string_value() const { return at<8>().as_string(); }
6289 };
6290 
6291 class DebugAnnotation_NestedValue : public ::protozero::Message {
6292  public:
6293   using Decoder = DebugAnnotation_NestedValue_Decoder;
6294   enum : int32_t {
6295     kNestedTypeFieldNumber = 1,
6296     kDictKeysFieldNumber = 2,
6297     kDictValuesFieldNumber = 3,
6298     kArrayValuesFieldNumber = 4,
6299     kIntValueFieldNumber = 5,
6300     kDoubleValueFieldNumber = 6,
6301     kBoolValueFieldNumber = 7,
6302     kStringValueFieldNumber = 8,
6303   };
6304   using NestedType = ::perfetto::protos::pbzero::DebugAnnotation_NestedValue_NestedType;
6305   static const NestedType UNSPECIFIED = DebugAnnotation_NestedValue_NestedType_UNSPECIFIED;
6306   static const NestedType DICT = DebugAnnotation_NestedValue_NestedType_DICT;
6307   static const NestedType ARRAY = DebugAnnotation_NestedValue_NestedType_ARRAY;
set_nested_type(::perfetto::protos::pbzero::DebugAnnotation_NestedValue_NestedType value)6308   void set_nested_type(::perfetto::protos::pbzero::DebugAnnotation_NestedValue_NestedType value) {
6309     AppendTinyVarInt(1, value);
6310   }
add_dict_keys(const std::string & value)6311   void add_dict_keys(const std::string& value) {
6312     AppendBytes(2, value.data(), value.size());
6313   }
add_dict_keys(const char * data,size_t size)6314   void add_dict_keys(const char* data, size_t size) {
6315     AppendBytes(2, data, size);
6316   }
add_dict_values()6317   template <typename T = DebugAnnotation_NestedValue> T* add_dict_values() {
6318     return BeginNestedMessage<T>(3);
6319   }
6320 
add_array_values()6321   template <typename T = DebugAnnotation_NestedValue> T* add_array_values() {
6322     return BeginNestedMessage<T>(4);
6323   }
6324 
set_int_value(int64_t value)6325   void set_int_value(int64_t value) {
6326     AppendVarInt(5, value);
6327   }
set_double_value(double value)6328   void set_double_value(double value) {
6329     AppendFixed(6, value);
6330   }
set_bool_value(bool value)6331   void set_bool_value(bool value) {
6332     AppendTinyVarInt(7, value);
6333   }
set_string_value(const std::string & value)6334   void set_string_value(const std::string& value) {
6335     AppendBytes(8, value.data(), value.size());
6336   }
set_string_value(const char * data,size_t size)6337   void set_string_value(const char* data, size_t size) {
6338     AppendBytes(8, data, size);
6339   }
6340 };
6341 
6342 } // Namespace.
6343 } // Namespace.
6344 } // Namespace.
6345 #endif  // Include guard.
6346 /*
6347  * Copyright (C) 2019 The Android Open Source Project
6348  *
6349  * Licensed under the Apache License, Version 2.0 (the "License");
6350  * you may not use this file except in compliance with the License.
6351  * You may obtain a copy of the License at
6352  *
6353  *      http://www.apache.org/licenses/LICENSE-2.0
6354  *
6355  * Unless required by applicable law or agreed to in writing, software
6356  * distributed under the License is distributed on an "AS IS" BASIS,
6357  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6358  * See the License for the specific language governing permissions and
6359  * limitations under the License.
6360  */
6361 
6362 #ifndef INCLUDE_PERFETTO_TRACING_DEBUG_ANNOTATION_H_
6363 #define INCLUDE_PERFETTO_TRACING_DEBUG_ANNOTATION_H_
6364 
6365 // gen_amalgamated expanded: #include "perfetto/base/export.h"
6366 // gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/debug_annotation.pbzero.h"
6367 
6368 #include <stdint.h>
6369 
6370 #include <memory>
6371 #include <string>
6372 
6373 namespace {
6374 // std::underlying_type can't be used with non-enum types, so we need this
6375 // indirection.
6376 template <typename T, bool = std::is_enum<T>::value>
6377 struct safe_underlying_type {
6378   using type = typename std::underlying_type<T>::type;
6379 };
6380 
6381 template <typename T>
6382 struct safe_underlying_type<T, false> {
6383   using type = T;
6384 };
6385 }  // namespace
6386 
6387 namespace perfetto {
6388 namespace protos {
6389 namespace pbzero {
6390 class DebugAnnotation;
6391 }  // namespace pbzero
6392 }  // namespace protos
6393 
6394 // A base class for custom track event debug annotations.
6395 class PERFETTO_EXPORT DebugAnnotation {
6396  public:
6397   DebugAnnotation() = default;
6398   virtual ~DebugAnnotation();
6399 
6400   // Called to write the contents of the debug annotation into the trace.
6401   virtual void Add(protos::pbzero::DebugAnnotation*) const = 0;
6402 };
6403 
6404 namespace internal {
6405 // Overloads for all the supported built in debug annotation types. Numeric
6406 // types are handled with templates to avoid problems with overloading
6407 // platform-specific types (e.g., size_t).
6408 void PERFETTO_EXPORT WriteDebugAnnotation(protos::pbzero::DebugAnnotation*,
6409                                           const char*);
6410 void PERFETTO_EXPORT WriteDebugAnnotation(protos::pbzero::DebugAnnotation*,
6411                                           const std::string&);
6412 void PERFETTO_EXPORT WriteDebugAnnotation(protos::pbzero::DebugAnnotation*,
6413                                           const void*);
6414 void PERFETTO_EXPORT WriteDebugAnnotation(protos::pbzero::DebugAnnotation*,
6415                                           const DebugAnnotation&);
6416 
6417 template <typename T>
6418 void WriteDebugAnnotation(
6419     protos::pbzero::DebugAnnotation* annotation,
6420     T value,
6421     typename std::enable_if<std::is_floating_point<T>::value>::type* =
6422         nullptr) {
6423   annotation->set_double_value(static_cast<double>(value));
6424 }
6425 
6426 template <typename T>
6427 void WriteDebugAnnotation(
6428     protos::pbzero::DebugAnnotation* annotation,
6429     T value,
6430     typename std::enable_if<std::is_integral<T>::value &&
6431                             !std::is_same<T, bool>::value &&
6432                             std::is_signed<T>::value>::type* = nullptr) {
6433   annotation->set_int_value(value);
6434 }
6435 
6436 template <typename T>
6437 void WriteDebugAnnotation(
6438     protos::pbzero::DebugAnnotation* annotation,
6439     T value,
6440     typename std::enable_if<
6441         std::is_enum<T>::value &&
6442         std::is_signed<typename safe_underlying_type<T>::type>::value>::type* =
6443         nullptr) {
6444   annotation->set_int_value(value);
6445 }
6446 
6447 template <typename T>
6448 void WriteDebugAnnotation(
6449     protos::pbzero::DebugAnnotation* annotation,
6450     T value,
6451     typename std::enable_if<std::is_enum<T>::value &&
6452                             std::is_unsigned<typename safe_underlying_type<
6453                                 T>::type>::value>::type* = nullptr) {
6454   annotation->set_uint_value(value);
6455 }
6456 
6457 template <typename T>
6458 void WriteDebugAnnotation(
6459     protos::pbzero::DebugAnnotation* annotation,
6460     T value,
6461     typename std::enable_if<std::is_integral<T>::value &&
6462                             !std::is_same<T, bool>::value &&
6463                             std::is_unsigned<T>::value>::type* = nullptr) {
6464   annotation->set_uint_value(value);
6465 }
6466 
6467 template <typename T>
6468 void WriteDebugAnnotation(
6469     protos::pbzero::DebugAnnotation* annotation,
6470     T value,
6471     typename std::enable_if<std::is_same<T, bool>::value>::type* = nullptr) {
6472   annotation->set_bool_value(value);
6473 }
6474 
6475 template <typename T>
6476 void WriteDebugAnnotation(protos::pbzero::DebugAnnotation* annotation,
6477                           const std::unique_ptr<T>& value) {
6478   WriteDebugAnnotation(annotation, *value);
6479 }
6480 
6481 }  // namespace internal
6482 }  // namespace perfetto
6483 
6484 #endif  // INCLUDE_PERFETTO_TRACING_DEBUG_ANNOTATION_H_
6485 // gen_amalgamated begin header: include/perfetto/tracing/track.h
6486 // gen_amalgamated begin header: include/perfetto/base/proc_utils.h
6487 /*
6488  * Copyright (C) 2019 The Android Open Source Project
6489  *
6490  * Licensed under the Apache License, Version 2.0 (the "License");
6491  * you may not use this file except in compliance with the License.
6492  * You may obtain a copy of the License at
6493  *
6494  *      http://www.apache.org/licenses/LICENSE-2.0
6495  *
6496  * Unless required by applicable law or agreed to in writing, software
6497  * distributed under the License is distributed on an "AS IS" BASIS,
6498  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6499  * See the License for the specific language governing permissions and
6500  * limitations under the License.
6501  */
6502 
6503 #ifndef INCLUDE_PERFETTO_BASE_PROC_UTILS_H_
6504 #define INCLUDE_PERFETTO_BASE_PROC_UTILS_H_
6505 
6506 #include <stdint.h>
6507 
6508 // gen_amalgamated expanded: #include "perfetto/base/build_config.h"
6509 
6510 #if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
6511 #include <Windows.h>
6512 #include <processthreadsapi.h>
6513 #elif PERFETTO_BUILDFLAG(PERFETTO_OS_FUCHSIA)
6514 #include <zircon/process.h>
6515 #include <zircon/types.h>
6516 #else
6517 #include <unistd.h>
6518 #endif
6519 
6520 namespace perfetto {
6521 namespace base {
6522 
6523 #if PERFETTO_BUILDFLAG(PERFETTO_OS_FUCHSIA)
6524 using PlatformProcessId = zx_handle_t;
6525 inline PlatformProcessId GetProcessId() {
6526   return zx_process_self();
6527 }
6528 #elif PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
6529 using PlatformProcessId = uint64_t;
6530 inline PlatformProcessId GetProcessId() {
6531   return static_cast<uint64_t>(GetCurrentProcessId());
6532 }
6533 #else
6534 using PlatformProcessId = pid_t;
6535 inline PlatformProcessId GetProcessId() {
6536   return getpid();
6537 }
6538 #endif
6539 
6540 }  // namespace base
6541 }  // namespace perfetto
6542 
6543 #endif  // INCLUDE_PERFETTO_BASE_PROC_UTILS_H_
6544 // gen_amalgamated begin header: include/perfetto/base/thread_utils.h
6545 /*
6546  * Copyright (C) 2018 The Android Open Source Project
6547  *
6548  * Licensed under the Apache License, Version 2.0 (the "License");
6549  * you may not use this file except in compliance with the License.
6550  * You may obtain a copy of the License at
6551  *
6552  *      http://www.apache.org/licenses/LICENSE-2.0
6553  *
6554  * Unless required by applicable law or agreed to in writing, software
6555  * distributed under the License is distributed on an "AS IS" BASIS,
6556  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6557  * See the License for the specific language governing permissions and
6558  * limitations under the License.
6559  */
6560 
6561 #ifndef INCLUDE_PERFETTO_BASE_THREAD_UTILS_H_
6562 #define INCLUDE_PERFETTO_BASE_THREAD_UTILS_H_
6563 
6564 #include <stdint.h>
6565 
6566 // gen_amalgamated expanded: #include "perfetto/base/build_config.h"
6567 
6568 #if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
6569 #include <Windows.h>
6570 #include <processthreadsapi.h>
6571 #elif PERFETTO_BUILDFLAG(PERFETTO_OS_FUCHSIA)
6572 #include <zircon/process.h>
6573 #include <zircon/types.h>
6574 #elif PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) || \
6575     PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
6576 #include <sys/syscall.h>
6577 #include <sys/types.h>
6578 #include <unistd.h>
6579 #else
6580 #include <pthread.h>
6581 #endif
6582 
6583 namespace perfetto {
6584 namespace base {
6585 
6586 #if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
6587 using PlatformThreadId = pid_t;
6588 inline PlatformThreadId GetThreadId() {
6589   return gettid();
6590 }
6591 #elif PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX)
6592 using PlatformThreadId = pid_t;
6593 inline PlatformThreadId GetThreadId() {
6594   return static_cast<pid_t>(syscall(__NR_gettid));
6595 }
6596 #elif PERFETTO_BUILDFLAG(PERFETTO_OS_FUCHSIA)
6597 using PlatformThreadId = zx_handle_t;
6598 inline PlatformThreadId GetThreadId() {
6599   return zx_thread_self();
6600 }
6601 #elif PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE)
6602 using PlatformThreadId = uint64_t;
6603 inline PlatformThreadId GetThreadId() {
6604   uint64_t tid;
6605   pthread_threadid_np(nullptr, &tid);
6606   return tid;
6607 }
6608 #elif PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
6609 using PlatformThreadId = uint64_t;
6610 inline PlatformThreadId GetThreadId() {
6611   return static_cast<uint64_t>(GetCurrentThreadId());
6612 }
6613 #elif PERFETTO_BUILDFLAG(PERFETTO_OS_NACL)
6614 using PlatformThreadId = pid_t;
6615 inline PlatformThreadId GetThreadId() {
6616   return reinterpret_cast<int32_t>(pthread_self());
6617 }
6618 #else  // Default to pthreads in case no OS is set.
6619 using PlatformThreadId = pthread_t;
6620 inline PlatformThreadId GetThreadId() {
6621   return pthread_self();
6622 }
6623 #endif
6624 
6625 }  // namespace base
6626 }  // namespace perfetto
6627 
6628 #endif  // INCLUDE_PERFETTO_BASE_THREAD_UTILS_H_
6629 // gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/track_descriptor.gen.h
6630 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
6631 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TRACK_DESCRIPTOR_PROTO_CPP_H_
6632 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TRACK_DESCRIPTOR_PROTO_CPP_H_
6633 
6634 #include <stdint.h>
6635 #include <bitset>
6636 #include <vector>
6637 #include <string>
6638 #include <type_traits>
6639 
6640 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
6641 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
6642 // gen_amalgamated expanded: #include "perfetto/base/export.h"
6643 
6644 namespace perfetto {
6645 namespace protos {
6646 namespace gen {
6647 class TrackDescriptor;
6648 class CounterDescriptor;
6649 class ChromeThreadDescriptor;
6650 class ThreadDescriptor;
6651 class ChromeProcessDescriptor;
6652 class ProcessDescriptor;
6653 enum CounterDescriptor_BuiltinCounterType : int;
6654 enum CounterDescriptor_Unit : int;
6655 enum ChromeThreadDescriptor_ThreadType : int;
6656 enum ThreadDescriptor_ChromeThreadType : int;
6657 enum ChromeProcessDescriptor_ProcessType : int;
6658 enum ProcessDescriptor_ChromeProcessType : int;
6659 }  // namespace perfetto
6660 }  // namespace protos
6661 }  // namespace gen
6662 
6663 namespace protozero {
6664 class Message;
6665 }  // namespace protozero
6666 
6667 namespace perfetto {
6668 namespace protos {
6669 namespace gen {
6670 
6671 class PERFETTO_EXPORT TrackDescriptor : public ::protozero::CppMessageObj {
6672  public:
6673   enum FieldNumbers {
6674     kUuidFieldNumber = 1,
6675     kParentUuidFieldNumber = 5,
6676     kNameFieldNumber = 2,
6677     kProcessFieldNumber = 3,
6678     kChromeProcessFieldNumber = 6,
6679     kThreadFieldNumber = 4,
6680     kChromeThreadFieldNumber = 7,
6681     kCounterFieldNumber = 8,
6682   };
6683 
6684   TrackDescriptor();
6685   ~TrackDescriptor() override;
6686   TrackDescriptor(TrackDescriptor&&) noexcept;
6687   TrackDescriptor& operator=(TrackDescriptor&&);
6688   TrackDescriptor(const TrackDescriptor&);
6689   TrackDescriptor& operator=(const TrackDescriptor&);
6690   bool operator==(const TrackDescriptor&) const;
6691   bool operator!=(const TrackDescriptor& other) const { return !(*this == other); }
6692 
6693   bool ParseFromArray(const void*, size_t) override;
6694   std::string SerializeAsString() const override;
6695   std::vector<uint8_t> SerializeAsArray() const override;
6696   void Serialize(::protozero::Message*) const;
6697 
6698   bool has_uuid() const { return _has_field_[1]; }
6699   uint64_t uuid() const { return uuid_; }
6700   void set_uuid(uint64_t value) { uuid_ = value; _has_field_.set(1); }
6701 
6702   bool has_parent_uuid() const { return _has_field_[5]; }
6703   uint64_t parent_uuid() const { return parent_uuid_; }
6704   void set_parent_uuid(uint64_t value) { parent_uuid_ = value; _has_field_.set(5); }
6705 
6706   bool has_name() const { return _has_field_[2]; }
6707   const std::string& name() const { return name_; }
6708   void set_name(const std::string& value) { name_ = value; _has_field_.set(2); }
6709 
6710   bool has_process() const { return _has_field_[3]; }
6711   const ProcessDescriptor& process() const { return *process_; }
6712   ProcessDescriptor* mutable_process() { _has_field_.set(3); return process_.get(); }
6713 
6714   bool has_chrome_process() const { return _has_field_[6]; }
6715   const ChromeProcessDescriptor& chrome_process() const { return *chrome_process_; }
6716   ChromeProcessDescriptor* mutable_chrome_process() { _has_field_.set(6); return chrome_process_.get(); }
6717 
6718   bool has_thread() const { return _has_field_[4]; }
6719   const ThreadDescriptor& thread() const { return *thread_; }
6720   ThreadDescriptor* mutable_thread() { _has_field_.set(4); return thread_.get(); }
6721 
6722   bool has_chrome_thread() const { return _has_field_[7]; }
6723   const ChromeThreadDescriptor& chrome_thread() const { return *chrome_thread_; }
6724   ChromeThreadDescriptor* mutable_chrome_thread() { _has_field_.set(7); return chrome_thread_.get(); }
6725 
6726   bool has_counter() const { return _has_field_[8]; }
6727   const CounterDescriptor& counter() const { return *counter_; }
6728   CounterDescriptor* mutable_counter() { _has_field_.set(8); return counter_.get(); }
6729 
6730  private:
6731   uint64_t uuid_{};
6732   uint64_t parent_uuid_{};
6733   std::string name_{};
6734   ::protozero::CopyablePtr<ProcessDescriptor> process_;
6735   ::protozero::CopyablePtr<ChromeProcessDescriptor> chrome_process_;
6736   ::protozero::CopyablePtr<ThreadDescriptor> thread_;
6737   ::protozero::CopyablePtr<ChromeThreadDescriptor> chrome_thread_;
6738   ::protozero::CopyablePtr<CounterDescriptor> counter_;
6739 
6740   // Allows to preserve unknown protobuf fields for compatibility
6741   // with future versions of .proto files.
6742   std::string unknown_fields_;
6743 
6744   std::bitset<9> _has_field_{};
6745 };
6746 
6747 }  // namespace perfetto
6748 }  // namespace protos
6749 }  // namespace gen
6750 
6751 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TRACK_DESCRIPTOR_PROTO_CPP_H_
6752 // gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/track_descriptor.pbzero.h
6753 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
6754 
6755 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TRACK_DESCRIPTOR_PROTO_H_
6756 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TRACK_DESCRIPTOR_PROTO_H_
6757 
6758 #include <stddef.h>
6759 #include <stdint.h>
6760 
6761 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
6762 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
6763 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
6764 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
6765 
6766 namespace perfetto {
6767 namespace protos {
6768 namespace pbzero {
6769 
6770 class ChromeProcessDescriptor;
6771 class ChromeThreadDescriptor;
6772 class CounterDescriptor;
6773 class ProcessDescriptor;
6774 class ThreadDescriptor;
6775 
6776 class TrackDescriptor_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
6777  public:
6778   TrackDescriptor_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
6779   explicit TrackDescriptor_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
6780   explicit TrackDescriptor_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
6781   bool has_uuid() const { return at<1>().valid(); }
6782   uint64_t uuid() const { return at<1>().as_uint64(); }
6783   bool has_parent_uuid() const { return at<5>().valid(); }
6784   uint64_t parent_uuid() const { return at<5>().as_uint64(); }
6785   bool has_name() const { return at<2>().valid(); }
6786   ::protozero::ConstChars name() const { return at<2>().as_string(); }
6787   bool has_process() const { return at<3>().valid(); }
6788   ::protozero::ConstBytes process() const { return at<3>().as_bytes(); }
6789   bool has_chrome_process() const { return at<6>().valid(); }
6790   ::protozero::ConstBytes chrome_process() const { return at<6>().as_bytes(); }
6791   bool has_thread() const { return at<4>().valid(); }
6792   ::protozero::ConstBytes thread() const { return at<4>().as_bytes(); }
6793   bool has_chrome_thread() const { return at<7>().valid(); }
6794   ::protozero::ConstBytes chrome_thread() const { return at<7>().as_bytes(); }
6795   bool has_counter() const { return at<8>().valid(); }
6796   ::protozero::ConstBytes counter() const { return at<8>().as_bytes(); }
6797 };
6798 
6799 class TrackDescriptor : public ::protozero::Message {
6800  public:
6801   using Decoder = TrackDescriptor_Decoder;
6802   enum : int32_t {
6803     kUuidFieldNumber = 1,
6804     kParentUuidFieldNumber = 5,
6805     kNameFieldNumber = 2,
6806     kProcessFieldNumber = 3,
6807     kChromeProcessFieldNumber = 6,
6808     kThreadFieldNumber = 4,
6809     kChromeThreadFieldNumber = 7,
6810     kCounterFieldNumber = 8,
6811   };
6812   void set_uuid(uint64_t value) {
6813     AppendVarInt(1, value);
6814   }
6815   void set_parent_uuid(uint64_t value) {
6816     AppendVarInt(5, value);
6817   }
6818   void set_name(const std::string& value) {
6819     AppendBytes(2, value.data(), value.size());
6820   }
6821   void set_name(const char* data, size_t size) {
6822     AppendBytes(2, data, size);
6823   }
6824   template <typename T = ProcessDescriptor> T* set_process() {
6825     return BeginNestedMessage<T>(3);
6826   }
6827 
6828   template <typename T = ChromeProcessDescriptor> T* set_chrome_process() {
6829     return BeginNestedMessage<T>(6);
6830   }
6831 
6832   template <typename T = ThreadDescriptor> T* set_thread() {
6833     return BeginNestedMessage<T>(4);
6834   }
6835 
6836   template <typename T = ChromeThreadDescriptor> T* set_chrome_thread() {
6837     return BeginNestedMessage<T>(7);
6838   }
6839 
6840   template <typename T = CounterDescriptor> T* set_counter() {
6841     return BeginNestedMessage<T>(8);
6842   }
6843 
6844 };
6845 
6846 } // Namespace.
6847 } // Namespace.
6848 } // Namespace.
6849 #endif  // Include guard.
6850 /*
6851  * Copyright (C) 2019 The Android Open Source Project
6852  *
6853  * Licensed under the Apache License, Version 2.0 (the "License");
6854  * you may not use this file except in compliance with the License.
6855  * You may obtain a copy of the License at
6856  *
6857  *      http://www.apache.org/licenses/LICENSE-2.0
6858  *
6859  * Unless required by applicable law or agreed to in writing, software
6860  * distributed under the License is distributed on an "AS IS" BASIS,
6861  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6862  * See the License for the specific language governing permissions and
6863  * limitations under the License.
6864  */
6865 
6866 #ifndef INCLUDE_PERFETTO_TRACING_TRACK_H_
6867 #define INCLUDE_PERFETTO_TRACING_TRACK_H_
6868 
6869 // gen_amalgamated expanded: #include "perfetto/base/export.h"
6870 // gen_amalgamated expanded: #include "perfetto/base/proc_utils.h"
6871 // gen_amalgamated expanded: #include "perfetto/base/thread_utils.h"
6872 // gen_amalgamated expanded: #include "perfetto/protozero/message_handle.h"
6873 // gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
6874 // gen_amalgamated expanded: #include "protos/perfetto/trace/trace_packet.pbzero.h"
6875 // gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/track_descriptor.gen.h"
6876 // gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/track_descriptor.pbzero.h"
6877 
6878 #include <stdint.h>
6879 #include <map>
6880 #include <mutex>
6881 
6882 namespace perfetto {
6883 namespace internal {
6884 class TrackRegistry;
6885 }
6886 
6887 // Track events are recorded on a timeline track, which maintains the relative
6888 // time ordering of all events on that track. Each thread has its own default
6889 // track (ThreadTrack), which is by default where all track events are written.
6890 // Thread tracks are grouped under their hosting process (ProcessTrack).
6891 
6892 // Events which aren't strictly scoped to a thread or a process, or don't
6893 // correspond to synchronous code execution on a thread can use a custom
6894 // track (Track, ThreadTrack or ProcessTrack). A Track object can also
6895 // optionally be parented to a thread or a process.
6896 //
6897 // A track is represented by a uuid, which must be unique across the entire
6898 // recorded trace.
6899 //
6900 // For example, to record an event that begins and ends on different threads,
6901 // use a matching id to tie the begin and end events together:
6902 //
6903 //   TRACE_EVENT_BEGIN("category", "AsyncEvent", perfetto::Track(8086));
6904 //   ...
6905 //   TRACE_EVENT_END("category", perfetto::Track(8086));
6906 //
6907 // Tracks can also be annotated with metadata:
6908 //
6909 //   auto desc = track.Serialize();
6910 //   desc.set_name("MyTrack");
6911 //   perfetto::TrackEvent::SetTrackDescriptor(track, desc);
6912 //
6913 // Threads and processes can also be named in a similar way, e.g.:
6914 //
6915 //   auto desc = perfetto::ProcessTrack::Current().Serialize();
6916 //   desc.mutable_process()->set_process_name("MyProcess");
6917 //   perfetto::TrackEvent::SetTrackDescriptor(
6918 //       perfetto::ProcessTrack::Current(), desc);
6919 //
6920 // The metadata remains valid between tracing sessions. To free up data for a
6921 // track, call EraseTrackDescriptor:
6922 //
6923 //   perfetto::TrackEvent::EraseTrackDescriptor(track);
6924 //
6925 struct PERFETTO_EXPORT Track {
6926   const uint64_t uuid;
6927   const uint64_t parent_uuid;
6928   constexpr Track() : uuid(0), parent_uuid(0) {}
6929 
6930   // Construct a track with identifier |id|, optionally parented under |parent|.
6931   // If no parent is specified, the track's parent is the current process's
6932   // track.
6933   //
6934   // To minimize the chances for accidental id collisions across processes, the
6935   // track's effective uuid is generated by xorring |id| with a random,
6936   // per-process cookie.
6937   explicit Track(uint64_t id, Track parent = MakeProcessTrack())
6938       : uuid(id ^ parent.uuid), parent_uuid(parent.uuid) {}
6939 
6940   explicit operator bool() const { return uuid; }
6941   void Serialize(protos::pbzero::TrackDescriptor*) const;
6942   protos::gen::TrackDescriptor Serialize() const;
6943 
6944   // Construct a global track with identifier |id|.
6945   //
6946   // Beware: the globally unique |id| should be chosen carefully to avoid
6947   // accidental clashes with track identifiers emitted by other producers.
6948   static Track Global(uint64_t id) { return Track(id, Track()); }
6949 
6950  protected:
6951   static Track MakeThreadTrack(base::PlatformThreadId tid) {
6952     // If tid were 0 here (which is an invalid tid), we would create a thread
6953     // track with a uuid that conflicts with the corresponding ProcessTrack.
6954     PERFETTO_DCHECK(tid != 0);
6955     return Track(static_cast<uint64_t>(tid), MakeProcessTrack());
6956   }
6957 
6958   static Track MakeProcessTrack() { return Track(process_uuid, Track()); }
6959 
6960  private:
6961   friend class internal::TrackRegistry;
6962   static uint64_t process_uuid;
6963 };
6964 
6965 // A process track represents events that describe the state of the entire
6966 // application (e.g., counter events). Currently a ProcessTrack can only
6967 // represent the current process.
6968 struct PERFETTO_EXPORT ProcessTrack : public Track {
6969   const base::PlatformProcessId pid;
6970 
6971   static ProcessTrack Current() { return ProcessTrack(); }
6972 
6973   void Serialize(protos::pbzero::TrackDescriptor*) const;
6974   protos::gen::TrackDescriptor Serialize() const;
6975 
6976  private:
6977   ProcessTrack() : Track(MakeProcessTrack()), pid(base::GetProcessId()) {}
6978 };
6979 
6980 // A thread track is associated with a specific thread of execution. Currently
6981 // only threads in the current process can be referenced.
6982 struct PERFETTO_EXPORT ThreadTrack : public Track {
6983   const base::PlatformProcessId pid;
6984   const base::PlatformThreadId tid;
6985 
6986   static ThreadTrack Current() { return ThreadTrack(base::GetThreadId()); }
6987 
6988   // Represents a thread in the current process.
6989   static ThreadTrack ForThread(base::PlatformThreadId tid_) {
6990     return ThreadTrack(tid_);
6991   }
6992 
6993   void Serialize(protos::pbzero::TrackDescriptor*) const;
6994   protos::gen::TrackDescriptor Serialize() const;
6995 
6996  private:
6997   explicit ThreadTrack(base::PlatformThreadId tid_)
6998       : Track(MakeThreadTrack(tid_)),
6999         pid(ProcessTrack::Current().pid),
7000         tid(tid_) {}
7001 };
7002 
7003 namespace internal {
7004 
7005 // Keeps a map of uuids to serialized track descriptors and provides a
7006 // thread-safe way to read and write them. Each trace writer keeps a TLS set of
7007 // the tracks it has seen (see TrackEventIncrementalState). In the common case,
7008 // this registry is not consulted (and no locks are taken). However when a new
7009 // track is seen, this registry is used to write either 1) the default
7010 // descriptor for that track (see *Track::Serialize) or 2) a serialized
7011 // descriptor stored in the registry which may have additional metadata (e.g.,
7012 // track name).
7013 // TODO(eseckler): Remove PERFETTO_EXPORT once Chromium no longer calls
7014 // TrackRegistry::InitializeInstance() directly.
7015 class PERFETTO_EXPORT TrackRegistry {
7016  public:
7017   using SerializedTrackDescriptor = std::string;
7018 
7019   TrackRegistry();
7020   ~TrackRegistry();
7021 
7022   static void InitializeInstance();
7023   static TrackRegistry* Get() { return instance_; }
7024 
7025   void EraseTrack(Track);
7026 
7027   // Store metadata for |track| in the registry. |fill_function| is called
7028   // synchronously to record additional properties for the track.
7029   template <typename TrackType>
7030   void UpdateTrack(
7031       const TrackType& track,
7032       std::function<void(protos::pbzero::TrackDescriptor*)> fill_function) {
7033     UpdateTrackImpl(track, [&](protos::pbzero::TrackDescriptor* desc) {
7034       track.Serialize(desc);
7035       fill_function(desc);
7036     });
7037   }
7038 
7039   // This variant lets the user supply a serialized track descriptor directly.
7040   void UpdateTrack(Track, const std::string& serialized_desc);
7041 
7042   // If |track| exists in the registry, write out the serialized track
7043   // descriptor for it into |packet|. Otherwise just the ephemeral track object
7044   // is serialized without any additional metadata.
7045   template <typename TrackType>
7046   void SerializeTrack(
7047       const TrackType& track,
7048       protozero::MessageHandle<protos::pbzero::TracePacket> packet) {
7049     // If the track has extra metadata (recorded with UpdateTrack), it will be
7050     // found in the registry. To minimize the time the lock is held, make a copy
7051     // of the data held in the registry and write it outside the lock.
7052     std::string desc_copy;
7053     {
7054       std::lock_guard<std::mutex> lock(mutex_);
7055       const auto& it = tracks_.find(track.uuid);
7056       if (it != tracks_.end()) {
7057         desc_copy = it->second;
7058         PERFETTO_DCHECK(!desc_copy.empty());
7059       }
7060     }
7061     if (!desc_copy.empty()) {
7062       WriteTrackDescriptor(std::move(desc_copy), std::move(packet));
7063     } else {
7064       // Otherwise we just write the basic descriptor for this type of track
7065       // (e.g., just uuid, no name).
7066       track.Serialize(packet->set_track_descriptor());
7067     }
7068   }
7069 
7070   static void WriteTrackDescriptor(
7071       const SerializedTrackDescriptor& desc,
7072       protozero::MessageHandle<protos::pbzero::TracePacket> packet);
7073 
7074  private:
7075   void UpdateTrackImpl(
7076       Track,
7077       std::function<void(protos::pbzero::TrackDescriptor*)> fill_function);
7078 
7079   std::mutex mutex_;
7080   std::map<uint64_t /* uuid */, SerializedTrackDescriptor> tracks_;
7081 
7082   static TrackRegistry* instance_;
7083 };
7084 
7085 }  // namespace internal
7086 }  // namespace perfetto
7087 
7088 #endif  // INCLUDE_PERFETTO_TRACING_TRACK_H_
7089 // gen_amalgamated begin header: gen/protos/perfetto/common/builtin_clock.pbzero.h
7090 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
7091 
7092 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_BUILTIN_CLOCK_PROTO_H_
7093 #define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_BUILTIN_CLOCK_PROTO_H_
7094 
7095 #include <stddef.h>
7096 #include <stdint.h>
7097 
7098 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
7099 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
7100 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
7101 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
7102 
7103 namespace perfetto {
7104 namespace protos {
7105 namespace pbzero {
7106 
7107 
7108 enum BuiltinClock : int32_t {
7109   BUILTIN_CLOCK_UNKNOWN = 0,
7110   BUILTIN_CLOCK_REALTIME = 1,
7111   BUILTIN_CLOCK_REALTIME_COARSE = 2,
7112   BUILTIN_CLOCK_MONOTONIC = 3,
7113   BUILTIN_CLOCK_MONOTONIC_COARSE = 4,
7114   BUILTIN_CLOCK_MONOTONIC_RAW = 5,
7115   BUILTIN_CLOCK_BOOTTIME = 6,
7116   BUILTIN_CLOCK_MAX_ID = 63,
7117 };
7118 
7119 const BuiltinClock BuiltinClock_MIN = BUILTIN_CLOCK_UNKNOWN;
7120 const BuiltinClock BuiltinClock_MAX = BUILTIN_CLOCK_MAX_ID;
7121 
7122 } // Namespace.
7123 } // Namespace.
7124 } // Namespace.
7125 #endif  // Include guard.
7126 // gen_amalgamated begin header: gen/protos/perfetto/trace/interned_data/interned_data.pbzero.h
7127 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
7128 
7129 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_INTERNED_DATA_INTERNED_DATA_PROTO_H_
7130 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_INTERNED_DATA_INTERNED_DATA_PROTO_H_
7131 
7132 #include <stddef.h>
7133 #include <stdint.h>
7134 
7135 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
7136 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
7137 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
7138 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
7139 
7140 namespace perfetto {
7141 namespace protos {
7142 namespace pbzero {
7143 
7144 class Callstack;
7145 class DebugAnnotationName;
7146 class EventCategory;
7147 class EventName;
7148 class Frame;
7149 class InternedGpuRenderStageSpecification;
7150 class InternedGraphicsContext;
7151 class InternedString;
7152 class LogMessageBody;
7153 class Mapping;
7154 class ProfiledFrameSymbols;
7155 class SourceLocation;
7156 
7157 class InternedData_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/24, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
7158  public:
7159   InternedData_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
7160   explicit InternedData_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
7161   explicit InternedData_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
7162   bool has_event_categories() const { return at<1>().valid(); }
7163   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> event_categories() const { return GetRepeated<::protozero::ConstBytes>(1); }
7164   bool has_event_names() const { return at<2>().valid(); }
7165   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> event_names() const { return GetRepeated<::protozero::ConstBytes>(2); }
7166   bool has_debug_annotation_names() const { return at<3>().valid(); }
7167   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> debug_annotation_names() const { return GetRepeated<::protozero::ConstBytes>(3); }
7168   bool has_source_locations() const { return at<4>().valid(); }
7169   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> source_locations() const { return GetRepeated<::protozero::ConstBytes>(4); }
7170   bool has_log_message_body() const { return at<20>().valid(); }
7171   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> log_message_body() const { return GetRepeated<::protozero::ConstBytes>(20); }
7172   bool has_build_ids() const { return at<16>().valid(); }
7173   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> build_ids() const { return GetRepeated<::protozero::ConstBytes>(16); }
7174   bool has_mapping_paths() const { return at<17>().valid(); }
7175   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> mapping_paths() const { return GetRepeated<::protozero::ConstBytes>(17); }
7176   bool has_source_paths() const { return at<18>().valid(); }
7177   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> source_paths() const { return GetRepeated<::protozero::ConstBytes>(18); }
7178   bool has_function_names() const { return at<5>().valid(); }
7179   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> function_names() const { return GetRepeated<::protozero::ConstBytes>(5); }
7180   bool has_profiled_frame_symbols() const { return at<21>().valid(); }
7181   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> profiled_frame_symbols() const { return GetRepeated<::protozero::ConstBytes>(21); }
7182   bool has_mappings() const { return at<19>().valid(); }
7183   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> mappings() const { return GetRepeated<::protozero::ConstBytes>(19); }
7184   bool has_frames() const { return at<6>().valid(); }
7185   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> frames() const { return GetRepeated<::protozero::ConstBytes>(6); }
7186   bool has_callstacks() const { return at<7>().valid(); }
7187   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> callstacks() const { return GetRepeated<::protozero::ConstBytes>(7); }
7188   bool has_vulkan_memory_keys() const { return at<22>().valid(); }
7189   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> vulkan_memory_keys() const { return GetRepeated<::protozero::ConstBytes>(22); }
7190   bool has_graphics_contexts() const { return at<23>().valid(); }
7191   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> graphics_contexts() const { return GetRepeated<::protozero::ConstBytes>(23); }
7192   bool has_gpu_specifications() const { return at<24>().valid(); }
7193   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> gpu_specifications() const { return GetRepeated<::protozero::ConstBytes>(24); }
7194 };
7195 
7196 class InternedData : public ::protozero::Message {
7197  public:
7198   using Decoder = InternedData_Decoder;
7199   enum : int32_t {
7200     kEventCategoriesFieldNumber = 1,
7201     kEventNamesFieldNumber = 2,
7202     kDebugAnnotationNamesFieldNumber = 3,
7203     kSourceLocationsFieldNumber = 4,
7204     kLogMessageBodyFieldNumber = 20,
7205     kBuildIdsFieldNumber = 16,
7206     kMappingPathsFieldNumber = 17,
7207     kSourcePathsFieldNumber = 18,
7208     kFunctionNamesFieldNumber = 5,
7209     kProfiledFrameSymbolsFieldNumber = 21,
7210     kMappingsFieldNumber = 19,
7211     kFramesFieldNumber = 6,
7212     kCallstacksFieldNumber = 7,
7213     kVulkanMemoryKeysFieldNumber = 22,
7214     kGraphicsContextsFieldNumber = 23,
7215     kGpuSpecificationsFieldNumber = 24,
7216   };
7217   template <typename T = EventCategory> T* add_event_categories() {
7218     return BeginNestedMessage<T>(1);
7219   }
7220 
7221   template <typename T = EventName> T* add_event_names() {
7222     return BeginNestedMessage<T>(2);
7223   }
7224 
7225   template <typename T = DebugAnnotationName> T* add_debug_annotation_names() {
7226     return BeginNestedMessage<T>(3);
7227   }
7228 
7229   template <typename T = SourceLocation> T* add_source_locations() {
7230     return BeginNestedMessage<T>(4);
7231   }
7232 
7233   template <typename T = LogMessageBody> T* add_log_message_body() {
7234     return BeginNestedMessage<T>(20);
7235   }
7236 
7237   template <typename T = InternedString> T* add_build_ids() {
7238     return BeginNestedMessage<T>(16);
7239   }
7240 
7241   template <typename T = InternedString> T* add_mapping_paths() {
7242     return BeginNestedMessage<T>(17);
7243   }
7244 
7245   template <typename T = InternedString> T* add_source_paths() {
7246     return BeginNestedMessage<T>(18);
7247   }
7248 
7249   template <typename T = InternedString> T* add_function_names() {
7250     return BeginNestedMessage<T>(5);
7251   }
7252 
7253   template <typename T = ProfiledFrameSymbols> T* add_profiled_frame_symbols() {
7254     return BeginNestedMessage<T>(21);
7255   }
7256 
7257   template <typename T = Mapping> T* add_mappings() {
7258     return BeginNestedMessage<T>(19);
7259   }
7260 
7261   template <typename T = Frame> T* add_frames() {
7262     return BeginNestedMessage<T>(6);
7263   }
7264 
7265   template <typename T = Callstack> T* add_callstacks() {
7266     return BeginNestedMessage<T>(7);
7267   }
7268 
7269   template <typename T = InternedString> T* add_vulkan_memory_keys() {
7270     return BeginNestedMessage<T>(22);
7271   }
7272 
7273   template <typename T = InternedGraphicsContext> T* add_graphics_contexts() {
7274     return BeginNestedMessage<T>(23);
7275   }
7276 
7277   template <typename T = InternedGpuRenderStageSpecification> T* add_gpu_specifications() {
7278     return BeginNestedMessage<T>(24);
7279   }
7280 
7281 };
7282 
7283 } // Namespace.
7284 } // Namespace.
7285 } // Namespace.
7286 #endif  // Include guard.
7287 // gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/track_event.pbzero.h
7288 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
7289 
7290 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TRACK_EVENT_PROTO_H_
7291 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TRACK_EVENT_PROTO_H_
7292 
7293 #include <stddef.h>
7294 #include <stdint.h>
7295 
7296 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
7297 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
7298 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
7299 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
7300 
7301 namespace perfetto {
7302 namespace protos {
7303 namespace pbzero {
7304 
7305 class ChromeCompositorSchedulerState;
7306 class ChromeFrameReporter;
7307 class ChromeHistogramSample;
7308 class ChromeKeyedService;
7309 class ChromeLatencyInfo;
7310 class ChromeLegacyIpc;
7311 class ChromeUserEvent;
7312 class DebugAnnotation;
7313 class LogMessage;
7314 class TaskExecution;
7315 class TrackEvent_LegacyEvent;
7316 enum TrackEvent_LegacyEvent_FlowDirection : int32_t;
7317 enum TrackEvent_LegacyEvent_InstantEventScope : int32_t;
7318 enum TrackEvent_Type : int32_t;
7319 
7320 enum TrackEvent_Type : int32_t {
7321   TrackEvent_Type_TYPE_UNSPECIFIED = 0,
7322   TrackEvent_Type_TYPE_SLICE_BEGIN = 1,
7323   TrackEvent_Type_TYPE_SLICE_END = 2,
7324   TrackEvent_Type_TYPE_INSTANT = 3,
7325   TrackEvent_Type_TYPE_COUNTER = 4,
7326 };
7327 
7328 const TrackEvent_Type TrackEvent_Type_MIN = TrackEvent_Type_TYPE_UNSPECIFIED;
7329 const TrackEvent_Type TrackEvent_Type_MAX = TrackEvent_Type_TYPE_COUNTER;
7330 
7331 enum TrackEvent_LegacyEvent_FlowDirection : int32_t {
7332   TrackEvent_LegacyEvent_FlowDirection_FLOW_UNSPECIFIED = 0,
7333   TrackEvent_LegacyEvent_FlowDirection_FLOW_IN = 1,
7334   TrackEvent_LegacyEvent_FlowDirection_FLOW_OUT = 2,
7335   TrackEvent_LegacyEvent_FlowDirection_FLOW_INOUT = 3,
7336 };
7337 
7338 const TrackEvent_LegacyEvent_FlowDirection TrackEvent_LegacyEvent_FlowDirection_MIN = TrackEvent_LegacyEvent_FlowDirection_FLOW_UNSPECIFIED;
7339 const TrackEvent_LegacyEvent_FlowDirection TrackEvent_LegacyEvent_FlowDirection_MAX = TrackEvent_LegacyEvent_FlowDirection_FLOW_INOUT;
7340 
7341 enum TrackEvent_LegacyEvent_InstantEventScope : int32_t {
7342   TrackEvent_LegacyEvent_InstantEventScope_SCOPE_UNSPECIFIED = 0,
7343   TrackEvent_LegacyEvent_InstantEventScope_SCOPE_GLOBAL = 1,
7344   TrackEvent_LegacyEvent_InstantEventScope_SCOPE_PROCESS = 2,
7345   TrackEvent_LegacyEvent_InstantEventScope_SCOPE_THREAD = 3,
7346 };
7347 
7348 const TrackEvent_LegacyEvent_InstantEventScope TrackEvent_LegacyEvent_InstantEventScope_MIN = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_UNSPECIFIED;
7349 const TrackEvent_LegacyEvent_InstantEventScope TrackEvent_LegacyEvent_InstantEventScope_MAX = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_THREAD;
7350 
7351 class EventName_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
7352  public:
7353   EventName_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
7354   explicit EventName_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
7355   explicit EventName_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
7356   bool has_iid() const { return at<1>().valid(); }
7357   uint64_t iid() const { return at<1>().as_uint64(); }
7358   bool has_name() const { return at<2>().valid(); }
7359   ::protozero::ConstChars name() const { return at<2>().as_string(); }
7360 };
7361 
7362 class EventName : public ::protozero::Message {
7363  public:
7364   using Decoder = EventName_Decoder;
7365   enum : int32_t {
7366     kIidFieldNumber = 1,
7367     kNameFieldNumber = 2,
7368   };
7369   void set_iid(uint64_t value) {
7370     AppendVarInt(1, value);
7371   }
7372   void set_name(const std::string& value) {
7373     AppendBytes(2, value.data(), value.size());
7374   }
7375   void set_name(const char* data, size_t size) {
7376     AppendBytes(2, data, size);
7377   }
7378 };
7379 
7380 class EventCategory_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
7381  public:
7382   EventCategory_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
7383   explicit EventCategory_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
7384   explicit EventCategory_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
7385   bool has_iid() const { return at<1>().valid(); }
7386   uint64_t iid() const { return at<1>().as_uint64(); }
7387   bool has_name() const { return at<2>().valid(); }
7388   ::protozero::ConstChars name() const { return at<2>().as_string(); }
7389 };
7390 
7391 class EventCategory : public ::protozero::Message {
7392  public:
7393   using Decoder = EventCategory_Decoder;
7394   enum : int32_t {
7395     kIidFieldNumber = 1,
7396     kNameFieldNumber = 2,
7397   };
7398   void set_iid(uint64_t value) {
7399     AppendVarInt(1, value);
7400   }
7401   void set_name(const std::string& value) {
7402     AppendBytes(2, value.data(), value.size());
7403   }
7404   void set_name(const char* data, size_t size) {
7405     AppendBytes(2, data, size);
7406   }
7407 };
7408 
7409 class TrackEventDefaults_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/31, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
7410  public:
7411   TrackEventDefaults_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
7412   explicit TrackEventDefaults_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
7413   explicit TrackEventDefaults_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
7414   bool has_track_uuid() const { return at<11>().valid(); }
7415   uint64_t track_uuid() const { return at<11>().as_uint64(); }
7416   bool has_extra_counter_track_uuids() const { return at<31>().valid(); }
7417   ::protozero::RepeatedFieldIterator<uint64_t> extra_counter_track_uuids() const { return GetRepeated<uint64_t>(31); }
7418 };
7419 
7420 class TrackEventDefaults : public ::protozero::Message {
7421  public:
7422   using Decoder = TrackEventDefaults_Decoder;
7423   enum : int32_t {
7424     kTrackUuidFieldNumber = 11,
7425     kExtraCounterTrackUuidsFieldNumber = 31,
7426   };
7427   void set_track_uuid(uint64_t value) {
7428     AppendVarInt(11, value);
7429   }
7430   void add_extra_counter_track_uuids(uint64_t value) {
7431     AppendVarInt(31, value);
7432   }
7433 };
7434 
7435 class TrackEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/32, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
7436  public:
7437   TrackEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
7438   explicit TrackEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
7439   explicit TrackEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
7440   bool has_category_iids() const { return at<3>().valid(); }
7441   ::protozero::RepeatedFieldIterator<uint64_t> category_iids() const { return GetRepeated<uint64_t>(3); }
7442   bool has_categories() const { return at<22>().valid(); }
7443   ::protozero::RepeatedFieldIterator<::protozero::ConstChars> categories() const { return GetRepeated<::protozero::ConstChars>(22); }
7444   bool has_name_iid() const { return at<10>().valid(); }
7445   uint64_t name_iid() const { return at<10>().as_uint64(); }
7446   bool has_name() const { return at<23>().valid(); }
7447   ::protozero::ConstChars name() const { return at<23>().as_string(); }
7448   bool has_type() const { return at<9>().valid(); }
7449   int32_t type() const { return at<9>().as_int32(); }
7450   bool has_track_uuid() const { return at<11>().valid(); }
7451   uint64_t track_uuid() const { return at<11>().as_uint64(); }
7452   bool has_counter_value() const { return at<30>().valid(); }
7453   int64_t counter_value() const { return at<30>().as_int64(); }
7454   bool has_extra_counter_track_uuids() const { return at<31>().valid(); }
7455   ::protozero::RepeatedFieldIterator<uint64_t> extra_counter_track_uuids() const { return GetRepeated<uint64_t>(31); }
7456   bool has_extra_counter_values() const { return at<12>().valid(); }
7457   ::protozero::RepeatedFieldIterator<int64_t> extra_counter_values() const { return GetRepeated<int64_t>(12); }
7458   bool has_debug_annotations() const { return at<4>().valid(); }
7459   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> debug_annotations() const { return GetRepeated<::protozero::ConstBytes>(4); }
7460   bool has_task_execution() const { return at<5>().valid(); }
7461   ::protozero::ConstBytes task_execution() const { return at<5>().as_bytes(); }
7462   bool has_log_message() const { return at<21>().valid(); }
7463   ::protozero::ConstBytes log_message() const { return at<21>().as_bytes(); }
7464   bool has_cc_scheduler_state() const { return at<24>().valid(); }
7465   ::protozero::ConstBytes cc_scheduler_state() const { return at<24>().as_bytes(); }
7466   bool has_chrome_user_event() const { return at<25>().valid(); }
7467   ::protozero::ConstBytes chrome_user_event() const { return at<25>().as_bytes(); }
7468   bool has_chrome_keyed_service() const { return at<26>().valid(); }
7469   ::protozero::ConstBytes chrome_keyed_service() const { return at<26>().as_bytes(); }
7470   bool has_chrome_legacy_ipc() const { return at<27>().valid(); }
7471   ::protozero::ConstBytes chrome_legacy_ipc() const { return at<27>().as_bytes(); }
7472   bool has_chrome_histogram_sample() const { return at<28>().valid(); }
7473   ::protozero::ConstBytes chrome_histogram_sample() const { return at<28>().as_bytes(); }
7474   bool has_chrome_latency_info() const { return at<29>().valid(); }
7475   ::protozero::ConstBytes chrome_latency_info() const { return at<29>().as_bytes(); }
7476   bool has_chrome_frame_reporter() const { return at<32>().valid(); }
7477   ::protozero::ConstBytes chrome_frame_reporter() const { return at<32>().as_bytes(); }
7478   bool has_timestamp_delta_us() const { return at<1>().valid(); }
7479   int64_t timestamp_delta_us() const { return at<1>().as_int64(); }
7480   bool has_timestamp_absolute_us() const { return at<16>().valid(); }
7481   int64_t timestamp_absolute_us() const { return at<16>().as_int64(); }
7482   bool has_thread_time_delta_us() const { return at<2>().valid(); }
7483   int64_t thread_time_delta_us() const { return at<2>().as_int64(); }
7484   bool has_thread_time_absolute_us() const { return at<17>().valid(); }
7485   int64_t thread_time_absolute_us() const { return at<17>().as_int64(); }
7486   bool has_thread_instruction_count_delta() const { return at<8>().valid(); }
7487   int64_t thread_instruction_count_delta() const { return at<8>().as_int64(); }
7488   bool has_thread_instruction_count_absolute() const { return at<20>().valid(); }
7489   int64_t thread_instruction_count_absolute() const { return at<20>().as_int64(); }
7490   bool has_legacy_event() const { return at<6>().valid(); }
7491   ::protozero::ConstBytes legacy_event() const { return at<6>().as_bytes(); }
7492 };
7493 
7494 class TrackEvent : public ::protozero::Message {
7495  public:
7496   using Decoder = TrackEvent_Decoder;
7497   enum : int32_t {
7498     kCategoryIidsFieldNumber = 3,
7499     kCategoriesFieldNumber = 22,
7500     kNameIidFieldNumber = 10,
7501     kNameFieldNumber = 23,
7502     kTypeFieldNumber = 9,
7503     kTrackUuidFieldNumber = 11,
7504     kCounterValueFieldNumber = 30,
7505     kExtraCounterTrackUuidsFieldNumber = 31,
7506     kExtraCounterValuesFieldNumber = 12,
7507     kDebugAnnotationsFieldNumber = 4,
7508     kTaskExecutionFieldNumber = 5,
7509     kLogMessageFieldNumber = 21,
7510     kCcSchedulerStateFieldNumber = 24,
7511     kChromeUserEventFieldNumber = 25,
7512     kChromeKeyedServiceFieldNumber = 26,
7513     kChromeLegacyIpcFieldNumber = 27,
7514     kChromeHistogramSampleFieldNumber = 28,
7515     kChromeLatencyInfoFieldNumber = 29,
7516     kChromeFrameReporterFieldNumber = 32,
7517     kTimestampDeltaUsFieldNumber = 1,
7518     kTimestampAbsoluteUsFieldNumber = 16,
7519     kThreadTimeDeltaUsFieldNumber = 2,
7520     kThreadTimeAbsoluteUsFieldNumber = 17,
7521     kThreadInstructionCountDeltaFieldNumber = 8,
7522     kThreadInstructionCountAbsoluteFieldNumber = 20,
7523     kLegacyEventFieldNumber = 6,
7524   };
7525   using LegacyEvent = ::perfetto::protos::pbzero::TrackEvent_LegacyEvent;
7526   using Type = ::perfetto::protos::pbzero::TrackEvent_Type;
7527   static const Type TYPE_UNSPECIFIED = TrackEvent_Type_TYPE_UNSPECIFIED;
7528   static const Type TYPE_SLICE_BEGIN = TrackEvent_Type_TYPE_SLICE_BEGIN;
7529   static const Type TYPE_SLICE_END = TrackEvent_Type_TYPE_SLICE_END;
7530   static const Type TYPE_INSTANT = TrackEvent_Type_TYPE_INSTANT;
7531   static const Type TYPE_COUNTER = TrackEvent_Type_TYPE_COUNTER;
7532   void add_category_iids(uint64_t value) {
7533     AppendVarInt(3, value);
7534   }
7535   void add_categories(const std::string& value) {
7536     AppendBytes(22, value.data(), value.size());
7537   }
7538   void add_categories(const char* data, size_t size) {
7539     AppendBytes(22, data, size);
7540   }
7541   void set_name_iid(uint64_t value) {
7542     AppendVarInt(10, value);
7543   }
7544   void set_name(const std::string& value) {
7545     AppendBytes(23, value.data(), value.size());
7546   }
7547   void set_name(const char* data, size_t size) {
7548     AppendBytes(23, data, size);
7549   }
7550   void set_type(::perfetto::protos::pbzero::TrackEvent_Type value) {
7551     AppendTinyVarInt(9, value);
7552   }
7553   void set_track_uuid(uint64_t value) {
7554     AppendVarInt(11, value);
7555   }
7556   void set_counter_value(int64_t value) {
7557     AppendVarInt(30, value);
7558   }
7559   void add_extra_counter_track_uuids(uint64_t value) {
7560     AppendVarInt(31, value);
7561   }
7562   void add_extra_counter_values(int64_t value) {
7563     AppendVarInt(12, value);
7564   }
7565   template <typename T = DebugAnnotation> T* add_debug_annotations() {
7566     return BeginNestedMessage<T>(4);
7567   }
7568 
7569   template <typename T = TaskExecution> T* set_task_execution() {
7570     return BeginNestedMessage<T>(5);
7571   }
7572 
7573   template <typename T = LogMessage> T* set_log_message() {
7574     return BeginNestedMessage<T>(21);
7575   }
7576 
7577   template <typename T = ChromeCompositorSchedulerState> T* set_cc_scheduler_state() {
7578     return BeginNestedMessage<T>(24);
7579   }
7580 
7581   template <typename T = ChromeUserEvent> T* set_chrome_user_event() {
7582     return BeginNestedMessage<T>(25);
7583   }
7584 
7585   template <typename T = ChromeKeyedService> T* set_chrome_keyed_service() {
7586     return BeginNestedMessage<T>(26);
7587   }
7588 
7589   template <typename T = ChromeLegacyIpc> T* set_chrome_legacy_ipc() {
7590     return BeginNestedMessage<T>(27);
7591   }
7592 
7593   template <typename T = ChromeHistogramSample> T* set_chrome_histogram_sample() {
7594     return BeginNestedMessage<T>(28);
7595   }
7596 
7597   template <typename T = ChromeLatencyInfo> T* set_chrome_latency_info() {
7598     return BeginNestedMessage<T>(29);
7599   }
7600 
7601   template <typename T = ChromeFrameReporter> T* set_chrome_frame_reporter() {
7602     return BeginNestedMessage<T>(32);
7603   }
7604 
7605   void set_timestamp_delta_us(int64_t value) {
7606     AppendVarInt(1, value);
7607   }
7608   void set_timestamp_absolute_us(int64_t value) {
7609     AppendVarInt(16, value);
7610   }
7611   void set_thread_time_delta_us(int64_t value) {
7612     AppendVarInt(2, value);
7613   }
7614   void set_thread_time_absolute_us(int64_t value) {
7615     AppendVarInt(17, value);
7616   }
7617   void set_thread_instruction_count_delta(int64_t value) {
7618     AppendVarInt(8, value);
7619   }
7620   void set_thread_instruction_count_absolute(int64_t value) {
7621     AppendVarInt(20, value);
7622   }
7623   template <typename T = TrackEvent_LegacyEvent> T* set_legacy_event() {
7624     return BeginNestedMessage<T>(6);
7625   }
7626 
7627 };
7628 
7629 class TrackEvent_LegacyEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/19, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
7630  public:
7631   TrackEvent_LegacyEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
7632   explicit TrackEvent_LegacyEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
7633   explicit TrackEvent_LegacyEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
7634   bool has_name_iid() const { return at<1>().valid(); }
7635   uint64_t name_iid() const { return at<1>().as_uint64(); }
7636   bool has_phase() const { return at<2>().valid(); }
7637   int32_t phase() const { return at<2>().as_int32(); }
7638   bool has_duration_us() const { return at<3>().valid(); }
7639   int64_t duration_us() const { return at<3>().as_int64(); }
7640   bool has_thread_duration_us() const { return at<4>().valid(); }
7641   int64_t thread_duration_us() const { return at<4>().as_int64(); }
7642   bool has_thread_instruction_delta() const { return at<15>().valid(); }
7643   int64_t thread_instruction_delta() const { return at<15>().as_int64(); }
7644   bool has_unscoped_id() const { return at<6>().valid(); }
7645   uint64_t unscoped_id() const { return at<6>().as_uint64(); }
7646   bool has_local_id() const { return at<10>().valid(); }
7647   uint64_t local_id() const { return at<10>().as_uint64(); }
7648   bool has_global_id() const { return at<11>().valid(); }
7649   uint64_t global_id() const { return at<11>().as_uint64(); }
7650   bool has_id_scope() const { return at<7>().valid(); }
7651   ::protozero::ConstChars id_scope() const { return at<7>().as_string(); }
7652   bool has_use_async_tts() const { return at<9>().valid(); }
7653   bool use_async_tts() const { return at<9>().as_bool(); }
7654   bool has_bind_id() const { return at<8>().valid(); }
7655   uint64_t bind_id() const { return at<8>().as_uint64(); }
7656   bool has_bind_to_enclosing() const { return at<12>().valid(); }
7657   bool bind_to_enclosing() const { return at<12>().as_bool(); }
7658   bool has_flow_direction() const { return at<13>().valid(); }
7659   int32_t flow_direction() const { return at<13>().as_int32(); }
7660   bool has_instant_event_scope() const { return at<14>().valid(); }
7661   int32_t instant_event_scope() const { return at<14>().as_int32(); }
7662   bool has_pid_override() const { return at<18>().valid(); }
7663   int32_t pid_override() const { return at<18>().as_int32(); }
7664   bool has_tid_override() const { return at<19>().valid(); }
7665   int32_t tid_override() const { return at<19>().as_int32(); }
7666 };
7667 
7668 class TrackEvent_LegacyEvent : public ::protozero::Message {
7669  public:
7670   using Decoder = TrackEvent_LegacyEvent_Decoder;
7671   enum : int32_t {
7672     kNameIidFieldNumber = 1,
7673     kPhaseFieldNumber = 2,
7674     kDurationUsFieldNumber = 3,
7675     kThreadDurationUsFieldNumber = 4,
7676     kThreadInstructionDeltaFieldNumber = 15,
7677     kUnscopedIdFieldNumber = 6,
7678     kLocalIdFieldNumber = 10,
7679     kGlobalIdFieldNumber = 11,
7680     kIdScopeFieldNumber = 7,
7681     kUseAsyncTtsFieldNumber = 9,
7682     kBindIdFieldNumber = 8,
7683     kBindToEnclosingFieldNumber = 12,
7684     kFlowDirectionFieldNumber = 13,
7685     kInstantEventScopeFieldNumber = 14,
7686     kPidOverrideFieldNumber = 18,
7687     kTidOverrideFieldNumber = 19,
7688   };
7689   using FlowDirection = ::perfetto::protos::pbzero::TrackEvent_LegacyEvent_FlowDirection;
7690   using InstantEventScope = ::perfetto::protos::pbzero::TrackEvent_LegacyEvent_InstantEventScope;
7691   static const FlowDirection FLOW_UNSPECIFIED = TrackEvent_LegacyEvent_FlowDirection_FLOW_UNSPECIFIED;
7692   static const FlowDirection FLOW_IN = TrackEvent_LegacyEvent_FlowDirection_FLOW_IN;
7693   static const FlowDirection FLOW_OUT = TrackEvent_LegacyEvent_FlowDirection_FLOW_OUT;
7694   static const FlowDirection FLOW_INOUT = TrackEvent_LegacyEvent_FlowDirection_FLOW_INOUT;
7695   static const InstantEventScope SCOPE_UNSPECIFIED = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_UNSPECIFIED;
7696   static const InstantEventScope SCOPE_GLOBAL = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_GLOBAL;
7697   static const InstantEventScope SCOPE_PROCESS = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_PROCESS;
7698   static const InstantEventScope SCOPE_THREAD = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_THREAD;
7699   void set_name_iid(uint64_t value) {
7700     AppendVarInt(1, value);
7701   }
7702   void set_phase(int32_t value) {
7703     AppendVarInt(2, value);
7704   }
7705   void set_duration_us(int64_t value) {
7706     AppendVarInt(3, value);
7707   }
7708   void set_thread_duration_us(int64_t value) {
7709     AppendVarInt(4, value);
7710   }
7711   void set_thread_instruction_delta(int64_t value) {
7712     AppendVarInt(15, value);
7713   }
7714   void set_unscoped_id(uint64_t value) {
7715     AppendVarInt(6, value);
7716   }
7717   void set_local_id(uint64_t value) {
7718     AppendVarInt(10, value);
7719   }
7720   void set_global_id(uint64_t value) {
7721     AppendVarInt(11, value);
7722   }
7723   void set_id_scope(const std::string& value) {
7724     AppendBytes(7, value.data(), value.size());
7725   }
7726   void set_id_scope(const char* data, size_t size) {
7727     AppendBytes(7, data, size);
7728   }
7729   void set_use_async_tts(bool value) {
7730     AppendTinyVarInt(9, value);
7731   }
7732   void set_bind_id(uint64_t value) {
7733     AppendVarInt(8, value);
7734   }
7735   void set_bind_to_enclosing(bool value) {
7736     AppendTinyVarInt(12, value);
7737   }
7738   void set_flow_direction(::perfetto::protos::pbzero::TrackEvent_LegacyEvent_FlowDirection value) {
7739     AppendTinyVarInt(13, value);
7740   }
7741   void set_instant_event_scope(::perfetto::protos::pbzero::TrackEvent_LegacyEvent_InstantEventScope value) {
7742     AppendTinyVarInt(14, value);
7743   }
7744   void set_pid_override(int32_t value) {
7745     AppendVarInt(18, value);
7746   }
7747   void set_tid_override(int32_t value) {
7748     AppendVarInt(19, value);
7749   }
7750 };
7751 
7752 } // Namespace.
7753 } // Namespace.
7754 } // Namespace.
7755 #endif  // Include guard.
7756 /*
7757  * Copyright (C) 2019 The Android Open Source Project
7758  *
7759  * Licensed under the Apache License, Version 2.0 (the "License");
7760  * you may not use this file except in compliance with the License.
7761  * You may obtain a copy of the License at
7762  *
7763  *      http://www.apache.org/licenses/LICENSE-2.0
7764  *
7765  * Unless required by applicable law or agreed to in writing, software
7766  * distributed under the License is distributed on an "AS IS" BASIS,
7767  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7768  * See the License for the specific language governing permissions and
7769  * limitations under the License.
7770  */
7771 
7772 #ifndef INCLUDE_PERFETTO_TRACING_INTERNAL_TRACK_EVENT_INTERNAL_H_
7773 #define INCLUDE_PERFETTO_TRACING_INTERNAL_TRACK_EVENT_INTERNAL_H_
7774 
7775 // gen_amalgamated expanded: #include "perfetto/base/flat_set.h"
7776 // gen_amalgamated expanded: #include "perfetto/protozero/scattered_heap_buffer.h"
7777 // gen_amalgamated expanded: #include "perfetto/tracing/core/forward_decls.h"
7778 // gen_amalgamated expanded: #include "perfetto/tracing/debug_annotation.h"
7779 // gen_amalgamated expanded: #include "perfetto/tracing/trace_writer_base.h"
7780 // gen_amalgamated expanded: #include "perfetto/tracing/track.h"
7781 // gen_amalgamated expanded: #include "protos/perfetto/common/builtin_clock.pbzero.h"
7782 // gen_amalgamated expanded: #include "protos/perfetto/trace/interned_data/interned_data.pbzero.h"
7783 // gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/track_event.pbzero.h"
7784 
7785 #include <unordered_map>
7786 
7787 namespace perfetto {
7788 class EventContext;
7789 struct Category;
7790 namespace protos {
7791 namespace gen {
7792 class TrackEventConfig;
7793 }  // namespace gen
7794 namespace pbzero {
7795 class DebugAnnotation;
7796 }  // namespace pbzero
7797 }  // namespace protos
7798 
7799 namespace internal {
7800 class TrackEventCategoryRegistry;
7801 
7802 class BaseTrackEventInternedDataIndex {
7803  public:
7804   virtual ~BaseTrackEventInternedDataIndex();
7805 
7806 #if PERFETTO_DCHECK_IS_ON()
7807   const char* type_id_ = nullptr;
7808 #endif  // PERFETTO_DCHECK_IS_ON()
7809 };
7810 
7811 struct TrackEventIncrementalState {
7812   static constexpr size_t kMaxInternedDataFields = 32;
7813 
7814   bool was_cleared = true;
7815 
7816   // A heap-allocated message for storing newly seen interned data while we are
7817   // in the middle of writing a track event. When a track event wants to write
7818   // new interned data into the trace, it is first serialized into this message
7819   // and then flushed to the real trace in EventContext when the packet ends.
7820   // The message is cached here as a part of incremental state so that we can
7821   // reuse the underlying buffer allocation for subsequently written interned
7822   // data.
7823   protozero::HeapBuffered<protos::pbzero::InternedData>
7824       serialized_interned_data;
7825 
7826   // In-memory indices for looking up interned data ids.
7827   // For each intern-able field (up to a max of 32) we keep a dictionary of
7828   // field-value -> interning-key. Depending on the type we either keep the full
7829   // value or a hash of it (See track_event_interned_data_index.h)
7830   using InternedDataIndex =
7831       std::pair</* interned_data.proto field number */ size_t,
7832                 std::unique_ptr<BaseTrackEventInternedDataIndex>>;
7833   std::array<InternedDataIndex, kMaxInternedDataFields> interned_data_indices =
7834       {};
7835 
7836   // Track uuids for which we have written descriptors into the trace. If a
7837   // trace event uses a track which is not in this set, we'll write out a
7838   // descriptor for it.
7839   base::FlatSet<uint64_t> seen_tracks;
7840 
7841   // Dynamically registered category names that have been encountered during
7842   // this tracing session. The value in the map indicates whether the category
7843   // is enabled or disabled.
7844   std::unordered_map<std::string, bool> dynamic_categories;
7845 };
7846 
7847 // The backend portion of the track event trace point implemention. Outlined to
7848 // a separate .cc file so it can be shared by different track event category
7849 // namespaces.
7850 class PERFETTO_EXPORT TrackEventInternal {
7851  public:
7852   static bool Initialize(
7853       const TrackEventCategoryRegistry&,
7854       bool (*register_data_source)(const DataSourceDescriptor&));
7855 
7856   static void EnableTracing(const TrackEventCategoryRegistry& registry,
7857                             const protos::gen::TrackEventConfig& config,
7858                             uint32_t instance_index);
7859   static void DisableTracing(const TrackEventCategoryRegistry& registry,
7860                              uint32_t instance_index);
7861   static bool IsCategoryEnabled(const TrackEventCategoryRegistry& registry,
7862                                 const protos::gen::TrackEventConfig& config,
7863                                 const Category& category);
7864 
7865   static perfetto::EventContext WriteEvent(
7866       TraceWriterBase*,
7867       TrackEventIncrementalState*,
7868       const Category* category,
7869       const char* name,
7870       perfetto::protos::pbzero::TrackEvent::Type,
7871       uint64_t timestamp = GetTimeNs());
7872 
7873   template <typename T>
7874   static void AddDebugAnnotation(perfetto::EventContext* event_ctx,
7875                                  const char* name,
7876                                  T&& value) {
7877     auto annotation = AddDebugAnnotation(event_ctx, name);
7878     WriteDebugAnnotation(annotation, value);
7879   }
7880 
7881   // If the given track hasn't been seen by the trace writer yet, write a
7882   // descriptor for it into the trace. Doesn't take a lock unless the track
7883   // descriptor is new.
7884   template <typename TrackType>
7885   static void WriteTrackDescriptorIfNeeded(
7886       const TrackType& track,
7887       TraceWriterBase* trace_writer,
7888       TrackEventIncrementalState* incr_state) {
7889     auto it_and_inserted = incr_state->seen_tracks.insert(track.uuid);
7890     if (PERFETTO_LIKELY(!it_and_inserted.second))
7891       return;
7892     WriteTrackDescriptor(track, trace_writer);
7893   }
7894 
7895   // Unconditionally write a track descriptor into the trace.
7896   template <typename TrackType>
7897   static void WriteTrackDescriptor(const TrackType& track,
7898                                    TraceWriterBase* trace_writer) {
7899     TrackRegistry::Get()->SerializeTrack(
7900         track, NewTracePacket(trace_writer, GetTimeNs()));
7901   }
7902 
7903   // Get the current time in nanoseconds in the trace clock timebase.
7904   static uint64_t GetTimeNs();
7905 
7906   // Get the clock used by GetTimeNs().
7907   static constexpr protos::pbzero::BuiltinClock GetClockId() {
7908 #if !PERFETTO_BUILDFLAG(PERFETTO_OS_APPLE) && \
7909     !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
7910     return protos::pbzero::BUILTIN_CLOCK_BOOTTIME;
7911 #else
7912     return protos::pbzero::BUILTIN_CLOCK_MONOTONIC;
7913 #endif
7914   }
7915 
7916  private:
7917   static void ResetIncrementalState(TraceWriterBase*, uint64_t timestamp);
7918   static protozero::MessageHandle<protos::pbzero::TracePacket> NewTracePacket(
7919       TraceWriterBase*,
7920       uint64_t timestamp,
7921       uint32_t seq_flags =
7922           protos::pbzero::TracePacket::SEQ_NEEDS_INCREMENTAL_STATE);
7923   static protos::pbzero::DebugAnnotation* AddDebugAnnotation(
7924       perfetto::EventContext*,
7925       const char* name);
7926 };
7927 
7928 }  // namespace internal
7929 }  // namespace perfetto
7930 
7931 #endif  // INCLUDE_PERFETTO_TRACING_INTERNAL_TRACK_EVENT_INTERNAL_H_
7932 /*
7933  * Copyright (C) 2019 The Android Open Source Project
7934  *
7935  * Licensed under the Apache License, Version 2.0 (the "License");
7936  * you may not use this file except in compliance with the License.
7937  * You may obtain a copy of the License at
7938  *
7939  *      http://www.apache.org/licenses/LICENSE-2.0
7940  *
7941  * Unless required by applicable law or agreed to in writing, software
7942  * distributed under the License is distributed on an "AS IS" BASIS,
7943  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7944  * See the License for the specific language governing permissions and
7945  * limitations under the License.
7946  */
7947 
7948 #ifndef INCLUDE_PERFETTO_TRACING_EVENT_CONTEXT_H_
7949 #define INCLUDE_PERFETTO_TRACING_EVENT_CONTEXT_H_
7950 
7951 // gen_amalgamated expanded: #include "perfetto/protozero/message_handle.h"
7952 // gen_amalgamated expanded: #include "perfetto/tracing/internal/track_event_internal.h"
7953 // gen_amalgamated expanded: #include "protos/perfetto/trace/trace_packet.pbzero.h"
7954 
7955 namespace perfetto {
7956 namespace internal {
7957 class TrackEventInternal;
7958 }
7959 
7960 // Allows adding custom arguments into track events. Example:
7961 //
7962 //   TRACE_EVENT_BEGIN("category", "Title",
7963 //                     [](perfetto::EventContext ctx) {
7964 //                       auto* dbg = ctx.event()->add_debug_annotations();
7965 //                       dbg->set_name("name");
7966 //                       dbg->set_int_value(1234);
7967 //                     });
7968 //
7969 class PERFETTO_EXPORT EventContext {
7970  public:
7971   EventContext(EventContext&&) = default;
7972 
7973   // For Chromium during the transition phase to the client library.
7974   // TODO(eseckler): Remove once Chromium has switched to client lib entirely.
7975   explicit EventContext(protos::pbzero::TrackEvent* event)
7976       : event_(event), incremental_state_(nullptr) {}
7977 
7978   ~EventContext();
7979 
7980   protos::pbzero::TrackEvent* event() const { return event_; }
7981 
7982  private:
7983   template <typename, size_t, typename, typename>
7984   friend class TrackEventInternedDataIndex;
7985   friend class internal::TrackEventInternal;
7986 
7987   using TracePacketHandle =
7988       ::protozero::MessageHandle<protos::pbzero::TracePacket>;
7989 
7990   EventContext(TracePacketHandle, internal::TrackEventIncrementalState*);
7991   EventContext(const EventContext&) = delete;
7992 
7993   TracePacketHandle trace_packet_;
7994   protos::pbzero::TrackEvent* event_;
7995   internal::TrackEventIncrementalState* incremental_state_;
7996 };
7997 
7998 }  // namespace perfetto
7999 
8000 #endif  // INCLUDE_PERFETTO_TRACING_EVENT_CONTEXT_H_
8001 // gen_amalgamated begin header: include/perfetto/tracing/track_event_category_registry.h
8002 /*
8003  * Copyright (C) 2019 The Android Open Source Project
8004  *
8005  * Licensed under the Apache License, Version 2.0 (the "License");
8006  * you may not use this file except in compliance with the License.
8007  * You may obtain a copy of the License at
8008  *
8009  *      http://www.apache.org/licenses/LICENSE-2.0
8010  *
8011  * Unless required by applicable law or agreed to in writing, software
8012  * distributed under the License is distributed on an "AS IS" BASIS,
8013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8014  * See the License for the specific language governing permissions and
8015  * limitations under the License.
8016  */
8017 
8018 #ifndef INCLUDE_PERFETTO_TRACING_TRACK_EVENT_CATEGORY_REGISTRY_H_
8019 #define INCLUDE_PERFETTO_TRACING_TRACK_EVENT_CATEGORY_REGISTRY_H_
8020 
8021 // gen_amalgamated expanded: #include "perfetto/tracing/data_source.h"
8022 
8023 #include <stddef.h>
8024 
8025 #include <atomic>
8026 #include <utility>
8027 
8028 namespace perfetto {
8029 class DynamicCategory;
8030 
8031 // A compile-time representation of a track event category. See
8032 // PERFETTO_DEFINE_CATEGORIES for registering your own categories.
8033 struct PERFETTO_EXPORT Category {
8034   using Tags = std::array<const char*, 4>;
8035 
8036   const char* const name = nullptr;
8037   const char* const description = nullptr;
8038   const Tags tags = {};
8039 
8040   constexpr Category(const Category&) = default;
8041   constexpr explicit Category(const char* name_)
8042       : name(CheckIsValidCategory(name_)),
8043         name_sizes_(ComputeNameSizes(name_)) {}
8044 
8045   constexpr Category SetDescription(const char* description_) const {
8046     return Category(name, description_, tags, name_sizes_);
8047   }
8048 
8049   template <typename... Args>
8050   constexpr Category SetTags(Args&&... args) const {
8051     return Category(name, description, {std::forward<Args>(args)...},
8052                     name_sizes_);
8053   }
8054 
8055   // A comma separated list of multiple categories to be used in a single trace
8056   // point.
8057   static constexpr Category Group(const char* names) {
8058     return Category(names, AllowGroup{});
8059   }
8060 
8061   // Used for parsing dynamic category groups. Note that |name| and
8062   // |DynamicCategory| must outlive the returned object because the category
8063   // name isn't copied.
8064   static Category FromDynamicCategory(const char* name);
8065   static Category FromDynamicCategory(const DynamicCategory&);
8066 
8067   constexpr bool IsGroup() const { return GetNameSize(1) > 0; }
8068 
8069   // Returns the number of character in the category name. Not valid for
8070   // category groups.
8071   size_t name_size() const {
8072     PERFETTO_DCHECK(!IsGroup());
8073     return GetNameSize(0);
8074   }
8075 
8076   // Iterates over all the members of this category group, or just the name of
8077   // the category itself if this isn't a category group. Return false from
8078   // |callback| to stop iteration.
8079   template <typename T>
8080   void ForEachGroupMember(T callback) const {
8081     const char* name_ptr = name;
8082     size_t i = 0;
8083     while (size_t name_size = GetNameSize(i++)) {
8084       if (!callback(name_ptr, name_size))
8085         break;
8086       name_ptr += name_size + 1;
8087     }
8088   }
8089 
8090  private:
8091   static constexpr size_t kMaxGroupSize = 4;
8092   using NameSizes = std::array<uint8_t, kMaxGroupSize>;
8093 
8094   constexpr Category(const char* name_,
8095                      const char* description_,
8096                      Tags tags_,
8097                      NameSizes name_sizes)
8098       : name(name_),
8099         description(description_),
8100         tags(tags_),
8101         name_sizes_(name_sizes) {}
8102 
8103   enum AllowGroup {};
8104   constexpr Category(const char* name_, AllowGroup)
8105       : name(CheckIsValidCategoryGroup(name_)),
8106         name_sizes_(ComputeNameSizes(name_)) {}
8107 
8108   constexpr size_t GetNameSize(size_t i) const {
8109     return i < name_sizes_.size() ? name_sizes_[i] : 0;
8110   }
8111 
8112   static constexpr NameSizes ComputeNameSizes(const char* s) {
8113     static_assert(kMaxGroupSize == 4, "Unexpected maximum category group size");
8114     return NameSizes{{static_cast<uint8_t>(GetNthNameSize(0, s, s)),
8115                       static_cast<uint8_t>(GetNthNameSize(1, s, s)),
8116                       static_cast<uint8_t>(GetNthNameSize(2, s, s)),
8117                       static_cast<uint8_t>(GetNthNameSize(3, s, s))}};
8118   }
8119 
8120   static constexpr ptrdiff_t GetNthNameSize(int n,
8121                                             const char* start,
8122                                             const char* end,
8123                                             int counter = 0) {
8124     return (!*end || *end == ',')
8125                ? ((!*end || counter == n)
8126                       ? (counter == n ? end - start : 0)
8127                       : GetNthNameSize(n, end + 1, end + 1, counter + 1))
8128                : GetNthNameSize(n, start, end + 1, counter);
8129   }
8130 
8131   static constexpr const char* CheckIsValidCategory(const char* n) {
8132     // We just replace invalid input with a nullptr here; it will trigger a
8133     // static assert in TrackEventCategoryRegistry::ValidateCategories().
8134     return GetNthNameSize(1, n, n) ? nullptr : n;
8135   }
8136 
8137   static constexpr const char* CheckIsValidCategoryGroup(const char* n) {
8138     // Same as above: replace invalid input with nullptr.
8139     return !GetNthNameSize(1, n, n) || GetNthNameSize(kMaxGroupSize, n, n)
8140                ? nullptr
8141                : n;
8142   }
8143 
8144   // An array of lengths of the different names associated with this category.
8145   // If this category doesn't represent a group of multiple categories, only the
8146   // first element is non-zero.
8147   const NameSizes name_sizes_ = {};
8148 };
8149 
8150 // Dynamically constructed category names should marked as such through this
8151 // container type to make it less likely for trace points to accidentally start
8152 // using dynamic categories. Events with dynamic categories will always be
8153 // slightly more expensive than regular events, so use them sparingly.
8154 class PERFETTO_EXPORT DynamicCategory final {
8155  public:
8156   explicit DynamicCategory(const std::string& name_) : name(name_) {}
8157   explicit DynamicCategory(const char* name_) : name(name_) {}
8158   DynamicCategory() {}
8159   ~DynamicCategory() = default;
8160 
8161   const std::string name;
8162 };
8163 
8164 namespace internal {
8165 
8166 constexpr const char* NullCategory(const char*) {
8167   return nullptr;
8168 }
8169 
8170 perfetto::DynamicCategory NullCategory(const perfetto::DynamicCategory&);
8171 
8172 constexpr bool StringMatchesPrefix(const char* str, const char* prefix) {
8173   return !*str ? !*prefix
8174                : !*prefix ? true
8175                           : *str != *prefix
8176                                 ? false
8177                                 : StringMatchesPrefix(str + 1, prefix + 1);
8178 }
8179 
8180 constexpr bool IsStringInPrefixList(const char*) {
8181   return false;
8182 }
8183 
8184 template <typename... Args>
8185 constexpr bool IsStringInPrefixList(const char* str,
8186                                     const char* prefix,
8187                                     Args... args) {
8188   return StringMatchesPrefix(str, prefix) ||
8189          IsStringInPrefixList(str, std::forward<Args>(args)...);
8190 }
8191 
8192 // Holds all the registered categories for one category namespace. See
8193 // PERFETTO_DEFINE_CATEGORIES for building the registry.
8194 class PERFETTO_EXPORT TrackEventCategoryRegistry {
8195  public:
8196   constexpr TrackEventCategoryRegistry(size_t category_count,
8197                                        const Category* categories,
8198                                        std::atomic<uint8_t>* state_storage)
8199       : categories_(categories),
8200         category_count_(category_count),
8201         state_storage_(state_storage) {
8202     static_assert(
8203         sizeof(state_storage[0].load()) * 8 >= kMaxDataSourceInstances,
8204         "The category state must have enough bits for all possible data source "
8205         "instances");
8206   }
8207 
8208   size_t category_count() const { return category_count_; }
8209 
8210   // Returns a category based on its index.
8211   const Category* GetCategory(size_t index) const;
8212 
8213   // Turn tracing on or off for the given category in a track event data source
8214   // instance.
8215   void EnableCategoryForInstance(size_t category_index,
8216                                  uint32_t instance_index) const;
8217   void DisableCategoryForInstance(size_t category_index,
8218                                   uint32_t instance_index) const;
8219 
8220   constexpr std::atomic<uint8_t>* GetCategoryState(
8221       size_t category_index) const {
8222     return &state_storage_[category_index];
8223   }
8224 
8225   // --------------------------------------------------------------------------
8226   // Trace point support
8227   // --------------------------------------------------------------------------
8228   //
8229   // (The following methods are used by the track event trace point
8230   // implementation and typically don't need to be called by other code.)
8231 
8232   // At compile time, turn a category name into an index into the registry.
8233   // Returns kInvalidCategoryIndex if the category was not found, or
8234   // kDynamicCategoryIndex if |is_dynamic| is true or a DynamicCategory was
8235   // passed in.
8236   static constexpr size_t kInvalidCategoryIndex = static_cast<size_t>(-1);
8237   static constexpr size_t kDynamicCategoryIndex = static_cast<size_t>(-2);
8238   constexpr size_t Find(const char* name, bool is_dynamic) const {
8239     return CheckIsValidCategoryIndex(FindImpl(name, is_dynamic));
8240   }
8241 
8242   constexpr size_t Find(const DynamicCategory&, bool) const {
8243     return kDynamicCategoryIndex;
8244   }
8245 
8246   constexpr bool ValidateCategories(size_t index = 0) const {
8247     return (index == category_count_)
8248                ? true
8249                : IsValidCategoryName(categories_[index].name)
8250                      ? ValidateCategories(index + 1)
8251                      : false;
8252   }
8253 
8254  private:
8255   // TODO(skyostil): Make the compile-time routines nicer with C++14.
8256   constexpr size_t FindImpl(const char* name,
8257                             bool is_dynamic,
8258                             size_t index = 0) const {
8259     return is_dynamic ? kDynamicCategoryIndex
8260                       : (index == category_count_)
8261                             ? kInvalidCategoryIndex
8262                             : StringEq(categories_[index].name, name)
8263                                   ? index
8264                                   : FindImpl(name, false, index + 1);
8265   }
8266 
8267   // A compile time helper for checking that a category index is valid.
8268   static constexpr size_t CheckIsValidCategoryIndex(size_t index) {
8269     // Relies on PERFETTO_CHECK() (and the surrounding lambda) being a
8270     // non-constexpr function, which will fail the build if the given |index| is
8271     // invalid. The funny formatting here is so that clang shows the comment
8272     // below as part of the error message.
8273     // clang-format off
8274     return index != kInvalidCategoryIndex ? index : \
8275         /* Invalid category -- add it to PERFETTO_DEFINE_CATEGORIES(). */ [] {
8276         PERFETTO_CHECK(
8277             false &&
8278             "A track event used an unknown category. Please add it to "
8279             "PERFETTO_DEFINE_CATEGORIES().");
8280         return kInvalidCategoryIndex;
8281       }();
8282     // clang-format on
8283   }
8284 
8285   static constexpr bool IsValidCategoryName(const char* name) {
8286     return (!name || *name == '\"' || *name == '*' || *name == ' ')
8287                ? false
8288                : *name ? IsValidCategoryName(name + 1) : true;
8289   }
8290 
8291   static constexpr bool StringEq(const char* a, const char* b) {
8292     return *a != *b ? false
8293                     : (!*a || !*b) ? (*a == *b) : StringEq(a + 1, b + 1);
8294   }
8295 
8296   const Category* const categories_;
8297   const size_t category_count_;
8298   std::atomic<uint8_t>* const state_storage_;
8299 };
8300 
8301 }  // namespace internal
8302 }  // namespace perfetto
8303 
8304 #endif  // INCLUDE_PERFETTO_TRACING_TRACK_EVENT_CATEGORY_REGISTRY_H_
8305 // gen_amalgamated begin header: gen/protos/perfetto/config/track_event/track_event_config.gen.h
8306 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
8307 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TRACK_EVENT_TRACK_EVENT_CONFIG_PROTO_CPP_H_
8308 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TRACK_EVENT_TRACK_EVENT_CONFIG_PROTO_CPP_H_
8309 
8310 #include <stdint.h>
8311 #include <bitset>
8312 #include <vector>
8313 #include <string>
8314 #include <type_traits>
8315 
8316 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
8317 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
8318 // gen_amalgamated expanded: #include "perfetto/base/export.h"
8319 
8320 namespace perfetto {
8321 namespace protos {
8322 namespace gen {
8323 class TrackEventConfig;
8324 }  // namespace perfetto
8325 }  // namespace protos
8326 }  // namespace gen
8327 
8328 namespace protozero {
8329 class Message;
8330 }  // namespace protozero
8331 
8332 namespace perfetto {
8333 namespace protos {
8334 namespace gen {
8335 
8336 class PERFETTO_EXPORT TrackEventConfig : public ::protozero::CppMessageObj {
8337  public:
8338   enum FieldNumbers {
8339     kDisabledCategoriesFieldNumber = 1,
8340     kEnabledCategoriesFieldNumber = 2,
8341     kDisabledTagsFieldNumber = 3,
8342     kEnabledTagsFieldNumber = 4,
8343   };
8344 
8345   TrackEventConfig();
8346   ~TrackEventConfig() override;
8347   TrackEventConfig(TrackEventConfig&&) noexcept;
8348   TrackEventConfig& operator=(TrackEventConfig&&);
8349   TrackEventConfig(const TrackEventConfig&);
8350   TrackEventConfig& operator=(const TrackEventConfig&);
8351   bool operator==(const TrackEventConfig&) const;
8352   bool operator!=(const TrackEventConfig& other) const { return !(*this == other); }
8353 
8354   bool ParseFromArray(const void*, size_t) override;
8355   std::string SerializeAsString() const override;
8356   std::vector<uint8_t> SerializeAsArray() const override;
8357   void Serialize(::protozero::Message*) const;
8358 
8359   int disabled_categories_size() const { return static_cast<int>(disabled_categories_.size()); }
8360   const std::vector<std::string>& disabled_categories() const { return disabled_categories_; }
8361   std::vector<std::string>* mutable_disabled_categories() { return &disabled_categories_; }
8362   void clear_disabled_categories() { disabled_categories_.clear(); }
8363   void add_disabled_categories(std::string value) { disabled_categories_.emplace_back(value); }
8364   std::string* add_disabled_categories() { disabled_categories_.emplace_back(); return &disabled_categories_.back(); }
8365 
8366   int enabled_categories_size() const { return static_cast<int>(enabled_categories_.size()); }
8367   const std::vector<std::string>& enabled_categories() const { return enabled_categories_; }
8368   std::vector<std::string>* mutable_enabled_categories() { return &enabled_categories_; }
8369   void clear_enabled_categories() { enabled_categories_.clear(); }
8370   void add_enabled_categories(std::string value) { enabled_categories_.emplace_back(value); }
8371   std::string* add_enabled_categories() { enabled_categories_.emplace_back(); return &enabled_categories_.back(); }
8372 
8373   int disabled_tags_size() const { return static_cast<int>(disabled_tags_.size()); }
8374   const std::vector<std::string>& disabled_tags() const { return disabled_tags_; }
8375   std::vector<std::string>* mutable_disabled_tags() { return &disabled_tags_; }
8376   void clear_disabled_tags() { disabled_tags_.clear(); }
8377   void add_disabled_tags(std::string value) { disabled_tags_.emplace_back(value); }
8378   std::string* add_disabled_tags() { disabled_tags_.emplace_back(); return &disabled_tags_.back(); }
8379 
8380   int enabled_tags_size() const { return static_cast<int>(enabled_tags_.size()); }
8381   const std::vector<std::string>& enabled_tags() const { return enabled_tags_; }
8382   std::vector<std::string>* mutable_enabled_tags() { return &enabled_tags_; }
8383   void clear_enabled_tags() { enabled_tags_.clear(); }
8384   void add_enabled_tags(std::string value) { enabled_tags_.emplace_back(value); }
8385   std::string* add_enabled_tags() { enabled_tags_.emplace_back(); return &enabled_tags_.back(); }
8386 
8387  private:
8388   std::vector<std::string> disabled_categories_;
8389   std::vector<std::string> enabled_categories_;
8390   std::vector<std::string> disabled_tags_;
8391   std::vector<std::string> enabled_tags_;
8392 
8393   // Allows to preserve unknown protobuf fields for compatibility
8394   // with future versions of .proto files.
8395   std::string unknown_fields_;
8396 
8397   std::bitset<5> _has_field_{};
8398 };
8399 
8400 }  // namespace perfetto
8401 }  // namespace protos
8402 }  // namespace gen
8403 
8404 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TRACK_EVENT_TRACK_EVENT_CONFIG_PROTO_CPP_H_
8405 /*
8406  * Copyright (C) 2019 The Android Open Source Project
8407  *
8408  * Licensed under the Apache License, Version 2.0 (the "License");
8409  * you may not use this file except in compliance with the License.
8410  * You may obtain a copy of the License at
8411  *
8412  *      http://www.apache.org/licenses/LICENSE-2.0
8413  *
8414  * Unless required by applicable law or agreed to in writing, software
8415  * distributed under the License is distributed on an "AS IS" BASIS,
8416  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8417  * See the License for the specific language governing permissions and
8418  * limitations under the License.
8419  */
8420 
8421 #ifndef INCLUDE_PERFETTO_TRACING_INTERNAL_TRACK_EVENT_DATA_SOURCE_H_
8422 #define INCLUDE_PERFETTO_TRACING_INTERNAL_TRACK_EVENT_DATA_SOURCE_H_
8423 
8424 // gen_amalgamated expanded: #include "perfetto/base/compiler.h"
8425 // gen_amalgamated expanded: #include "perfetto/protozero/message_handle.h"
8426 // gen_amalgamated expanded: #include "perfetto/tracing/core/data_source_config.h"
8427 // gen_amalgamated expanded: #include "perfetto/tracing/data_source.h"
8428 // gen_amalgamated expanded: #include "perfetto/tracing/event_context.h"
8429 // gen_amalgamated expanded: #include "perfetto/tracing/internal/track_event_internal.h"
8430 // gen_amalgamated expanded: #include "perfetto/tracing/track.h"
8431 // gen_amalgamated expanded: #include "perfetto/tracing/track_event_category_registry.h"
8432 // gen_amalgamated expanded: #include "protos/perfetto/common/builtin_clock.pbzero.h"
8433 // gen_amalgamated expanded: #include "protos/perfetto/config/track_event/track_event_config.gen.h"
8434 // gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/track_event.pbzero.h"
8435 
8436 #include <type_traits>
8437 
8438 namespace perfetto {
8439 namespace internal {
8440 namespace {
8441 
8442 // A template helper for determining whether a type can be used as a track event
8443 // lambda, i.e., it has the signature "void(EventContext)". This is achieved by
8444 // checking that we can pass an EventContext value (the inner declval) into a T
8445 // instance (the outer declval). If this is a valid expression, the result
8446 // evaluates to sizeof(0), i.e., true.
8447 // TODO(skyostil): Replace this with std::is_convertible<std::function<...>>
8448 // once we have C++14.
8449 template <typename T>
8450 static constexpr bool IsValidTraceLambdaImpl(
8451     typename std::enable_if<static_cast<bool>(
8452         sizeof(std::declval<T>()(std::declval<EventContext>()), 0))>::type* =
8453         nullptr) {
8454   return true;
8455 }
8456 
8457 template <typename T>
8458 static constexpr bool IsValidTraceLambdaImpl(...) {
8459   return false;
8460 }
8461 
8462 template <typename T>
8463 static constexpr bool IsValidTraceLambda() {
8464   return IsValidTraceLambdaImpl<T>(nullptr);
8465 }
8466 
8467 }  // namespace
8468 
8469 struct TrackEventDataSourceTraits : public perfetto::DefaultDataSourceTraits {
8470   using IncrementalStateType = TrackEventIncrementalState;
8471 
8472   // Use a one shared TLS slot so that all track event data sources write into
8473   // the same sequence and share interning dictionaries.
8474   static DataSourceThreadLocalState* GetDataSourceTLS(DataSourceStaticState*,
8475                                                       TracingTLS* root_tls) {
8476     return &root_tls->track_event_tls;
8477   }
8478 };
8479 
8480 // A helper that ensures movable debug annotations are passed by value to
8481 // minimize binary size at the call site, while allowing non-movable and
8482 // non-copiable arguments to be passed by reference.
8483 // TODO(skyostil): Remove this with C++17.
8484 template <typename T>
8485 struct DebugAnnotationArg {
8486   using type = typename std::
8487       conditional<std::is_move_constructible<T>::value, T, T&&>::type;
8488 };
8489 
8490 // A generic track event data source which is instantiated once per track event
8491 // category namespace.
8492 template <typename DataSourceType, const TrackEventCategoryRegistry* Registry>
8493 class TrackEventDataSource
8494     : public DataSource<DataSourceType, TrackEventDataSourceTraits> {
8495   using Base = DataSource<DataSourceType, TrackEventDataSourceTraits>;
8496 
8497  public:
8498   // DataSource implementation.
8499   void OnSetup(const DataSourceBase::SetupArgs& args) override {
8500     auto config_raw = args.config->track_event_config_raw();
8501     bool ok = config_.ParseFromArray(config_raw.data(), config_raw.size());
8502     PERFETTO_DCHECK(ok);
8503     TrackEventInternal::EnableTracing(*Registry, config_,
8504                                       args.internal_instance_index);
8505   }
8506 
8507   void OnStart(const DataSourceBase::StartArgs&) override {}
8508 
8509   void OnStop(const DataSourceBase::StopArgs& args) override {
8510     TrackEventInternal::DisableTracing(*Registry, args.internal_instance_index);
8511   }
8512 
8513   static void Flush() {
8514     Base::template Trace([](typename Base::TraceContext ctx) { ctx.Flush(); });
8515   }
8516 
8517   // Determine if tracing for the given static category is enabled.
8518   template <size_t CategoryIndex>
8519   static bool IsCategoryEnabled() {
8520     return Registry->GetCategoryState(CategoryIndex)
8521         ->load(std::memory_order_relaxed);
8522   }
8523 
8524   // Determine if tracing for the given dynamic category is enabled.
8525   static bool IsDynamicCategoryEnabled(
8526       const DynamicCategory& dynamic_category) {
8527     bool enabled = false;
8528     Base::template Trace([&](typename Base::TraceContext ctx) {
8529       enabled = IsDynamicCategoryEnabled(&ctx, dynamic_category);
8530     });
8531     return enabled;
8532   }
8533 
8534   // This is the inlined entrypoint for all track event trace points. It tries
8535   // to be as lightweight as possible in terms of instructions and aims to
8536   // compile down to an unlikely conditional jump to the actual trace writing
8537   // function.
8538   template <size_t CategoryIndex, typename Callback>
8539   static void CallIfCategoryEnabled(Callback callback) PERFETTO_ALWAYS_INLINE {
8540     Base::template CallIfEnabled<CategoryTracePointTraits<CategoryIndex>>(
8541         [&callback](uint32_t instances) { callback(instances); });
8542   }
8543 
8544   // Once we've determined tracing to be enabled for this category, actually
8545   // write a trace event onto this thread's default track. Outlined to avoid
8546   // bloating code (mostly stack depth) at the actual trace point.
8547   //
8548   // To minimize call overhead at each trace point, we provide the following
8549   // trace point argument variants:
8550   //
8551   // - None
8552   // - Lambda
8553   // - Lambda + timestamp
8554   // - One debug annotation
8555   // - Two debug annotations
8556   // - Track
8557   // - Track + Lambda
8558   // - Track + timestamp
8559   // - Track + Lambda + timestamp
8560   // - Track + one debug annotation
8561   // - Track + two debug annotations
8562 
8563   // Trace point which takes no arguments.
8564   template <size_t CategoryIndex, typename CategoryType>
8565   static void TraceForCategory(uint32_t instances,
8566                                const CategoryType& dynamic_category,
8567                                const char* event_name,
8568                                perfetto::protos::pbzero::TrackEvent::Type type)
8569       PERFETTO_NO_INLINE {
8570     TraceForCategoryImpl<CategoryIndex>(instances, dynamic_category, event_name,
8571                                         type);
8572   }
8573 
8574   // Trace point which takes a lambda function argument.
8575   template <size_t CategoryIndex,
8576             typename CategoryType,
8577             typename ArgumentFunction = void (*)(EventContext),
8578             typename ArgumentFunctionCheck = typename std::enable_if<
8579                 IsValidTraceLambda<ArgumentFunction>()>::type>
8580   static void TraceForCategory(uint32_t instances,
8581                                const CategoryType& dynamic_category,
8582                                const char* event_name,
8583                                perfetto::protos::pbzero::TrackEvent::Type type,
8584                                ArgumentFunction arg_function)
8585       PERFETTO_NO_INLINE {
8586     TraceForCategoryImpl<CategoryIndex>(
8587         instances, dynamic_category, event_name, type, Track(),
8588         TrackEventInternal::GetTimeNs(), std::move(arg_function));
8589   }
8590 
8591   // Trace point which takes a lambda function argument and an overridden
8592   // timestamp. |timestamp| must be in nanoseconds in the trace clock timebase.
8593   template <size_t CategoryIndex,
8594             typename CategoryType,
8595             typename ArgumentFunction = void (*)(EventContext),
8596             typename ArgumentFunctionCheck = typename std::enable_if<
8597                 IsValidTraceLambda<ArgumentFunction>()>::type>
8598   static void TraceForCategory(uint32_t instances,
8599                                const CategoryType& dynamic_category,
8600                                const char* event_name,
8601                                perfetto::protos::pbzero::TrackEvent::Type type,
8602                                uint64_t timestamp,
8603                                ArgumentFunction arg_function)
8604       PERFETTO_NO_INLINE {
8605     TraceForCategoryImpl<CategoryIndex>(instances, dynamic_category, event_name,
8606                                         type, Track(), timestamp,
8607                                         std::move(arg_function));
8608   }
8609 
8610   // This variant of the inner trace point takes a Track argument which can be
8611   // used to emit events on a non-default track.
8612   template <size_t CategoryIndex,
8613             typename CategoryType,
8614             typename TrackType,
8615             typename TrackTypeCheck = typename std::enable_if<
8616                 std::is_convertible<TrackType, Track>::value>::type>
8617   static void TraceForCategory(uint32_t instances,
8618                                const CategoryType& dynamic_category,
8619                                const char* event_name,
8620                                perfetto::protos::pbzero::TrackEvent::Type type,
8621                                const TrackType& track) PERFETTO_NO_INLINE {
8622     TraceForCategoryImpl<CategoryIndex>(instances, dynamic_category, event_name,
8623                                         type, track);
8624   }
8625 
8626   // Trace point with a track and a lambda function.
8627   template <size_t CategoryIndex,
8628             typename TrackType,
8629             typename CategoryType,
8630             typename ArgumentFunction = void (*)(EventContext),
8631             typename ArgumentFunctionCheck = typename std::enable_if<
8632                 IsValidTraceLambda<ArgumentFunction>()>::type,
8633             typename TrackTypeCheck = typename std::enable_if<
8634                 std::is_convertible<TrackType, Track>::value>::type>
8635   static void TraceForCategory(uint32_t instances,
8636                                const CategoryType& dynamic_category,
8637                                const char* event_name,
8638                                perfetto::protos::pbzero::TrackEvent::Type type,
8639                                const TrackType& track,
8640                                ArgumentFunction arg_function)
8641       PERFETTO_NO_INLINE {
8642     TraceForCategoryImpl<CategoryIndex>(
8643         instances, dynamic_category, event_name, type, track,
8644         TrackEventInternal::GetTimeNs(), std::move(arg_function));
8645   }
8646 
8647   // Trace point with a track and overridden timestamp.
8648   template <size_t CategoryIndex,
8649             typename CategoryType,
8650             typename TrackType,
8651             typename TrackTypeCheck = typename std::enable_if<
8652                 std::is_convertible<TrackType, Track>::value>::type>
8653   static void TraceForCategory(uint32_t instances,
8654                                const CategoryType& dynamic_category,
8655                                const char* event_name,
8656                                perfetto::protos::pbzero::TrackEvent::Type type,
8657                                const TrackType& track,
8658                                uint64_t timestamp) PERFETTO_NO_INLINE {
8659     TraceForCategoryImpl<CategoryIndex>(instances, dynamic_category, event_name,
8660                                         type, track, timestamp);
8661   }
8662 
8663   // Trace point with a track, a lambda function and an overridden timestamp.
8664   // |timestamp| must be in nanoseconds in the trace clock timebase.
8665   template <size_t CategoryIndex,
8666             typename TrackType,
8667             typename CategoryType,
8668             typename ArgumentFunction = void (*)(EventContext),
8669             typename ArgumentFunctionCheck = typename std::enable_if<
8670                 IsValidTraceLambda<ArgumentFunction>()>::type>
8671   static void TraceForCategory(uint32_t instances,
8672                                const CategoryType& dynamic_category,
8673                                const char* event_name,
8674                                perfetto::protos::pbzero::TrackEvent::Type type,
8675                                const TrackType& track,
8676                                uint64_t timestamp,
8677                                ArgumentFunction arg_function)
8678       PERFETTO_NO_INLINE {
8679     TraceForCategoryImpl<CategoryIndex>(instances, dynamic_category, event_name,
8680                                         type, track, timestamp,
8681                                         std::move(arg_function));
8682   }
8683 
8684   // Trace point with one debug annotation.
8685   //
8686   // This type of trace point is implemented with an inner helper function which
8687   // ensures |arg_value| is only passed by reference when required (i.e., with a
8688   // custom DebugAnnotation type). This avoids the binary and runtime overhead
8689   // of unnecessarily passing all types debug annotations by reference.
8690   //
8691   // Note that for this to work well, the _outer_ function (this function) has
8692   // to be inlined at the call site while the _inner_ function
8693   // (TraceForCategoryWithDebugAnnotations) is still outlined to minimize
8694   // overall binary size.
8695   template <size_t CategoryIndex, typename CategoryType, typename ArgType>
8696   static void TraceForCategory(uint32_t instances,
8697                                const CategoryType& dynamic_category,
8698                                const char* event_name,
8699                                perfetto::protos::pbzero::TrackEvent::Type type,
8700                                const char* arg_name,
8701                                ArgType&& arg_value) PERFETTO_ALWAYS_INLINE {
8702     TraceForCategoryWithDebugAnnotations<CategoryIndex, CategoryType, Track,
8703                                          ArgType>(
8704         instances, dynamic_category, event_name, type, Track(), arg_name,
8705         std::forward<ArgType>(arg_value));
8706   }
8707 
8708   // A one argument trace point which takes an explicit track.
8709   template <size_t CategoryIndex,
8710             typename CategoryType,
8711             typename TrackType,
8712             typename ArgType>
8713   static void TraceForCategory(uint32_t instances,
8714                                const CategoryType& dynamic_category,
8715                                const char* event_name,
8716                                perfetto::protos::pbzero::TrackEvent::Type type,
8717                                const TrackType& track,
8718                                const char* arg_name,
8719                                ArgType&& arg_value) PERFETTO_ALWAYS_INLINE {
8720     PERFETTO_DCHECK(track);
8721     TraceForCategoryWithDebugAnnotations<CategoryIndex, CategoryType, TrackType,
8722                                          ArgType>(
8723         instances, dynamic_category, event_name, type, track, arg_name,
8724         std::forward<ArgType>(arg_value));
8725   }
8726 
8727   template <size_t CategoryIndex,
8728             typename CategoryType,
8729             typename TrackType,
8730             typename ArgType>
8731   static void TraceForCategoryWithDebugAnnotations(
8732       uint32_t instances,
8733       const CategoryType& dynamic_category,
8734       const char* event_name,
8735       perfetto::protos::pbzero::TrackEvent::Type type,
8736       const TrackType& track,
8737       const char* arg_name,
8738       typename internal::DebugAnnotationArg<ArgType>::type arg_value)
8739       PERFETTO_NO_INLINE {
8740     TraceForCategoryImpl<CategoryIndex>(
8741         instances, dynamic_category, event_name, type, track,
8742         TrackEventInternal::GetTimeNs(), [&](EventContext event_ctx) {
8743           TrackEventInternal::AddDebugAnnotation(&event_ctx, arg_name,
8744                                                  arg_value);
8745         });
8746   }
8747 
8748   // Trace point with two debug annotations. Note that we only support up to two
8749   // direct debug annotations. For more complicated arguments, you should
8750   // define your own argument type in track_event.proto and use a lambda to fill
8751   // it in your trace point.
8752   template <size_t CategoryIndex,
8753             typename CategoryType,
8754             typename ArgType,
8755             typename ArgType2>
8756   static void TraceForCategory(uint32_t instances,
8757                                const CategoryType& dynamic_category,
8758                                const char* event_name,
8759                                perfetto::protos::pbzero::TrackEvent::Type type,
8760                                const char* arg_name,
8761                                ArgType&& arg_value,
8762                                const char* arg_name2,
8763                                ArgType2&& arg_value2) PERFETTO_ALWAYS_INLINE {
8764     TraceForCategoryWithDebugAnnotations<CategoryIndex, CategoryType, Track,
8765                                          ArgType, ArgType2>(
8766         instances, dynamic_category, event_name, type, Track(), arg_name,
8767         std::forward<ArgType>(arg_value), arg_name2,
8768         std::forward<ArgType2>(arg_value2));
8769   }
8770 
8771   // A two argument trace point which takes an explicit track.
8772   template <size_t CategoryIndex,
8773             typename CategoryType,
8774             typename TrackType,
8775             typename ArgType,
8776             typename ArgType2>
8777   static void TraceForCategory(uint32_t instances,
8778                                const CategoryType& dynamic_category,
8779                                const char* event_name,
8780                                perfetto::protos::pbzero::TrackEvent::Type type,
8781                                const TrackType& track,
8782                                const char* arg_name,
8783                                ArgType&& arg_value,
8784                                const char* arg_name2,
8785                                ArgType2&& arg_value2) PERFETTO_ALWAYS_INLINE {
8786     PERFETTO_DCHECK(track);
8787     TraceForCategoryWithDebugAnnotations<CategoryIndex, CategoryType, TrackType,
8788                                          ArgType, ArgType2>(
8789         instances, dynamic_category, event_name, type, track, arg_name,
8790         std::forward<ArgType>(arg_value), arg_name2,
8791         std::forward<ArgType2>(arg_value2));
8792   }
8793 
8794   template <size_t CategoryIndex,
8795             typename CategoryType,
8796             typename TrackType,
8797             typename ArgType,
8798             typename ArgType2>
8799   static void TraceForCategoryWithDebugAnnotations(
8800       uint32_t instances,
8801       const CategoryType& dynamic_category,
8802       const char* event_name,
8803       perfetto::protos::pbzero::TrackEvent::Type type,
8804       TrackType track,
8805       const char* arg_name,
8806       typename internal::DebugAnnotationArg<ArgType>::type arg_value,
8807       const char* arg_name2,
8808       typename internal::DebugAnnotationArg<ArgType2>::type arg_value2)
8809       PERFETTO_NO_INLINE {
8810     TraceForCategoryImpl<CategoryIndex>(
8811         instances, dynamic_category, event_name, type, track,
8812         TrackEventInternal::GetTimeNs(), [&](EventContext event_ctx) {
8813           TrackEventInternal::AddDebugAnnotation(&event_ctx, arg_name,
8814                                                  arg_value);
8815           TrackEventInternal::AddDebugAnnotation(&event_ctx, arg_name2,
8816                                                  arg_value2);
8817         });
8818   }
8819 
8820   // Initialize the track event library. Should be called before tracing is
8821   // enabled.
8822   static bool Register() {
8823     // Registration is performed out-of-line so users don't need to depend on
8824     // DataSourceDescriptor C++ bindings.
8825     return TrackEventInternal::Initialize(
8826         *Registry,
8827         [](const DataSourceDescriptor& dsd) { return Base::Register(dsd); });
8828   }
8829 
8830   // Record metadata about different types of timeline tracks. See Track.
8831   static void SetTrackDescriptor(const Track& track,
8832                                  const protos::gen::TrackDescriptor& desc) {
8833     PERFETTO_DCHECK(track.uuid == desc.uuid());
8834     TrackRegistry::Get()->UpdateTrack(track, desc.SerializeAsString());
8835     Base::template Trace([&](typename Base::TraceContext ctx) {
8836       TrackEventInternal::WriteTrackDescriptor(
8837           track, ctx.tls_inst_->trace_writer.get());
8838     });
8839   }
8840 
8841   // DEPRECATED. Only kept for backwards compatibility.
8842   static void SetTrackDescriptor(
8843       const Track& track,
8844       std::function<void(protos::pbzero::TrackDescriptor*)> callback) {
8845     SetTrackDescriptorImpl(track, std::move(callback));
8846   }
8847 
8848   // DEPRECATED. Only kept for backwards compatibility.
8849   static void SetProcessDescriptor(
8850       std::function<void(protos::pbzero::TrackDescriptor*)> callback,
8851       const ProcessTrack& track = ProcessTrack::Current()) {
8852     SetTrackDescriptorImpl(std::move(track), std::move(callback));
8853   }
8854 
8855   // DEPRECATED. Only kept for backwards compatibility.
8856   static void SetThreadDescriptor(
8857       std::function<void(protos::pbzero::TrackDescriptor*)> callback,
8858       const ThreadTrack& track = ThreadTrack::Current()) {
8859     SetTrackDescriptorImpl(std::move(track), std::move(callback));
8860   }
8861 
8862   static void EraseTrackDescriptor(const Track& track) {
8863     TrackRegistry::Get()->EraseTrack(track);
8864   }
8865 
8866   // Returns the current trace timestamp in nanoseconds. Note the returned
8867   // timebase may vary depending on the platform, but will always match the
8868   // timestamps recorded by track events (see GetTraceClockId).
8869   static uint64_t GetTraceTimeNs() { return TrackEventInternal::GetTimeNs(); }
8870 
8871   // Returns the type of clock used by GetTraceTimeNs().
8872   static constexpr protos::pbzero::BuiltinClock GetTraceClockId() {
8873     return TrackEventInternal::GetClockId();
8874   }
8875 
8876  private:
8877   // Each category has its own enabled/disabled state, stored in the category
8878   // registry.
8879   template <size_t CategoryIndex>
8880   struct CategoryTracePointTraits {
8881     static constexpr std::atomic<uint8_t>* GetActiveInstances() {
8882       static_assert(
8883           CategoryIndex != TrackEventCategoryRegistry::kInvalidCategoryIndex,
8884           "Invalid category index");
8885       return Registry->GetCategoryState(CategoryIndex);
8886     }
8887   };
8888 
8889   // TODO(skyostil): Make |CategoryIndex| a regular parameter to reuse trace
8890   // point code across different categories.
8891   template <size_t CategoryIndex,
8892             typename CategoryType,
8893             typename TrackType = Track,
8894             typename ArgumentFunction = void (*)(EventContext),
8895             typename ArgumentFunctionCheck = typename std::enable_if<
8896                 IsValidTraceLambda<ArgumentFunction>()>::type,
8897             typename TrackTypeCheck = typename std::enable_if<
8898                 std::is_convertible<TrackType, Track>::value>::type>
8899   static void TraceForCategoryImpl(
8900       uint32_t instances,
8901       const CategoryType& dynamic_category,
8902       const char* event_name,
8903       perfetto::protos::pbzero::TrackEvent::Type type,
8904       const TrackType& track = Track(),
8905       uint64_t timestamp = TrackEventInternal::GetTimeNs(),
8906       ArgumentFunction arg_function = [](EventContext) {
8907       }) PERFETTO_ALWAYS_INLINE {
8908     TraceWithInstances<CategoryIndex>(
8909         instances, [&](typename Base::TraceContext ctx) {
8910           // If this category is dynamic, first check whether it's enabled.
8911           constexpr bool kIsDynamic =
8912               CategoryIndex ==
8913               TrackEventCategoryRegistry::kDynamicCategoryIndex;
8914           if (kIsDynamic && !IsDynamicCategoryEnabled(
8915                                 &ctx, DynamicCategory{dynamic_category})) {
8916             return;
8917           }
8918 
8919           {
8920             // TODO(skyostil): Intern categories at compile time.
8921             const Category* static_category =
8922                 kIsDynamic ? nullptr : Registry->GetCategory(CategoryIndex);
8923             auto event_ctx = TrackEventInternal::WriteEvent(
8924                 ctx.tls_inst_->trace_writer.get(), ctx.GetIncrementalState(),
8925                 static_category, event_name, type, timestamp);
8926             if (kIsDynamic) {
8927               Category category{
8928                   Category::FromDynamicCategory(dynamic_category)};
8929               category.ForEachGroupMember(
8930                   [&](const char* member_name, size_t name_size) {
8931                     event_ctx.event()->add_categories(member_name, name_size);
8932                     return true;
8933                   });
8934             }
8935             if (track)
8936               event_ctx.event()->set_track_uuid(track.uuid);
8937             arg_function(std::move(event_ctx));
8938           }  // event_ctx
8939 
8940           if (track) {
8941             TrackEventInternal::WriteTrackDescriptorIfNeeded(
8942                 track, ctx.tls_inst_->trace_writer.get(),
8943                 ctx.GetIncrementalState());
8944           }
8945         });
8946   }
8947 
8948   template <size_t CategoryIndex, typename Lambda>
8949   static void TraceWithInstances(uint32_t instances,
8950                                  Lambda lambda) PERFETTO_ALWAYS_INLINE {
8951     if (CategoryIndex == TrackEventCategoryRegistry::kDynamicCategoryIndex) {
8952       Base::template TraceWithInstances(instances, std::move(lambda));
8953     } else {
8954       Base::template TraceWithInstances<
8955           CategoryTracePointTraits<CategoryIndex>>(instances,
8956                                                    std::move(lambda));
8957     }
8958   }
8959 
8960   // Records a track descriptor into the track descriptor registry and, if we
8961   // are tracing, also mirrors the descriptor into the trace.
8962   template <typename TrackType>
8963   static void SetTrackDescriptorImpl(
8964       const TrackType& track,
8965       std::function<void(protos::pbzero::TrackDescriptor*)> callback) {
8966     TrackRegistry::Get()->UpdateTrack(track, std::move(callback));
8967     Base::template Trace([&](typename Base::TraceContext ctx) {
8968       TrackEventInternal::WriteTrackDescriptor(
8969           track, ctx.tls_inst_->trace_writer.get());
8970     });
8971   }
8972 
8973   // Determines if the given dynamic category is enabled, first by checking the
8974   // per-trace writer cache or by falling back to computing it based on the
8975   // trace config for the given session.
8976   static bool IsDynamicCategoryEnabled(
8977       typename Base::TraceContext* ctx,
8978       const DynamicCategory& dynamic_category) {
8979     auto incr_state = ctx->GetIncrementalState();
8980     auto it = incr_state->dynamic_categories.find(dynamic_category.name);
8981     if (it == incr_state->dynamic_categories.end()) {
8982       // We haven't seen this category before. Let's figure out if it's enabled.
8983       // This requires grabbing a lock to read the session's trace config.
8984       auto ds = ctx->GetDataSourceLocked();
8985       Category category{Category::FromDynamicCategory(dynamic_category)};
8986       bool enabled = TrackEventInternal::IsCategoryEnabled(
8987           *Registry, ds->config_, category);
8988       // TODO(skyostil): Cap the size of |dynamic_categories|.
8989       incr_state->dynamic_categories[dynamic_category.name] = enabled;
8990       return enabled;
8991     }
8992     return it->second;
8993   }
8994 
8995   // Config for the current tracing session.
8996   protos::gen::TrackEventConfig config_;
8997 };
8998 
8999 }  // namespace internal
9000 }  // namespace perfetto
9001 
9002 #endif  // INCLUDE_PERFETTO_TRACING_INTERNAL_TRACK_EVENT_DATA_SOURCE_H_
9003 // gen_amalgamated begin header: include/perfetto/tracing/internal/track_event_macros.h
9004 /*
9005  * Copyright (C) 2019 The Android Open Source Project
9006  *
9007  * Licensed under the Apache License, Version 2.0 (the "License");
9008  * you may not use this file except in compliance with the License.
9009  * You may obtain a copy of the License at
9010  *
9011  *      http://www.apache.org/licenses/LICENSE-2.0
9012  *
9013  * Unless required by applicable law or agreed to in writing, software
9014  * distributed under the License is distributed on an "AS IS" BASIS,
9015  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9016  * See the License for the specific language governing permissions and
9017  * limitations under the License.
9018  */
9019 
9020 #ifndef INCLUDE_PERFETTO_TRACING_INTERNAL_TRACK_EVENT_MACROS_H_
9021 #define INCLUDE_PERFETTO_TRACING_INTERNAL_TRACK_EVENT_MACROS_H_
9022 
9023 // This file contains underlying macros for the trace point track event
9024 // implementation. Perfetto API users typically don't need to use anything here
9025 // directly.
9026 
9027 // gen_amalgamated expanded: #include "perfetto/base/compiler.h"
9028 // gen_amalgamated expanded: #include "perfetto/tracing/internal/track_event_data_source.h"
9029 // gen_amalgamated expanded: #include "perfetto/tracing/track_event_category_registry.h"
9030 
9031 // Ignore GCC warning about a missing argument for a variadic macro parameter.
9032 #pragma GCC system_header
9033 
9034 // Defines data structures for backing a category registry.
9035 //
9036 // Each category has one enabled/disabled bit per possible data source instance.
9037 // The bits are packed, i.e., each byte holds the state for instances. To
9038 // improve cache locality, the bits for each instance are stored separately from
9039 // the names of the categories:
9040 //
9041 //   byte 0                      byte 1
9042 //   (inst0, inst1, ..., inst7), (inst0, inst1, ..., inst7)
9043 //
9044 #define PERFETTO_INTERNAL_DECLARE_CATEGORIES(...)                             \
9045   namespace internal {                                                        \
9046   constexpr ::perfetto::Category kCategories[] = {__VA_ARGS__};               \
9047   constexpr size_t kCategoryCount =                                           \
9048       sizeof(kCategories) / sizeof(kCategories[0]);                           \
9049   /* The per-instance enable/disable state per category */                    \
9050   extern std::atomic<uint8_t> g_category_state_storage[kCategoryCount];       \
9051   /* The category registry which mediates access to the above structures. */  \
9052   /* The registry is used for two purposes: */                                \
9053   /**/                                                                        \
9054   /*    1) For looking up categories at build (constexpr) time. */            \
9055   /*    2) For declaring the per-namespace TrackEvent data source. */         \
9056   /**/                                                                        \
9057   /* Because usage #1 requires a constexpr type and usage #2 requires an */   \
9058   /* extern type (to avoid declaring a type based on a translation-unit */    \
9059   /* variable), we need two separate copies of the registry with different */ \
9060   /* storage specifiers. */                                                   \
9061   /**/                                                                        \
9062   /* TODO(skyostil): Unify these using a C++17 inline constexpr variable. */  \
9063   constexpr ::perfetto::internal::TrackEventCategoryRegistry                  \
9064       kConstExprCategoryRegistry(kCategoryCount,                              \
9065                                  &kCategories[0],                             \
9066                                  &g_category_state_storage[0]);               \
9067   PERFETTO_COMPONENT_EXPORT extern const ::perfetto::internal::               \
9068       TrackEventCategoryRegistry kCategoryRegistry;                           \
9069   static_assert(kConstExprCategoryRegistry.ValidateCategories(),              \
9070                 "Invalid category names found");                              \
9071   }  // namespace internal
9072 
9073 // In a .cc file, declares storage for each category's runtime state.
9074 #define PERFETTO_INTERNAL_CATEGORY_STORAGE()                     \
9075   namespace internal {                                           \
9076   std::atomic<uint8_t> g_category_state_storage[kCategoryCount]; \
9077   PERFETTO_COMPONENT_EXPORT constexpr ::perfetto::internal::     \
9078       TrackEventCategoryRegistry kCategoryRegistry(              \
9079           kCategoryCount,                                        \
9080           &kCategories[0],                                       \
9081           &g_category_state_storage[0]);                         \
9082   }  // namespace internal
9083 
9084 // Defines the TrackEvent data source for the current track event namespace.
9085 #define PERFETTO_INTERNAL_DECLARE_TRACK_EVENT_DATA_SOURCE() \
9086   struct PERFETTO_COMPONENT_EXPORT TrackEvent               \
9087       : public ::perfetto::internal::TrackEventDataSource<  \
9088             TrackEvent, &internal::kCategoryRegistry> {}
9089 
9090 // At compile time, turns a category name represented by a static string into an
9091 // index into the current category registry. A build error will be generated if
9092 // the category hasn't been registered or added to the list of allowed dynamic
9093 // categories. See PERFETTO_DEFINE_CATEGORIES.
9094 #define PERFETTO_GET_CATEGORY_INDEX(category)                                  \
9095   ::PERFETTO_TRACK_EVENT_NAMESPACE::internal::kConstExprCategoryRegistry.Find( \
9096       category,                                                                \
9097       ::PERFETTO_TRACK_EVENT_NAMESPACE::internal::IsDynamicCategory(category))
9098 
9099 // Generate a unique variable name with a given prefix.
9100 #define PERFETTO_INTERNAL_CONCAT2(a, b) a##b
9101 #define PERFETTO_INTERNAL_CONCAT(a, b) PERFETTO_INTERNAL_CONCAT2(a, b)
9102 #define PERFETTO_UID(prefix) PERFETTO_INTERNAL_CONCAT(prefix, __LINE__)
9103 
9104 // Efficiently determines whether tracing is enabled for the given category, and
9105 // if so, emits one trace event with the given arguments.
9106 #define PERFETTO_INTERNAL_TRACK_EVENT(category, ...)                      \
9107   do {                                                                    \
9108     namespace tns = ::PERFETTO_TRACK_EVENT_NAMESPACE;                     \
9109     /* Compute the category index outside the lambda to work around a */  \
9110     /* GCC 7 bug */                                                       \
9111     constexpr auto PERFETTO_UID(kCatIndex) =                              \
9112         PERFETTO_GET_CATEGORY_INDEX(category);                            \
9113     if (tns::internal::IsDynamicCategory(category)) {                     \
9114       tns::TrackEvent::CallIfEnabled([&](uint32_t instances) {            \
9115         tns::TrackEvent::TraceForCategory<PERFETTO_UID(kCatIndex)>(       \
9116             instances, category, ##__VA_ARGS__);                          \
9117       });                                                                 \
9118     } else {                                                              \
9119       tns::TrackEvent::CallIfCategoryEnabled<PERFETTO_UID(kCatIndex)>(    \
9120           [&](uint32_t instances) {                                       \
9121             /* TODO(skyostil): Get rid of the category name parameter. */ \
9122             tns::TrackEvent::TraceForCategory<PERFETTO_UID(kCatIndex)>(   \
9123                 instances, nullptr, ##__VA_ARGS__);                       \
9124           });                                                             \
9125     }                                                                     \
9126   } while (false)
9127 
9128 #define PERFETTO_INTERNAL_SCOPED_TRACK_EVENT(category, name, ...)             \
9129   struct PERFETTO_UID(ScopedEvent) {                                          \
9130     struct EventFinalizer {                                                   \
9131       /* The parameter is an implementation detail. It allows the          */ \
9132       /* anonymous struct to use aggregate initialization to invoke the    */ \
9133       /* lambda (which emits the BEGIN event and returns an integer)       */ \
9134       /* with the proper reference capture for any                         */ \
9135       /* TrackEventArgumentFunction in |__VA_ARGS__|. This is required so  */ \
9136       /* that the scoped event is exactly ONE line and can't escape the    */ \
9137       /* scope if used in a single line if statement.                      */ \
9138       EventFinalizer(...) {}                                                  \
9139       ~EventFinalizer() { TRACE_EVENT_END(category); }                        \
9140     } finalizer;                                                              \
9141   } PERFETTO_UID(scoped_event) {                                              \
9142     [&]() {                                                                   \
9143       TRACE_EVENT_BEGIN(category, name, ##__VA_ARGS__);                       \
9144       return 0;                                                               \
9145     }()                                                                       \
9146   }
9147 
9148 #define PERFETTO_INTERNAL_CATEGORY_ENABLED(category)                         \
9149   (::PERFETTO_TRACK_EVENT_NAMESPACE::internal::IsDynamicCategory(category)   \
9150        ? ::PERFETTO_TRACK_EVENT_NAMESPACE::TrackEvent::                      \
9151              IsDynamicCategoryEnabled(::perfetto::DynamicCategory(category)) \
9152        : ::PERFETTO_TRACK_EVENT_NAMESPACE::TrackEvent::IsCategoryEnabled<    \
9153              PERFETTO_GET_CATEGORY_INDEX(category)>())
9154 
9155 #endif  // INCLUDE_PERFETTO_TRACING_INTERNAL_TRACK_EVENT_MACROS_H_
9156 /*
9157  * Copyright (C) 2019 The Android Open Source Project
9158  *
9159  * Licensed under the Apache License, Version 2.0 (the "License");
9160  * you may not use this file except in compliance with the License.
9161  * You may obtain a copy of the License at
9162  *
9163  *      http://www.apache.org/licenses/LICENSE-2.0
9164  *
9165  * Unless required by applicable law or agreed to in writing, software
9166  * distributed under the License is distributed on an "AS IS" BASIS,
9167  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9168  * See the License for the specific language governing permissions and
9169  * limitations under the License.
9170  */
9171 
9172 #ifndef INCLUDE_PERFETTO_TRACING_TRACK_EVENT_H_
9173 #define INCLUDE_PERFETTO_TRACING_TRACK_EVENT_H_
9174 
9175 // gen_amalgamated expanded: #include "perfetto/base/time.h"
9176 // gen_amalgamated expanded: #include "perfetto/tracing/internal/track_event_data_source.h"
9177 // gen_amalgamated expanded: #include "perfetto/tracing/internal/track_event_internal.h"
9178 // gen_amalgamated expanded: #include "perfetto/tracing/internal/track_event_macros.h"
9179 // gen_amalgamated expanded: #include "perfetto/tracing/track.h"
9180 // gen_amalgamated expanded: #include "perfetto/tracing/track_event_category_registry.h"
9181 // gen_amalgamated expanded: #include "protos/perfetto/trace/track_event/track_event.pbzero.h"
9182 
9183 #include <type_traits>
9184 
9185 // This file contains a set of macros designed for instrumenting applications
9186 // with track event trace points. While the underlying TrackEvent API can also
9187 // be used directly, doing so efficiently requires some care (e.g., to avoid
9188 // evaluating arguments while tracing is disabled). These types of optimizations
9189 // are abstracted away by the macros below.
9190 //
9191 // ================
9192 // Quickstart guide
9193 // ================
9194 //
9195 //   To add track events to your application, first define your categories in,
9196 //   e.g., my_tracing.h:
9197 //
9198 //       PERFETTO_DEFINE_CATEGORIES(
9199 //           perfetto::Category("base"),
9200 //           perfetto::Category("v8"),
9201 //           perfetto::Category("cc"));
9202 //
9203 //   Then in a single .cc file, e.g., my_tracing.cc:
9204 //
9205 //       #include "my_tracing.h"
9206 //       PERFETTO_TRACK_EVENT_STATIC_STORAGE();
9207 //
9208 //   Finally, register track events at startup, after which you can record
9209 //   events with the TRACE_EVENT macros:
9210 //
9211 //       #include "my_tracing.h"
9212 //
9213 //       int main() {
9214 //         perfetto::TrackEvent::Register();
9215 //
9216 //         // A basic track event with just a name.
9217 //         TRACE_EVENT("category", "MyEvent");
9218 //
9219 //         // A track event with (up to two) debug annotations.
9220 //         TRACE_EVENT("category", "MyEvent", "parameter", 42);
9221 //
9222 //         // A track event with a strongly typed parameter.
9223 //         TRACE_EVENT("category", "MyEvent", [](perfetto::EventContext ctx) {
9224 //           ctx.event()->set_foo(42);
9225 //           ctx.event()->set_bar(.5f);
9226 //         });
9227 //       }
9228 //
9229 //  Note that track events must be nested consistently, i.e., the following is
9230 //  not allowed:
9231 //
9232 //    TRACE_EVENT_BEGIN("a", "bar", ...);
9233 //    TRACE_EVENT_BEGIN("b", "foo", ...);
9234 //    TRACE_EVENT_END("a");  // "foo" must be closed before "bar".
9235 //    TRACE_EVENT_END("b");
9236 //
9237 // ====================
9238 // Implementation notes
9239 // ====================
9240 //
9241 // The track event library consists of the following layers and components. The
9242 // classes the internal namespace shouldn't be considered part of the public
9243 // API.
9244 //                    .--------------------------------.
9245 //               .----|  TRACE_EVENT                   |----.
9246 //      write   |     |   - App instrumentation point  |     |  write
9247 //      event   |     '--------------------------------'     |  arguments
9248 //              V                                            V
9249 //  .----------------------------------.    .-----------------------------.
9250 //  | TrackEvent                       |    | EventContext                |
9251 //  |  - Registry of event categories  |    |  - One track event instance |
9252 //  '----------------------------------'    '-----------------------------'
9253 //              |                                            |
9254 //              |                                            | look up
9255 //              | is                                         | interning ids
9256 //              V                                            V
9257 //  .----------------------------------.    .-----------------------------.
9258 //  | internal::TrackEventDataSource   |    | TrackEventInternedDataIndex |
9259 //  | - Perfetto data source           |    | - Corresponds to a field in |
9260 //  | - Has TrackEventIncrementalState |    |   in interned_data.proto    |
9261 //  '----------------------------------'    '-----------------------------'
9262 //              |                  |                         ^
9263 //              |                  |       owns (1:many)     |
9264 //              | write event      '-------------------------'
9265 //              V
9266 //  .----------------------------------.
9267 //  | internal::TrackEventInternal     |
9268 //  | - Outlined code to serialize     |
9269 //  |   one track event                |
9270 //  '----------------------------------'
9271 //
9272 
9273 // Each compilation unit can be in exactly one track event namespace,
9274 // allowing the overall program to use multiple track event data sources and
9275 // category lists if necessary. Use this macro to select the namespace for the
9276 // current compilation unit.
9277 //
9278 // If the program uses multiple track event namespaces, category & track event
9279 // registration (see quickstart above) needs to happen for both namespaces
9280 // separately.
9281 #ifndef PERFETTO_TRACK_EVENT_NAMESPACE
9282 #define PERFETTO_TRACK_EVENT_NAMESPACE perfetto
9283 #endif
9284 
9285 // Deprecated; see perfetto::Category().
9286 #define PERFETTO_CATEGORY(name) \
9287   ::perfetto::Category { #name }
9288 
9289 // Internal helpers for determining if a given category is defined at build or
9290 // runtime.
9291 namespace PERFETTO_TRACK_EVENT_NAMESPACE {
9292 namespace internal {
9293 
9294 // By default no statically defined categories are dynamic, but this can be
9295 // overridden with PERFETTO_DEFINE_TEST_CATEGORY_PREFIXES.
9296 template <typename... T>
9297 constexpr bool IsDynamicCategory(const char*) {
9298   return false;
9299 }
9300 
9301 // Explicitly dynamic categories are always dynamic.
9302 constexpr bool IsDynamicCategory(const ::perfetto::DynamicCategory&) {
9303   return true;
9304 }
9305 
9306 }  // namespace internal
9307 }  // namespace PERFETTO_TRACK_EVENT_NAMESPACE
9308 
9309 namespace perfetto {
9310 
9311 // A wrapper for marking strings that can't be determined to be static at build
9312 // time, but are in fact static.
9313 class PERFETTO_EXPORT StaticString final {
9314  public:
9315   const char* value;
9316 
9317   operator const char*() const { return value; }
9318 };
9319 
9320 namespace internal {
9321 
9322 template <typename T = void>
9323 constexpr bool IsStaticString(const char*) {
9324   return true;
9325 }
9326 
9327 template <typename T = void>
9328 constexpr bool IsStaticString(...) {
9329   return false;
9330 }
9331 
9332 }  // namespace internal
9333 }  // namespace perfetto
9334 
9335 // Normally all categories are defined statically at build-time (see
9336 // PERFETTO_DEFINE_CATEGORIES). However, some categories are only used for
9337 // testing, and we shouldn't publish them to the tracing service or include them
9338 // in a production binary. Use this macro to define a list of prefixes for these
9339 // types of categories. Note that trace points using these categories will be
9340 // slightly less efficient compared to regular trace points.
9341 #define PERFETTO_DEFINE_TEST_CATEGORY_PREFIXES(...)                       \
9342   namespace PERFETTO_TRACK_EVENT_NAMESPACE {                              \
9343   namespace internal {                                                    \
9344   template <>                                                             \
9345   constexpr bool IsDynamicCategory(const char* name) {                    \
9346     return ::perfetto::internal::IsStringInPrefixList(name, __VA_ARGS__); \
9347   }                                                                       \
9348   } /* namespace internal */                                              \
9349   } /* namespace PERFETTO_TRACK_EVENT_NAMESPACE */                        \
9350   PERFETTO_INTERNAL_SWALLOW_SEMICOLON()
9351 
9352 // Register the set of available categories by passing a list of categories to
9353 // this macro: PERFETTO_CATEGORY(cat1), PERFETTO_CATEGORY(cat2), ...
9354 #define PERFETTO_DEFINE_CATEGORIES(...)                        \
9355   namespace PERFETTO_TRACK_EVENT_NAMESPACE {                   \
9356   /* The list of category names */                             \
9357   PERFETTO_INTERNAL_DECLARE_CATEGORIES(__VA_ARGS__)            \
9358   /* The track event data source for this set of categories */ \
9359   PERFETTO_INTERNAL_DECLARE_TRACK_EVENT_DATA_SOURCE();         \
9360   } /* namespace PERFETTO_TRACK_EVENT_NAMESPACE */             \
9361   PERFETTO_DECLARE_DATA_SOURCE_STATIC_MEMBERS(                 \
9362       PERFETTO_TRACK_EVENT_NAMESPACE::TrackEvent,              \
9363       perfetto::internal::TrackEventDataSourceTraits)
9364 
9365 // Allocate storage for each category by using this macro once per track event
9366 // namespace.
9367 #define PERFETTO_TRACK_EVENT_STATIC_STORAGE()      \
9368   namespace PERFETTO_TRACK_EVENT_NAMESPACE {       \
9369   PERFETTO_INTERNAL_CATEGORY_STORAGE()             \
9370   } /* namespace PERFETTO_TRACK_EVENT_NAMESPACE */ \
9371   PERFETTO_DEFINE_DATA_SOURCE_STATIC_MEMBERS(      \
9372       PERFETTO_TRACK_EVENT_NAMESPACE::TrackEvent,  \
9373       perfetto::internal::TrackEventDataSourceTraits)
9374 
9375 // Ignore GCC warning about a missing argument for a variadic macro parameter.
9376 #pragma GCC system_header
9377 
9378 // Ensure that |string| is a static constant string.
9379 //
9380 // If you get a compiler failure here, you are most likely trying to use
9381 // TRACE_EVENT with a dynamic event name. There are two ways to fix this:
9382 //
9383 // 1) If the event name is actually dynamic (e.g., std::string), write it into
9384 //    the event manually:
9385 //
9386 //      TRACE_EVENT("category", nullptr, [&](perfetto::EventContext ctx) {
9387 //        ctx.event()->set_name(dynamic_name);
9388 //      });
9389 //
9390 // 2) If the name is static, but the pointer is computed at runtime, wrap it
9391 //    with perfetto::StaticString:
9392 //
9393 //      TRACE_EVENT("category", perfetto::StaticString{name});
9394 //
9395 //    DANGER: Using perfetto::StaticString with strings whose contents change
9396 //            dynamically can cause silent trace data corruption.
9397 //
9398 #define PERFETTO_GET_STATIC_STRING(string)                                 \
9399   [&]() {                                                                  \
9400     static_assert(                                                         \
9401         std::is_same<decltype(string), ::perfetto::StaticString>::value || \
9402             ::perfetto::internal::IsStaticString(string),                  \
9403         "String must be static");                                          \
9404     return static_cast<const char*>(string);                               \
9405   }()
9406 
9407 // Begin a slice under |category| with the title |name|. Both strings must be
9408 // static constants. The track event is only recorded if |category| is enabled
9409 // for a tracing session.
9410 //
9411 // The slice is thread-scoped (i.e., written to the default track of the current
9412 // thread) unless overridden with a custom track object (see Track).
9413 //
9414 // |name| must be a string with static lifetime (i.e., the same
9415 // address must not be used for a different event name in the future). If you
9416 // want to use a dynamically allocated name, do this:
9417 //
9418 //  TRACE_EVENT("category", nullptr, [&](perfetto::EventContext ctx) {
9419 //    ctx.event()->set_name(dynamic_name);
9420 //  });
9421 //
9422 #define TRACE_EVENT_BEGIN(category, name, ...)    \
9423   PERFETTO_INTERNAL_TRACK_EVENT(                  \
9424       category, PERFETTO_GET_STATIC_STRING(name), \
9425       ::perfetto::protos::pbzero::TrackEvent::TYPE_SLICE_BEGIN, ##__VA_ARGS__)
9426 
9427 // End a slice under |category|.
9428 #define TRACE_EVENT_END(category, ...) \
9429   PERFETTO_INTERNAL_TRACK_EVENT(       \
9430       category, nullptr,               \
9431       ::perfetto::protos::pbzero::TrackEvent::TYPE_SLICE_END, ##__VA_ARGS__)
9432 
9433 // Begin a slice which gets automatically closed when going out of scope.
9434 #define TRACE_EVENT(category, name, ...) \
9435   PERFETTO_INTERNAL_SCOPED_TRACK_EVENT(category, name, ##__VA_ARGS__)
9436 
9437 // Emit a slice which has zero duration.
9438 #define TRACE_EVENT_INSTANT(category, name, ...)  \
9439   PERFETTO_INTERNAL_TRACK_EVENT(                  \
9440       category, PERFETTO_GET_STATIC_STRING(name), \
9441       ::perfetto::protos::pbzero::TrackEvent::TYPE_INSTANT, ##__VA_ARGS__)
9442 
9443 // Efficiently determine if the given static or dynamic trace category or
9444 // category group is enabled for tracing.
9445 #define TRACE_EVENT_CATEGORY_ENABLED(category) \
9446   PERFETTO_INTERNAL_CATEGORY_ENABLED(category)
9447 
9448 // TODO(skyostil): Add flow events.
9449 // TODO(skyostil): Add counters.
9450 
9451 #endif  // INCLUDE_PERFETTO_TRACING_TRACK_EVENT_H_
9452 // gen_amalgamated begin header: include/perfetto/tracing/track_event_interned_data_index.h
9453 /*
9454  * Copyright (C) 2019 The Android Open Source Project
9455  *
9456  * Licensed under the Apache License, Version 2.0 (the "License");
9457  * you may not use this file except in compliance with the License.
9458  * You may obtain a copy of the License at
9459  *
9460  *      http://www.apache.org/licenses/LICENSE-2.0
9461  *
9462  * Unless required by applicable law or agreed to in writing, software
9463  * distributed under the License is distributed on an "AS IS" BASIS,
9464  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9465  * See the License for the specific language governing permissions and
9466  * limitations under the License.
9467  */
9468 
9469 #ifndef INCLUDE_PERFETTO_TRACING_TRACK_EVENT_INTERNED_DATA_INDEX_H_
9470 #define INCLUDE_PERFETTO_TRACING_TRACK_EVENT_INTERNED_DATA_INDEX_H_
9471 
9472 // gen_amalgamated expanded: #include "perfetto/tracing/internal/track_event_internal.h"
9473 
9474 // gen_amalgamated expanded: #include "perfetto/base/compiler.h"
9475 // gen_amalgamated expanded: #include "perfetto/tracing/event_context.h"
9476 
9477 #include <map>
9478 #include <type_traits>
9479 #include <unordered_map>
9480 
9481 // This file has templates for defining your own interned data types to be used
9482 // with track event. Interned data can be useful for avoiding repeating the same
9483 // constant data (e.g., strings) throughout the trace.
9484 //
9485 // =============
9486 // Example usage
9487 // =============
9488 //
9489 // First define an interning index for your type. It should map to a specific
9490 // field of interned_data.proto and define how the interned data is written into
9491 // that message.
9492 //
9493 //   struct MyInternedData
9494 //       : public perfetto::TrackEventInternedDataIndex<
9495 //           MyInternedData,
9496 //           perfetto::protos::pbzero::InternedData::kMyInternedDataFieldNumber,
9497 //           const char*> {
9498 //     static void Add(perfetto::protos::pbzero::InternedData* interned_data,
9499 //                      size_t iid,
9500 //                      const char* value) {
9501 //       auto my_data = interned_data->add_my_interned_data();
9502 //       my_data->set_iid(iid);
9503 //       my_data->set_value(value);
9504 //     }
9505 //   };
9506 //
9507 // Next, use your interned data in a trace point as shown below. The interned
9508 // string will only be emitted the first time the trace point is hit.
9509 //
9510 //   TRACE_EVENT_BEGIN(
9511 //      "category", "Event", [&](perfetto::EventContext ctx) {
9512 //        auto my_message = ctx.event()->set_my_message();
9513 //        size_t iid = MyInternedData::Get(&ctx, "Some data");
9514 //        my_message->set_iid(iid);
9515 //      });
9516 //
9517 
9518 namespace perfetto {
9519 
9520 // By default, the interning index stores a full copy of the interned data. This
9521 // ensures the same data is always mapped to the same interning id, and there is
9522 // no danger of collisions. This comes at the cost of memory usage, however, so
9523 // consider using HashedInternedDataTraits if that may be an issue.
9524 //
9525 // This type of index also performs hashing on the stored data for lookups; for
9526 // types where this isn't necessary (e.g., raw const char*), use
9527 // SmallInternedDataTraits.
9528 struct BigInternedDataTraits {
9529   template <typename ValueType>
9530   class Index {
9531    public:
9532     bool LookUpOrInsert(size_t* iid, const ValueType& value) {
9533       size_t next_id = data_.size() + 1;
9534       auto it_and_inserted = data_.insert(std::make_pair(value, next_id));
9535       if (!it_and_inserted.second) {
9536         *iid = it_and_inserted.first->second;
9537         return true;
9538       }
9539       *iid = next_id;
9540       return false;
9541     }
9542 
9543    private:
9544     std::unordered_map<ValueType, size_t> data_;
9545   };
9546 };
9547 
9548 // This type of interning index keeps full copies of interned data without
9549 // hashing the values. This is a good fit for small types that can be directly
9550 // used as index keys.
9551 struct SmallInternedDataTraits {
9552   template <typename ValueType>
9553   class Index {
9554    public:
9555     bool LookUpOrInsert(size_t* iid, const ValueType& value) {
9556       size_t next_id = data_.size() + 1;
9557       auto it_and_inserted = data_.insert(std::make_pair(value, next_id));
9558       if (!it_and_inserted.second) {
9559         *iid = it_and_inserted.first->second;
9560         return true;
9561       }
9562       *iid = next_id;
9563       return false;
9564     }
9565 
9566    private:
9567     std::map<ValueType, size_t> data_;
9568   };
9569 };
9570 
9571 // This type of interning index only stores the hash of the interned values
9572 // instead of the values themselves. This is more efficient in terms of memory
9573 // usage, but assumes that there are no hash collisions. If a hash collision
9574 // occurs, two or more values will be mapped to the same interning id.
9575 //
9576 // Note that the given type must have a specialization for std::hash.
9577 struct HashedInternedDataTraits {
9578   template <typename ValueType>
9579   class Index {
9580    public:
9581     bool LookUpOrInsert(size_t* iid, const ValueType& value) {
9582       auto key = std::hash<ValueType>()(value);
9583       size_t next_id = data_.size() + 1;
9584       auto it_and_inserted = data_.insert(std::make_pair(key, next_id));
9585       if (!it_and_inserted.second) {
9586         *iid = it_and_inserted.first->second;
9587         return true;
9588       }
9589       *iid = next_id;
9590       return false;
9591     }
9592 
9593    private:
9594     std::map<size_t, size_t> data_;
9595   };
9596 };
9597 
9598 // A templated base class for an interned data type which corresponds to a field
9599 // in interned_data.proto.
9600 //
9601 // |InternedDataType| must be the type of the subclass.
9602 // |FieldNumber| is the corresponding protobuf field in InternedData.
9603 // |ValueType| is the type which is stored in the index. It must be copyable.
9604 // |Traits| can be used to customize the storage and lookup mechanism.
9605 //
9606 // The subclass should define a static method with the following signature for
9607 // committing interned data together with the interning id |iid| into the trace:
9608 //
9609 //   static void Add(perfetto::protos::pbzero::InternedData*,
9610 //                   size_t iid,
9611 //                   const ValueType& value);
9612 //
9613 template <typename InternedDataType,
9614           size_t FieldNumber,
9615           typename ValueType,
9616           // Avoid unnecessary hashing for pointers by default.
9617           typename Traits =
9618               typename std::conditional<(std::is_pointer<ValueType>::value),
9619                                         SmallInternedDataTraits,
9620                                         BigInternedDataTraits>::type>
9621 class TrackEventInternedDataIndex
9622     : public internal::BaseTrackEventInternedDataIndex {
9623  public:
9624   // Return an interning id for |value|. The returned id can be immediately
9625   // written to the trace. The optional |add_args| are passed to the Add()
9626   // function.
9627   template <typename... Args>
9628   static size_t Get(EventContext* ctx,
9629                     const ValueType& value,
9630                     Args&&... add_args) {
9631     // First check if the value exists in the dictionary.
9632     auto index_for_field = GetOrCreateIndexForField(ctx->incremental_state_);
9633     size_t iid;
9634     if (PERFETTO_LIKELY(index_for_field->index_.LookUpOrInsert(&iid, value))) {
9635       PERFETTO_DCHECK(iid);
9636       return iid;
9637     }
9638 
9639     // If not, we need to serialize the definition of the interned value into
9640     // the heap buffered message (which is committed to the trace when the
9641     // packet ends).
9642     PERFETTO_DCHECK(iid);
9643     InternedDataType::Add(
9644         ctx->incremental_state_->serialized_interned_data.get(), iid,
9645         std::move(value), std::forward<Args>(add_args)...);
9646     return iid;
9647   }
9648 
9649  private:
9650   static InternedDataType* GetOrCreateIndexForField(
9651       internal::TrackEventIncrementalState* incremental_state) {
9652     // Fast path: look for matching field number.
9653     for (const auto& entry : incremental_state->interned_data_indices) {
9654       if (entry.first == FieldNumber) {
9655 #if PERFETTO_DCHECK_IS_ON()
9656         if (strcmp(PERFETTO_DEBUG_FUNCTION_IDENTIFIER(),
9657                    entry.second->type_id_)) {
9658           PERFETTO_FATAL(
9659               "Interned data accessed under different types! Previous type: "
9660               "%s. New type: %s.",
9661               entry.second->type_id_, PERFETTO_DEBUG_FUNCTION_IDENTIFIER());
9662         }
9663 #endif  // PERFETTO_DCHECK_IS_ON()
9664         return reinterpret_cast<InternedDataType*>(entry.second.get());
9665       }
9666     }
9667     // No match -- add a new entry for this field.
9668     for (auto& entry : incremental_state->interned_data_indices) {
9669       if (!entry.first) {
9670         entry.first = FieldNumber;
9671         entry.second.reset(new InternedDataType());
9672 #if PERFETTO_DCHECK_IS_ON()
9673         entry.second->type_id_ = PERFETTO_DEBUG_FUNCTION_IDENTIFIER();
9674 #endif  // PERFETTO_DCHECK_IS_ON()
9675         return reinterpret_cast<InternedDataType*>(entry.second.get());
9676       }
9677     }
9678     // Out of space in the interned data index table.
9679     PERFETTO_CHECK(false);
9680   }
9681 
9682   // The actual interning dictionary for this type of interned data. The actual
9683   // container type is defined by |Traits|, hence the extra layer of template
9684   // indirection here.
9685   typename Traits::template Index<ValueType> index_;
9686 };
9687 
9688 }  // namespace perfetto
9689 
9690 #endif  // INCLUDE_PERFETTO_TRACING_TRACK_EVENT_INTERNED_DATA_INDEX_H_
9691 // gen_amalgamated begin header: include/perfetto/tracing/track_event_legacy.h
9692 /*
9693  * Copyright (C) 2020 The Android Open Source Project
9694  *
9695  * Licensed under the Apache License, Version 2.0 (the "License");
9696  * you may not use this file except in compliance with the License.
9697  * You may obtain a copy of the License at
9698  *
9699  *      http://www.apache.org/licenses/LICENSE-2.0
9700  *
9701  * Unless required by applicable law or agreed to in writing, software
9702  * distributed under the License is distributed on an "AS IS" BASIS,
9703  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9704  * See the License for the specific language governing permissions and
9705  * limitations under the License.
9706  */
9707 
9708 #ifndef INCLUDE_PERFETTO_TRACING_TRACK_EVENT_LEGACY_H_
9709 #define INCLUDE_PERFETTO_TRACING_TRACK_EVENT_LEGACY_H_
9710 
9711 // This file defines a compatibility shim between legacy (Chrome, V8) trace
9712 // event macros and track events. To avoid accidentally introducing legacy
9713 // events in new code, the PERFETTO_ENABLE_LEGACY_TRACE_EVENTS macro must be set
9714 // to 1 activate the compatibility layer.
9715 
9716 // gen_amalgamated expanded: #include "perfetto/base/compiler.h"
9717 // gen_amalgamated expanded: #include "perfetto/tracing/track_event.h"
9718 
9719 #include <stdint.h>
9720 
9721 #ifndef PERFETTO_ENABLE_LEGACY_TRACE_EVENTS
9722 #define PERFETTO_ENABLE_LEGACY_TRACE_EVENTS 0
9723 #endif
9724 
9725 // Ignore GCC warning about a missing argument for a variadic macro parameter.
9726 #pragma GCC system_header
9727 
9728 // ----------------------------------------------------------------------------
9729 // Constants.
9730 // ----------------------------------------------------------------------------
9731 
9732 namespace perfetto {
9733 namespace legacy {
9734 
9735 enum TraceEventFlag {
9736   kTraceEventFlagNone = 0,
9737   kTraceEventFlagCopy = 1u << 0,
9738   kTraceEventFlagHasId = 1u << 1,
9739   kTraceEventFlagScopeOffset = 1u << 2,
9740   kTraceEventFlagScopeExtra = 1u << 3,
9741   kTraceEventFlagExplicitTimestamp = 1u << 4,
9742   kTraceEventFlagAsyncTTS = 1u << 5,
9743   kTraceEventFlagBindToEnclosing = 1u << 6,
9744   kTraceEventFlagFlowIn = 1u << 7,
9745   kTraceEventFlagFlowOut = 1u << 8,
9746   kTraceEventFlagHasContextId = 1u << 9,
9747   kTraceEventFlagHasProcessId = 1u << 10,
9748   kTraceEventFlagHasLocalId = 1u << 11,
9749   kTraceEventFlagHasGlobalId = 1u << 12,
9750   // TODO(eseckler): Remove once we have native support for typed proto events
9751   // in TRACE_EVENT macros.
9752   kTraceEventFlagTypedProtoArgs = 1u << 15,
9753   kTraceEventFlagJavaStringLiterals = 1u << 16,
9754 };
9755 
9756 enum PerfettoLegacyCurrentThreadId { kCurrentThreadId };
9757 
9758 }  // namespace legacy
9759 }  // namespace perfetto
9760 
9761 #if PERFETTO_ENABLE_LEGACY_TRACE_EVENTS
9762 // The following constants are defined in the global namespace, since they were
9763 // originally implemented as macros.
9764 
9765 // Event phases.
9766 static constexpr char TRACE_EVENT_PHASE_BEGIN = 'B';
9767 static constexpr char TRACE_EVENT_PHASE_END = 'E';
9768 static constexpr char TRACE_EVENT_PHASE_COMPLETE = 'X';
9769 static constexpr char TRACE_EVENT_PHASE_INSTANT = 'I';
9770 static constexpr char TRACE_EVENT_PHASE_ASYNC_BEGIN = 'S';
9771 static constexpr char TRACE_EVENT_PHASE_ASYNC_STEP_INTO = 'T';
9772 static constexpr char TRACE_EVENT_PHASE_ASYNC_STEP_PAST = 'p';
9773 static constexpr char TRACE_EVENT_PHASE_ASYNC_END = 'F';
9774 static constexpr char TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN = 'b';
9775 static constexpr char TRACE_EVENT_PHASE_NESTABLE_ASYNC_END = 'e';
9776 static constexpr char TRACE_EVENT_PHASE_NESTABLE_ASYNC_INSTANT = 'n';
9777 static constexpr char TRACE_EVENT_PHASE_FLOW_BEGIN = 's';
9778 static constexpr char TRACE_EVENT_PHASE_FLOW_STEP = 't';
9779 static constexpr char TRACE_EVENT_PHASE_FLOW_END = 'f';
9780 static constexpr char TRACE_EVENT_PHASE_METADATA = 'M';
9781 static constexpr char TRACE_EVENT_PHASE_COUNTER = 'C';
9782 static constexpr char TRACE_EVENT_PHASE_SAMPLE = 'P';
9783 static constexpr char TRACE_EVENT_PHASE_CREATE_OBJECT = 'N';
9784 static constexpr char TRACE_EVENT_PHASE_SNAPSHOT_OBJECT = 'O';
9785 static constexpr char TRACE_EVENT_PHASE_DELETE_OBJECT = 'D';
9786 static constexpr char TRACE_EVENT_PHASE_MEMORY_DUMP = 'v';
9787 static constexpr char TRACE_EVENT_PHASE_MARK = 'R';
9788 static constexpr char TRACE_EVENT_PHASE_CLOCK_SYNC = 'c';
9789 static constexpr char TRACE_EVENT_PHASE_ENTER_CONTEXT = '(';
9790 static constexpr char TRACE_EVENT_PHASE_LEAVE_CONTEXT = ')';
9791 
9792 // Flags for changing the behavior of TRACE_EVENT_API_ADD_TRACE_EVENT.
9793 static constexpr uint32_t TRACE_EVENT_FLAG_NONE =
9794     perfetto::legacy::kTraceEventFlagNone;
9795 static constexpr uint32_t TRACE_EVENT_FLAG_COPY =
9796     perfetto::legacy::kTraceEventFlagCopy;
9797 static constexpr uint32_t TRACE_EVENT_FLAG_HAS_ID =
9798     perfetto::legacy::kTraceEventFlagHasId;
9799 static constexpr uint32_t TRACE_EVENT_FLAG_SCOPE_OFFSET =
9800     perfetto::legacy::kTraceEventFlagScopeOffset;
9801 static constexpr uint32_t TRACE_EVENT_FLAG_SCOPE_EXTRA =
9802     perfetto::legacy::kTraceEventFlagScopeExtra;
9803 static constexpr uint32_t TRACE_EVENT_FLAG_EXPLICIT_TIMESTAMP =
9804     perfetto::legacy::kTraceEventFlagExplicitTimestamp;
9805 static constexpr uint32_t TRACE_EVENT_FLAG_ASYNC_TTS =
9806     perfetto::legacy::kTraceEventFlagAsyncTTS;
9807 static constexpr uint32_t TRACE_EVENT_FLAG_BIND_TO_ENCLOSING =
9808     perfetto::legacy::kTraceEventFlagBindToEnclosing;
9809 static constexpr uint32_t TRACE_EVENT_FLAG_FLOW_IN =
9810     perfetto::legacy::kTraceEventFlagFlowIn;
9811 static constexpr uint32_t TRACE_EVENT_FLAG_FLOW_OUT =
9812     perfetto::legacy::kTraceEventFlagFlowOut;
9813 static constexpr uint32_t TRACE_EVENT_FLAG_HAS_CONTEXT_ID =
9814     perfetto::legacy::kTraceEventFlagHasContextId;
9815 static constexpr uint32_t TRACE_EVENT_FLAG_HAS_PROCESS_ID =
9816     perfetto::legacy::kTraceEventFlagHasProcessId;
9817 static constexpr uint32_t TRACE_EVENT_FLAG_HAS_LOCAL_ID =
9818     perfetto::legacy::kTraceEventFlagHasLocalId;
9819 static constexpr uint32_t TRACE_EVENT_FLAG_HAS_GLOBAL_ID =
9820     perfetto::legacy::kTraceEventFlagHasGlobalId;
9821 static constexpr uint32_t TRACE_EVENT_FLAG_TYPED_PROTO_ARGS =
9822     perfetto::legacy::kTraceEventFlagTypedProtoArgs;
9823 static constexpr uint32_t TRACE_EVENT_FLAG_JAVA_STRING_LITERALS =
9824     perfetto::legacy::kTraceEventFlagJavaStringLiterals;
9825 
9826 static constexpr uint32_t TRACE_EVENT_FLAG_SCOPE_MASK =
9827     TRACE_EVENT_FLAG_SCOPE_OFFSET | TRACE_EVENT_FLAG_SCOPE_EXTRA;
9828 
9829 // Type values for identifying types in the TraceValue union.
9830 static constexpr uint8_t TRACE_VALUE_TYPE_BOOL = 1;
9831 static constexpr uint8_t TRACE_VALUE_TYPE_UINT = 2;
9832 static constexpr uint8_t TRACE_VALUE_TYPE_INT = 3;
9833 static constexpr uint8_t TRACE_VALUE_TYPE_DOUBLE = 4;
9834 static constexpr uint8_t TRACE_VALUE_TYPE_POINTER = 5;
9835 static constexpr uint8_t TRACE_VALUE_TYPE_STRING = 6;
9836 static constexpr uint8_t TRACE_VALUE_TYPE_COPY_STRING = 7;
9837 static constexpr uint8_t TRACE_VALUE_TYPE_CONVERTABLE = 8;
9838 
9839 // Enum reflecting the scope of an INSTANT event. Must fit within
9840 // TRACE_EVENT_FLAG_SCOPE_MASK.
9841 static constexpr uint8_t TRACE_EVENT_SCOPE_GLOBAL = 0u << 2;
9842 static constexpr uint8_t TRACE_EVENT_SCOPE_PROCESS = 1u << 2;
9843 static constexpr uint8_t TRACE_EVENT_SCOPE_THREAD = 2u << 2;
9844 
9845 static constexpr char TRACE_EVENT_SCOPE_NAME_GLOBAL = 'g';
9846 static constexpr char TRACE_EVENT_SCOPE_NAME_PROCESS = 'p';
9847 static constexpr char TRACE_EVENT_SCOPE_NAME_THREAD = 't';
9848 
9849 static constexpr auto TRACE_EVENT_API_CURRENT_THREAD_ID =
9850     perfetto::legacy::kCurrentThreadId;
9851 
9852 #endif  // PERFETTO_ENABLE_LEGACY_TRACE_EVENTS
9853 
9854 // ----------------------------------------------------------------------------
9855 // Internal legacy trace point implementation.
9856 // ----------------------------------------------------------------------------
9857 
9858 namespace perfetto {
9859 namespace legacy {
9860 
9861 // The following user-provided adaptors are used to serialize user-defined
9862 // thread id and time types into track events. For full compatibility, the user
9863 // should also define the following macros appropriately:
9864 //
9865 //   #define TRACE_TIME_TICKS_NOW() ...
9866 //   #define TRACE_TIME_NOW() ...
9867 
9868 // User-provided function to convert an abstract thread id into either a track
9869 // uuid or a pid/tid override. Return true if the conversion succeeded.
9870 template <typename T>
9871 bool ConvertThreadId(const T&,
9872                      uint64_t* track_uuid_out,
9873                      int32_t* pid_override_out,
9874                      int32_t* tid_override_out);
9875 
9876 // User-provided function to convert an abstract timestamp into the trace clock
9877 // timebase in nanoseconds.
9878 template <typename T>
9879 uint64_t ConvertTimestampToTraceTimeNs(const T&);
9880 
9881 // Built-in implementation for events referring to the current thread.
9882 template <>
9883 bool PERFETTO_EXPORT ConvertThreadId(const PerfettoLegacyCurrentThreadId&,
9884                                      uint64_t*,
9885                                      int32_t*,
9886                                      int32_t*);
9887 
9888 }  // namespace legacy
9889 
9890 namespace internal {
9891 
9892 // LegacyTraceId encapsulates an ID that can either be an integer or pointer.
9893 class PERFETTO_EXPORT LegacyTraceId {
9894  public:
9895   // Can be combined with WithScope.
9896   class LocalId {
9897    public:
9898     explicit LocalId(const void* raw_id)
9899         : raw_id_(static_cast<uint64_t>(reinterpret_cast<uintptr_t>(raw_id))) {}
9900     explicit LocalId(uint64_t raw_id) : raw_id_(raw_id) {}
9901     uint64_t raw_id() const { return raw_id_; }
9902 
9903    private:
9904     uint64_t raw_id_;
9905   };
9906 
9907   // Can be combined with WithScope.
9908   class GlobalId {
9909    public:
9910     explicit GlobalId(uint64_t raw_id) : raw_id_(raw_id) {}
9911     uint64_t raw_id() const { return raw_id_; }
9912 
9913    private:
9914     uint64_t raw_id_;
9915   };
9916 
9917   class WithScope {
9918    public:
9919     WithScope(const char* scope, uint64_t raw_id)
9920         : scope_(scope), raw_id_(raw_id) {}
9921     WithScope(const char* scope, LocalId local_id)
9922         : scope_(scope), raw_id_(local_id.raw_id()) {
9923       id_flags_ = legacy::kTraceEventFlagHasLocalId;
9924     }
9925     WithScope(const char* scope, GlobalId global_id)
9926         : scope_(scope), raw_id_(global_id.raw_id()) {
9927       id_flags_ = legacy::kTraceEventFlagHasGlobalId;
9928     }
9929     WithScope(const char* scope, uint64_t prefix, uint64_t raw_id)
9930         : scope_(scope), has_prefix_(true), prefix_(prefix), raw_id_(raw_id) {}
9931     WithScope(const char* scope, uint64_t prefix, GlobalId global_id)
9932         : scope_(scope),
9933           has_prefix_(true),
9934           prefix_(prefix),
9935           raw_id_(global_id.raw_id()) {
9936       id_flags_ = legacy::kTraceEventFlagHasGlobalId;
9937     }
9938     uint64_t raw_id() const { return raw_id_; }
9939     const char* scope() const { return scope_; }
9940     bool has_prefix() const { return has_prefix_; }
9941     uint64_t prefix() const { return prefix_; }
9942     uint32_t id_flags() const { return id_flags_; }
9943 
9944    private:
9945     const char* scope_ = nullptr;
9946     bool has_prefix_ = false;
9947     uint64_t prefix_;
9948     uint64_t raw_id_;
9949     uint32_t id_flags_ = legacy::kTraceEventFlagHasId;
9950   };
9951 
9952   LegacyTraceId(const void* raw_id)
9953       : raw_id_(static_cast<uint64_t>(reinterpret_cast<uintptr_t>(raw_id))) {
9954     id_flags_ = legacy::kTraceEventFlagHasLocalId;
9955   }
9956   explicit LegacyTraceId(uint64_t raw_id) : raw_id_(raw_id) {}
9957   explicit LegacyTraceId(uint32_t raw_id) : raw_id_(raw_id) {}
9958   explicit LegacyTraceId(uint16_t raw_id) : raw_id_(raw_id) {}
9959   explicit LegacyTraceId(uint8_t raw_id) : raw_id_(raw_id) {}
9960   explicit LegacyTraceId(int64_t raw_id)
9961       : raw_id_(static_cast<uint64_t>(raw_id)) {}
9962   explicit LegacyTraceId(int32_t raw_id)
9963       : raw_id_(static_cast<uint64_t>(raw_id)) {}
9964   explicit LegacyTraceId(int16_t raw_id)
9965       : raw_id_(static_cast<uint64_t>(raw_id)) {}
9966   explicit LegacyTraceId(int8_t raw_id)
9967       : raw_id_(static_cast<uint64_t>(raw_id)) {}
9968   explicit LegacyTraceId(LocalId raw_id) : raw_id_(raw_id.raw_id()) {
9969     id_flags_ = legacy::kTraceEventFlagHasLocalId;
9970   }
9971   explicit LegacyTraceId(GlobalId raw_id) : raw_id_(raw_id.raw_id()) {
9972     id_flags_ = legacy::kTraceEventFlagHasGlobalId;
9973   }
9974   explicit LegacyTraceId(WithScope scoped_id)
9975       : scope_(scoped_id.scope()),
9976         has_prefix_(scoped_id.has_prefix()),
9977         prefix_(scoped_id.prefix()),
9978         raw_id_(scoped_id.raw_id()),
9979         id_flags_(scoped_id.id_flags()) {}
9980 
9981   uint64_t raw_id() const { return raw_id_; }
9982   const char* scope() const { return scope_; }
9983   bool has_prefix() const { return has_prefix_; }
9984   uint64_t prefix() const { return prefix_; }
9985   uint32_t id_flags() const { return id_flags_; }
9986 
9987   void Write(protos::pbzero::TrackEvent::LegacyEvent*,
9988              uint32_t event_flags) const;
9989 
9990  private:
9991   const char* scope_ = nullptr;
9992   bool has_prefix_ = false;
9993   uint64_t prefix_;
9994   uint64_t raw_id_;
9995   uint32_t id_flags_ = legacy::kTraceEventFlagHasId;
9996 };
9997 
9998 }  // namespace internal
9999 }  // namespace perfetto
10000 
10001 #if PERFETTO_ENABLE_LEGACY_TRACE_EVENTS
10002 
10003 namespace perfetto {
10004 namespace internal {
10005 
10006 class PERFETTO_EXPORT TrackEventLegacy {
10007  public:
10008   static constexpr protos::pbzero::TrackEvent::Type PhaseToType(char phase) {
10009     // clang-format off
10010     return (phase == TRACE_EVENT_PHASE_BEGIN) ?
10011                protos::pbzero::TrackEvent::TYPE_SLICE_BEGIN :
10012            (phase == TRACE_EVENT_PHASE_END) ?
10013                protos::pbzero::TrackEvent::TYPE_SLICE_END :
10014            (phase == TRACE_EVENT_PHASE_INSTANT) ?
10015                protos::pbzero::TrackEvent::TYPE_INSTANT :
10016            protos::pbzero::TrackEvent::TYPE_UNSPECIFIED;
10017     // clang-format on
10018   }
10019 
10020   // Reduce binary size overhead by outlining most of the code for writing a
10021   // legacy trace event.
10022   template <typename... Args>
10023   static void WriteLegacyEvent(EventContext ctx,
10024                                char phase,
10025                                uint32_t flags,
10026                                Args&&... args) PERFETTO_NO_INLINE {
10027     AddDebugAnnotations(&ctx, std::forward<Args>(args)...);
10028     SetTrackIfNeeded(&ctx, flags);
10029     if (NeedLegacyFlags(phase, flags)) {
10030       auto legacy_event = ctx.event()->set_legacy_event();
10031       SetLegacyFlags(legacy_event, phase, flags);
10032     }
10033   }
10034 
10035   template <typename ThreadIdType, typename... Args>
10036   static void WriteLegacyEventWithIdAndTid(EventContext ctx,
10037                                            char phase,
10038                                            uint32_t flags,
10039                                            const LegacyTraceId& id,
10040                                            const ThreadIdType& thread_id,
10041                                            Args&&... args) PERFETTO_NO_INLINE {
10042     //
10043     // Overrides to consider:
10044     //
10045     // 1. If we have an id, we need to write {unscoped,local,global}_id and/or
10046     //    bind_id.
10047     // 2. If we have a thread id, we need to write track_uuid() or
10048     //    {pid,tid}_override. This happens in embedder code since the thread id
10049     //    is embedder-specified.
10050     // 3. If we have a timestamp, we need to write a different timestamp in the
10051     //    trace packet itself and make sure TrackEvent won't write one
10052     //    internally. This is already done at the call site.
10053     //
10054     flags |= id.id_flags();
10055     AddDebugAnnotations(&ctx, std::forward<Args>(args)...);
10056     int32_t pid_override = 0;
10057     int32_t tid_override = 0;
10058     uint64_t track_uuid = 0;
10059     if (legacy::ConvertThreadId(thread_id, &track_uuid, &pid_override,
10060                                 &tid_override) &&
10061         track_uuid) {
10062       if (track_uuid != ThreadTrack::Current().uuid)
10063         ctx.event()->set_track_uuid(track_uuid);
10064     } else if (pid_override || tid_override) {
10065       // Explicitly clear the track so the overrides below take effect.
10066       ctx.event()->set_track_uuid(0);
10067     } else {
10068       // No pid/tid/track overrides => obey the flags instead.
10069       SetTrackIfNeeded(&ctx, flags);
10070     }
10071     if (NeedLegacyFlags(phase, flags) || pid_override || tid_override) {
10072       auto legacy_event = ctx.event()->set_legacy_event();
10073       SetLegacyFlags(legacy_event, phase, flags);
10074       if (id.id_flags())
10075         id.Write(legacy_event, flags);
10076       if (pid_override)
10077         legacy_event->set_pid_override(pid_override);
10078       if (tid_override)
10079         legacy_event->set_tid_override(tid_override);
10080     }
10081   }
10082 
10083   // No arguments.
10084   static void AddDebugAnnotations(EventContext*) {}
10085 
10086   // One argument.
10087   template <typename ArgType>
10088   static void AddDebugAnnotations(EventContext* ctx,
10089                                   const char* arg_name,
10090                                   ArgType&& arg_value) {
10091     TrackEventInternal::AddDebugAnnotation(ctx, arg_name, arg_value);
10092   }
10093 
10094   // Two arguments.
10095   template <typename ArgType, typename ArgType2>
10096   static void AddDebugAnnotations(EventContext* ctx,
10097                                   const char* arg_name,
10098                                   ArgType&& arg_value,
10099                                   const char* arg_name2,
10100                                   ArgType2&& arg_value2) {
10101     TrackEventInternal::AddDebugAnnotation(ctx, arg_name, arg_value);
10102     TrackEventInternal::AddDebugAnnotation(ctx, arg_name2, arg_value2);
10103   }
10104 
10105  private:
10106   static void SetTrackIfNeeded(EventContext* ctx, uint32_t flags) {
10107     // Note: This avoids the need to set LegacyEvent::instant_event_scope.
10108     auto scope = flags & TRACE_EVENT_FLAG_SCOPE_MASK;
10109     switch (scope) {
10110       case TRACE_EVENT_SCOPE_GLOBAL:
10111         ctx->event()->set_track_uuid(0);
10112         break;
10113       case TRACE_EVENT_SCOPE_PROCESS:
10114         ctx->event()->set_track_uuid(ProcessTrack::Current().uuid);
10115         break;
10116       default:
10117       case TRACE_EVENT_SCOPE_THREAD:
10118         // Thread scope is already the default.
10119         break;
10120     }
10121   }
10122 
10123   static bool NeedLegacyFlags(char phase, uint32_t flags) {
10124     if (PhaseToType(phase) == protos::pbzero::TrackEvent::TYPE_UNSPECIFIED)
10125       return true;
10126     // TODO(skyostil): Implement/deprecate:
10127     // - TRACE_EVENT_FLAG_EXPLICIT_TIMESTAMP
10128     // - TRACE_EVENT_FLAG_HAS_CONTEXT_ID
10129     // - TRACE_EVENT_FLAG_HAS_PROCESS_ID
10130     // - TRACE_EVENT_FLAG_TYPED_PROTO_ARGS
10131     // - TRACE_EVENT_FLAG_JAVA_STRING_LITERALS
10132     return flags &
10133            (TRACE_EVENT_FLAG_HAS_ID | TRACE_EVENT_FLAG_HAS_LOCAL_ID |
10134             TRACE_EVENT_FLAG_HAS_GLOBAL_ID | TRACE_EVENT_FLAG_ASYNC_TTS |
10135             TRACE_EVENT_FLAG_BIND_TO_ENCLOSING | TRACE_EVENT_FLAG_FLOW_IN |
10136             TRACE_EVENT_FLAG_FLOW_OUT);
10137   }
10138 
10139   static void SetLegacyFlags(
10140       protos::pbzero::TrackEvent::LegacyEvent* legacy_event,
10141       char phase,
10142       uint32_t flags) {
10143     if (PhaseToType(phase) == protos::pbzero::TrackEvent::TYPE_UNSPECIFIED)
10144       legacy_event->set_phase(phase);
10145     if (flags & TRACE_EVENT_FLAG_ASYNC_TTS)
10146       legacy_event->set_use_async_tts(true);
10147     if (flags & TRACE_EVENT_FLAG_BIND_TO_ENCLOSING)
10148       legacy_event->set_bind_to_enclosing(true);
10149 
10150     const auto kFlowIn = TRACE_EVENT_FLAG_FLOW_IN;
10151     const auto kFlowOut = TRACE_EVENT_FLAG_FLOW_OUT;
10152     const auto kFlowInOut = kFlowIn | kFlowOut;
10153     if ((flags & kFlowInOut) == kFlowInOut) {
10154       legacy_event->set_flow_direction(
10155           protos::pbzero::TrackEvent::LegacyEvent::FLOW_INOUT);
10156     } else if (flags & kFlowIn) {
10157       legacy_event->set_flow_direction(
10158           protos::pbzero::TrackEvent::LegacyEvent::FLOW_IN);
10159     } else if (flags & kFlowOut) {
10160       legacy_event->set_flow_direction(
10161           protos::pbzero::TrackEvent::LegacyEvent::FLOW_OUT);
10162     }
10163   }
10164 };
10165 
10166 }  // namespace internal
10167 }  // namespace perfetto
10168 
10169 // Implementations for the INTERNAL_* adapter macros used by the trace points
10170 // below.
10171 #define INTERNAL_TRACE_EVENT_ADD(phase, category, name, flags, ...)      \
10172   PERFETTO_INTERNAL_TRACK_EVENT(                                         \
10173       category, ::perfetto::StaticString{name},                          \
10174       ::perfetto::internal::TrackEventLegacy::PhaseToType(phase),        \
10175       [&](perfetto::EventContext ctx) {                                  \
10176         using ::perfetto::internal::TrackEventLegacy;                    \
10177         TrackEventLegacy::WriteLegacyEvent(std::move(ctx), phase, flags, \
10178                                            ##__VA_ARGS__);               \
10179       })
10180 
10181 #define INTERNAL_TRACE_EVENT_ADD_SCOPED(category, name, ...)        \
10182   PERFETTO_INTERNAL_SCOPED_TRACK_EVENT(                             \
10183       category, ::perfetto::StaticString{name},                     \
10184       [&](perfetto::EventContext ctx) {                             \
10185         using ::perfetto::internal::TrackEventLegacy;               \
10186         TrackEventLegacy::AddDebugAnnotations(&ctx, ##__VA_ARGS__); \
10187       })
10188 
10189 #define INTERNAL_TRACE_EVENT_ADD_SCOPED_WITH_FLOW(category, name, bind_id, \
10190                                                   flags, ...)              \
10191   PERFETTO_INTERNAL_SCOPED_TRACK_EVENT(                                    \
10192       category, ::perfetto::StaticString{name},                            \
10193       [&](perfetto::EventContext ctx) {                                    \
10194         using ::perfetto::internal::TrackEventLegacy;                      \
10195         ::perfetto::internal::LegacyTraceId trace_id{bind_id};             \
10196         TrackEventLegacy::WriteLegacyEventWithIdAndTid(                    \
10197             std::move(ctx), TRACE_EVENT_PHASE_BEGIN, flags, trace_id,      \
10198             TRACE_EVENT_API_CURRENT_THREAD_ID, ##__VA_ARGS__);             \
10199       })
10200 
10201 #define INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP(phase, category, name,   \
10202                                                 timestamp, flags, ...)   \
10203   PERFETTO_INTERNAL_TRACK_EVENT(                                         \
10204       category, ::perfetto::StaticString{name},                          \
10205       ::perfetto::internal::TrackEventLegacy::PhaseToType(phase),        \
10206       ::perfetto::legacy::ConvertTimestampToTraceTimeNs(timestamp),      \
10207       [&](perfetto::EventContext ctx) {                                  \
10208         using ::perfetto::internal::TrackEventLegacy;                    \
10209         TrackEventLegacy::WriteLegacyEvent(std::move(ctx), phase, flags, \
10210                                            ##__VA_ARGS__);               \
10211       })
10212 
10213 #define INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                    \
10214     phase, category, name, id, thread_id, timestamp, flags, ...)               \
10215   PERFETTO_INTERNAL_TRACK_EVENT(                                               \
10216       category, ::perfetto::StaticString{name},                                \
10217       ::perfetto::internal::TrackEventLegacy::PhaseToType(phase),              \
10218       ::perfetto::legacy::ConvertTimestampToTraceTimeNs(timestamp),            \
10219       [&](perfetto::EventContext ctx) {                                        \
10220         using ::perfetto::internal::TrackEventLegacy;                          \
10221         ::perfetto::internal::LegacyTraceId trace_id{id};                      \
10222         TrackEventLegacy::WriteLegacyEventWithIdAndTid(                        \
10223             std::move(ctx), phase, flags, trace_id, thread_id, ##__VA_ARGS__); \
10224       })
10225 
10226 #define INTERNAL_TRACE_EVENT_ADD_WITH_ID(phase, category, name, id, flags, \
10227                                          ...)                              \
10228   PERFETTO_INTERNAL_TRACK_EVENT(                                           \
10229       category, ::perfetto::StaticString{name},                            \
10230       ::perfetto::internal::TrackEventLegacy::PhaseToType(phase),          \
10231       [&](perfetto::EventContext ctx) {                                    \
10232         using ::perfetto::internal::TrackEventLegacy;                      \
10233         ::perfetto::internal::LegacyTraceId trace_id{id};                  \
10234         TrackEventLegacy::WriteLegacyEventWithIdAndTid(                    \
10235             std::move(ctx), phase, flags, trace_id,                        \
10236             TRACE_EVENT_API_CURRENT_THREAD_ID, ##__VA_ARGS__);             \
10237       })
10238 
10239 #define INTERNAL_TRACE_EVENT_METADATA_ADD(category, name, ...)         \
10240   INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_METADATA, category, name, \
10241                            TRACE_EVENT_FLAG_NONE)
10242 
10243 // ----------------------------------------------------------------------------
10244 // Legacy tracing common API (adapted from trace_event_common.h).
10245 // ----------------------------------------------------------------------------
10246 
10247 #define TRACE_DISABLED_BY_DEFAULT(name) "disabled-by-default-" name
10248 
10249 // Scoped events.
10250 #define TRACE_EVENT0(category_group, name) \
10251   INTERNAL_TRACE_EVENT_ADD_SCOPED(category_group, name)
10252 #define TRACE_EVENT_WITH_FLOW0(category_group, name, bind_id, flow_flags)  \
10253   INTERNAL_TRACE_EVENT_ADD_SCOPED_WITH_FLOW(category_group, name, bind_id, \
10254                                             flow_flags)
10255 #define TRACE_EVENT1(category_group, name, arg1_name, arg1_val) \
10256   INTERNAL_TRACE_EVENT_ADD_SCOPED(category_group, name, arg1_name, arg1_val)
10257 #define TRACE_EVENT_WITH_FLOW1(category_group, name, bind_id, flow_flags,  \
10258                                arg1_name, arg1_val)                        \
10259   INTERNAL_TRACE_EVENT_ADD_SCOPED_WITH_FLOW(category_group, name, bind_id, \
10260                                             flow_flags, arg1_name, arg1_val)
10261 #define TRACE_EVENT2(category_group, name, arg1_name, arg1_val, arg2_name,   \
10262                      arg2_val)                                               \
10263   INTERNAL_TRACE_EVENT_ADD_SCOPED(category_group, name, arg1_name, arg1_val, \
10264                                   arg2_name, arg2_val)
10265 #define TRACE_EVENT_WITH_FLOW2(category_group, name, bind_id, flow_flags,    \
10266                                arg1_name, arg1_val, arg2_name, arg2_val)     \
10267   INTERNAL_TRACE_EVENT_ADD_SCOPED_WITH_FLOW(category_group, name, bind_id,   \
10268                                             flow_flags, arg1_name, arg1_val, \
10269                                             arg2_name, arg2_val)
10270 
10271 // Instant events.
10272 #define TRACE_EVENT_INSTANT0(category_group, name, scope)                   \
10273   INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, category_group, name, \
10274                            TRACE_EVENT_FLAG_NONE | scope)
10275 #define TRACE_EVENT_INSTANT1(category_group, name, scope, arg1_name, arg1_val) \
10276   INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, category_group, name,    \
10277                            TRACE_EVENT_FLAG_NONE | scope, arg1_name, arg1_val)
10278 #define TRACE_EVENT_INSTANT2(category_group, name, scope, arg1_name, arg1_val, \
10279                              arg2_name, arg2_val)                              \
10280   INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, category_group, name,    \
10281                            TRACE_EVENT_FLAG_NONE | scope, arg1_name, arg1_val, \
10282                            arg2_name, arg2_val)
10283 #define TRACE_EVENT_COPY_INSTANT0(category_group, name, scope)              \
10284   INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, category_group, name, \
10285                            TRACE_EVENT_FLAG_COPY | scope)
10286 #define TRACE_EVENT_COPY_INSTANT1(category_group, name, scope, arg1_name,   \
10287                                   arg1_val)                                 \
10288   INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, category_group, name, \
10289                            TRACE_EVENT_FLAG_COPY | scope, arg1_name, arg1_val)
10290 #define TRACE_EVENT_COPY_INSTANT2(category_group, name, scope, arg1_name,      \
10291                                   arg1_val, arg2_name, arg2_val)               \
10292   INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, category_group, name,    \
10293                            TRACE_EVENT_FLAG_COPY | scope, arg1_name, arg1_val, \
10294                            arg2_name, arg2_val)
10295 #define TRACE_EVENT_INSTANT_WITH_FLAGS0(category_group, name, scope_and_flags) \
10296   INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, category_group, name,    \
10297                            scope_and_flags)
10298 #define TRACE_EVENT_INSTANT_WITH_FLAGS1(category_group, name, scope_and_flags, \
10299                                         arg1_name, arg1_val)                   \
10300   INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, category_group, name,    \
10301                            scope_and_flags, arg1_name, arg1_val)
10302 
10303 // Instant events with explicit timestamps.
10304 #define TRACE_EVENT_INSTANT_WITH_TIMESTAMP0(category_group, name, scope,   \
10305                                             timestamp)                     \
10306   INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP(TRACE_EVENT_PHASE_INSTANT,       \
10307                                           category_group, name, timestamp, \
10308                                           TRACE_EVENT_FLAG_NONE | scope)
10309 
10310 #define TRACE_EVENT_INSTANT_WITH_TIMESTAMP1(category_group, name, scope,  \
10311                                             timestamp, arg_name, arg_val) \
10312   INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP(                                \
10313       TRACE_EVENT_PHASE_INSTANT, category_group, name, timestamp,         \
10314       TRACE_EVENT_FLAG_NONE | scope, arg_name, arg_val)
10315 
10316 // Begin events.
10317 #define TRACE_EVENT_BEGIN0(category_group, name)                          \
10318   INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, category_group, name, \
10319                            TRACE_EVENT_FLAG_NONE)
10320 #define TRACE_EVENT_BEGIN1(category_group, name, arg1_name, arg1_val)     \
10321   INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, category_group, name, \
10322                            TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val)
10323 #define TRACE_EVENT_BEGIN2(category_group, name, arg1_name, arg1_val,     \
10324                            arg2_name, arg2_val)                           \
10325   INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, category_group, name, \
10326                            TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val,    \
10327                            arg2_name, arg2_val)
10328 #define TRACE_EVENT_BEGIN_WITH_FLAGS0(category_group, name, flags) \
10329   INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, category_group, name, flags)
10330 #define TRACE_EVENT_BEGIN_WITH_FLAGS1(category_group, name, flags, arg1_name, \
10331                                       arg1_val)                               \
10332   INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, category_group, name,     \
10333                            flags, arg1_name, arg1_val)
10334 #define TRACE_EVENT_COPY_BEGIN2(category_group, name, arg1_name, arg1_val, \
10335                                 arg2_name, arg2_val)                       \
10336   INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, category_group, name,  \
10337                            TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val,     \
10338                            arg2_name, arg2_val)
10339 
10340 // Begin events with explicit timestamps.
10341 #define TRACE_EVENT_BEGIN_WITH_ID_TID_AND_TIMESTAMP0(category_group, name, id, \
10342                                                      thread_id, timestamp)     \
10343   INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                          \
10344       TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id, thread_id,      \
10345       timestamp, TRACE_EVENT_FLAG_NONE)
10346 #define TRACE_EVENT_COPY_BEGIN_WITH_ID_TID_AND_TIMESTAMP0(                \
10347     category_group, name, id, thread_id, timestamp)                       \
10348   INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                     \
10349       TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id, thread_id, \
10350       timestamp, TRACE_EVENT_FLAG_COPY)
10351 #define TRACE_EVENT_COPY_BEGIN_WITH_ID_TID_AND_TIMESTAMP1(                \
10352     category_group, name, id, thread_id, timestamp, arg1_name, arg1_val)  \
10353   INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                     \
10354       TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id, thread_id, \
10355       timestamp, TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val)
10356 #define TRACE_EVENT_COPY_BEGIN_WITH_ID_TID_AND_TIMESTAMP2(                \
10357     category_group, name, id, thread_id, timestamp, arg1_name, arg1_val,  \
10358     arg2_name, arg2_val)                                                  \
10359   INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                     \
10360       TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id, thread_id, \
10361       timestamp, TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, arg2_name,   \
10362       arg2_val)
10363 
10364 // End events.
10365 #define TRACE_EVENT_END0(category_group, name)                          \
10366   INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, category_group, name, \
10367                            TRACE_EVENT_FLAG_NONE)
10368 #define TRACE_EVENT_END1(category_group, name, arg1_name, arg1_val)     \
10369   INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, category_group, name, \
10370                            TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val)
10371 #define TRACE_EVENT_END2(category_group, name, arg1_name, arg1_val, arg2_name, \
10372                          arg2_val)                                             \
10373   INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, category_group, name,        \
10374                            TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val,         \
10375                            arg2_name, arg2_val)
10376 #define TRACE_EVENT_END_WITH_FLAGS0(category_group, name, flags) \
10377   INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, category_group, name, flags)
10378 #define TRACE_EVENT_END_WITH_FLAGS1(category_group, name, flags, arg1_name,    \
10379                                     arg1_val)                                  \
10380   INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, category_group, name, flags, \
10381                            arg1_name, arg1_val)
10382 #define TRACE_EVENT_COPY_END2(category_group, name, arg1_name, arg1_val, \
10383                               arg2_name, arg2_val)                       \
10384   INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, category_group, name,  \
10385                            TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val,   \
10386                            arg2_name, arg2_val)
10387 
10388 // Mark events.
10389 #define TRACE_EVENT_MARK_WITH_TIMESTAMP0(category_group, name, timestamp)  \
10390   INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP(TRACE_EVENT_PHASE_MARK,          \
10391                                           category_group, name, timestamp, \
10392                                           TRACE_EVENT_FLAG_NONE)
10393 
10394 #define TRACE_EVENT_MARK_WITH_TIMESTAMP1(category_group, name, timestamp, \
10395                                          arg1_name, arg1_val)             \
10396   INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP(                                \
10397       TRACE_EVENT_PHASE_MARK, category_group, name, timestamp,            \
10398       TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val)
10399 
10400 #define TRACE_EVENT_MARK_WITH_TIMESTAMP2(                                      \
10401     category_group, name, timestamp, arg1_name, arg1_val, arg2_name, arg2_val) \
10402   INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP(                                     \
10403       TRACE_EVENT_PHASE_MARK, category_group, name, timestamp,                 \
10404       TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, arg2_name, arg2_val)
10405 
10406 #define TRACE_EVENT_COPY_MARK(category_group, name)                      \
10407   INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_MARK, category_group, name, \
10408                            TRACE_EVENT_FLAG_COPY)
10409 
10410 #define TRACE_EVENT_COPY_MARK1(category_group, name, arg1_name, arg1_val) \
10411   INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_MARK, category_group, name,  \
10412                            TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val)
10413 
10414 #define TRACE_EVENT_COPY_MARK_WITH_TIMESTAMP(category_group, name, timestamp) \
10415   INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP(TRACE_EVENT_PHASE_MARK,             \
10416                                           category_group, name, timestamp,    \
10417                                           TRACE_EVENT_FLAG_COPY)
10418 
10419 // End events with explicit thread and timestamp.
10420 #define TRACE_EVENT_END_WITH_ID_TID_AND_TIMESTAMP0(category_group, name, id, \
10421                                                    thread_id, timestamp)     \
10422   INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                        \
10423       TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id, thread_id,      \
10424       timestamp, TRACE_EVENT_FLAG_NONE)
10425 #define TRACE_EVENT_COPY_END_WITH_ID_TID_AND_TIMESTAMP0(                \
10426     category_group, name, id, thread_id, timestamp)                     \
10427   INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                   \
10428       TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id, thread_id, \
10429       timestamp, TRACE_EVENT_FLAG_COPY)
10430 #define TRACE_EVENT_COPY_END_WITH_ID_TID_AND_TIMESTAMP1(                 \
10431     category_group, name, id, thread_id, timestamp, arg1_name, arg1_val) \
10432   INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                    \
10433       TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id, thread_id,  \
10434       timestamp, TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val)
10435 #define TRACE_EVENT_COPY_END_WITH_ID_TID_AND_TIMESTAMP2(                 \
10436     category_group, name, id, thread_id, timestamp, arg1_name, arg1_val, \
10437     arg2_name, arg2_val)                                                 \
10438   INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                    \
10439       TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id, thread_id,  \
10440       timestamp, TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, arg2_name,  \
10441       arg2_val)
10442 
10443 // Counters.
10444 #define TRACE_COUNTER1(category_group, name, value)                         \
10445   INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, category_group, name, \
10446                            TRACE_EVENT_FLAG_NONE, "value",                  \
10447                            static_cast<int>(value))
10448 #define TRACE_COUNTER_WITH_FLAG1(category_group, name, flag, value)         \
10449   INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, category_group, name, \
10450                            flag, "value", static_cast<int>(value))
10451 #define TRACE_COPY_COUNTER1(category_group, name, value)                    \
10452   INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, category_group, name, \
10453                            TRACE_EVENT_FLAG_COPY, "value",                  \
10454                            static_cast<int>(value))
10455 #define TRACE_COUNTER2(category_group, name, value1_name, value1_val,       \
10456                        value2_name, value2_val)                             \
10457   INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, category_group, name, \
10458                            TRACE_EVENT_FLAG_NONE, value1_name,              \
10459                            static_cast<int>(value1_val), value2_name,       \
10460                            static_cast<int>(value2_val))
10461 #define TRACE_COPY_COUNTER2(category_group, name, value1_name, value1_val,  \
10462                             value2_name, value2_val)                        \
10463   INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, category_group, name, \
10464                            TRACE_EVENT_FLAG_COPY, value1_name,              \
10465                            static_cast<int>(value1_val), value2_name,       \
10466                            static_cast<int>(value2_val))
10467 
10468 // Counters with explicit timestamps.
10469 #define TRACE_COUNTER_WITH_TIMESTAMP1(category_group, name, timestamp, value) \
10470   INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP(                                    \
10471       TRACE_EVENT_PHASE_COUNTER, category_group, name, timestamp,             \
10472       TRACE_EVENT_FLAG_NONE, "value", static_cast<int>(value))
10473 
10474 #define TRACE_COUNTER_WITH_TIMESTAMP2(category_group, name, timestamp,      \
10475                                       value1_name, value1_val, value2_name, \
10476                                       value2_val)                           \
10477   INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP(                                  \
10478       TRACE_EVENT_PHASE_COUNTER, category_group, name, timestamp,           \
10479       TRACE_EVENT_FLAG_NONE, value1_name, static_cast<int>(value1_val),     \
10480       value2_name, static_cast<int>(value2_val))
10481 
10482 // Counters with ids.
10483 #define TRACE_COUNTER_ID1(category_group, name, id, value)                    \
10484   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_COUNTER, category_group, \
10485                                    name, id, TRACE_EVENT_FLAG_NONE, "value",  \
10486                                    static_cast<int>(value))
10487 #define TRACE_COPY_COUNTER_ID1(category_group, name, id, value)               \
10488   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_COUNTER, category_group, \
10489                                    name, id, TRACE_EVENT_FLAG_COPY, "value",  \
10490                                    static_cast<int>(value))
10491 #define TRACE_COUNTER_ID2(category_group, name, id, value1_name, value1_val,  \
10492                           value2_name, value2_val)                            \
10493   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_COUNTER, category_group, \
10494                                    name, id, TRACE_EVENT_FLAG_NONE,           \
10495                                    value1_name, static_cast<int>(value1_val), \
10496                                    value2_name, static_cast<int>(value2_val))
10497 #define TRACE_COPY_COUNTER_ID2(category_group, name, id, value1_name,         \
10498                                value1_val, value2_name, value2_val)           \
10499   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_COUNTER, category_group, \
10500                                    name, id, TRACE_EVENT_FLAG_COPY,           \
10501                                    value1_name, static_cast<int>(value1_val), \
10502                                    value2_name, static_cast<int>(value2_val))
10503 
10504 // Sampling profiler events.
10505 #define TRACE_EVENT_SAMPLE_WITH_ID1(category_group, name, id, arg1_name,       \
10506                                     arg1_val)                                  \
10507   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_SAMPLE, category_group,   \
10508                                    name, id, TRACE_EVENT_FLAG_NONE, arg1_name, \
10509                                    arg1_val)
10510 
10511 // Legacy async events.
10512 #define TRACE_EVENT_ASYNC_BEGIN0(category_group, name, id)        \
10513   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \
10514                                    category_group, name, id,      \
10515                                    TRACE_EVENT_FLAG_NONE)
10516 #define TRACE_EVENT_ASYNC_BEGIN1(category_group, name, id, arg1_name, \
10517                                  arg1_val)                            \
10518   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN,     \
10519                                    category_group, name, id,          \
10520                                    TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val)
10521 #define TRACE_EVENT_ASYNC_BEGIN2(category_group, name, id, arg1_name, \
10522                                  arg1_val, arg2_name, arg2_val)       \
10523   INTERNAL_TRACE_EVENT_ADD_WITH_ID(                                   \
10524       TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id,        \
10525       TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, arg2_name, arg2_val)
10526 #define TRACE_EVENT_COPY_ASYNC_BEGIN0(category_group, name, id)   \
10527   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \
10528                                    category_group, name, id,      \
10529                                    TRACE_EVENT_FLAG_COPY)
10530 #define TRACE_EVENT_COPY_ASYNC_BEGIN1(category_group, name, id, arg1_name, \
10531                                       arg1_val)                            \
10532   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN,          \
10533                                    category_group, name, id,               \
10534                                    TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val)
10535 #define TRACE_EVENT_COPY_ASYNC_BEGIN2(category_group, name, id, arg1_name, \
10536                                       arg1_val, arg2_name, arg2_val)       \
10537   INTERNAL_TRACE_EVENT_ADD_WITH_ID(                                        \
10538       TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id,             \
10539       TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, arg2_name, arg2_val)
10540 #define TRACE_EVENT_ASYNC_BEGIN_WITH_FLAGS0(category_group, name, id, flags) \
10541   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN,            \
10542                                    category_group, name, id, flags)
10543 
10544 // Legacy async events with explicit timestamps.
10545 #define TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP0(category_group, name, id, \
10546                                                 timestamp)                \
10547   INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                     \
10548       TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id,            \
10549       TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE)
10550 #define TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP1(                           \
10551     category_group, name, id, timestamp, arg1_name, arg1_val)              \
10552   INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                      \
10553       TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id,             \
10554       TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE, \
10555       arg1_name, arg1_val)
10556 #define TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP2(category_group, name, id,      \
10557                                                 timestamp, arg1_name,          \
10558                                                 arg1_val, arg2_name, arg2_val) \
10559   INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                          \
10560       TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id,                 \
10561       TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE,     \
10562       arg1_name, arg1_val, arg2_name, arg2_val)
10563 #define TRACE_EVENT_COPY_ASYNC_BEGIN_WITH_TIMESTAMP0(category_group, name, id, \
10564                                                      timestamp)                \
10565   INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                          \
10566       TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id,                 \
10567       TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_COPY)
10568 #define TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP_AND_FLAGS0(     \
10569     category_group, name, id, timestamp, flags)                \
10570   INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(          \
10571       TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id, \
10572       TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, flags)
10573 
10574 // Legacy async step into events.
10575 #define TRACE_EVENT_ASYNC_STEP_INTO0(category_group, name, id, step)  \
10576   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_STEP_INTO, \
10577                                    category_group, name, id,          \
10578                                    TRACE_EVENT_FLAG_NONE, "step", step)
10579 #define TRACE_EVENT_ASYNC_STEP_INTO1(category_group, name, id, step, \
10580                                      arg1_name, arg1_val)            \
10581   INTERNAL_TRACE_EVENT_ADD_WITH_ID(                                  \
10582       TRACE_EVENT_PHASE_ASYNC_STEP_INTO, category_group, name, id,   \
10583       TRACE_EVENT_FLAG_NONE, "step", step, arg1_name, arg1_val)
10584 
10585 // Legacy async step into events with timestamps.
10586 #define TRACE_EVENT_ASYNC_STEP_INTO_WITH_TIMESTAMP0(category_group, name, id, \
10587                                                     step, timestamp)          \
10588   INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                         \
10589       TRACE_EVENT_PHASE_ASYNC_STEP_INTO, category_group, name, id,            \
10590       TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE,    \
10591       "step", step)
10592 
10593 // Legacy async step past events.
10594 #define TRACE_EVENT_ASYNC_STEP_PAST0(category_group, name, id, step)  \
10595   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_STEP_PAST, \
10596                                    category_group, name, id,          \
10597                                    TRACE_EVENT_FLAG_NONE, "step", step)
10598 #define TRACE_EVENT_ASYNC_STEP_PAST1(category_group, name, id, step, \
10599                                      arg1_name, arg1_val)            \
10600   INTERNAL_TRACE_EVENT_ADD_WITH_ID(                                  \
10601       TRACE_EVENT_PHASE_ASYNC_STEP_PAST, category_group, name, id,   \
10602       TRACE_EVENT_FLAG_NONE, "step", step, arg1_name, arg1_val)
10603 
10604 // Legacy async end events.
10605 #define TRACE_EVENT_ASYNC_END0(category_group, name, id)        \
10606   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \
10607                                    category_group, name, id,    \
10608                                    TRACE_EVENT_FLAG_NONE)
10609 #define TRACE_EVENT_ASYNC_END1(category_group, name, id, arg1_name, arg1_val) \
10610   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END,               \
10611                                    category_group, name, id,                  \
10612                                    TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val)
10613 #define TRACE_EVENT_ASYNC_END2(category_group, name, id, arg1_name, arg1_val, \
10614                                arg2_name, arg2_val)                           \
10615   INTERNAL_TRACE_EVENT_ADD_WITH_ID(                                           \
10616       TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id,                  \
10617       TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, arg2_name, arg2_val)
10618 #define TRACE_EVENT_COPY_ASYNC_END0(category_group, name, id)   \
10619   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \
10620                                    category_group, name, id,    \
10621                                    TRACE_EVENT_FLAG_COPY)
10622 #define TRACE_EVENT_COPY_ASYNC_END1(category_group, name, id, arg1_name, \
10623                                     arg1_val)                            \
10624   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END,          \
10625                                    category_group, name, id,             \
10626                                    TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val)
10627 #define TRACE_EVENT_COPY_ASYNC_END2(category_group, name, id, arg1_name, \
10628                                     arg1_val, arg2_name, arg2_val)       \
10629   INTERNAL_TRACE_EVENT_ADD_WITH_ID(                                      \
10630       TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id,             \
10631       TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, arg2_name, arg2_val)
10632 #define TRACE_EVENT_ASYNC_END_WITH_FLAGS0(category_group, name, id, flags) \
10633   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END,            \
10634                                    category_group, name, id, flags)
10635 
10636 // Legacy async end events with explicit timestamps.
10637 #define TRACE_EVENT_ASYNC_END_WITH_TIMESTAMP0(category_group, name, id, \
10638                                               timestamp)                \
10639   INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                   \
10640       TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id,            \
10641       TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE)
10642 #define TRACE_EVENT_ASYNC_END_WITH_TIMESTAMP1(category_group, name, id,       \
10643                                               timestamp, arg1_name, arg1_val) \
10644   INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                         \
10645       TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id,                  \
10646       TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE,    \
10647       arg1_name, arg1_val)
10648 #define TRACE_EVENT_ASYNC_END_WITH_TIMESTAMP2(category_group, name, id,       \
10649                                               timestamp, arg1_name, arg1_val, \
10650                                               arg2_name, arg2_val)            \
10651   INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                         \
10652       TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id,                  \
10653       TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE,    \
10654       arg1_name, arg1_val, arg2_name, arg2_val)
10655 #define TRACE_EVENT_COPY_ASYNC_END_WITH_TIMESTAMP0(category_group, name, id, \
10656                                                    timestamp)                \
10657   INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                        \
10658       TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id,                 \
10659       TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_COPY)
10660 #define TRACE_EVENT_ASYNC_END_WITH_TIMESTAMP_AND_FLAGS0(category_group, name, \
10661                                                         id, timestamp, flags) \
10662   INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                         \
10663       TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id,                  \
10664       TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, flags)
10665 
10666 // Async events.
10667 #define TRACE_EVENT_NESTABLE_ASYNC_BEGIN0(category_group, name, id)        \
10668   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, \
10669                                    category_group, name, id,               \
10670                                    TRACE_EVENT_FLAG_NONE)
10671 #define TRACE_EVENT_NESTABLE_ASYNC_BEGIN1(category_group, name, id, arg1_name, \
10672                                           arg1_val)                            \
10673   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN,     \
10674                                    category_group, name, id,                   \
10675                                    TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val)
10676 #define TRACE_EVENT_NESTABLE_ASYNC_BEGIN2(category_group, name, id, arg1_name, \
10677                                           arg1_val, arg2_name, arg2_val)       \
10678   INTERNAL_TRACE_EVENT_ADD_WITH_ID(                                            \
10679       TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, category_group, name, id,        \
10680       TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, arg2_name, arg2_val)
10681 
10682 // Async end events.
10683 #define TRACE_EVENT_NESTABLE_ASYNC_END0(category_group, name, id)        \
10684   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, \
10685                                    category_group, name, id,             \
10686                                    TRACE_EVENT_FLAG_NONE)
10687 #define TRACE_EVENT_NESTABLE_ASYNC_END1(category_group, name, id, arg1_name, \
10688                                         arg1_val)                            \
10689   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_END,     \
10690                                    category_group, name, id,                 \
10691                                    TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val)
10692 #define TRACE_EVENT_NESTABLE_ASYNC_END2(category_group, name, id, arg1_name, \
10693                                         arg1_val, arg2_name, arg2_val)       \
10694   INTERNAL_TRACE_EVENT_ADD_WITH_ID(                                          \
10695       TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, category_group, name, id,        \
10696       TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, arg2_name, arg2_val)
10697 
10698 // Async instant events.
10699 #define TRACE_EVENT_NESTABLE_ASYNC_INSTANT0(category_group, name, id)        \
10700   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_INSTANT, \
10701                                    category_group, name, id,                 \
10702                                    TRACE_EVENT_FLAG_NONE)
10703 #define TRACE_EVENT_NESTABLE_ASYNC_INSTANT1(category_group, name, id,        \
10704                                             arg1_name, arg1_val)             \
10705   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_INSTANT, \
10706                                    category_group, name, id,                 \
10707                                    TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val)
10708 #define TRACE_EVENT_NESTABLE_ASYNC_INSTANT2(                              \
10709     category_group, name, id, arg1_name, arg1_val, arg2_name, arg2_val)   \
10710   INTERNAL_TRACE_EVENT_ADD_WITH_ID(                                       \
10711       TRACE_EVENT_PHASE_NESTABLE_ASYNC_INSTANT, category_group, name, id, \
10712       TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, arg2_name, arg2_val)
10713 #define TRACE_EVENT_COPY_NESTABLE_ASYNC_BEGIN_WITH_TTS2(                       \
10714     category_group, name, id, arg1_name, arg1_val, arg2_name, arg2_val)        \
10715   INTERNAL_TRACE_EVENT_ADD_WITH_ID(                                            \
10716       TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, category_group, name, id,        \
10717       TRACE_EVENT_FLAG_ASYNC_TTS | TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, \
10718       arg2_name, arg2_val)
10719 #define TRACE_EVENT_COPY_NESTABLE_ASYNC_END_WITH_TTS2(                         \
10720     category_group, name, id, arg1_name, arg1_val, arg2_name, arg2_val)        \
10721   INTERNAL_TRACE_EVENT_ADD_WITH_ID(                                            \
10722       TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, category_group, name, id,          \
10723       TRACE_EVENT_FLAG_ASYNC_TTS | TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, \
10724       arg2_name, arg2_val)
10725 
10726 // Async events with explicit timestamps.
10727 #define TRACE_EVENT_NESTABLE_ASYNC_BEGIN_WITH_TIMESTAMP0(category_group, name, \
10728                                                          id, timestamp)        \
10729   INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                          \
10730       TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, category_group, name, id,        \
10731       TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE)
10732 #define TRACE_EVENT_NESTABLE_ASYNC_END_WITH_TIMESTAMP0(category_group, name, \
10733                                                        id, timestamp)        \
10734   INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                        \
10735       TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, category_group, name, id,        \
10736       TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE)
10737 #define TRACE_EVENT_NESTABLE_ASYNC_END_WITH_TIMESTAMP1(                    \
10738     category_group, name, id, timestamp, arg1_name, arg1_val)              \
10739   INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                      \
10740       TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, category_group, name, id,      \
10741       TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE, \
10742       arg1_name, arg1_val)
10743 #define TRACE_EVENT_NESTABLE_ASYNC_INSTANT_WITH_TIMESTAMP0(               \
10744     category_group, name, id, timestamp)                                  \
10745   INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                     \
10746       TRACE_EVENT_PHASE_NESTABLE_ASYNC_INSTANT, category_group, name, id, \
10747       TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE)
10748 #define TRACE_EVENT_COPY_NESTABLE_ASYNC_BEGIN0(category_group, name, id)   \
10749   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, \
10750                                    category_group, name, id,               \
10751                                    TRACE_EVENT_FLAG_COPY)
10752 #define TRACE_EVENT_COPY_NESTABLE_ASYNC_END0(category_group, name, id)   \
10753   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, \
10754                                    category_group, name, id,             \
10755                                    TRACE_EVENT_FLAG_COPY)
10756 #define TRACE_EVENT_COPY_NESTABLE_ASYNC_BEGIN_WITH_TIMESTAMP0(          \
10757     category_group, name, id, timestamp)                                \
10758   INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                   \
10759       TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, category_group, name, id, \
10760       TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_COPY)
10761 #define TRACE_EVENT_COPY_NESTABLE_ASYNC_END_WITH_TIMESTAMP0(          \
10762     category_group, name, id, timestamp)                              \
10763   INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                 \
10764       TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, category_group, name, id, \
10765       TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_COPY)
10766 
10767 // Legacy flow events.
10768 #define TRACE_EVENT_FLOW_BEGIN0(category_group, name, id)        \
10769   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN, \
10770                                    category_group, name, id,     \
10771                                    TRACE_EVENT_FLAG_NONE)
10772 #define TRACE_EVENT_FLOW_BEGIN1(category_group, name, id, arg1_name, arg1_val) \
10773   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN,               \
10774                                    category_group, name, id,                   \
10775                                    TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val)
10776 #define TRACE_EVENT_FLOW_BEGIN2(category_group, name, id, arg1_name, arg1_val, \
10777                                 arg2_name, arg2_val)                           \
10778   INTERNAL_TRACE_EVENT_ADD_WITH_ID(                                            \
10779       TRACE_EVENT_PHASE_FLOW_BEGIN, category_group, name, id,                  \
10780       TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, arg2_name, arg2_val)
10781 #define TRACE_EVENT_COPY_FLOW_BEGIN0(category_group, name, id)   \
10782   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN, \
10783                                    category_group, name, id,     \
10784                                    TRACE_EVENT_FLAG_COPY)
10785 #define TRACE_EVENT_COPY_FLOW_BEGIN1(category_group, name, id, arg1_name, \
10786                                      arg1_val)                            \
10787   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN,          \
10788                                    category_group, name, id,              \
10789                                    TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val)
10790 #define TRACE_EVENT_COPY_FLOW_BEGIN2(category_group, name, id, arg1_name, \
10791                                      arg1_val, arg2_name, arg2_val)       \
10792   INTERNAL_TRACE_EVENT_ADD_WITH_ID(                                       \
10793       TRACE_EVENT_PHASE_FLOW_BEGIN, category_group, name, id,             \
10794       TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, arg2_name, arg2_val)
10795 
10796 // Legacy flow step events.
10797 #define TRACE_EVENT_FLOW_STEP0(category_group, name, id, step)  \
10798   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_STEP, \
10799                                    category_group, name, id,    \
10800                                    TRACE_EVENT_FLAG_NONE, "step", step)
10801 #define TRACE_EVENT_FLOW_STEP1(category_group, name, id, step, arg1_name, \
10802                                arg1_val)                                  \
10803   INTERNAL_TRACE_EVENT_ADD_WITH_ID(                                       \
10804       TRACE_EVENT_PHASE_FLOW_STEP, category_group, name, id,              \
10805       TRACE_EVENT_FLAG_NONE, "step", step, arg1_name, arg1_val)
10806 #define TRACE_EVENT_COPY_FLOW_STEP0(category_group, name, id, step) \
10807   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_STEP,     \
10808                                    category_group, name, id,        \
10809                                    TRACE_EVENT_FLAG_COPY, "step", step)
10810 #define TRACE_EVENT_COPY_FLOW_STEP1(category_group, name, id, step, arg1_name, \
10811                                     arg1_val)                                  \
10812   INTERNAL_TRACE_EVENT_ADD_WITH_ID(                                            \
10813       TRACE_EVENT_PHASE_FLOW_STEP, category_group, name, id,                   \
10814       TRACE_EVENT_FLAG_COPY, "step", step, arg1_name, arg1_val)
10815 
10816 // Legacy flow end events.
10817 #define TRACE_EVENT_FLOW_END0(category_group, name, id)                        \
10818   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, category_group, \
10819                                    name, id, TRACE_EVENT_FLAG_NONE)
10820 #define TRACE_EVENT_FLOW_END_BIND_TO_ENCLOSING0(category_group, name, id)      \
10821   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, category_group, \
10822                                    name, id,                                   \
10823                                    TRACE_EVENT_FLAG_BIND_TO_ENCLOSING)
10824 #define TRACE_EVENT_FLOW_END1(category_group, name, id, arg1_name, arg1_val)   \
10825   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, category_group, \
10826                                    name, id, TRACE_EVENT_FLAG_NONE, arg1_name, \
10827                                    arg1_val)
10828 #define TRACE_EVENT_FLOW_END2(category_group, name, id, arg1_name, arg1_val,   \
10829                               arg2_name, arg2_val)                             \
10830   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, category_group, \
10831                                    name, id, TRACE_EVENT_FLAG_NONE, arg1_name, \
10832                                    arg1_val, arg2_name, arg2_val)
10833 #define TRACE_EVENT_COPY_FLOW_END0(category_group, name, id)                   \
10834   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, category_group, \
10835                                    name, id, TRACE_EVENT_FLAG_COPY)
10836 #define TRACE_EVENT_COPY_FLOW_END1(category_group, name, id, arg1_name,        \
10837                                    arg1_val)                                   \
10838   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, category_group, \
10839                                    name, id, TRACE_EVENT_FLAG_COPY, arg1_name, \
10840                                    arg1_val)
10841 #define TRACE_EVENT_COPY_FLOW_END2(category_group, name, id, arg1_name,        \
10842                                    arg1_val, arg2_name, arg2_val)              \
10843   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, category_group, \
10844                                    name, id, TRACE_EVENT_FLAG_COPY, arg1_name, \
10845                                    arg1_val, arg2_name, arg2_val)
10846 
10847 // Special strongly typed trace events.
10848 // TODO(skyostil): Migrate these to regular track event trace points.
10849 #define TRACE_TASK_EXECUTION(run_function, task) \
10850   if (false) {                                   \
10851     base::ignore_result(run_function);           \
10852     base::ignore_result(task);                   \
10853   }
10854 
10855 #define TRACE_LOG_MESSAGE(file, message, line) \
10856   if (false) {                                 \
10857     base::ignore_result(file);                 \
10858     base::ignore_result(message);              \
10859     base::ignore_result(line);                 \
10860   }
10861 
10862 // Metadata events.
10863 #define TRACE_EVENT_METADATA1(category_group, name, arg1_name, arg1_val) \
10864   INTERNAL_TRACE_EVENT_METADATA_ADD(category_group, name, arg1_name, arg1_val)
10865 
10866 // Clock sync events.
10867 #define TRACE_EVENT_CLOCK_SYNC_RECEIVER(sync_id)                           \
10868   INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_CLOCK_SYNC, "__metadata",     \
10869                            "clock_sync", TRACE_EVENT_FLAG_NONE, "sync_id", \
10870                            sync_id)
10871 #define TRACE_EVENT_CLOCK_SYNC_ISSUER(sync_id, issue_ts, issue_end_ts)        \
10872   INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP(                                    \
10873       TRACE_EVENT_PHASE_CLOCK_SYNC, "__metadata", "clock_sync", issue_end_ts, \
10874       TRACE_EVENT_FLAG_NONE, "sync_id", sync_id, "issue_ts", issue_ts)
10875 
10876 // Object events.
10877 #define TRACE_EVENT_OBJECT_CREATED_WITH_ID(category_group, name, id) \
10878   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_CREATE_OBJECT,  \
10879                                    category_group, name, id,         \
10880                                    TRACE_EVENT_FLAG_NONE)
10881 
10882 #define TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(category_group, name, id, \
10883                                             snapshot)                 \
10884   INTERNAL_TRACE_EVENT_ADD_WITH_ID(                                   \
10885       TRACE_EVENT_PHASE_SNAPSHOT_OBJECT, category_group, name, id,    \
10886       TRACE_EVENT_FLAG_NONE, "snapshot", snapshot)
10887 
10888 #define TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID_AND_TIMESTAMP(                 \
10889     category_group, name, id, timestamp, snapshot)                         \
10890   INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(                      \
10891       TRACE_EVENT_PHASE_SNAPSHOT_OBJECT, category_group, name, id,         \
10892       TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE, \
10893       "snapshot", snapshot)
10894 
10895 #define TRACE_EVENT_OBJECT_DELETED_WITH_ID(category_group, name, id) \
10896   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_DELETE_OBJECT,  \
10897                                    category_group, name, id,         \
10898                                    TRACE_EVENT_FLAG_NONE)
10899 
10900 // Context events.
10901 #define TRACE_EVENT_ENTER_CONTEXT(category_group, name, context)    \
10902   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ENTER_CONTEXT, \
10903                                    category_group, name, context,   \
10904                                    TRACE_EVENT_FLAG_NONE)
10905 #define TRACE_EVENT_LEAVE_CONTEXT(category_group, name, context)    \
10906   INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_LEAVE_CONTEXT, \
10907                                    category_group, name, context,   \
10908                                    TRACE_EVENT_FLAG_NONE)
10909 
10910 // Macro to efficiently determine if a given category group is enabled.
10911 #define TRACE_EVENT_CATEGORY_GROUP_ENABLED(category, ret) \
10912   do {                                                    \
10913     *ret = TRACE_EVENT_CATEGORY_ENABLED(category);        \
10914   } while (0)
10915 
10916 // Macro to efficiently determine, through polling, if a new trace has begun.
10917 // TODO(skyostil): Implement.
10918 #define TRACE_EVENT_IS_NEW_TRACE(ret) \
10919   do {                                \
10920     *ret = false;                     \
10921   } while (0)
10922 
10923 // ----------------------------------------------------------------------------
10924 // Legacy tracing API (adapted from trace_event.h).
10925 // ----------------------------------------------------------------------------
10926 
10927 // We can implement the following subset of the legacy tracing API without
10928 // involvement from the embedder. APIs such as TRACE_EVENT_API_ADD_TRACE_EVENT
10929 // are still up to the embedder to define.
10930 
10931 #define TRACE_STR_COPY(str) (str)
10932 
10933 #define TRACE_ID_WITH_SCOPE(scope, ...) \
10934   ::perfetto::internal::LegacyTraceId::WithScope(scope, ##__VA_ARGS__)
10935 
10936 // Use this for ids that are unique across processes. This allows different
10937 // processes to use the same id to refer to the same event.
10938 #define TRACE_ID_GLOBAL(id) ::perfetto::internal::LegacyTraceId::GlobalId(id)
10939 
10940 // Use this for ids that are unique within a single process. This allows
10941 // different processes to use the same id to refer to different events.
10942 #define TRACE_ID_LOCAL(id) ::perfetto::internal::LegacyTraceId::LocalId(id)
10943 
10944 // Returns a pointer to a uint8_t which indicates whether tracing is enabled for
10945 // the given category or not. A zero value means tracing is disabled and
10946 // non-zero indicates at least one tracing session for this category is active.
10947 // Note that callers should not make any assumptions at what each bit represents
10948 // in the status byte. Does not support dynamic categories.
10949 #define TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(category)                 \
10950   reinterpret_cast<const uint8_t*>(                                          \
10951       [&] {                                                                  \
10952         static_assert(                                                       \
10953             !::PERFETTO_TRACK_EVENT_NAMESPACE::internal::IsDynamicCategory(  \
10954                 category),                                                   \
10955             "Enabled flag pointers are not supported for dynamic trace "     \
10956             "categories.");                                                  \
10957       },                                                                     \
10958       ::PERFETTO_TRACK_EVENT_NAMESPACE::internal::kConstExprCategoryRegistry \
10959           .GetCategoryState(PERFETTO_GET_CATEGORY_INDEX(category)))
10960 
10961 #endif  // PERFETTO_ENABLE_LEGACY_TRACE_EVENTS
10962 
10963 #endif  // INCLUDE_PERFETTO_TRACING_TRACK_EVENT_LEGACY_H_
10964 /*
10965  * Copyright (C) 2019 The Android Open Source Project
10966  *
10967  * Licensed under the Apache License, Version 2.0 (the "License");
10968  * you may not use this file except in compliance with the License.
10969  * You may obtain a copy of the License at
10970  *
10971  *      http://www.apache.org/licenses/LICENSE-2.0
10972  *
10973  * Unless required by applicable law or agreed to in writing, software
10974  * distributed under the License is distributed on an "AS IS" BASIS,
10975  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10976  * See the License for the specific language governing permissions and
10977  * limitations under the License.
10978  */
10979 
10980 #ifndef INCLUDE_PERFETTO_TRACING_H_
10981 #define INCLUDE_PERFETTO_TRACING_H_
10982 
10983 // This headers wraps all the headers necessary to use the public Perfetto
10984 // Tracing API. Embedders should preferably use this one header to avoid having
10985 // to figure out the various set of header required for each class.
10986 // The only exception to this should be large projects where build time is a
10987 // concern (e.g. chromium), which migh prefer sticking to strict IWYU.
10988 
10989 // gen_amalgamated expanded: #include "perfetto/tracing/buffer_exhausted_policy.h"
10990 // gen_amalgamated expanded: #include "perfetto/tracing/core/data_source_config.h"
10991 // gen_amalgamated expanded: #include "perfetto/tracing/core/data_source_descriptor.h"
10992 // gen_amalgamated expanded: #include "perfetto/tracing/core/trace_config.h"
10993 // gen_amalgamated expanded: #include "perfetto/tracing/data_source.h"
10994 // gen_amalgamated expanded: #include "perfetto/tracing/platform.h"
10995 // gen_amalgamated expanded: #include "perfetto/tracing/tracing.h"
10996 // gen_amalgamated expanded: #include "perfetto/tracing/tracing_backend.h"
10997 // gen_amalgamated expanded: #include "perfetto/tracing/track_event.h"
10998 // gen_amalgamated expanded: #include "perfetto/tracing/track_event_interned_data_index.h"
10999 // gen_amalgamated expanded: #include "perfetto/tracing/track_event_legacy.h"
11000 
11001 #endif  // INCLUDE_PERFETTO_TRACING_H_
11002 // gen_amalgamated begin header: gen/protos/perfetto/common/android_log_constants.gen.h
11003 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
11004 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_ANDROID_LOG_CONSTANTS_PROTO_CPP_H_
11005 #define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_ANDROID_LOG_CONSTANTS_PROTO_CPP_H_
11006 
11007 #include <stdint.h>
11008 #include <bitset>
11009 #include <vector>
11010 #include <string>
11011 #include <type_traits>
11012 
11013 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
11014 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
11015 // gen_amalgamated expanded: #include "perfetto/base/export.h"
11016 
11017 namespace perfetto {
11018 namespace protos {
11019 namespace gen {
11020 enum AndroidLogId : int;
11021 enum AndroidLogPriority : int;
11022 }  // namespace perfetto
11023 }  // namespace protos
11024 }  // namespace gen
11025 
11026 namespace protozero {
11027 class Message;
11028 }  // namespace protozero
11029 
11030 namespace perfetto {
11031 namespace protos {
11032 namespace gen {
11033 enum AndroidLogId : int {
11034   LID_DEFAULT = 0,
11035   LID_RADIO = 1,
11036   LID_EVENTS = 2,
11037   LID_SYSTEM = 3,
11038   LID_CRASH = 4,
11039   LID_STATS = 5,
11040   LID_SECURITY = 6,
11041   LID_KERNEL = 7,
11042 };
11043 enum AndroidLogPriority : int {
11044   PRIO_UNSPECIFIED = 0,
11045   PRIO_UNUSED = 1,
11046   PRIO_VERBOSE = 2,
11047   PRIO_DEBUG = 3,
11048   PRIO_INFO = 4,
11049   PRIO_WARN = 5,
11050   PRIO_ERROR = 6,
11051   PRIO_FATAL = 7,
11052 };
11053 }  // namespace perfetto
11054 }  // namespace protos
11055 }  // namespace gen
11056 
11057 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_ANDROID_LOG_CONSTANTS_PROTO_CPP_H_
11058 // gen_amalgamated begin header: gen/protos/perfetto/common/builtin_clock.gen.h
11059 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
11060 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_BUILTIN_CLOCK_PROTO_CPP_H_
11061 #define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_BUILTIN_CLOCK_PROTO_CPP_H_
11062 
11063 #include <stdint.h>
11064 #include <bitset>
11065 #include <vector>
11066 #include <string>
11067 #include <type_traits>
11068 
11069 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
11070 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
11071 // gen_amalgamated expanded: #include "perfetto/base/export.h"
11072 
11073 namespace perfetto {
11074 namespace protos {
11075 namespace gen {
11076 enum BuiltinClock : int;
11077 }  // namespace perfetto
11078 }  // namespace protos
11079 }  // namespace gen
11080 
11081 namespace protozero {
11082 class Message;
11083 }  // namespace protozero
11084 
11085 namespace perfetto {
11086 namespace protos {
11087 namespace gen {
11088 enum BuiltinClock : int {
11089   BUILTIN_CLOCK_UNKNOWN = 0,
11090   BUILTIN_CLOCK_REALTIME = 1,
11091   BUILTIN_CLOCK_REALTIME_COARSE = 2,
11092   BUILTIN_CLOCK_MONOTONIC = 3,
11093   BUILTIN_CLOCK_MONOTONIC_COARSE = 4,
11094   BUILTIN_CLOCK_MONOTONIC_RAW = 5,
11095   BUILTIN_CLOCK_BOOTTIME = 6,
11096   BUILTIN_CLOCK_MAX_ID = 63,
11097 };
11098 }  // namespace perfetto
11099 }  // namespace protos
11100 }  // namespace gen
11101 
11102 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_BUILTIN_CLOCK_PROTO_CPP_H_
11103 // gen_amalgamated begin header: gen/protos/perfetto/common/commit_data_request.gen.h
11104 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
11105 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_COMMIT_DATA_REQUEST_PROTO_CPP_H_
11106 #define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_COMMIT_DATA_REQUEST_PROTO_CPP_H_
11107 
11108 #include <stdint.h>
11109 #include <bitset>
11110 #include <vector>
11111 #include <string>
11112 #include <type_traits>
11113 
11114 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
11115 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
11116 // gen_amalgamated expanded: #include "perfetto/base/export.h"
11117 
11118 namespace perfetto {
11119 namespace protos {
11120 namespace gen {
11121 class CommitDataRequest;
11122 class CommitDataRequest_ChunkToPatch;
11123 class CommitDataRequest_ChunkToPatch_Patch;
11124 class CommitDataRequest_ChunksToMove;
11125 }  // namespace perfetto
11126 }  // namespace protos
11127 }  // namespace gen
11128 
11129 namespace protozero {
11130 class Message;
11131 }  // namespace protozero
11132 
11133 namespace perfetto {
11134 namespace protos {
11135 namespace gen {
11136 
11137 class PERFETTO_EXPORT CommitDataRequest : public ::protozero::CppMessageObj {
11138  public:
11139   using ChunksToMove = CommitDataRequest_ChunksToMove;
11140   using ChunkToPatch = CommitDataRequest_ChunkToPatch;
11141   enum FieldNumbers {
11142     kChunksToMoveFieldNumber = 1,
11143     kChunksToPatchFieldNumber = 2,
11144     kFlushRequestIdFieldNumber = 3,
11145   };
11146 
11147   CommitDataRequest();
11148   ~CommitDataRequest() override;
11149   CommitDataRequest(CommitDataRequest&&) noexcept;
11150   CommitDataRequest& operator=(CommitDataRequest&&);
11151   CommitDataRequest(const CommitDataRequest&);
11152   CommitDataRequest& operator=(const CommitDataRequest&);
11153   bool operator==(const CommitDataRequest&) const;
11154   bool operator!=(const CommitDataRequest& other) const { return !(*this == other); }
11155 
11156   bool ParseFromArray(const void*, size_t) override;
11157   std::string SerializeAsString() const override;
11158   std::vector<uint8_t> SerializeAsArray() const override;
11159   void Serialize(::protozero::Message*) const;
11160 
11161   int chunks_to_move_size() const { return static_cast<int>(chunks_to_move_.size()); }
11162   const std::vector<CommitDataRequest_ChunksToMove>& chunks_to_move() const { return chunks_to_move_; }
11163   std::vector<CommitDataRequest_ChunksToMove>* mutable_chunks_to_move() { return &chunks_to_move_; }
11164   void clear_chunks_to_move() { chunks_to_move_.clear(); }
11165   CommitDataRequest_ChunksToMove* add_chunks_to_move() { chunks_to_move_.emplace_back(); return &chunks_to_move_.back(); }
11166 
11167   int chunks_to_patch_size() const { return static_cast<int>(chunks_to_patch_.size()); }
11168   const std::vector<CommitDataRequest_ChunkToPatch>& chunks_to_patch() const { return chunks_to_patch_; }
11169   std::vector<CommitDataRequest_ChunkToPatch>* mutable_chunks_to_patch() { return &chunks_to_patch_; }
11170   void clear_chunks_to_patch() { chunks_to_patch_.clear(); }
11171   CommitDataRequest_ChunkToPatch* add_chunks_to_patch() { chunks_to_patch_.emplace_back(); return &chunks_to_patch_.back(); }
11172 
11173   bool has_flush_request_id() const { return _has_field_[3]; }
11174   uint64_t flush_request_id() const { return flush_request_id_; }
11175   void set_flush_request_id(uint64_t value) { flush_request_id_ = value; _has_field_.set(3); }
11176 
11177  private:
11178   std::vector<CommitDataRequest_ChunksToMove> chunks_to_move_;
11179   std::vector<CommitDataRequest_ChunkToPatch> chunks_to_patch_;
11180   uint64_t flush_request_id_{};
11181 
11182   // Allows to preserve unknown protobuf fields for compatibility
11183   // with future versions of .proto files.
11184   std::string unknown_fields_;
11185 
11186   std::bitset<4> _has_field_{};
11187 };
11188 
11189 
11190 class PERFETTO_EXPORT CommitDataRequest_ChunkToPatch : public ::protozero::CppMessageObj {
11191  public:
11192   using Patch = CommitDataRequest_ChunkToPatch_Patch;
11193   enum FieldNumbers {
11194     kTargetBufferFieldNumber = 1,
11195     kWriterIdFieldNumber = 2,
11196     kChunkIdFieldNumber = 3,
11197     kPatchesFieldNumber = 4,
11198     kHasMorePatchesFieldNumber = 5,
11199   };
11200 
11201   CommitDataRequest_ChunkToPatch();
11202   ~CommitDataRequest_ChunkToPatch() override;
11203   CommitDataRequest_ChunkToPatch(CommitDataRequest_ChunkToPatch&&) noexcept;
11204   CommitDataRequest_ChunkToPatch& operator=(CommitDataRequest_ChunkToPatch&&);
11205   CommitDataRequest_ChunkToPatch(const CommitDataRequest_ChunkToPatch&);
11206   CommitDataRequest_ChunkToPatch& operator=(const CommitDataRequest_ChunkToPatch&);
11207   bool operator==(const CommitDataRequest_ChunkToPatch&) const;
11208   bool operator!=(const CommitDataRequest_ChunkToPatch& other) const { return !(*this == other); }
11209 
11210   bool ParseFromArray(const void*, size_t) override;
11211   std::string SerializeAsString() const override;
11212   std::vector<uint8_t> SerializeAsArray() const override;
11213   void Serialize(::protozero::Message*) const;
11214 
11215   bool has_target_buffer() const { return _has_field_[1]; }
11216   uint32_t target_buffer() const { return target_buffer_; }
11217   void set_target_buffer(uint32_t value) { target_buffer_ = value; _has_field_.set(1); }
11218 
11219   bool has_writer_id() const { return _has_field_[2]; }
11220   uint32_t writer_id() const { return writer_id_; }
11221   void set_writer_id(uint32_t value) { writer_id_ = value; _has_field_.set(2); }
11222 
11223   bool has_chunk_id() const { return _has_field_[3]; }
11224   uint32_t chunk_id() const { return chunk_id_; }
11225   void set_chunk_id(uint32_t value) { chunk_id_ = value; _has_field_.set(3); }
11226 
11227   int patches_size() const { return static_cast<int>(patches_.size()); }
11228   const std::vector<CommitDataRequest_ChunkToPatch_Patch>& patches() const { return patches_; }
11229   std::vector<CommitDataRequest_ChunkToPatch_Patch>* mutable_patches() { return &patches_; }
11230   void clear_patches() { patches_.clear(); }
11231   CommitDataRequest_ChunkToPatch_Patch* add_patches() { patches_.emplace_back(); return &patches_.back(); }
11232 
11233   bool has_has_more_patches() const { return _has_field_[5]; }
11234   bool has_more_patches() const { return has_more_patches_; }
11235   void set_has_more_patches(bool value) { has_more_patches_ = value; _has_field_.set(5); }
11236 
11237  private:
11238   uint32_t target_buffer_{};
11239   uint32_t writer_id_{};
11240   uint32_t chunk_id_{};
11241   std::vector<CommitDataRequest_ChunkToPatch_Patch> patches_;
11242   bool has_more_patches_{};
11243 
11244   // Allows to preserve unknown protobuf fields for compatibility
11245   // with future versions of .proto files.
11246   std::string unknown_fields_;
11247 
11248   std::bitset<6> _has_field_{};
11249 };
11250 
11251 
11252 class PERFETTO_EXPORT CommitDataRequest_ChunkToPatch_Patch : public ::protozero::CppMessageObj {
11253  public:
11254   enum FieldNumbers {
11255     kOffsetFieldNumber = 1,
11256     kDataFieldNumber = 2,
11257   };
11258 
11259   CommitDataRequest_ChunkToPatch_Patch();
11260   ~CommitDataRequest_ChunkToPatch_Patch() override;
11261   CommitDataRequest_ChunkToPatch_Patch(CommitDataRequest_ChunkToPatch_Patch&&) noexcept;
11262   CommitDataRequest_ChunkToPatch_Patch& operator=(CommitDataRequest_ChunkToPatch_Patch&&);
11263   CommitDataRequest_ChunkToPatch_Patch(const CommitDataRequest_ChunkToPatch_Patch&);
11264   CommitDataRequest_ChunkToPatch_Patch& operator=(const CommitDataRequest_ChunkToPatch_Patch&);
11265   bool operator==(const CommitDataRequest_ChunkToPatch_Patch&) const;
11266   bool operator!=(const CommitDataRequest_ChunkToPatch_Patch& other) const { return !(*this == other); }
11267 
11268   bool ParseFromArray(const void*, size_t) override;
11269   std::string SerializeAsString() const override;
11270   std::vector<uint8_t> SerializeAsArray() const override;
11271   void Serialize(::protozero::Message*) const;
11272 
11273   bool has_offset() const { return _has_field_[1]; }
11274   uint32_t offset() const { return offset_; }
11275   void set_offset(uint32_t value) { offset_ = value; _has_field_.set(1); }
11276 
11277   bool has_data() const { return _has_field_[2]; }
11278   const std::string& data() const { return data_; }
11279   void set_data(const std::string& value) { data_ = value; _has_field_.set(2); }
11280   void set_data(const void* p, size_t s) { data_.assign(reinterpret_cast<const char*>(p), s); _has_field_.set(2); }
11281 
11282  private:
11283   uint32_t offset_{};
11284   std::string data_{};
11285 
11286   // Allows to preserve unknown protobuf fields for compatibility
11287   // with future versions of .proto files.
11288   std::string unknown_fields_;
11289 
11290   std::bitset<3> _has_field_{};
11291 };
11292 
11293 
11294 class PERFETTO_EXPORT CommitDataRequest_ChunksToMove : public ::protozero::CppMessageObj {
11295  public:
11296   enum FieldNumbers {
11297     kPageFieldNumber = 1,
11298     kChunkFieldNumber = 2,
11299     kTargetBufferFieldNumber = 3,
11300   };
11301 
11302   CommitDataRequest_ChunksToMove();
11303   ~CommitDataRequest_ChunksToMove() override;
11304   CommitDataRequest_ChunksToMove(CommitDataRequest_ChunksToMove&&) noexcept;
11305   CommitDataRequest_ChunksToMove& operator=(CommitDataRequest_ChunksToMove&&);
11306   CommitDataRequest_ChunksToMove(const CommitDataRequest_ChunksToMove&);
11307   CommitDataRequest_ChunksToMove& operator=(const CommitDataRequest_ChunksToMove&);
11308   bool operator==(const CommitDataRequest_ChunksToMove&) const;
11309   bool operator!=(const CommitDataRequest_ChunksToMove& other) const { return !(*this == other); }
11310 
11311   bool ParseFromArray(const void*, size_t) override;
11312   std::string SerializeAsString() const override;
11313   std::vector<uint8_t> SerializeAsArray() const override;
11314   void Serialize(::protozero::Message*) const;
11315 
11316   bool has_page() const { return _has_field_[1]; }
11317   uint32_t page() const { return page_; }
11318   void set_page(uint32_t value) { page_ = value; _has_field_.set(1); }
11319 
11320   bool has_chunk() const { return _has_field_[2]; }
11321   uint32_t chunk() const { return chunk_; }
11322   void set_chunk(uint32_t value) { chunk_ = value; _has_field_.set(2); }
11323 
11324   bool has_target_buffer() const { return _has_field_[3]; }
11325   uint32_t target_buffer() const { return target_buffer_; }
11326   void set_target_buffer(uint32_t value) { target_buffer_ = value; _has_field_.set(3); }
11327 
11328  private:
11329   uint32_t page_{};
11330   uint32_t chunk_{};
11331   uint32_t target_buffer_{};
11332 
11333   // Allows to preserve unknown protobuf fields for compatibility
11334   // with future versions of .proto files.
11335   std::string unknown_fields_;
11336 
11337   std::bitset<4> _has_field_{};
11338 };
11339 
11340 }  // namespace perfetto
11341 }  // namespace protos
11342 }  // namespace gen
11343 
11344 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_COMMIT_DATA_REQUEST_PROTO_CPP_H_
11345 // gen_amalgamated begin header: gen/protos/perfetto/common/data_source_descriptor.gen.h
11346 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
11347 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_DATA_SOURCE_DESCRIPTOR_PROTO_CPP_H_
11348 #define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_DATA_SOURCE_DESCRIPTOR_PROTO_CPP_H_
11349 
11350 #include <stdint.h>
11351 #include <bitset>
11352 #include <vector>
11353 #include <string>
11354 #include <type_traits>
11355 
11356 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
11357 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
11358 // gen_amalgamated expanded: #include "perfetto/base/export.h"
11359 
11360 namespace perfetto {
11361 namespace protos {
11362 namespace gen {
11363 class DataSourceDescriptor;
11364 }  // namespace perfetto
11365 }  // namespace protos
11366 }  // namespace gen
11367 
11368 namespace protozero {
11369 class Message;
11370 }  // namespace protozero
11371 
11372 namespace perfetto {
11373 namespace protos {
11374 namespace gen {
11375 
11376 class PERFETTO_EXPORT DataSourceDescriptor : public ::protozero::CppMessageObj {
11377  public:
11378   enum FieldNumbers {
11379     kNameFieldNumber = 1,
11380     kWillNotifyOnStopFieldNumber = 2,
11381     kWillNotifyOnStartFieldNumber = 3,
11382     kHandlesIncrementalStateClearFieldNumber = 4,
11383     kGpuCounterDescriptorFieldNumber = 5,
11384     kTrackEventDescriptorFieldNumber = 6,
11385   };
11386 
11387   DataSourceDescriptor();
11388   ~DataSourceDescriptor() override;
11389   DataSourceDescriptor(DataSourceDescriptor&&) noexcept;
11390   DataSourceDescriptor& operator=(DataSourceDescriptor&&);
11391   DataSourceDescriptor(const DataSourceDescriptor&);
11392   DataSourceDescriptor& operator=(const DataSourceDescriptor&);
11393   bool operator==(const DataSourceDescriptor&) const;
11394   bool operator!=(const DataSourceDescriptor& other) const { return !(*this == other); }
11395 
11396   bool ParseFromArray(const void*, size_t) override;
11397   std::string SerializeAsString() const override;
11398   std::vector<uint8_t> SerializeAsArray() const override;
11399   void Serialize(::protozero::Message*) const;
11400 
11401   bool has_name() const { return _has_field_[1]; }
11402   const std::string& name() const { return name_; }
11403   void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
11404 
11405   bool has_will_notify_on_stop() const { return _has_field_[2]; }
11406   bool will_notify_on_stop() const { return will_notify_on_stop_; }
11407   void set_will_notify_on_stop(bool value) { will_notify_on_stop_ = value; _has_field_.set(2); }
11408 
11409   bool has_will_notify_on_start() const { return _has_field_[3]; }
11410   bool will_notify_on_start() const { return will_notify_on_start_; }
11411   void set_will_notify_on_start(bool value) { will_notify_on_start_ = value; _has_field_.set(3); }
11412 
11413   bool has_handles_incremental_state_clear() const { return _has_field_[4]; }
11414   bool handles_incremental_state_clear() const { return handles_incremental_state_clear_; }
11415   void set_handles_incremental_state_clear(bool value) { handles_incremental_state_clear_ = value; _has_field_.set(4); }
11416 
11417   const std::string& gpu_counter_descriptor_raw() const { return gpu_counter_descriptor_; }
11418   void set_gpu_counter_descriptor_raw(const std::string& raw) { gpu_counter_descriptor_ = raw; _has_field_.set(5); }
11419 
11420   const std::string& track_event_descriptor_raw() const { return track_event_descriptor_; }
11421   void set_track_event_descriptor_raw(const std::string& raw) { track_event_descriptor_ = raw; _has_field_.set(6); }
11422 
11423  private:
11424   std::string name_{};
11425   bool will_notify_on_stop_{};
11426   bool will_notify_on_start_{};
11427   bool handles_incremental_state_clear_{};
11428   std::string gpu_counter_descriptor_;  // [lazy=true]
11429   std::string track_event_descriptor_;  // [lazy=true]
11430 
11431   // Allows to preserve unknown protobuf fields for compatibility
11432   // with future versions of .proto files.
11433   std::string unknown_fields_;
11434 
11435   std::bitset<7> _has_field_{};
11436 };
11437 
11438 }  // namespace perfetto
11439 }  // namespace protos
11440 }  // namespace gen
11441 
11442 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_DATA_SOURCE_DESCRIPTOR_PROTO_CPP_H_
11443 // gen_amalgamated begin header: gen/protos/perfetto/common/descriptor.gen.h
11444 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
11445 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_DESCRIPTOR_PROTO_CPP_H_
11446 #define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_DESCRIPTOR_PROTO_CPP_H_
11447 
11448 #include <stdint.h>
11449 #include <bitset>
11450 #include <vector>
11451 #include <string>
11452 #include <type_traits>
11453 
11454 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
11455 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
11456 // gen_amalgamated expanded: #include "perfetto/base/export.h"
11457 
11458 namespace perfetto {
11459 namespace protos {
11460 namespace gen {
11461 class OneofOptions;
11462 class EnumValueDescriptorProto;
11463 class EnumDescriptorProto;
11464 class OneofDescriptorProto;
11465 class FieldDescriptorProto;
11466 class DescriptorProto;
11467 class DescriptorProto_ReservedRange;
11468 class FileDescriptorProto;
11469 class FileDescriptorSet;
11470 enum FieldDescriptorProto_Type : int;
11471 enum FieldDescriptorProto_Label : int;
11472 }  // namespace perfetto
11473 }  // namespace protos
11474 }  // namespace gen
11475 
11476 namespace protozero {
11477 class Message;
11478 }  // namespace protozero
11479 
11480 namespace perfetto {
11481 namespace protos {
11482 namespace gen {
11483 enum FieldDescriptorProto_Type : int {
11484   FieldDescriptorProto_Type_TYPE_DOUBLE = 1,
11485   FieldDescriptorProto_Type_TYPE_FLOAT = 2,
11486   FieldDescriptorProto_Type_TYPE_INT64 = 3,
11487   FieldDescriptorProto_Type_TYPE_UINT64 = 4,
11488   FieldDescriptorProto_Type_TYPE_INT32 = 5,
11489   FieldDescriptorProto_Type_TYPE_FIXED64 = 6,
11490   FieldDescriptorProto_Type_TYPE_FIXED32 = 7,
11491   FieldDescriptorProto_Type_TYPE_BOOL = 8,
11492   FieldDescriptorProto_Type_TYPE_STRING = 9,
11493   FieldDescriptorProto_Type_TYPE_GROUP = 10,
11494   FieldDescriptorProto_Type_TYPE_MESSAGE = 11,
11495   FieldDescriptorProto_Type_TYPE_BYTES = 12,
11496   FieldDescriptorProto_Type_TYPE_UINT32 = 13,
11497   FieldDescriptorProto_Type_TYPE_ENUM = 14,
11498   FieldDescriptorProto_Type_TYPE_SFIXED32 = 15,
11499   FieldDescriptorProto_Type_TYPE_SFIXED64 = 16,
11500   FieldDescriptorProto_Type_TYPE_SINT32 = 17,
11501   FieldDescriptorProto_Type_TYPE_SINT64 = 18,
11502 };
11503 enum FieldDescriptorProto_Label : int {
11504   FieldDescriptorProto_Label_LABEL_OPTIONAL = 1,
11505   FieldDescriptorProto_Label_LABEL_REQUIRED = 2,
11506   FieldDescriptorProto_Label_LABEL_REPEATED = 3,
11507 };
11508 
11509 class PERFETTO_EXPORT OneofOptions : public ::protozero::CppMessageObj {
11510  public:
11511   enum FieldNumbers {
11512   };
11513 
11514   OneofOptions();
11515   ~OneofOptions() override;
11516   OneofOptions(OneofOptions&&) noexcept;
11517   OneofOptions& operator=(OneofOptions&&);
11518   OneofOptions(const OneofOptions&);
11519   OneofOptions& operator=(const OneofOptions&);
11520   bool operator==(const OneofOptions&) const;
11521   bool operator!=(const OneofOptions& other) const { return !(*this == other); }
11522 
11523   bool ParseFromArray(const void*, size_t) override;
11524   std::string SerializeAsString() const override;
11525   std::vector<uint8_t> SerializeAsArray() const override;
11526   void Serialize(::protozero::Message*) const;
11527 
11528  private:
11529 
11530   // Allows to preserve unknown protobuf fields for compatibility
11531   // with future versions of .proto files.
11532   std::string unknown_fields_;
11533 
11534   std::bitset<2> _has_field_{};
11535 };
11536 
11537 
11538 class PERFETTO_EXPORT EnumValueDescriptorProto : public ::protozero::CppMessageObj {
11539  public:
11540   enum FieldNumbers {
11541     kNameFieldNumber = 1,
11542     kNumberFieldNumber = 2,
11543   };
11544 
11545   EnumValueDescriptorProto();
11546   ~EnumValueDescriptorProto() override;
11547   EnumValueDescriptorProto(EnumValueDescriptorProto&&) noexcept;
11548   EnumValueDescriptorProto& operator=(EnumValueDescriptorProto&&);
11549   EnumValueDescriptorProto(const EnumValueDescriptorProto&);
11550   EnumValueDescriptorProto& operator=(const EnumValueDescriptorProto&);
11551   bool operator==(const EnumValueDescriptorProto&) const;
11552   bool operator!=(const EnumValueDescriptorProto& other) const { return !(*this == other); }
11553 
11554   bool ParseFromArray(const void*, size_t) override;
11555   std::string SerializeAsString() const override;
11556   std::vector<uint8_t> SerializeAsArray() const override;
11557   void Serialize(::protozero::Message*) const;
11558 
11559   bool has_name() const { return _has_field_[1]; }
11560   const std::string& name() const { return name_; }
11561   void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
11562 
11563   bool has_number() const { return _has_field_[2]; }
11564   int32_t number() const { return number_; }
11565   void set_number(int32_t value) { number_ = value; _has_field_.set(2); }
11566 
11567  private:
11568   std::string name_{};
11569   int32_t number_{};
11570 
11571   // Allows to preserve unknown protobuf fields for compatibility
11572   // with future versions of .proto files.
11573   std::string unknown_fields_;
11574 
11575   std::bitset<3> _has_field_{};
11576 };
11577 
11578 
11579 class PERFETTO_EXPORT EnumDescriptorProto : public ::protozero::CppMessageObj {
11580  public:
11581   enum FieldNumbers {
11582     kNameFieldNumber = 1,
11583     kValueFieldNumber = 2,
11584     kReservedNameFieldNumber = 5,
11585   };
11586 
11587   EnumDescriptorProto();
11588   ~EnumDescriptorProto() override;
11589   EnumDescriptorProto(EnumDescriptorProto&&) noexcept;
11590   EnumDescriptorProto& operator=(EnumDescriptorProto&&);
11591   EnumDescriptorProto(const EnumDescriptorProto&);
11592   EnumDescriptorProto& operator=(const EnumDescriptorProto&);
11593   bool operator==(const EnumDescriptorProto&) const;
11594   bool operator!=(const EnumDescriptorProto& other) const { return !(*this == other); }
11595 
11596   bool ParseFromArray(const void*, size_t) override;
11597   std::string SerializeAsString() const override;
11598   std::vector<uint8_t> SerializeAsArray() const override;
11599   void Serialize(::protozero::Message*) const;
11600 
11601   bool has_name() const { return _has_field_[1]; }
11602   const std::string& name() const { return name_; }
11603   void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
11604 
11605   int value_size() const { return static_cast<int>(value_.size()); }
11606   const std::vector<EnumValueDescriptorProto>& value() const { return value_; }
11607   std::vector<EnumValueDescriptorProto>* mutable_value() { return &value_; }
11608   void clear_value() { value_.clear(); }
11609   EnumValueDescriptorProto* add_value() { value_.emplace_back(); return &value_.back(); }
11610 
11611   int reserved_name_size() const { return static_cast<int>(reserved_name_.size()); }
11612   const std::vector<std::string>& reserved_name() const { return reserved_name_; }
11613   std::vector<std::string>* mutable_reserved_name() { return &reserved_name_; }
11614   void clear_reserved_name() { reserved_name_.clear(); }
11615   void add_reserved_name(std::string value) { reserved_name_.emplace_back(value); }
11616   std::string* add_reserved_name() { reserved_name_.emplace_back(); return &reserved_name_.back(); }
11617 
11618  private:
11619   std::string name_{};
11620   std::vector<EnumValueDescriptorProto> value_;
11621   std::vector<std::string> reserved_name_;
11622 
11623   // Allows to preserve unknown protobuf fields for compatibility
11624   // with future versions of .proto files.
11625   std::string unknown_fields_;
11626 
11627   std::bitset<6> _has_field_{};
11628 };
11629 
11630 
11631 class PERFETTO_EXPORT OneofDescriptorProto : public ::protozero::CppMessageObj {
11632  public:
11633   enum FieldNumbers {
11634     kNameFieldNumber = 1,
11635     kOptionsFieldNumber = 2,
11636   };
11637 
11638   OneofDescriptorProto();
11639   ~OneofDescriptorProto() override;
11640   OneofDescriptorProto(OneofDescriptorProto&&) noexcept;
11641   OneofDescriptorProto& operator=(OneofDescriptorProto&&);
11642   OneofDescriptorProto(const OneofDescriptorProto&);
11643   OneofDescriptorProto& operator=(const OneofDescriptorProto&);
11644   bool operator==(const OneofDescriptorProto&) const;
11645   bool operator!=(const OneofDescriptorProto& other) const { return !(*this == other); }
11646 
11647   bool ParseFromArray(const void*, size_t) override;
11648   std::string SerializeAsString() const override;
11649   std::vector<uint8_t> SerializeAsArray() const override;
11650   void Serialize(::protozero::Message*) const;
11651 
11652   bool has_name() const { return _has_field_[1]; }
11653   const std::string& name() const { return name_; }
11654   void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
11655 
11656   bool has_options() const { return _has_field_[2]; }
11657   const OneofOptions& options() const { return *options_; }
11658   OneofOptions* mutable_options() { _has_field_.set(2); return options_.get(); }
11659 
11660  private:
11661   std::string name_{};
11662   ::protozero::CopyablePtr<OneofOptions> options_;
11663 
11664   // Allows to preserve unknown protobuf fields for compatibility
11665   // with future versions of .proto files.
11666   std::string unknown_fields_;
11667 
11668   std::bitset<3> _has_field_{};
11669 };
11670 
11671 
11672 class PERFETTO_EXPORT FieldDescriptorProto : public ::protozero::CppMessageObj {
11673  public:
11674   using Type = FieldDescriptorProto_Type;
11675   static constexpr auto TYPE_DOUBLE = FieldDescriptorProto_Type_TYPE_DOUBLE;
11676   static constexpr auto TYPE_FLOAT = FieldDescriptorProto_Type_TYPE_FLOAT;
11677   static constexpr auto TYPE_INT64 = FieldDescriptorProto_Type_TYPE_INT64;
11678   static constexpr auto TYPE_UINT64 = FieldDescriptorProto_Type_TYPE_UINT64;
11679   static constexpr auto TYPE_INT32 = FieldDescriptorProto_Type_TYPE_INT32;
11680   static constexpr auto TYPE_FIXED64 = FieldDescriptorProto_Type_TYPE_FIXED64;
11681   static constexpr auto TYPE_FIXED32 = FieldDescriptorProto_Type_TYPE_FIXED32;
11682   static constexpr auto TYPE_BOOL = FieldDescriptorProto_Type_TYPE_BOOL;
11683   static constexpr auto TYPE_STRING = FieldDescriptorProto_Type_TYPE_STRING;
11684   static constexpr auto TYPE_GROUP = FieldDescriptorProto_Type_TYPE_GROUP;
11685   static constexpr auto TYPE_MESSAGE = FieldDescriptorProto_Type_TYPE_MESSAGE;
11686   static constexpr auto TYPE_BYTES = FieldDescriptorProto_Type_TYPE_BYTES;
11687   static constexpr auto TYPE_UINT32 = FieldDescriptorProto_Type_TYPE_UINT32;
11688   static constexpr auto TYPE_ENUM = FieldDescriptorProto_Type_TYPE_ENUM;
11689   static constexpr auto TYPE_SFIXED32 = FieldDescriptorProto_Type_TYPE_SFIXED32;
11690   static constexpr auto TYPE_SFIXED64 = FieldDescriptorProto_Type_TYPE_SFIXED64;
11691   static constexpr auto TYPE_SINT32 = FieldDescriptorProto_Type_TYPE_SINT32;
11692   static constexpr auto TYPE_SINT64 = FieldDescriptorProto_Type_TYPE_SINT64;
11693   static constexpr auto Type_MIN = FieldDescriptorProto_Type_TYPE_DOUBLE;
11694   static constexpr auto Type_MAX = FieldDescriptorProto_Type_TYPE_SINT64;
11695   using Label = FieldDescriptorProto_Label;
11696   static constexpr auto LABEL_OPTIONAL = FieldDescriptorProto_Label_LABEL_OPTIONAL;
11697   static constexpr auto LABEL_REQUIRED = FieldDescriptorProto_Label_LABEL_REQUIRED;
11698   static constexpr auto LABEL_REPEATED = FieldDescriptorProto_Label_LABEL_REPEATED;
11699   static constexpr auto Label_MIN = FieldDescriptorProto_Label_LABEL_OPTIONAL;
11700   static constexpr auto Label_MAX = FieldDescriptorProto_Label_LABEL_REPEATED;
11701   enum FieldNumbers {
11702     kNameFieldNumber = 1,
11703     kNumberFieldNumber = 3,
11704     kLabelFieldNumber = 4,
11705     kTypeFieldNumber = 5,
11706     kTypeNameFieldNumber = 6,
11707     kExtendeeFieldNumber = 2,
11708     kDefaultValueFieldNumber = 7,
11709     kOneofIndexFieldNumber = 9,
11710   };
11711 
11712   FieldDescriptorProto();
11713   ~FieldDescriptorProto() override;
11714   FieldDescriptorProto(FieldDescriptorProto&&) noexcept;
11715   FieldDescriptorProto& operator=(FieldDescriptorProto&&);
11716   FieldDescriptorProto(const FieldDescriptorProto&);
11717   FieldDescriptorProto& operator=(const FieldDescriptorProto&);
11718   bool operator==(const FieldDescriptorProto&) const;
11719   bool operator!=(const FieldDescriptorProto& other) const { return !(*this == other); }
11720 
11721   bool ParseFromArray(const void*, size_t) override;
11722   std::string SerializeAsString() const override;
11723   std::vector<uint8_t> SerializeAsArray() const override;
11724   void Serialize(::protozero::Message*) const;
11725 
11726   bool has_name() const { return _has_field_[1]; }
11727   const std::string& name() const { return name_; }
11728   void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
11729 
11730   bool has_number() const { return _has_field_[3]; }
11731   int32_t number() const { return number_; }
11732   void set_number(int32_t value) { number_ = value; _has_field_.set(3); }
11733 
11734   bool has_label() const { return _has_field_[4]; }
11735   FieldDescriptorProto_Label label() const { return label_; }
11736   void set_label(FieldDescriptorProto_Label value) { label_ = value; _has_field_.set(4); }
11737 
11738   bool has_type() const { return _has_field_[5]; }
11739   FieldDescriptorProto_Type type() const { return type_; }
11740   void set_type(FieldDescriptorProto_Type value) { type_ = value; _has_field_.set(5); }
11741 
11742   bool has_type_name() const { return _has_field_[6]; }
11743   const std::string& type_name() const { return type_name_; }
11744   void set_type_name(const std::string& value) { type_name_ = value; _has_field_.set(6); }
11745 
11746   bool has_extendee() const { return _has_field_[2]; }
11747   const std::string& extendee() const { return extendee_; }
11748   void set_extendee(const std::string& value) { extendee_ = value; _has_field_.set(2); }
11749 
11750   bool has_default_value() const { return _has_field_[7]; }
11751   const std::string& default_value() const { return default_value_; }
11752   void set_default_value(const std::string& value) { default_value_ = value; _has_field_.set(7); }
11753 
11754   bool has_oneof_index() const { return _has_field_[9]; }
11755   int32_t oneof_index() const { return oneof_index_; }
11756   void set_oneof_index(int32_t value) { oneof_index_ = value; _has_field_.set(9); }
11757 
11758  private:
11759   std::string name_{};
11760   int32_t number_{};
11761   FieldDescriptorProto_Label label_{};
11762   FieldDescriptorProto_Type type_{};
11763   std::string type_name_{};
11764   std::string extendee_{};
11765   std::string default_value_{};
11766   int32_t oneof_index_{};
11767 
11768   // Allows to preserve unknown protobuf fields for compatibility
11769   // with future versions of .proto files.
11770   std::string unknown_fields_;
11771 
11772   std::bitset<10> _has_field_{};
11773 };
11774 
11775 
11776 class PERFETTO_EXPORT DescriptorProto : public ::protozero::CppMessageObj {
11777  public:
11778   using ReservedRange = DescriptorProto_ReservedRange;
11779   enum FieldNumbers {
11780     kNameFieldNumber = 1,
11781     kFieldFieldNumber = 2,
11782     kExtensionFieldNumber = 6,
11783     kNestedTypeFieldNumber = 3,
11784     kEnumTypeFieldNumber = 4,
11785     kOneofDeclFieldNumber = 8,
11786     kReservedRangeFieldNumber = 9,
11787     kReservedNameFieldNumber = 10,
11788   };
11789 
11790   DescriptorProto();
11791   ~DescriptorProto() override;
11792   DescriptorProto(DescriptorProto&&) noexcept;
11793   DescriptorProto& operator=(DescriptorProto&&);
11794   DescriptorProto(const DescriptorProto&);
11795   DescriptorProto& operator=(const DescriptorProto&);
11796   bool operator==(const DescriptorProto&) const;
11797   bool operator!=(const DescriptorProto& other) const { return !(*this == other); }
11798 
11799   bool ParseFromArray(const void*, size_t) override;
11800   std::string SerializeAsString() const override;
11801   std::vector<uint8_t> SerializeAsArray() const override;
11802   void Serialize(::protozero::Message*) const;
11803 
11804   bool has_name() const { return _has_field_[1]; }
11805   const std::string& name() const { return name_; }
11806   void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
11807 
11808   int field_size() const { return static_cast<int>(field_.size()); }
11809   const std::vector<FieldDescriptorProto>& field() const { return field_; }
11810   std::vector<FieldDescriptorProto>* mutable_field() { return &field_; }
11811   void clear_field() { field_.clear(); }
11812   FieldDescriptorProto* add_field() { field_.emplace_back(); return &field_.back(); }
11813 
11814   int extension_size() const { return static_cast<int>(extension_.size()); }
11815   const std::vector<FieldDescriptorProto>& extension() const { return extension_; }
11816   std::vector<FieldDescriptorProto>* mutable_extension() { return &extension_; }
11817   void clear_extension() { extension_.clear(); }
11818   FieldDescriptorProto* add_extension() { extension_.emplace_back(); return &extension_.back(); }
11819 
11820   int nested_type_size() const { return static_cast<int>(nested_type_.size()); }
11821   const std::vector<DescriptorProto>& nested_type() const { return nested_type_; }
11822   std::vector<DescriptorProto>* mutable_nested_type() { return &nested_type_; }
11823   void clear_nested_type() { nested_type_.clear(); }
11824   DescriptorProto* add_nested_type() { nested_type_.emplace_back(); return &nested_type_.back(); }
11825 
11826   int enum_type_size() const { return static_cast<int>(enum_type_.size()); }
11827   const std::vector<EnumDescriptorProto>& enum_type() const { return enum_type_; }
11828   std::vector<EnumDescriptorProto>* mutable_enum_type() { return &enum_type_; }
11829   void clear_enum_type() { enum_type_.clear(); }
11830   EnumDescriptorProto* add_enum_type() { enum_type_.emplace_back(); return &enum_type_.back(); }
11831 
11832   int oneof_decl_size() const { return static_cast<int>(oneof_decl_.size()); }
11833   const std::vector<OneofDescriptorProto>& oneof_decl() const { return oneof_decl_; }
11834   std::vector<OneofDescriptorProto>* mutable_oneof_decl() { return &oneof_decl_; }
11835   void clear_oneof_decl() { oneof_decl_.clear(); }
11836   OneofDescriptorProto* add_oneof_decl() { oneof_decl_.emplace_back(); return &oneof_decl_.back(); }
11837 
11838   int reserved_range_size() const { return static_cast<int>(reserved_range_.size()); }
11839   const std::vector<DescriptorProto_ReservedRange>& reserved_range() const { return reserved_range_; }
11840   std::vector<DescriptorProto_ReservedRange>* mutable_reserved_range() { return &reserved_range_; }
11841   void clear_reserved_range() { reserved_range_.clear(); }
11842   DescriptorProto_ReservedRange* add_reserved_range() { reserved_range_.emplace_back(); return &reserved_range_.back(); }
11843 
11844   int reserved_name_size() const { return static_cast<int>(reserved_name_.size()); }
11845   const std::vector<std::string>& reserved_name() const { return reserved_name_; }
11846   std::vector<std::string>* mutable_reserved_name() { return &reserved_name_; }
11847   void clear_reserved_name() { reserved_name_.clear(); }
11848   void add_reserved_name(std::string value) { reserved_name_.emplace_back(value); }
11849   std::string* add_reserved_name() { reserved_name_.emplace_back(); return &reserved_name_.back(); }
11850 
11851  private:
11852   std::string name_{};
11853   std::vector<FieldDescriptorProto> field_;
11854   std::vector<FieldDescriptorProto> extension_;
11855   std::vector<DescriptorProto> nested_type_;
11856   std::vector<EnumDescriptorProto> enum_type_;
11857   std::vector<OneofDescriptorProto> oneof_decl_;
11858   std::vector<DescriptorProto_ReservedRange> reserved_range_;
11859   std::vector<std::string> reserved_name_;
11860 
11861   // Allows to preserve unknown protobuf fields for compatibility
11862   // with future versions of .proto files.
11863   std::string unknown_fields_;
11864 
11865   std::bitset<11> _has_field_{};
11866 };
11867 
11868 
11869 class PERFETTO_EXPORT DescriptorProto_ReservedRange : public ::protozero::CppMessageObj {
11870  public:
11871   enum FieldNumbers {
11872     kStartFieldNumber = 1,
11873     kEndFieldNumber = 2,
11874   };
11875 
11876   DescriptorProto_ReservedRange();
11877   ~DescriptorProto_ReservedRange() override;
11878   DescriptorProto_ReservedRange(DescriptorProto_ReservedRange&&) noexcept;
11879   DescriptorProto_ReservedRange& operator=(DescriptorProto_ReservedRange&&);
11880   DescriptorProto_ReservedRange(const DescriptorProto_ReservedRange&);
11881   DescriptorProto_ReservedRange& operator=(const DescriptorProto_ReservedRange&);
11882   bool operator==(const DescriptorProto_ReservedRange&) const;
11883   bool operator!=(const DescriptorProto_ReservedRange& other) const { return !(*this == other); }
11884 
11885   bool ParseFromArray(const void*, size_t) override;
11886   std::string SerializeAsString() const override;
11887   std::vector<uint8_t> SerializeAsArray() const override;
11888   void Serialize(::protozero::Message*) const;
11889 
11890   bool has_start() const { return _has_field_[1]; }
11891   int32_t start() const { return start_; }
11892   void set_start(int32_t value) { start_ = value; _has_field_.set(1); }
11893 
11894   bool has_end() const { return _has_field_[2]; }
11895   int32_t end() const { return end_; }
11896   void set_end(int32_t value) { end_ = value; _has_field_.set(2); }
11897 
11898  private:
11899   int32_t start_{};
11900   int32_t end_{};
11901 
11902   // Allows to preserve unknown protobuf fields for compatibility
11903   // with future versions of .proto files.
11904   std::string unknown_fields_;
11905 
11906   std::bitset<3> _has_field_{};
11907 };
11908 
11909 
11910 class PERFETTO_EXPORT FileDescriptorProto : public ::protozero::CppMessageObj {
11911  public:
11912   enum FieldNumbers {
11913     kNameFieldNumber = 1,
11914     kPackageFieldNumber = 2,
11915     kDependencyFieldNumber = 3,
11916     kPublicDependencyFieldNumber = 10,
11917     kWeakDependencyFieldNumber = 11,
11918     kMessageTypeFieldNumber = 4,
11919     kEnumTypeFieldNumber = 5,
11920     kExtensionFieldNumber = 7,
11921   };
11922 
11923   FileDescriptorProto();
11924   ~FileDescriptorProto() override;
11925   FileDescriptorProto(FileDescriptorProto&&) noexcept;
11926   FileDescriptorProto& operator=(FileDescriptorProto&&);
11927   FileDescriptorProto(const FileDescriptorProto&);
11928   FileDescriptorProto& operator=(const FileDescriptorProto&);
11929   bool operator==(const FileDescriptorProto&) const;
11930   bool operator!=(const FileDescriptorProto& other) const { return !(*this == other); }
11931 
11932   bool ParseFromArray(const void*, size_t) override;
11933   std::string SerializeAsString() const override;
11934   std::vector<uint8_t> SerializeAsArray() const override;
11935   void Serialize(::protozero::Message*) const;
11936 
11937   bool has_name() const { return _has_field_[1]; }
11938   const std::string& name() const { return name_; }
11939   void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
11940 
11941   bool has_package() const { return _has_field_[2]; }
11942   const std::string& package() const { return package_; }
11943   void set_package(const std::string& value) { package_ = value; _has_field_.set(2); }
11944 
11945   int dependency_size() const { return static_cast<int>(dependency_.size()); }
11946   const std::vector<std::string>& dependency() const { return dependency_; }
11947   std::vector<std::string>* mutable_dependency() { return &dependency_; }
11948   void clear_dependency() { dependency_.clear(); }
11949   void add_dependency(std::string value) { dependency_.emplace_back(value); }
11950   std::string* add_dependency() { dependency_.emplace_back(); return &dependency_.back(); }
11951 
11952   int public_dependency_size() const { return static_cast<int>(public_dependency_.size()); }
11953   const std::vector<int32_t>& public_dependency() const { return public_dependency_; }
11954   std::vector<int32_t>* mutable_public_dependency() { return &public_dependency_; }
11955   void clear_public_dependency() { public_dependency_.clear(); }
11956   void add_public_dependency(int32_t value) { public_dependency_.emplace_back(value); }
11957   int32_t* add_public_dependency() { public_dependency_.emplace_back(); return &public_dependency_.back(); }
11958 
11959   int weak_dependency_size() const { return static_cast<int>(weak_dependency_.size()); }
11960   const std::vector<int32_t>& weak_dependency() const { return weak_dependency_; }
11961   std::vector<int32_t>* mutable_weak_dependency() { return &weak_dependency_; }
11962   void clear_weak_dependency() { weak_dependency_.clear(); }
11963   void add_weak_dependency(int32_t value) { weak_dependency_.emplace_back(value); }
11964   int32_t* add_weak_dependency() { weak_dependency_.emplace_back(); return &weak_dependency_.back(); }
11965 
11966   int message_type_size() const { return static_cast<int>(message_type_.size()); }
11967   const std::vector<DescriptorProto>& message_type() const { return message_type_; }
11968   std::vector<DescriptorProto>* mutable_message_type() { return &message_type_; }
11969   void clear_message_type() { message_type_.clear(); }
11970   DescriptorProto* add_message_type() { message_type_.emplace_back(); return &message_type_.back(); }
11971 
11972   int enum_type_size() const { return static_cast<int>(enum_type_.size()); }
11973   const std::vector<EnumDescriptorProto>& enum_type() const { return enum_type_; }
11974   std::vector<EnumDescriptorProto>* mutable_enum_type() { return &enum_type_; }
11975   void clear_enum_type() { enum_type_.clear(); }
11976   EnumDescriptorProto* add_enum_type() { enum_type_.emplace_back(); return &enum_type_.back(); }
11977 
11978   int extension_size() const { return static_cast<int>(extension_.size()); }
11979   const std::vector<FieldDescriptorProto>& extension() const { return extension_; }
11980   std::vector<FieldDescriptorProto>* mutable_extension() { return &extension_; }
11981   void clear_extension() { extension_.clear(); }
11982   FieldDescriptorProto* add_extension() { extension_.emplace_back(); return &extension_.back(); }
11983 
11984  private:
11985   std::string name_{};
11986   std::string package_{};
11987   std::vector<std::string> dependency_;
11988   std::vector<int32_t> public_dependency_;
11989   std::vector<int32_t> weak_dependency_;
11990   std::vector<DescriptorProto> message_type_;
11991   std::vector<EnumDescriptorProto> enum_type_;
11992   std::vector<FieldDescriptorProto> extension_;
11993 
11994   // Allows to preserve unknown protobuf fields for compatibility
11995   // with future versions of .proto files.
11996   std::string unknown_fields_;
11997 
11998   std::bitset<12> _has_field_{};
11999 };
12000 
12001 
12002 class PERFETTO_EXPORT FileDescriptorSet : public ::protozero::CppMessageObj {
12003  public:
12004   enum FieldNumbers {
12005     kFileFieldNumber = 1,
12006   };
12007 
12008   FileDescriptorSet();
12009   ~FileDescriptorSet() override;
12010   FileDescriptorSet(FileDescriptorSet&&) noexcept;
12011   FileDescriptorSet& operator=(FileDescriptorSet&&);
12012   FileDescriptorSet(const FileDescriptorSet&);
12013   FileDescriptorSet& operator=(const FileDescriptorSet&);
12014   bool operator==(const FileDescriptorSet&) const;
12015   bool operator!=(const FileDescriptorSet& other) const { return !(*this == other); }
12016 
12017   bool ParseFromArray(const void*, size_t) override;
12018   std::string SerializeAsString() const override;
12019   std::vector<uint8_t> SerializeAsArray() const override;
12020   void Serialize(::protozero::Message*) const;
12021 
12022   int file_size() const { return static_cast<int>(file_.size()); }
12023   const std::vector<FileDescriptorProto>& file() const { return file_; }
12024   std::vector<FileDescriptorProto>* mutable_file() { return &file_; }
12025   void clear_file() { file_.clear(); }
12026   FileDescriptorProto* add_file() { file_.emplace_back(); return &file_.back(); }
12027 
12028  private:
12029   std::vector<FileDescriptorProto> file_;
12030 
12031   // Allows to preserve unknown protobuf fields for compatibility
12032   // with future versions of .proto files.
12033   std::string unknown_fields_;
12034 
12035   std::bitset<2> _has_field_{};
12036 };
12037 
12038 }  // namespace perfetto
12039 }  // namespace protos
12040 }  // namespace gen
12041 
12042 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_DESCRIPTOR_PROTO_CPP_H_
12043 // gen_amalgamated begin header: gen/protos/perfetto/common/gpu_counter_descriptor.gen.h
12044 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
12045 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_GPU_COUNTER_DESCRIPTOR_PROTO_CPP_H_
12046 #define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_GPU_COUNTER_DESCRIPTOR_PROTO_CPP_H_
12047 
12048 #include <stdint.h>
12049 #include <bitset>
12050 #include <vector>
12051 #include <string>
12052 #include <type_traits>
12053 
12054 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
12055 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
12056 // gen_amalgamated expanded: #include "perfetto/base/export.h"
12057 
12058 namespace perfetto {
12059 namespace protos {
12060 namespace gen {
12061 class GpuCounterDescriptor;
12062 class GpuCounterDescriptor_GpuCounterBlock;
12063 class GpuCounterDescriptor_GpuCounterSpec;
12064 enum GpuCounterDescriptor_GpuCounterGroup : int;
12065 enum GpuCounterDescriptor_MeasureUnit : int;
12066 }  // namespace perfetto
12067 }  // namespace protos
12068 }  // namespace gen
12069 
12070 namespace protozero {
12071 class Message;
12072 }  // namespace protozero
12073 
12074 namespace perfetto {
12075 namespace protos {
12076 namespace gen {
12077 enum GpuCounterDescriptor_GpuCounterGroup : int {
12078   GpuCounterDescriptor_GpuCounterGroup_UNCLASSIFIED = 0,
12079   GpuCounterDescriptor_GpuCounterGroup_SYSTEM = 1,
12080   GpuCounterDescriptor_GpuCounterGroup_VERTICES = 2,
12081   GpuCounterDescriptor_GpuCounterGroup_FRAGMENTS = 3,
12082   GpuCounterDescriptor_GpuCounterGroup_PRIMITIVES = 4,
12083   GpuCounterDescriptor_GpuCounterGroup_MEMORY = 5,
12084   GpuCounterDescriptor_GpuCounterGroup_COMPUTE = 6,
12085 };
12086 enum GpuCounterDescriptor_MeasureUnit : int {
12087   GpuCounterDescriptor_MeasureUnit_NONE = 0,
12088   GpuCounterDescriptor_MeasureUnit_BIT = 1,
12089   GpuCounterDescriptor_MeasureUnit_KILOBIT = 2,
12090   GpuCounterDescriptor_MeasureUnit_MEGABIT = 3,
12091   GpuCounterDescriptor_MeasureUnit_GIGABIT = 4,
12092   GpuCounterDescriptor_MeasureUnit_TERABIT = 5,
12093   GpuCounterDescriptor_MeasureUnit_PETABIT = 6,
12094   GpuCounterDescriptor_MeasureUnit_BYTE = 7,
12095   GpuCounterDescriptor_MeasureUnit_KILOBYTE = 8,
12096   GpuCounterDescriptor_MeasureUnit_MEGABYTE = 9,
12097   GpuCounterDescriptor_MeasureUnit_GIGABYTE = 10,
12098   GpuCounterDescriptor_MeasureUnit_TERABYTE = 11,
12099   GpuCounterDescriptor_MeasureUnit_PETABYTE = 12,
12100   GpuCounterDescriptor_MeasureUnit_HERTZ = 13,
12101   GpuCounterDescriptor_MeasureUnit_KILOHERTZ = 14,
12102   GpuCounterDescriptor_MeasureUnit_MEGAHERTZ = 15,
12103   GpuCounterDescriptor_MeasureUnit_GIGAHERTZ = 16,
12104   GpuCounterDescriptor_MeasureUnit_TERAHERTZ = 17,
12105   GpuCounterDescriptor_MeasureUnit_PETAHERTZ = 18,
12106   GpuCounterDescriptor_MeasureUnit_NANOSECOND = 19,
12107   GpuCounterDescriptor_MeasureUnit_MICROSECOND = 20,
12108   GpuCounterDescriptor_MeasureUnit_MILLISECOND = 21,
12109   GpuCounterDescriptor_MeasureUnit_SECOND = 22,
12110   GpuCounterDescriptor_MeasureUnit_MINUTE = 23,
12111   GpuCounterDescriptor_MeasureUnit_HOUR = 24,
12112   GpuCounterDescriptor_MeasureUnit_VERTEX = 25,
12113   GpuCounterDescriptor_MeasureUnit_PIXEL = 26,
12114   GpuCounterDescriptor_MeasureUnit_TRIANGLE = 27,
12115   GpuCounterDescriptor_MeasureUnit_PRIMITIVE = 38,
12116   GpuCounterDescriptor_MeasureUnit_FRAGMENT = 39,
12117   GpuCounterDescriptor_MeasureUnit_MILLIWATT = 28,
12118   GpuCounterDescriptor_MeasureUnit_WATT = 29,
12119   GpuCounterDescriptor_MeasureUnit_KILOWATT = 30,
12120   GpuCounterDescriptor_MeasureUnit_JOULE = 31,
12121   GpuCounterDescriptor_MeasureUnit_VOLT = 32,
12122   GpuCounterDescriptor_MeasureUnit_AMPERE = 33,
12123   GpuCounterDescriptor_MeasureUnit_CELSIUS = 34,
12124   GpuCounterDescriptor_MeasureUnit_FAHRENHEIT = 35,
12125   GpuCounterDescriptor_MeasureUnit_KELVIN = 36,
12126   GpuCounterDescriptor_MeasureUnit_PERCENT = 37,
12127   GpuCounterDescriptor_MeasureUnit_INSTRUCTION = 40,
12128 };
12129 
12130 class PERFETTO_EXPORT GpuCounterDescriptor : public ::protozero::CppMessageObj {
12131  public:
12132   using GpuCounterSpec = GpuCounterDescriptor_GpuCounterSpec;
12133   using GpuCounterBlock = GpuCounterDescriptor_GpuCounterBlock;
12134   using GpuCounterGroup = GpuCounterDescriptor_GpuCounterGroup;
12135   static constexpr auto UNCLASSIFIED = GpuCounterDescriptor_GpuCounterGroup_UNCLASSIFIED;
12136   static constexpr auto SYSTEM = GpuCounterDescriptor_GpuCounterGroup_SYSTEM;
12137   static constexpr auto VERTICES = GpuCounterDescriptor_GpuCounterGroup_VERTICES;
12138   static constexpr auto FRAGMENTS = GpuCounterDescriptor_GpuCounterGroup_FRAGMENTS;
12139   static constexpr auto PRIMITIVES = GpuCounterDescriptor_GpuCounterGroup_PRIMITIVES;
12140   static constexpr auto MEMORY = GpuCounterDescriptor_GpuCounterGroup_MEMORY;
12141   static constexpr auto COMPUTE = GpuCounterDescriptor_GpuCounterGroup_COMPUTE;
12142   static constexpr auto GpuCounterGroup_MIN = GpuCounterDescriptor_GpuCounterGroup_UNCLASSIFIED;
12143   static constexpr auto GpuCounterGroup_MAX = GpuCounterDescriptor_GpuCounterGroup_COMPUTE;
12144   using MeasureUnit = GpuCounterDescriptor_MeasureUnit;
12145   static constexpr auto NONE = GpuCounterDescriptor_MeasureUnit_NONE;
12146   static constexpr auto BIT = GpuCounterDescriptor_MeasureUnit_BIT;
12147   static constexpr auto KILOBIT = GpuCounterDescriptor_MeasureUnit_KILOBIT;
12148   static constexpr auto MEGABIT = GpuCounterDescriptor_MeasureUnit_MEGABIT;
12149   static constexpr auto GIGABIT = GpuCounterDescriptor_MeasureUnit_GIGABIT;
12150   static constexpr auto TERABIT = GpuCounterDescriptor_MeasureUnit_TERABIT;
12151   static constexpr auto PETABIT = GpuCounterDescriptor_MeasureUnit_PETABIT;
12152   static constexpr auto BYTE = GpuCounterDescriptor_MeasureUnit_BYTE;
12153   static constexpr auto KILOBYTE = GpuCounterDescriptor_MeasureUnit_KILOBYTE;
12154   static constexpr auto MEGABYTE = GpuCounterDescriptor_MeasureUnit_MEGABYTE;
12155   static constexpr auto GIGABYTE = GpuCounterDescriptor_MeasureUnit_GIGABYTE;
12156   static constexpr auto TERABYTE = GpuCounterDescriptor_MeasureUnit_TERABYTE;
12157   static constexpr auto PETABYTE = GpuCounterDescriptor_MeasureUnit_PETABYTE;
12158   static constexpr auto HERTZ = GpuCounterDescriptor_MeasureUnit_HERTZ;
12159   static constexpr auto KILOHERTZ = GpuCounterDescriptor_MeasureUnit_KILOHERTZ;
12160   static constexpr auto MEGAHERTZ = GpuCounterDescriptor_MeasureUnit_MEGAHERTZ;
12161   static constexpr auto GIGAHERTZ = GpuCounterDescriptor_MeasureUnit_GIGAHERTZ;
12162   static constexpr auto TERAHERTZ = GpuCounterDescriptor_MeasureUnit_TERAHERTZ;
12163   static constexpr auto PETAHERTZ = GpuCounterDescriptor_MeasureUnit_PETAHERTZ;
12164   static constexpr auto NANOSECOND = GpuCounterDescriptor_MeasureUnit_NANOSECOND;
12165   static constexpr auto MICROSECOND = GpuCounterDescriptor_MeasureUnit_MICROSECOND;
12166   static constexpr auto MILLISECOND = GpuCounterDescriptor_MeasureUnit_MILLISECOND;
12167   static constexpr auto SECOND = GpuCounterDescriptor_MeasureUnit_SECOND;
12168   static constexpr auto MINUTE = GpuCounterDescriptor_MeasureUnit_MINUTE;
12169   static constexpr auto HOUR = GpuCounterDescriptor_MeasureUnit_HOUR;
12170   static constexpr auto VERTEX = GpuCounterDescriptor_MeasureUnit_VERTEX;
12171   static constexpr auto PIXEL = GpuCounterDescriptor_MeasureUnit_PIXEL;
12172   static constexpr auto TRIANGLE = GpuCounterDescriptor_MeasureUnit_TRIANGLE;
12173   static constexpr auto PRIMITIVE = GpuCounterDescriptor_MeasureUnit_PRIMITIVE;
12174   static constexpr auto FRAGMENT = GpuCounterDescriptor_MeasureUnit_FRAGMENT;
12175   static constexpr auto MILLIWATT = GpuCounterDescriptor_MeasureUnit_MILLIWATT;
12176   static constexpr auto WATT = GpuCounterDescriptor_MeasureUnit_WATT;
12177   static constexpr auto KILOWATT = GpuCounterDescriptor_MeasureUnit_KILOWATT;
12178   static constexpr auto JOULE = GpuCounterDescriptor_MeasureUnit_JOULE;
12179   static constexpr auto VOLT = GpuCounterDescriptor_MeasureUnit_VOLT;
12180   static constexpr auto AMPERE = GpuCounterDescriptor_MeasureUnit_AMPERE;
12181   static constexpr auto CELSIUS = GpuCounterDescriptor_MeasureUnit_CELSIUS;
12182   static constexpr auto FAHRENHEIT = GpuCounterDescriptor_MeasureUnit_FAHRENHEIT;
12183   static constexpr auto KELVIN = GpuCounterDescriptor_MeasureUnit_KELVIN;
12184   static constexpr auto PERCENT = GpuCounterDescriptor_MeasureUnit_PERCENT;
12185   static constexpr auto INSTRUCTION = GpuCounterDescriptor_MeasureUnit_INSTRUCTION;
12186   static constexpr auto MeasureUnit_MIN = GpuCounterDescriptor_MeasureUnit_NONE;
12187   static constexpr auto MeasureUnit_MAX = GpuCounterDescriptor_MeasureUnit_INSTRUCTION;
12188   enum FieldNumbers {
12189     kSpecsFieldNumber = 1,
12190     kBlocksFieldNumber = 2,
12191     kMinSamplingPeriodNsFieldNumber = 3,
12192     kMaxSamplingPeriodNsFieldNumber = 4,
12193     kSupportsInstrumentedSamplingFieldNumber = 5,
12194   };
12195 
12196   GpuCounterDescriptor();
12197   ~GpuCounterDescriptor() override;
12198   GpuCounterDescriptor(GpuCounterDescriptor&&) noexcept;
12199   GpuCounterDescriptor& operator=(GpuCounterDescriptor&&);
12200   GpuCounterDescriptor(const GpuCounterDescriptor&);
12201   GpuCounterDescriptor& operator=(const GpuCounterDescriptor&);
12202   bool operator==(const GpuCounterDescriptor&) const;
12203   bool operator!=(const GpuCounterDescriptor& other) const { return !(*this == other); }
12204 
12205   bool ParseFromArray(const void*, size_t) override;
12206   std::string SerializeAsString() const override;
12207   std::vector<uint8_t> SerializeAsArray() const override;
12208   void Serialize(::protozero::Message*) const;
12209 
12210   int specs_size() const { return static_cast<int>(specs_.size()); }
12211   const std::vector<GpuCounterDescriptor_GpuCounterSpec>& specs() const { return specs_; }
12212   std::vector<GpuCounterDescriptor_GpuCounterSpec>* mutable_specs() { return &specs_; }
12213   void clear_specs() { specs_.clear(); }
12214   GpuCounterDescriptor_GpuCounterSpec* add_specs() { specs_.emplace_back(); return &specs_.back(); }
12215 
12216   int blocks_size() const { return static_cast<int>(blocks_.size()); }
12217   const std::vector<GpuCounterDescriptor_GpuCounterBlock>& blocks() const { return blocks_; }
12218   std::vector<GpuCounterDescriptor_GpuCounterBlock>* mutable_blocks() { return &blocks_; }
12219   void clear_blocks() { blocks_.clear(); }
12220   GpuCounterDescriptor_GpuCounterBlock* add_blocks() { blocks_.emplace_back(); return &blocks_.back(); }
12221 
12222   bool has_min_sampling_period_ns() const { return _has_field_[3]; }
12223   uint64_t min_sampling_period_ns() const { return min_sampling_period_ns_; }
12224   void set_min_sampling_period_ns(uint64_t value) { min_sampling_period_ns_ = value; _has_field_.set(3); }
12225 
12226   bool has_max_sampling_period_ns() const { return _has_field_[4]; }
12227   uint64_t max_sampling_period_ns() const { return max_sampling_period_ns_; }
12228   void set_max_sampling_period_ns(uint64_t value) { max_sampling_period_ns_ = value; _has_field_.set(4); }
12229 
12230   bool has_supports_instrumented_sampling() const { return _has_field_[5]; }
12231   bool supports_instrumented_sampling() const { return supports_instrumented_sampling_; }
12232   void set_supports_instrumented_sampling(bool value) { supports_instrumented_sampling_ = value; _has_field_.set(5); }
12233 
12234  private:
12235   std::vector<GpuCounterDescriptor_GpuCounterSpec> specs_;
12236   std::vector<GpuCounterDescriptor_GpuCounterBlock> blocks_;
12237   uint64_t min_sampling_period_ns_{};
12238   uint64_t max_sampling_period_ns_{};
12239   bool supports_instrumented_sampling_{};
12240 
12241   // Allows to preserve unknown protobuf fields for compatibility
12242   // with future versions of .proto files.
12243   std::string unknown_fields_;
12244 
12245   std::bitset<6> _has_field_{};
12246 };
12247 
12248 
12249 class PERFETTO_EXPORT GpuCounterDescriptor_GpuCounterBlock : public ::protozero::CppMessageObj {
12250  public:
12251   enum FieldNumbers {
12252     kBlockIdFieldNumber = 1,
12253     kBlockCapacityFieldNumber = 2,
12254     kNameFieldNumber = 3,
12255     kDescriptionFieldNumber = 4,
12256     kCounterIdsFieldNumber = 5,
12257   };
12258 
12259   GpuCounterDescriptor_GpuCounterBlock();
12260   ~GpuCounterDescriptor_GpuCounterBlock() override;
12261   GpuCounterDescriptor_GpuCounterBlock(GpuCounterDescriptor_GpuCounterBlock&&) noexcept;
12262   GpuCounterDescriptor_GpuCounterBlock& operator=(GpuCounterDescriptor_GpuCounterBlock&&);
12263   GpuCounterDescriptor_GpuCounterBlock(const GpuCounterDescriptor_GpuCounterBlock&);
12264   GpuCounterDescriptor_GpuCounterBlock& operator=(const GpuCounterDescriptor_GpuCounterBlock&);
12265   bool operator==(const GpuCounterDescriptor_GpuCounterBlock&) const;
12266   bool operator!=(const GpuCounterDescriptor_GpuCounterBlock& other) const { return !(*this == other); }
12267 
12268   bool ParseFromArray(const void*, size_t) override;
12269   std::string SerializeAsString() const override;
12270   std::vector<uint8_t> SerializeAsArray() const override;
12271   void Serialize(::protozero::Message*) const;
12272 
12273   bool has_block_id() const { return _has_field_[1]; }
12274   uint32_t block_id() const { return block_id_; }
12275   void set_block_id(uint32_t value) { block_id_ = value; _has_field_.set(1); }
12276 
12277   bool has_block_capacity() const { return _has_field_[2]; }
12278   uint32_t block_capacity() const { return block_capacity_; }
12279   void set_block_capacity(uint32_t value) { block_capacity_ = value; _has_field_.set(2); }
12280 
12281   bool has_name() const { return _has_field_[3]; }
12282   const std::string& name() const { return name_; }
12283   void set_name(const std::string& value) { name_ = value; _has_field_.set(3); }
12284 
12285   bool has_description() const { return _has_field_[4]; }
12286   const std::string& description() const { return description_; }
12287   void set_description(const std::string& value) { description_ = value; _has_field_.set(4); }
12288 
12289   int counter_ids_size() const { return static_cast<int>(counter_ids_.size()); }
12290   const std::vector<uint32_t>& counter_ids() const { return counter_ids_; }
12291   std::vector<uint32_t>* mutable_counter_ids() { return &counter_ids_; }
12292   void clear_counter_ids() { counter_ids_.clear(); }
12293   void add_counter_ids(uint32_t value) { counter_ids_.emplace_back(value); }
12294   uint32_t* add_counter_ids() { counter_ids_.emplace_back(); return &counter_ids_.back(); }
12295 
12296  private:
12297   uint32_t block_id_{};
12298   uint32_t block_capacity_{};
12299   std::string name_{};
12300   std::string description_{};
12301   std::vector<uint32_t> counter_ids_;
12302 
12303   // Allows to preserve unknown protobuf fields for compatibility
12304   // with future versions of .proto files.
12305   std::string unknown_fields_;
12306 
12307   std::bitset<6> _has_field_{};
12308 };
12309 
12310 
12311 class PERFETTO_EXPORT GpuCounterDescriptor_GpuCounterSpec : public ::protozero::CppMessageObj {
12312  public:
12313   enum FieldNumbers {
12314     kCounterIdFieldNumber = 1,
12315     kNameFieldNumber = 2,
12316     kDescriptionFieldNumber = 3,
12317     kIntPeakValueFieldNumber = 5,
12318     kDoublePeakValueFieldNumber = 6,
12319     kNumeratorUnitsFieldNumber = 7,
12320     kDenominatorUnitsFieldNumber = 8,
12321     kSelectByDefaultFieldNumber = 9,
12322     kGroupsFieldNumber = 10,
12323   };
12324 
12325   GpuCounterDescriptor_GpuCounterSpec();
12326   ~GpuCounterDescriptor_GpuCounterSpec() override;
12327   GpuCounterDescriptor_GpuCounterSpec(GpuCounterDescriptor_GpuCounterSpec&&) noexcept;
12328   GpuCounterDescriptor_GpuCounterSpec& operator=(GpuCounterDescriptor_GpuCounterSpec&&);
12329   GpuCounterDescriptor_GpuCounterSpec(const GpuCounterDescriptor_GpuCounterSpec&);
12330   GpuCounterDescriptor_GpuCounterSpec& operator=(const GpuCounterDescriptor_GpuCounterSpec&);
12331   bool operator==(const GpuCounterDescriptor_GpuCounterSpec&) const;
12332   bool operator!=(const GpuCounterDescriptor_GpuCounterSpec& other) const { return !(*this == other); }
12333 
12334   bool ParseFromArray(const void*, size_t) override;
12335   std::string SerializeAsString() const override;
12336   std::vector<uint8_t> SerializeAsArray() const override;
12337   void Serialize(::protozero::Message*) const;
12338 
12339   bool has_counter_id() const { return _has_field_[1]; }
12340   uint32_t counter_id() const { return counter_id_; }
12341   void set_counter_id(uint32_t value) { counter_id_ = value; _has_field_.set(1); }
12342 
12343   bool has_name() const { return _has_field_[2]; }
12344   const std::string& name() const { return name_; }
12345   void set_name(const std::string& value) { name_ = value; _has_field_.set(2); }
12346 
12347   bool has_description() const { return _has_field_[3]; }
12348   const std::string& description() const { return description_; }
12349   void set_description(const std::string& value) { description_ = value; _has_field_.set(3); }
12350 
12351   bool has_int_peak_value() const { return _has_field_[5]; }
12352   int64_t int_peak_value() const { return int_peak_value_; }
12353   void set_int_peak_value(int64_t value) { int_peak_value_ = value; _has_field_.set(5); }
12354 
12355   bool has_double_peak_value() const { return _has_field_[6]; }
12356   double double_peak_value() const { return double_peak_value_; }
12357   void set_double_peak_value(double value) { double_peak_value_ = value; _has_field_.set(6); }
12358 
12359   int numerator_units_size() const { return static_cast<int>(numerator_units_.size()); }
12360   const std::vector<GpuCounterDescriptor_MeasureUnit>& numerator_units() const { return numerator_units_; }
12361   std::vector<GpuCounterDescriptor_MeasureUnit>* mutable_numerator_units() { return &numerator_units_; }
12362   void clear_numerator_units() { numerator_units_.clear(); }
12363   void add_numerator_units(GpuCounterDescriptor_MeasureUnit value) { numerator_units_.emplace_back(value); }
12364   GpuCounterDescriptor_MeasureUnit* add_numerator_units() { numerator_units_.emplace_back(); return &numerator_units_.back(); }
12365 
12366   int denominator_units_size() const { return static_cast<int>(denominator_units_.size()); }
12367   const std::vector<GpuCounterDescriptor_MeasureUnit>& denominator_units() const { return denominator_units_; }
12368   std::vector<GpuCounterDescriptor_MeasureUnit>* mutable_denominator_units() { return &denominator_units_; }
12369   void clear_denominator_units() { denominator_units_.clear(); }
12370   void add_denominator_units(GpuCounterDescriptor_MeasureUnit value) { denominator_units_.emplace_back(value); }
12371   GpuCounterDescriptor_MeasureUnit* add_denominator_units() { denominator_units_.emplace_back(); return &denominator_units_.back(); }
12372 
12373   bool has_select_by_default() const { return _has_field_[9]; }
12374   bool select_by_default() const { return select_by_default_; }
12375   void set_select_by_default(bool value) { select_by_default_ = value; _has_field_.set(9); }
12376 
12377   int groups_size() const { return static_cast<int>(groups_.size()); }
12378   const std::vector<GpuCounterDescriptor_GpuCounterGroup>& groups() const { return groups_; }
12379   std::vector<GpuCounterDescriptor_GpuCounterGroup>* mutable_groups() { return &groups_; }
12380   void clear_groups() { groups_.clear(); }
12381   void add_groups(GpuCounterDescriptor_GpuCounterGroup value) { groups_.emplace_back(value); }
12382   GpuCounterDescriptor_GpuCounterGroup* add_groups() { groups_.emplace_back(); return &groups_.back(); }
12383 
12384  private:
12385   uint32_t counter_id_{};
12386   std::string name_{};
12387   std::string description_{};
12388   int64_t int_peak_value_{};
12389   double double_peak_value_{};
12390   std::vector<GpuCounterDescriptor_MeasureUnit> numerator_units_;
12391   std::vector<GpuCounterDescriptor_MeasureUnit> denominator_units_;
12392   bool select_by_default_{};
12393   std::vector<GpuCounterDescriptor_GpuCounterGroup> groups_;
12394 
12395   // Allows to preserve unknown protobuf fields for compatibility
12396   // with future versions of .proto files.
12397   std::string unknown_fields_;
12398 
12399   std::bitset<11> _has_field_{};
12400 };
12401 
12402 }  // namespace perfetto
12403 }  // namespace protos
12404 }  // namespace gen
12405 
12406 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_GPU_COUNTER_DESCRIPTOR_PROTO_CPP_H_
12407 // gen_amalgamated begin header: gen/protos/perfetto/common/observable_events.gen.h
12408 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
12409 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_OBSERVABLE_EVENTS_PROTO_CPP_H_
12410 #define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_OBSERVABLE_EVENTS_PROTO_CPP_H_
12411 
12412 #include <stdint.h>
12413 #include <bitset>
12414 #include <vector>
12415 #include <string>
12416 #include <type_traits>
12417 
12418 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
12419 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
12420 // gen_amalgamated expanded: #include "perfetto/base/export.h"
12421 
12422 namespace perfetto {
12423 namespace protos {
12424 namespace gen {
12425 class ObservableEvents;
12426 class ObservableEvents_DataSourceInstanceStateChange;
12427 enum ObservableEvents_Type : int;
12428 enum ObservableEvents_DataSourceInstanceState : int;
12429 }  // namespace perfetto
12430 }  // namespace protos
12431 }  // namespace gen
12432 
12433 namespace protozero {
12434 class Message;
12435 }  // namespace protozero
12436 
12437 namespace perfetto {
12438 namespace protos {
12439 namespace gen {
12440 enum ObservableEvents_Type : int {
12441   ObservableEvents_Type_TYPE_UNSPECIFIED = 0,
12442   ObservableEvents_Type_TYPE_DATA_SOURCES_INSTANCES = 1,
12443   ObservableEvents_Type_TYPE_ALL_DATA_SOURCES_STARTED = 2,
12444 };
12445 enum ObservableEvents_DataSourceInstanceState : int {
12446   ObservableEvents_DataSourceInstanceState_DATA_SOURCE_INSTANCE_STATE_STOPPED = 1,
12447   ObservableEvents_DataSourceInstanceState_DATA_SOURCE_INSTANCE_STATE_STARTED = 2,
12448 };
12449 
12450 class PERFETTO_EXPORT ObservableEvents : public ::protozero::CppMessageObj {
12451  public:
12452   using DataSourceInstanceStateChange = ObservableEvents_DataSourceInstanceStateChange;
12453   using Type = ObservableEvents_Type;
12454   static constexpr auto TYPE_UNSPECIFIED = ObservableEvents_Type_TYPE_UNSPECIFIED;
12455   static constexpr auto TYPE_DATA_SOURCES_INSTANCES = ObservableEvents_Type_TYPE_DATA_SOURCES_INSTANCES;
12456   static constexpr auto TYPE_ALL_DATA_SOURCES_STARTED = ObservableEvents_Type_TYPE_ALL_DATA_SOURCES_STARTED;
12457   static constexpr auto Type_MIN = ObservableEvents_Type_TYPE_UNSPECIFIED;
12458   static constexpr auto Type_MAX = ObservableEvents_Type_TYPE_ALL_DATA_SOURCES_STARTED;
12459   using DataSourceInstanceState = ObservableEvents_DataSourceInstanceState;
12460   static constexpr auto DATA_SOURCE_INSTANCE_STATE_STOPPED = ObservableEvents_DataSourceInstanceState_DATA_SOURCE_INSTANCE_STATE_STOPPED;
12461   static constexpr auto DATA_SOURCE_INSTANCE_STATE_STARTED = ObservableEvents_DataSourceInstanceState_DATA_SOURCE_INSTANCE_STATE_STARTED;
12462   static constexpr auto DataSourceInstanceState_MIN = ObservableEvents_DataSourceInstanceState_DATA_SOURCE_INSTANCE_STATE_STOPPED;
12463   static constexpr auto DataSourceInstanceState_MAX = ObservableEvents_DataSourceInstanceState_DATA_SOURCE_INSTANCE_STATE_STARTED;
12464   enum FieldNumbers {
12465     kInstanceStateChangesFieldNumber = 1,
12466     kAllDataSourcesStartedFieldNumber = 2,
12467   };
12468 
12469   ObservableEvents();
12470   ~ObservableEvents() override;
12471   ObservableEvents(ObservableEvents&&) noexcept;
12472   ObservableEvents& operator=(ObservableEvents&&);
12473   ObservableEvents(const ObservableEvents&);
12474   ObservableEvents& operator=(const ObservableEvents&);
12475   bool operator==(const ObservableEvents&) const;
12476   bool operator!=(const ObservableEvents& other) const { return !(*this == other); }
12477 
12478   bool ParseFromArray(const void*, size_t) override;
12479   std::string SerializeAsString() const override;
12480   std::vector<uint8_t> SerializeAsArray() const override;
12481   void Serialize(::protozero::Message*) const;
12482 
12483   int instance_state_changes_size() const { return static_cast<int>(instance_state_changes_.size()); }
12484   const std::vector<ObservableEvents_DataSourceInstanceStateChange>& instance_state_changes() const { return instance_state_changes_; }
12485   std::vector<ObservableEvents_DataSourceInstanceStateChange>* mutable_instance_state_changes() { return &instance_state_changes_; }
12486   void clear_instance_state_changes() { instance_state_changes_.clear(); }
12487   ObservableEvents_DataSourceInstanceStateChange* add_instance_state_changes() { instance_state_changes_.emplace_back(); return &instance_state_changes_.back(); }
12488 
12489   bool has_all_data_sources_started() const { return _has_field_[2]; }
12490   bool all_data_sources_started() const { return all_data_sources_started_; }
12491   void set_all_data_sources_started(bool value) { all_data_sources_started_ = value; _has_field_.set(2); }
12492 
12493  private:
12494   std::vector<ObservableEvents_DataSourceInstanceStateChange> instance_state_changes_;
12495   bool all_data_sources_started_{};
12496 
12497   // Allows to preserve unknown protobuf fields for compatibility
12498   // with future versions of .proto files.
12499   std::string unknown_fields_;
12500 
12501   std::bitset<3> _has_field_{};
12502 };
12503 
12504 
12505 class PERFETTO_EXPORT ObservableEvents_DataSourceInstanceStateChange : public ::protozero::CppMessageObj {
12506  public:
12507   enum FieldNumbers {
12508     kProducerNameFieldNumber = 1,
12509     kDataSourceNameFieldNumber = 2,
12510     kStateFieldNumber = 3,
12511   };
12512 
12513   ObservableEvents_DataSourceInstanceStateChange();
12514   ~ObservableEvents_DataSourceInstanceStateChange() override;
12515   ObservableEvents_DataSourceInstanceStateChange(ObservableEvents_DataSourceInstanceStateChange&&) noexcept;
12516   ObservableEvents_DataSourceInstanceStateChange& operator=(ObservableEvents_DataSourceInstanceStateChange&&);
12517   ObservableEvents_DataSourceInstanceStateChange(const ObservableEvents_DataSourceInstanceStateChange&);
12518   ObservableEvents_DataSourceInstanceStateChange& operator=(const ObservableEvents_DataSourceInstanceStateChange&);
12519   bool operator==(const ObservableEvents_DataSourceInstanceStateChange&) const;
12520   bool operator!=(const ObservableEvents_DataSourceInstanceStateChange& other) const { return !(*this == other); }
12521 
12522   bool ParseFromArray(const void*, size_t) override;
12523   std::string SerializeAsString() const override;
12524   std::vector<uint8_t> SerializeAsArray() const override;
12525   void Serialize(::protozero::Message*) const;
12526 
12527   bool has_producer_name() const { return _has_field_[1]; }
12528   const std::string& producer_name() const { return producer_name_; }
12529   void set_producer_name(const std::string& value) { producer_name_ = value; _has_field_.set(1); }
12530 
12531   bool has_data_source_name() const { return _has_field_[2]; }
12532   const std::string& data_source_name() const { return data_source_name_; }
12533   void set_data_source_name(const std::string& value) { data_source_name_ = value; _has_field_.set(2); }
12534 
12535   bool has_state() const { return _has_field_[3]; }
12536   ObservableEvents_DataSourceInstanceState state() const { return state_; }
12537   void set_state(ObservableEvents_DataSourceInstanceState value) { state_ = value; _has_field_.set(3); }
12538 
12539  private:
12540   std::string producer_name_{};
12541   std::string data_source_name_{};
12542   ObservableEvents_DataSourceInstanceState state_{};
12543 
12544   // Allows to preserve unknown protobuf fields for compatibility
12545   // with future versions of .proto files.
12546   std::string unknown_fields_;
12547 
12548   std::bitset<4> _has_field_{};
12549 };
12550 
12551 }  // namespace perfetto
12552 }  // namespace protos
12553 }  // namespace gen
12554 
12555 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_OBSERVABLE_EVENTS_PROTO_CPP_H_
12556 // gen_amalgamated begin header: gen/protos/perfetto/common/sys_stats_counters.gen.h
12557 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
12558 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_SYS_STATS_COUNTERS_PROTO_CPP_H_
12559 #define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_SYS_STATS_COUNTERS_PROTO_CPP_H_
12560 
12561 #include <stdint.h>
12562 #include <bitset>
12563 #include <vector>
12564 #include <string>
12565 #include <type_traits>
12566 
12567 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
12568 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
12569 // gen_amalgamated expanded: #include "perfetto/base/export.h"
12570 
12571 namespace perfetto {
12572 namespace protos {
12573 namespace gen {
12574 enum MeminfoCounters : int;
12575 enum VmstatCounters : int;
12576 }  // namespace perfetto
12577 }  // namespace protos
12578 }  // namespace gen
12579 
12580 namespace protozero {
12581 class Message;
12582 }  // namespace protozero
12583 
12584 namespace perfetto {
12585 namespace protos {
12586 namespace gen {
12587 enum MeminfoCounters : int {
12588   MEMINFO_UNSPECIFIED = 0,
12589   MEMINFO_MEM_TOTAL = 1,
12590   MEMINFO_MEM_FREE = 2,
12591   MEMINFO_MEM_AVAILABLE = 3,
12592   MEMINFO_BUFFERS = 4,
12593   MEMINFO_CACHED = 5,
12594   MEMINFO_SWAP_CACHED = 6,
12595   MEMINFO_ACTIVE = 7,
12596   MEMINFO_INACTIVE = 8,
12597   MEMINFO_ACTIVE_ANON = 9,
12598   MEMINFO_INACTIVE_ANON = 10,
12599   MEMINFO_ACTIVE_FILE = 11,
12600   MEMINFO_INACTIVE_FILE = 12,
12601   MEMINFO_UNEVICTABLE = 13,
12602   MEMINFO_MLOCKED = 14,
12603   MEMINFO_SWAP_TOTAL = 15,
12604   MEMINFO_SWAP_FREE = 16,
12605   MEMINFO_DIRTY = 17,
12606   MEMINFO_WRITEBACK = 18,
12607   MEMINFO_ANON_PAGES = 19,
12608   MEMINFO_MAPPED = 20,
12609   MEMINFO_SHMEM = 21,
12610   MEMINFO_SLAB = 22,
12611   MEMINFO_SLAB_RECLAIMABLE = 23,
12612   MEMINFO_SLAB_UNRECLAIMABLE = 24,
12613   MEMINFO_KERNEL_STACK = 25,
12614   MEMINFO_PAGE_TABLES = 26,
12615   MEMINFO_COMMIT_LIMIT = 27,
12616   MEMINFO_COMMITED_AS = 28,
12617   MEMINFO_VMALLOC_TOTAL = 29,
12618   MEMINFO_VMALLOC_USED = 30,
12619   MEMINFO_VMALLOC_CHUNK = 31,
12620   MEMINFO_CMA_TOTAL = 32,
12621   MEMINFO_CMA_FREE = 33,
12622 };
12623 enum VmstatCounters : int {
12624   VMSTAT_UNSPECIFIED = 0,
12625   VMSTAT_NR_FREE_PAGES = 1,
12626   VMSTAT_NR_ALLOC_BATCH = 2,
12627   VMSTAT_NR_INACTIVE_ANON = 3,
12628   VMSTAT_NR_ACTIVE_ANON = 4,
12629   VMSTAT_NR_INACTIVE_FILE = 5,
12630   VMSTAT_NR_ACTIVE_FILE = 6,
12631   VMSTAT_NR_UNEVICTABLE = 7,
12632   VMSTAT_NR_MLOCK = 8,
12633   VMSTAT_NR_ANON_PAGES = 9,
12634   VMSTAT_NR_MAPPED = 10,
12635   VMSTAT_NR_FILE_PAGES = 11,
12636   VMSTAT_NR_DIRTY = 12,
12637   VMSTAT_NR_WRITEBACK = 13,
12638   VMSTAT_NR_SLAB_RECLAIMABLE = 14,
12639   VMSTAT_NR_SLAB_UNRECLAIMABLE = 15,
12640   VMSTAT_NR_PAGE_TABLE_PAGES = 16,
12641   VMSTAT_NR_KERNEL_STACK = 17,
12642   VMSTAT_NR_OVERHEAD = 18,
12643   VMSTAT_NR_UNSTABLE = 19,
12644   VMSTAT_NR_BOUNCE = 20,
12645   VMSTAT_NR_VMSCAN_WRITE = 21,
12646   VMSTAT_NR_VMSCAN_IMMEDIATE_RECLAIM = 22,
12647   VMSTAT_NR_WRITEBACK_TEMP = 23,
12648   VMSTAT_NR_ISOLATED_ANON = 24,
12649   VMSTAT_NR_ISOLATED_FILE = 25,
12650   VMSTAT_NR_SHMEM = 26,
12651   VMSTAT_NR_DIRTIED = 27,
12652   VMSTAT_NR_WRITTEN = 28,
12653   VMSTAT_NR_PAGES_SCANNED = 29,
12654   VMSTAT_WORKINGSET_REFAULT = 30,
12655   VMSTAT_WORKINGSET_ACTIVATE = 31,
12656   VMSTAT_WORKINGSET_NODERECLAIM = 32,
12657   VMSTAT_NR_ANON_TRANSPARENT_HUGEPAGES = 33,
12658   VMSTAT_NR_FREE_CMA = 34,
12659   VMSTAT_NR_SWAPCACHE = 35,
12660   VMSTAT_NR_DIRTY_THRESHOLD = 36,
12661   VMSTAT_NR_DIRTY_BACKGROUND_THRESHOLD = 37,
12662   VMSTAT_PGPGIN = 38,
12663   VMSTAT_PGPGOUT = 39,
12664   VMSTAT_PGPGOUTCLEAN = 40,
12665   VMSTAT_PSWPIN = 41,
12666   VMSTAT_PSWPOUT = 42,
12667   VMSTAT_PGALLOC_DMA = 43,
12668   VMSTAT_PGALLOC_NORMAL = 44,
12669   VMSTAT_PGALLOC_MOVABLE = 45,
12670   VMSTAT_PGFREE = 46,
12671   VMSTAT_PGACTIVATE = 47,
12672   VMSTAT_PGDEACTIVATE = 48,
12673   VMSTAT_PGFAULT = 49,
12674   VMSTAT_PGMAJFAULT = 50,
12675   VMSTAT_PGREFILL_DMA = 51,
12676   VMSTAT_PGREFILL_NORMAL = 52,
12677   VMSTAT_PGREFILL_MOVABLE = 53,
12678   VMSTAT_PGSTEAL_KSWAPD_DMA = 54,
12679   VMSTAT_PGSTEAL_KSWAPD_NORMAL = 55,
12680   VMSTAT_PGSTEAL_KSWAPD_MOVABLE = 56,
12681   VMSTAT_PGSTEAL_DIRECT_DMA = 57,
12682   VMSTAT_PGSTEAL_DIRECT_NORMAL = 58,
12683   VMSTAT_PGSTEAL_DIRECT_MOVABLE = 59,
12684   VMSTAT_PGSCAN_KSWAPD_DMA = 60,
12685   VMSTAT_PGSCAN_KSWAPD_NORMAL = 61,
12686   VMSTAT_PGSCAN_KSWAPD_MOVABLE = 62,
12687   VMSTAT_PGSCAN_DIRECT_DMA = 63,
12688   VMSTAT_PGSCAN_DIRECT_NORMAL = 64,
12689   VMSTAT_PGSCAN_DIRECT_MOVABLE = 65,
12690   VMSTAT_PGSCAN_DIRECT_THROTTLE = 66,
12691   VMSTAT_PGINODESTEAL = 67,
12692   VMSTAT_SLABS_SCANNED = 68,
12693   VMSTAT_KSWAPD_INODESTEAL = 69,
12694   VMSTAT_KSWAPD_LOW_WMARK_HIT_QUICKLY = 70,
12695   VMSTAT_KSWAPD_HIGH_WMARK_HIT_QUICKLY = 71,
12696   VMSTAT_PAGEOUTRUN = 72,
12697   VMSTAT_ALLOCSTALL = 73,
12698   VMSTAT_PGROTATED = 74,
12699   VMSTAT_DROP_PAGECACHE = 75,
12700   VMSTAT_DROP_SLAB = 76,
12701   VMSTAT_PGMIGRATE_SUCCESS = 77,
12702   VMSTAT_PGMIGRATE_FAIL = 78,
12703   VMSTAT_COMPACT_MIGRATE_SCANNED = 79,
12704   VMSTAT_COMPACT_FREE_SCANNED = 80,
12705   VMSTAT_COMPACT_ISOLATED = 81,
12706   VMSTAT_COMPACT_STALL = 82,
12707   VMSTAT_COMPACT_FAIL = 83,
12708   VMSTAT_COMPACT_SUCCESS = 84,
12709   VMSTAT_COMPACT_DAEMON_WAKE = 85,
12710   VMSTAT_UNEVICTABLE_PGS_CULLED = 86,
12711   VMSTAT_UNEVICTABLE_PGS_SCANNED = 87,
12712   VMSTAT_UNEVICTABLE_PGS_RESCUED = 88,
12713   VMSTAT_UNEVICTABLE_PGS_MLOCKED = 89,
12714   VMSTAT_UNEVICTABLE_PGS_MUNLOCKED = 90,
12715   VMSTAT_UNEVICTABLE_PGS_CLEARED = 91,
12716   VMSTAT_UNEVICTABLE_PGS_STRANDED = 92,
12717   VMSTAT_NR_ZSPAGES = 93,
12718   VMSTAT_NR_ION_HEAP = 94,
12719   VMSTAT_NR_GPU_HEAP = 95,
12720 };
12721 }  // namespace perfetto
12722 }  // namespace protos
12723 }  // namespace gen
12724 
12725 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_SYS_STATS_COUNTERS_PROTO_CPP_H_
12726 // gen_amalgamated begin header: gen/protos/perfetto/common/trace_stats.gen.h
12727 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
12728 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACE_STATS_PROTO_CPP_H_
12729 #define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACE_STATS_PROTO_CPP_H_
12730 
12731 #include <stdint.h>
12732 #include <bitset>
12733 #include <vector>
12734 #include <string>
12735 #include <type_traits>
12736 
12737 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
12738 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
12739 // gen_amalgamated expanded: #include "perfetto/base/export.h"
12740 
12741 namespace perfetto {
12742 namespace protos {
12743 namespace gen {
12744 class TraceStats;
12745 class TraceStats_BufferStats;
12746 }  // namespace perfetto
12747 }  // namespace protos
12748 }  // namespace gen
12749 
12750 namespace protozero {
12751 class Message;
12752 }  // namespace protozero
12753 
12754 namespace perfetto {
12755 namespace protos {
12756 namespace gen {
12757 
12758 class PERFETTO_EXPORT TraceStats : public ::protozero::CppMessageObj {
12759  public:
12760   using BufferStats = TraceStats_BufferStats;
12761   enum FieldNumbers {
12762     kBufferStatsFieldNumber = 1,
12763     kProducersConnectedFieldNumber = 2,
12764     kProducersSeenFieldNumber = 3,
12765     kDataSourcesRegisteredFieldNumber = 4,
12766     kDataSourcesSeenFieldNumber = 5,
12767     kTracingSessionsFieldNumber = 6,
12768     kTotalBuffersFieldNumber = 7,
12769     kChunksDiscardedFieldNumber = 8,
12770     kPatchesDiscardedFieldNumber = 9,
12771     kInvalidPacketsFieldNumber = 10,
12772   };
12773 
12774   TraceStats();
12775   ~TraceStats() override;
12776   TraceStats(TraceStats&&) noexcept;
12777   TraceStats& operator=(TraceStats&&);
12778   TraceStats(const TraceStats&);
12779   TraceStats& operator=(const TraceStats&);
12780   bool operator==(const TraceStats&) const;
12781   bool operator!=(const TraceStats& other) const { return !(*this == other); }
12782 
12783   bool ParseFromArray(const void*, size_t) override;
12784   std::string SerializeAsString() const override;
12785   std::vector<uint8_t> SerializeAsArray() const override;
12786   void Serialize(::protozero::Message*) const;
12787 
12788   int buffer_stats_size() const { return static_cast<int>(buffer_stats_.size()); }
12789   const std::vector<TraceStats_BufferStats>& buffer_stats() const { return buffer_stats_; }
12790   std::vector<TraceStats_BufferStats>* mutable_buffer_stats() { return &buffer_stats_; }
12791   void clear_buffer_stats() { buffer_stats_.clear(); }
12792   TraceStats_BufferStats* add_buffer_stats() { buffer_stats_.emplace_back(); return &buffer_stats_.back(); }
12793 
12794   bool has_producers_connected() const { return _has_field_[2]; }
12795   uint32_t producers_connected() const { return producers_connected_; }
12796   void set_producers_connected(uint32_t value) { producers_connected_ = value; _has_field_.set(2); }
12797 
12798   bool has_producers_seen() const { return _has_field_[3]; }
12799   uint64_t producers_seen() const { return producers_seen_; }
12800   void set_producers_seen(uint64_t value) { producers_seen_ = value; _has_field_.set(3); }
12801 
12802   bool has_data_sources_registered() const { return _has_field_[4]; }
12803   uint32_t data_sources_registered() const { return data_sources_registered_; }
12804   void set_data_sources_registered(uint32_t value) { data_sources_registered_ = value; _has_field_.set(4); }
12805 
12806   bool has_data_sources_seen() const { return _has_field_[5]; }
12807   uint64_t data_sources_seen() const { return data_sources_seen_; }
12808   void set_data_sources_seen(uint64_t value) { data_sources_seen_ = value; _has_field_.set(5); }
12809 
12810   bool has_tracing_sessions() const { return _has_field_[6]; }
12811   uint32_t tracing_sessions() const { return tracing_sessions_; }
12812   void set_tracing_sessions(uint32_t value) { tracing_sessions_ = value; _has_field_.set(6); }
12813 
12814   bool has_total_buffers() const { return _has_field_[7]; }
12815   uint32_t total_buffers() const { return total_buffers_; }
12816   void set_total_buffers(uint32_t value) { total_buffers_ = value; _has_field_.set(7); }
12817 
12818   bool has_chunks_discarded() const { return _has_field_[8]; }
12819   uint64_t chunks_discarded() const { return chunks_discarded_; }
12820   void set_chunks_discarded(uint64_t value) { chunks_discarded_ = value; _has_field_.set(8); }
12821 
12822   bool has_patches_discarded() const { return _has_field_[9]; }
12823   uint64_t patches_discarded() const { return patches_discarded_; }
12824   void set_patches_discarded(uint64_t value) { patches_discarded_ = value; _has_field_.set(9); }
12825 
12826   bool has_invalid_packets() const { return _has_field_[10]; }
12827   uint64_t invalid_packets() const { return invalid_packets_; }
12828   void set_invalid_packets(uint64_t value) { invalid_packets_ = value; _has_field_.set(10); }
12829 
12830  private:
12831   std::vector<TraceStats_BufferStats> buffer_stats_;
12832   uint32_t producers_connected_{};
12833   uint64_t producers_seen_{};
12834   uint32_t data_sources_registered_{};
12835   uint64_t data_sources_seen_{};
12836   uint32_t tracing_sessions_{};
12837   uint32_t total_buffers_{};
12838   uint64_t chunks_discarded_{};
12839   uint64_t patches_discarded_{};
12840   uint64_t invalid_packets_{};
12841 
12842   // Allows to preserve unknown protobuf fields for compatibility
12843   // with future versions of .proto files.
12844   std::string unknown_fields_;
12845 
12846   std::bitset<11> _has_field_{};
12847 };
12848 
12849 
12850 class PERFETTO_EXPORT TraceStats_BufferStats : public ::protozero::CppMessageObj {
12851  public:
12852   enum FieldNumbers {
12853     kBufferSizeFieldNumber = 12,
12854     kBytesWrittenFieldNumber = 1,
12855     kBytesOverwrittenFieldNumber = 13,
12856     kBytesReadFieldNumber = 14,
12857     kPaddingBytesWrittenFieldNumber = 15,
12858     kPaddingBytesClearedFieldNumber = 16,
12859     kChunksWrittenFieldNumber = 2,
12860     kChunksRewrittenFieldNumber = 10,
12861     kChunksOverwrittenFieldNumber = 3,
12862     kChunksDiscardedFieldNumber = 18,
12863     kChunksReadFieldNumber = 17,
12864     kChunksCommittedOutOfOrderFieldNumber = 11,
12865     kWriteWrapCountFieldNumber = 4,
12866     kPatchesSucceededFieldNumber = 5,
12867     kPatchesFailedFieldNumber = 6,
12868     kReadaheadsSucceededFieldNumber = 7,
12869     kReadaheadsFailedFieldNumber = 8,
12870     kAbiViolationsFieldNumber = 9,
12871     kTraceWriterPacketLossFieldNumber = 19,
12872   };
12873 
12874   TraceStats_BufferStats();
12875   ~TraceStats_BufferStats() override;
12876   TraceStats_BufferStats(TraceStats_BufferStats&&) noexcept;
12877   TraceStats_BufferStats& operator=(TraceStats_BufferStats&&);
12878   TraceStats_BufferStats(const TraceStats_BufferStats&);
12879   TraceStats_BufferStats& operator=(const TraceStats_BufferStats&);
12880   bool operator==(const TraceStats_BufferStats&) const;
12881   bool operator!=(const TraceStats_BufferStats& other) const { return !(*this == other); }
12882 
12883   bool ParseFromArray(const void*, size_t) override;
12884   std::string SerializeAsString() const override;
12885   std::vector<uint8_t> SerializeAsArray() const override;
12886   void Serialize(::protozero::Message*) const;
12887 
12888   bool has_buffer_size() const { return _has_field_[12]; }
12889   uint64_t buffer_size() const { return buffer_size_; }
12890   void set_buffer_size(uint64_t value) { buffer_size_ = value; _has_field_.set(12); }
12891 
12892   bool has_bytes_written() const { return _has_field_[1]; }
12893   uint64_t bytes_written() const { return bytes_written_; }
12894   void set_bytes_written(uint64_t value) { bytes_written_ = value; _has_field_.set(1); }
12895 
12896   bool has_bytes_overwritten() const { return _has_field_[13]; }
12897   uint64_t bytes_overwritten() const { return bytes_overwritten_; }
12898   void set_bytes_overwritten(uint64_t value) { bytes_overwritten_ = value; _has_field_.set(13); }
12899 
12900   bool has_bytes_read() const { return _has_field_[14]; }
12901   uint64_t bytes_read() const { return bytes_read_; }
12902   void set_bytes_read(uint64_t value) { bytes_read_ = value; _has_field_.set(14); }
12903 
12904   bool has_padding_bytes_written() const { return _has_field_[15]; }
12905   uint64_t padding_bytes_written() const { return padding_bytes_written_; }
12906   void set_padding_bytes_written(uint64_t value) { padding_bytes_written_ = value; _has_field_.set(15); }
12907 
12908   bool has_padding_bytes_cleared() const { return _has_field_[16]; }
12909   uint64_t padding_bytes_cleared() const { return padding_bytes_cleared_; }
12910   void set_padding_bytes_cleared(uint64_t value) { padding_bytes_cleared_ = value; _has_field_.set(16); }
12911 
12912   bool has_chunks_written() const { return _has_field_[2]; }
12913   uint64_t chunks_written() const { return chunks_written_; }
12914   void set_chunks_written(uint64_t value) { chunks_written_ = value; _has_field_.set(2); }
12915 
12916   bool has_chunks_rewritten() const { return _has_field_[10]; }
12917   uint64_t chunks_rewritten() const { return chunks_rewritten_; }
12918   void set_chunks_rewritten(uint64_t value) { chunks_rewritten_ = value; _has_field_.set(10); }
12919 
12920   bool has_chunks_overwritten() const { return _has_field_[3]; }
12921   uint64_t chunks_overwritten() const { return chunks_overwritten_; }
12922   void set_chunks_overwritten(uint64_t value) { chunks_overwritten_ = value; _has_field_.set(3); }
12923 
12924   bool has_chunks_discarded() const { return _has_field_[18]; }
12925   uint64_t chunks_discarded() const { return chunks_discarded_; }
12926   void set_chunks_discarded(uint64_t value) { chunks_discarded_ = value; _has_field_.set(18); }
12927 
12928   bool has_chunks_read() const { return _has_field_[17]; }
12929   uint64_t chunks_read() const { return chunks_read_; }
12930   void set_chunks_read(uint64_t value) { chunks_read_ = value; _has_field_.set(17); }
12931 
12932   bool has_chunks_committed_out_of_order() const { return _has_field_[11]; }
12933   uint64_t chunks_committed_out_of_order() const { return chunks_committed_out_of_order_; }
12934   void set_chunks_committed_out_of_order(uint64_t value) { chunks_committed_out_of_order_ = value; _has_field_.set(11); }
12935 
12936   bool has_write_wrap_count() const { return _has_field_[4]; }
12937   uint64_t write_wrap_count() const { return write_wrap_count_; }
12938   void set_write_wrap_count(uint64_t value) { write_wrap_count_ = value; _has_field_.set(4); }
12939 
12940   bool has_patches_succeeded() const { return _has_field_[5]; }
12941   uint64_t patches_succeeded() const { return patches_succeeded_; }
12942   void set_patches_succeeded(uint64_t value) { patches_succeeded_ = value; _has_field_.set(5); }
12943 
12944   bool has_patches_failed() const { return _has_field_[6]; }
12945   uint64_t patches_failed() const { return patches_failed_; }
12946   void set_patches_failed(uint64_t value) { patches_failed_ = value; _has_field_.set(6); }
12947 
12948   bool has_readaheads_succeeded() const { return _has_field_[7]; }
12949   uint64_t readaheads_succeeded() const { return readaheads_succeeded_; }
12950   void set_readaheads_succeeded(uint64_t value) { readaheads_succeeded_ = value; _has_field_.set(7); }
12951 
12952   bool has_readaheads_failed() const { return _has_field_[8]; }
12953   uint64_t readaheads_failed() const { return readaheads_failed_; }
12954   void set_readaheads_failed(uint64_t value) { readaheads_failed_ = value; _has_field_.set(8); }
12955 
12956   bool has_abi_violations() const { return _has_field_[9]; }
12957   uint64_t abi_violations() const { return abi_violations_; }
12958   void set_abi_violations(uint64_t value) { abi_violations_ = value; _has_field_.set(9); }
12959 
12960   bool has_trace_writer_packet_loss() const { return _has_field_[19]; }
12961   uint64_t trace_writer_packet_loss() const { return trace_writer_packet_loss_; }
12962   void set_trace_writer_packet_loss(uint64_t value) { trace_writer_packet_loss_ = value; _has_field_.set(19); }
12963 
12964  private:
12965   uint64_t buffer_size_{};
12966   uint64_t bytes_written_{};
12967   uint64_t bytes_overwritten_{};
12968   uint64_t bytes_read_{};
12969   uint64_t padding_bytes_written_{};
12970   uint64_t padding_bytes_cleared_{};
12971   uint64_t chunks_written_{};
12972   uint64_t chunks_rewritten_{};
12973   uint64_t chunks_overwritten_{};
12974   uint64_t chunks_discarded_{};
12975   uint64_t chunks_read_{};
12976   uint64_t chunks_committed_out_of_order_{};
12977   uint64_t write_wrap_count_{};
12978   uint64_t patches_succeeded_{};
12979   uint64_t patches_failed_{};
12980   uint64_t readaheads_succeeded_{};
12981   uint64_t readaheads_failed_{};
12982   uint64_t abi_violations_{};
12983   uint64_t trace_writer_packet_loss_{};
12984 
12985   // Allows to preserve unknown protobuf fields for compatibility
12986   // with future versions of .proto files.
12987   std::string unknown_fields_;
12988 
12989   std::bitset<20> _has_field_{};
12990 };
12991 
12992 }  // namespace perfetto
12993 }  // namespace protos
12994 }  // namespace gen
12995 
12996 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACE_STATS_PROTO_CPP_H_
12997 // gen_amalgamated begin header: gen/protos/perfetto/common/tracing_service_capabilities.gen.h
12998 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
12999 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACING_SERVICE_CAPABILITIES_PROTO_CPP_H_
13000 #define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACING_SERVICE_CAPABILITIES_PROTO_CPP_H_
13001 
13002 #include <stdint.h>
13003 #include <bitset>
13004 #include <vector>
13005 #include <string>
13006 #include <type_traits>
13007 
13008 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
13009 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
13010 // gen_amalgamated expanded: #include "perfetto/base/export.h"
13011 
13012 namespace perfetto {
13013 namespace protos {
13014 namespace gen {
13015 class TracingServiceCapabilities;
13016 enum ObservableEvents_Type : int;
13017 }  // namespace perfetto
13018 }  // namespace protos
13019 }  // namespace gen
13020 
13021 namespace protozero {
13022 class Message;
13023 }  // namespace protozero
13024 
13025 namespace perfetto {
13026 namespace protos {
13027 namespace gen {
13028 
13029 class PERFETTO_EXPORT TracingServiceCapabilities : public ::protozero::CppMessageObj {
13030  public:
13031   enum FieldNumbers {
13032     kHasQueryCapabilitiesFieldNumber = 1,
13033     kObservableEventsFieldNumber = 2,
13034     kHasTraceConfigOutputPathFieldNumber = 3,
13035   };
13036 
13037   TracingServiceCapabilities();
13038   ~TracingServiceCapabilities() override;
13039   TracingServiceCapabilities(TracingServiceCapabilities&&) noexcept;
13040   TracingServiceCapabilities& operator=(TracingServiceCapabilities&&);
13041   TracingServiceCapabilities(const TracingServiceCapabilities&);
13042   TracingServiceCapabilities& operator=(const TracingServiceCapabilities&);
13043   bool operator==(const TracingServiceCapabilities&) const;
13044   bool operator!=(const TracingServiceCapabilities& other) const { return !(*this == other); }
13045 
13046   bool ParseFromArray(const void*, size_t) override;
13047   std::string SerializeAsString() const override;
13048   std::vector<uint8_t> SerializeAsArray() const override;
13049   void Serialize(::protozero::Message*) const;
13050 
13051   bool has_has_query_capabilities() const { return _has_field_[1]; }
13052   bool has_query_capabilities() const { return has_query_capabilities_; }
13053   void set_has_query_capabilities(bool value) { has_query_capabilities_ = value; _has_field_.set(1); }
13054 
13055   int observable_events_size() const { return static_cast<int>(observable_events_.size()); }
13056   const std::vector<ObservableEvents_Type>& observable_events() const { return observable_events_; }
13057   std::vector<ObservableEvents_Type>* mutable_observable_events() { return &observable_events_; }
13058   void clear_observable_events() { observable_events_.clear(); }
13059   void add_observable_events(ObservableEvents_Type value) { observable_events_.emplace_back(value); }
13060   ObservableEvents_Type* add_observable_events() { observable_events_.emplace_back(); return &observable_events_.back(); }
13061 
13062   bool has_has_trace_config_output_path() const { return _has_field_[3]; }
13063   bool has_trace_config_output_path() const { return has_trace_config_output_path_; }
13064   void set_has_trace_config_output_path(bool value) { has_trace_config_output_path_ = value; _has_field_.set(3); }
13065 
13066  private:
13067   bool has_query_capabilities_{};
13068   std::vector<ObservableEvents_Type> observable_events_;
13069   bool has_trace_config_output_path_{};
13070 
13071   // Allows to preserve unknown protobuf fields for compatibility
13072   // with future versions of .proto files.
13073   std::string unknown_fields_;
13074 
13075   std::bitset<4> _has_field_{};
13076 };
13077 
13078 }  // namespace perfetto
13079 }  // namespace protos
13080 }  // namespace gen
13081 
13082 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACING_SERVICE_CAPABILITIES_PROTO_CPP_H_
13083 // gen_amalgamated begin header: gen/protos/perfetto/common/tracing_service_state.gen.h
13084 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
13085 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACING_SERVICE_STATE_PROTO_CPP_H_
13086 #define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACING_SERVICE_STATE_PROTO_CPP_H_
13087 
13088 #include <stdint.h>
13089 #include <bitset>
13090 #include <vector>
13091 #include <string>
13092 #include <type_traits>
13093 
13094 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
13095 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
13096 // gen_amalgamated expanded: #include "perfetto/base/export.h"
13097 
13098 namespace perfetto {
13099 namespace protos {
13100 namespace gen {
13101 class TracingServiceState;
13102 class TracingServiceState_DataSource;
13103 class DataSourceDescriptor;
13104 class TracingServiceState_Producer;
13105 }  // namespace perfetto
13106 }  // namespace protos
13107 }  // namespace gen
13108 
13109 namespace protozero {
13110 class Message;
13111 }  // namespace protozero
13112 
13113 namespace perfetto {
13114 namespace protos {
13115 namespace gen {
13116 
13117 class PERFETTO_EXPORT TracingServiceState : public ::protozero::CppMessageObj {
13118  public:
13119   using Producer = TracingServiceState_Producer;
13120   using DataSource = TracingServiceState_DataSource;
13121   enum FieldNumbers {
13122     kProducersFieldNumber = 1,
13123     kDataSourcesFieldNumber = 2,
13124     kNumSessionsFieldNumber = 3,
13125     kNumSessionsStartedFieldNumber = 4,
13126   };
13127 
13128   TracingServiceState();
13129   ~TracingServiceState() override;
13130   TracingServiceState(TracingServiceState&&) noexcept;
13131   TracingServiceState& operator=(TracingServiceState&&);
13132   TracingServiceState(const TracingServiceState&);
13133   TracingServiceState& operator=(const TracingServiceState&);
13134   bool operator==(const TracingServiceState&) const;
13135   bool operator!=(const TracingServiceState& other) const { return !(*this == other); }
13136 
13137   bool ParseFromArray(const void*, size_t) override;
13138   std::string SerializeAsString() const override;
13139   std::vector<uint8_t> SerializeAsArray() const override;
13140   void Serialize(::protozero::Message*) const;
13141 
13142   int producers_size() const { return static_cast<int>(producers_.size()); }
13143   const std::vector<TracingServiceState_Producer>& producers() const { return producers_; }
13144   std::vector<TracingServiceState_Producer>* mutable_producers() { return &producers_; }
13145   void clear_producers() { producers_.clear(); }
13146   TracingServiceState_Producer* add_producers() { producers_.emplace_back(); return &producers_.back(); }
13147 
13148   int data_sources_size() const { return static_cast<int>(data_sources_.size()); }
13149   const std::vector<TracingServiceState_DataSource>& data_sources() const { return data_sources_; }
13150   std::vector<TracingServiceState_DataSource>* mutable_data_sources() { return &data_sources_; }
13151   void clear_data_sources() { data_sources_.clear(); }
13152   TracingServiceState_DataSource* add_data_sources() { data_sources_.emplace_back(); return &data_sources_.back(); }
13153 
13154   bool has_num_sessions() const { return _has_field_[3]; }
13155   int32_t num_sessions() const { return num_sessions_; }
13156   void set_num_sessions(int32_t value) { num_sessions_ = value; _has_field_.set(3); }
13157 
13158   bool has_num_sessions_started() const { return _has_field_[4]; }
13159   int32_t num_sessions_started() const { return num_sessions_started_; }
13160   void set_num_sessions_started(int32_t value) { num_sessions_started_ = value; _has_field_.set(4); }
13161 
13162  private:
13163   std::vector<TracingServiceState_Producer> producers_;
13164   std::vector<TracingServiceState_DataSource> data_sources_;
13165   int32_t num_sessions_{};
13166   int32_t num_sessions_started_{};
13167 
13168   // Allows to preserve unknown protobuf fields for compatibility
13169   // with future versions of .proto files.
13170   std::string unknown_fields_;
13171 
13172   std::bitset<5> _has_field_{};
13173 };
13174 
13175 
13176 class PERFETTO_EXPORT TracingServiceState_DataSource : public ::protozero::CppMessageObj {
13177  public:
13178   enum FieldNumbers {
13179     kDsDescriptorFieldNumber = 1,
13180     kProducerIdFieldNumber = 2,
13181   };
13182 
13183   TracingServiceState_DataSource();
13184   ~TracingServiceState_DataSource() override;
13185   TracingServiceState_DataSource(TracingServiceState_DataSource&&) noexcept;
13186   TracingServiceState_DataSource& operator=(TracingServiceState_DataSource&&);
13187   TracingServiceState_DataSource(const TracingServiceState_DataSource&);
13188   TracingServiceState_DataSource& operator=(const TracingServiceState_DataSource&);
13189   bool operator==(const TracingServiceState_DataSource&) const;
13190   bool operator!=(const TracingServiceState_DataSource& other) const { return !(*this == other); }
13191 
13192   bool ParseFromArray(const void*, size_t) override;
13193   std::string SerializeAsString() const override;
13194   std::vector<uint8_t> SerializeAsArray() const override;
13195   void Serialize(::protozero::Message*) const;
13196 
13197   bool has_ds_descriptor() const { return _has_field_[1]; }
13198   const DataSourceDescriptor& ds_descriptor() const { return *ds_descriptor_; }
13199   DataSourceDescriptor* mutable_ds_descriptor() { _has_field_.set(1); return ds_descriptor_.get(); }
13200 
13201   bool has_producer_id() const { return _has_field_[2]; }
13202   int32_t producer_id() const { return producer_id_; }
13203   void set_producer_id(int32_t value) { producer_id_ = value; _has_field_.set(2); }
13204 
13205  private:
13206   ::protozero::CopyablePtr<DataSourceDescriptor> ds_descriptor_;
13207   int32_t producer_id_{};
13208 
13209   // Allows to preserve unknown protobuf fields for compatibility
13210   // with future versions of .proto files.
13211   std::string unknown_fields_;
13212 
13213   std::bitset<3> _has_field_{};
13214 };
13215 
13216 
13217 class PERFETTO_EXPORT TracingServiceState_Producer : public ::protozero::CppMessageObj {
13218  public:
13219   enum FieldNumbers {
13220     kIdFieldNumber = 1,
13221     kNameFieldNumber = 2,
13222     kUidFieldNumber = 3,
13223   };
13224 
13225   TracingServiceState_Producer();
13226   ~TracingServiceState_Producer() override;
13227   TracingServiceState_Producer(TracingServiceState_Producer&&) noexcept;
13228   TracingServiceState_Producer& operator=(TracingServiceState_Producer&&);
13229   TracingServiceState_Producer(const TracingServiceState_Producer&);
13230   TracingServiceState_Producer& operator=(const TracingServiceState_Producer&);
13231   bool operator==(const TracingServiceState_Producer&) const;
13232   bool operator!=(const TracingServiceState_Producer& other) const { return !(*this == other); }
13233 
13234   bool ParseFromArray(const void*, size_t) override;
13235   std::string SerializeAsString() const override;
13236   std::vector<uint8_t> SerializeAsArray() const override;
13237   void Serialize(::protozero::Message*) const;
13238 
13239   bool has_id() const { return _has_field_[1]; }
13240   int32_t id() const { return id_; }
13241   void set_id(int32_t value) { id_ = value; _has_field_.set(1); }
13242 
13243   bool has_name() const { return _has_field_[2]; }
13244   const std::string& name() const { return name_; }
13245   void set_name(const std::string& value) { name_ = value; _has_field_.set(2); }
13246 
13247   bool has_uid() const { return _has_field_[3]; }
13248   int32_t uid() const { return uid_; }
13249   void set_uid(int32_t value) { uid_ = value; _has_field_.set(3); }
13250 
13251  private:
13252   int32_t id_{};
13253   std::string name_{};
13254   int32_t uid_{};
13255 
13256   // Allows to preserve unknown protobuf fields for compatibility
13257   // with future versions of .proto files.
13258   std::string unknown_fields_;
13259 
13260   std::bitset<4> _has_field_{};
13261 };
13262 
13263 }  // namespace perfetto
13264 }  // namespace protos
13265 }  // namespace gen
13266 
13267 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACING_SERVICE_STATE_PROTO_CPP_H_
13268 // gen_amalgamated begin header: gen/protos/perfetto/common/track_event_descriptor.gen.h
13269 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
13270 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACK_EVENT_DESCRIPTOR_PROTO_CPP_H_
13271 #define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACK_EVENT_DESCRIPTOR_PROTO_CPP_H_
13272 
13273 #include <stdint.h>
13274 #include <bitset>
13275 #include <vector>
13276 #include <string>
13277 #include <type_traits>
13278 
13279 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
13280 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
13281 // gen_amalgamated expanded: #include "perfetto/base/export.h"
13282 
13283 namespace perfetto {
13284 namespace protos {
13285 namespace gen {
13286 class TrackEventDescriptor;
13287 class TrackEventCategory;
13288 }  // namespace perfetto
13289 }  // namespace protos
13290 }  // namespace gen
13291 
13292 namespace protozero {
13293 class Message;
13294 }  // namespace protozero
13295 
13296 namespace perfetto {
13297 namespace protos {
13298 namespace gen {
13299 
13300 class PERFETTO_EXPORT TrackEventDescriptor : public ::protozero::CppMessageObj {
13301  public:
13302   enum FieldNumbers {
13303     kAvailableCategoriesFieldNumber = 1,
13304   };
13305 
13306   TrackEventDescriptor();
13307   ~TrackEventDescriptor() override;
13308   TrackEventDescriptor(TrackEventDescriptor&&) noexcept;
13309   TrackEventDescriptor& operator=(TrackEventDescriptor&&);
13310   TrackEventDescriptor(const TrackEventDescriptor&);
13311   TrackEventDescriptor& operator=(const TrackEventDescriptor&);
13312   bool operator==(const TrackEventDescriptor&) const;
13313   bool operator!=(const TrackEventDescriptor& other) const { return !(*this == other); }
13314 
13315   bool ParseFromArray(const void*, size_t) override;
13316   std::string SerializeAsString() const override;
13317   std::vector<uint8_t> SerializeAsArray() const override;
13318   void Serialize(::protozero::Message*) const;
13319 
13320   int available_categories_size() const { return static_cast<int>(available_categories_.size()); }
13321   const std::vector<TrackEventCategory>& available_categories() const { return available_categories_; }
13322   std::vector<TrackEventCategory>* mutable_available_categories() { return &available_categories_; }
13323   void clear_available_categories() { available_categories_.clear(); }
13324   TrackEventCategory* add_available_categories() { available_categories_.emplace_back(); return &available_categories_.back(); }
13325 
13326  private:
13327   std::vector<TrackEventCategory> available_categories_;
13328 
13329   // Allows to preserve unknown protobuf fields for compatibility
13330   // with future versions of .proto files.
13331   std::string unknown_fields_;
13332 
13333   std::bitset<2> _has_field_{};
13334 };
13335 
13336 
13337 class PERFETTO_EXPORT TrackEventCategory : public ::protozero::CppMessageObj {
13338  public:
13339   enum FieldNumbers {
13340     kNameFieldNumber = 1,
13341     kDescriptionFieldNumber = 2,
13342     kTagsFieldNumber = 3,
13343   };
13344 
13345   TrackEventCategory();
13346   ~TrackEventCategory() override;
13347   TrackEventCategory(TrackEventCategory&&) noexcept;
13348   TrackEventCategory& operator=(TrackEventCategory&&);
13349   TrackEventCategory(const TrackEventCategory&);
13350   TrackEventCategory& operator=(const TrackEventCategory&);
13351   bool operator==(const TrackEventCategory&) const;
13352   bool operator!=(const TrackEventCategory& other) const { return !(*this == other); }
13353 
13354   bool ParseFromArray(const void*, size_t) override;
13355   std::string SerializeAsString() const override;
13356   std::vector<uint8_t> SerializeAsArray() const override;
13357   void Serialize(::protozero::Message*) const;
13358 
13359   bool has_name() const { return _has_field_[1]; }
13360   const std::string& name() const { return name_; }
13361   void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
13362 
13363   bool has_description() const { return _has_field_[2]; }
13364   const std::string& description() const { return description_; }
13365   void set_description(const std::string& value) { description_ = value; _has_field_.set(2); }
13366 
13367   int tags_size() const { return static_cast<int>(tags_.size()); }
13368   const std::vector<std::string>& tags() const { return tags_; }
13369   std::vector<std::string>* mutable_tags() { return &tags_; }
13370   void clear_tags() { tags_.clear(); }
13371   void add_tags(std::string value) { tags_.emplace_back(value); }
13372   std::string* add_tags() { tags_.emplace_back(); return &tags_.back(); }
13373 
13374  private:
13375   std::string name_{};
13376   std::string description_{};
13377   std::vector<std::string> tags_;
13378 
13379   // Allows to preserve unknown protobuf fields for compatibility
13380   // with future versions of .proto files.
13381   std::string unknown_fields_;
13382 
13383   std::bitset<4> _has_field_{};
13384 };
13385 
13386 }  // namespace perfetto
13387 }  // namespace protos
13388 }  // namespace gen
13389 
13390 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACK_EVENT_DESCRIPTOR_PROTO_CPP_H_
13391 // gen_amalgamated begin header: gen/protos/perfetto/common/android_log_constants.pbzero.h
13392 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
13393 
13394 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_ANDROID_LOG_CONSTANTS_PROTO_H_
13395 #define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_ANDROID_LOG_CONSTANTS_PROTO_H_
13396 
13397 #include <stddef.h>
13398 #include <stdint.h>
13399 
13400 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
13401 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
13402 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
13403 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
13404 
13405 namespace perfetto {
13406 namespace protos {
13407 namespace pbzero {
13408 
13409 
13410 enum AndroidLogId : int32_t {
13411   LID_DEFAULT = 0,
13412   LID_RADIO = 1,
13413   LID_EVENTS = 2,
13414   LID_SYSTEM = 3,
13415   LID_CRASH = 4,
13416   LID_STATS = 5,
13417   LID_SECURITY = 6,
13418   LID_KERNEL = 7,
13419 };
13420 
13421 const AndroidLogId AndroidLogId_MIN = LID_DEFAULT;
13422 const AndroidLogId AndroidLogId_MAX = LID_KERNEL;
13423 
13424 enum AndroidLogPriority : int32_t {
13425   PRIO_UNSPECIFIED = 0,
13426   PRIO_UNUSED = 1,
13427   PRIO_VERBOSE = 2,
13428   PRIO_DEBUG = 3,
13429   PRIO_INFO = 4,
13430   PRIO_WARN = 5,
13431   PRIO_ERROR = 6,
13432   PRIO_FATAL = 7,
13433 };
13434 
13435 const AndroidLogPriority AndroidLogPriority_MIN = PRIO_UNSPECIFIED;
13436 const AndroidLogPriority AndroidLogPriority_MAX = PRIO_FATAL;
13437 
13438 } // Namespace.
13439 } // Namespace.
13440 } // Namespace.
13441 #endif  // Include guard.
13442 // gen_amalgamated begin header: gen/protos/perfetto/common/builtin_clock.pbzero.h
13443 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
13444 
13445 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_BUILTIN_CLOCK_PROTO_H_
13446 #define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_BUILTIN_CLOCK_PROTO_H_
13447 
13448 #include <stddef.h>
13449 #include <stdint.h>
13450 
13451 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
13452 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
13453 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
13454 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
13455 
13456 namespace perfetto {
13457 namespace protos {
13458 namespace pbzero {
13459 
13460 
13461 enum BuiltinClock : int32_t {
13462   BUILTIN_CLOCK_UNKNOWN = 0,
13463   BUILTIN_CLOCK_REALTIME = 1,
13464   BUILTIN_CLOCK_REALTIME_COARSE = 2,
13465   BUILTIN_CLOCK_MONOTONIC = 3,
13466   BUILTIN_CLOCK_MONOTONIC_COARSE = 4,
13467   BUILTIN_CLOCK_MONOTONIC_RAW = 5,
13468   BUILTIN_CLOCK_BOOTTIME = 6,
13469   BUILTIN_CLOCK_MAX_ID = 63,
13470 };
13471 
13472 const BuiltinClock BuiltinClock_MIN = BUILTIN_CLOCK_UNKNOWN;
13473 const BuiltinClock BuiltinClock_MAX = BUILTIN_CLOCK_MAX_ID;
13474 
13475 } // Namespace.
13476 } // Namespace.
13477 } // Namespace.
13478 #endif  // Include guard.
13479 // gen_amalgamated begin header: gen/protos/perfetto/common/commit_data_request.pbzero.h
13480 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
13481 
13482 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_COMMIT_DATA_REQUEST_PROTO_H_
13483 #define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_COMMIT_DATA_REQUEST_PROTO_H_
13484 
13485 #include <stddef.h>
13486 #include <stdint.h>
13487 
13488 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
13489 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
13490 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
13491 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
13492 
13493 namespace perfetto {
13494 namespace protos {
13495 namespace pbzero {
13496 
13497 class CommitDataRequest_ChunkToPatch;
13498 class CommitDataRequest_ChunkToPatch_Patch;
13499 class CommitDataRequest_ChunksToMove;
13500 
13501 class CommitDataRequest_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
13502  public:
13503   CommitDataRequest_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
13504   explicit CommitDataRequest_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
13505   explicit CommitDataRequest_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
13506   bool has_chunks_to_move() const { return at<1>().valid(); }
13507   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> chunks_to_move() const { return GetRepeated<::protozero::ConstBytes>(1); }
13508   bool has_chunks_to_patch() const { return at<2>().valid(); }
13509   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> chunks_to_patch() const { return GetRepeated<::protozero::ConstBytes>(2); }
13510   bool has_flush_request_id() const { return at<3>().valid(); }
13511   uint64_t flush_request_id() const { return at<3>().as_uint64(); }
13512 };
13513 
13514 class CommitDataRequest : public ::protozero::Message {
13515  public:
13516   using Decoder = CommitDataRequest_Decoder;
13517   enum : int32_t {
13518     kChunksToMoveFieldNumber = 1,
13519     kChunksToPatchFieldNumber = 2,
13520     kFlushRequestIdFieldNumber = 3,
13521   };
13522   using ChunksToMove = ::perfetto::protos::pbzero::CommitDataRequest_ChunksToMove;
13523   using ChunkToPatch = ::perfetto::protos::pbzero::CommitDataRequest_ChunkToPatch;
13524   template <typename T = CommitDataRequest_ChunksToMove> T* add_chunks_to_move() {
13525     return BeginNestedMessage<T>(1);
13526   }
13527 
13528   template <typename T = CommitDataRequest_ChunkToPatch> T* add_chunks_to_patch() {
13529     return BeginNestedMessage<T>(2);
13530   }
13531 
13532   void set_flush_request_id(uint64_t value) {
13533     AppendVarInt(3, value);
13534   }
13535 };
13536 
13537 class CommitDataRequest_ChunkToPatch_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
13538  public:
13539   CommitDataRequest_ChunkToPatch_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
13540   explicit CommitDataRequest_ChunkToPatch_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
13541   explicit CommitDataRequest_ChunkToPatch_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
13542   bool has_target_buffer() const { return at<1>().valid(); }
13543   uint32_t target_buffer() const { return at<1>().as_uint32(); }
13544   bool has_writer_id() const { return at<2>().valid(); }
13545   uint32_t writer_id() const { return at<2>().as_uint32(); }
13546   bool has_chunk_id() const { return at<3>().valid(); }
13547   uint32_t chunk_id() const { return at<3>().as_uint32(); }
13548   bool has_patches() const { return at<4>().valid(); }
13549   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> patches() const { return GetRepeated<::protozero::ConstBytes>(4); }
13550   bool has_has_more_patches() const { return at<5>().valid(); }
13551   bool has_more_patches() const { return at<5>().as_bool(); }
13552 };
13553 
13554 class CommitDataRequest_ChunkToPatch : public ::protozero::Message {
13555  public:
13556   using Decoder = CommitDataRequest_ChunkToPatch_Decoder;
13557   enum : int32_t {
13558     kTargetBufferFieldNumber = 1,
13559     kWriterIdFieldNumber = 2,
13560     kChunkIdFieldNumber = 3,
13561     kPatchesFieldNumber = 4,
13562     kHasMorePatchesFieldNumber = 5,
13563   };
13564   using Patch = ::perfetto::protos::pbzero::CommitDataRequest_ChunkToPatch_Patch;
13565   void set_target_buffer(uint32_t value) {
13566     AppendVarInt(1, value);
13567   }
13568   void set_writer_id(uint32_t value) {
13569     AppendVarInt(2, value);
13570   }
13571   void set_chunk_id(uint32_t value) {
13572     AppendVarInt(3, value);
13573   }
13574   template <typename T = CommitDataRequest_ChunkToPatch_Patch> T* add_patches() {
13575     return BeginNestedMessage<T>(4);
13576   }
13577 
13578   void set_has_more_patches(bool value) {
13579     AppendTinyVarInt(5, value);
13580   }
13581 };
13582 
13583 class CommitDataRequest_ChunkToPatch_Patch_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
13584  public:
13585   CommitDataRequest_ChunkToPatch_Patch_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
13586   explicit CommitDataRequest_ChunkToPatch_Patch_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
13587   explicit CommitDataRequest_ChunkToPatch_Patch_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
13588   bool has_offset() const { return at<1>().valid(); }
13589   uint32_t offset() const { return at<1>().as_uint32(); }
13590   bool has_data() const { return at<2>().valid(); }
13591   ::protozero::ConstBytes data() const { return at<2>().as_bytes(); }
13592 };
13593 
13594 class CommitDataRequest_ChunkToPatch_Patch : public ::protozero::Message {
13595  public:
13596   using Decoder = CommitDataRequest_ChunkToPatch_Patch_Decoder;
13597   enum : int32_t {
13598     kOffsetFieldNumber = 1,
13599     kDataFieldNumber = 2,
13600   };
13601   void set_offset(uint32_t value) {
13602     AppendVarInt(1, value);
13603   }
13604   void set_data(const std::string& value) {
13605     AppendBytes(2, value.data(), value.size());
13606   }
13607   void set_data(const uint8_t* data, size_t size) {
13608     AppendBytes(2, data, size);
13609   }
13610 };
13611 
13612 class CommitDataRequest_ChunksToMove_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
13613  public:
13614   CommitDataRequest_ChunksToMove_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
13615   explicit CommitDataRequest_ChunksToMove_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
13616   explicit CommitDataRequest_ChunksToMove_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
13617   bool has_page() const { return at<1>().valid(); }
13618   uint32_t page() const { return at<1>().as_uint32(); }
13619   bool has_chunk() const { return at<2>().valid(); }
13620   uint32_t chunk() const { return at<2>().as_uint32(); }
13621   bool has_target_buffer() const { return at<3>().valid(); }
13622   uint32_t target_buffer() const { return at<3>().as_uint32(); }
13623 };
13624 
13625 class CommitDataRequest_ChunksToMove : public ::protozero::Message {
13626  public:
13627   using Decoder = CommitDataRequest_ChunksToMove_Decoder;
13628   enum : int32_t {
13629     kPageFieldNumber = 1,
13630     kChunkFieldNumber = 2,
13631     kTargetBufferFieldNumber = 3,
13632   };
13633   void set_page(uint32_t value) {
13634     AppendVarInt(1, value);
13635   }
13636   void set_chunk(uint32_t value) {
13637     AppendVarInt(2, value);
13638   }
13639   void set_target_buffer(uint32_t value) {
13640     AppendVarInt(3, value);
13641   }
13642 };
13643 
13644 } // Namespace.
13645 } // Namespace.
13646 } // Namespace.
13647 #endif  // Include guard.
13648 // gen_amalgamated begin header: gen/protos/perfetto/common/data_source_descriptor.pbzero.h
13649 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
13650 
13651 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_DATA_SOURCE_DESCRIPTOR_PROTO_H_
13652 #define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_DATA_SOURCE_DESCRIPTOR_PROTO_H_
13653 
13654 #include <stddef.h>
13655 #include <stdint.h>
13656 
13657 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
13658 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
13659 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
13660 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
13661 
13662 namespace perfetto {
13663 namespace protos {
13664 namespace pbzero {
13665 
13666 class GpuCounterDescriptor;
13667 class TrackEventDescriptor;
13668 
13669 class DataSourceDescriptor_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
13670  public:
13671   DataSourceDescriptor_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
13672   explicit DataSourceDescriptor_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
13673   explicit DataSourceDescriptor_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
13674   bool has_name() const { return at<1>().valid(); }
13675   ::protozero::ConstChars name() const { return at<1>().as_string(); }
13676   bool has_will_notify_on_stop() const { return at<2>().valid(); }
13677   bool will_notify_on_stop() const { return at<2>().as_bool(); }
13678   bool has_will_notify_on_start() const { return at<3>().valid(); }
13679   bool will_notify_on_start() const { return at<3>().as_bool(); }
13680   bool has_handles_incremental_state_clear() const { return at<4>().valid(); }
13681   bool handles_incremental_state_clear() const { return at<4>().as_bool(); }
13682   bool has_gpu_counter_descriptor() const { return at<5>().valid(); }
13683   ::protozero::ConstBytes gpu_counter_descriptor() const { return at<5>().as_bytes(); }
13684   bool has_track_event_descriptor() const { return at<6>().valid(); }
13685   ::protozero::ConstBytes track_event_descriptor() const { return at<6>().as_bytes(); }
13686 };
13687 
13688 class DataSourceDescriptor : public ::protozero::Message {
13689  public:
13690   using Decoder = DataSourceDescriptor_Decoder;
13691   enum : int32_t {
13692     kNameFieldNumber = 1,
13693     kWillNotifyOnStopFieldNumber = 2,
13694     kWillNotifyOnStartFieldNumber = 3,
13695     kHandlesIncrementalStateClearFieldNumber = 4,
13696     kGpuCounterDescriptorFieldNumber = 5,
13697     kTrackEventDescriptorFieldNumber = 6,
13698   };
13699   void set_name(const std::string& value) {
13700     AppendBytes(1, value.data(), value.size());
13701   }
13702   void set_name(const char* data, size_t size) {
13703     AppendBytes(1, data, size);
13704   }
13705   void set_will_notify_on_stop(bool value) {
13706     AppendTinyVarInt(2, value);
13707   }
13708   void set_will_notify_on_start(bool value) {
13709     AppendTinyVarInt(3, value);
13710   }
13711   void set_handles_incremental_state_clear(bool value) {
13712     AppendTinyVarInt(4, value);
13713   }
13714   template <typename T = GpuCounterDescriptor> T* set_gpu_counter_descriptor() {
13715     return BeginNestedMessage<T>(5);
13716   }
13717 
13718   void set_gpu_counter_descriptor_raw(const std::string& raw) {
13719     return AppendBytes(5, raw.data(), raw.size());
13720   }
13721 
13722   template <typename T = TrackEventDescriptor> T* set_track_event_descriptor() {
13723     return BeginNestedMessage<T>(6);
13724   }
13725 
13726   void set_track_event_descriptor_raw(const std::string& raw) {
13727     return AppendBytes(6, raw.data(), raw.size());
13728   }
13729 
13730 };
13731 
13732 } // Namespace.
13733 } // Namespace.
13734 } // Namespace.
13735 #endif  // Include guard.
13736 // gen_amalgamated begin header: gen/protos/perfetto/common/descriptor.pbzero.h
13737 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
13738 
13739 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_DESCRIPTOR_PROTO_H_
13740 #define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_DESCRIPTOR_PROTO_H_
13741 
13742 #include <stddef.h>
13743 #include <stdint.h>
13744 
13745 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
13746 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
13747 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
13748 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
13749 
13750 namespace perfetto {
13751 namespace protos {
13752 namespace pbzero {
13753 
13754 class DescriptorProto;
13755 class DescriptorProto_ReservedRange;
13756 class EnumDescriptorProto;
13757 class EnumValueDescriptorProto;
13758 class FieldDescriptorProto;
13759 class FileDescriptorProto;
13760 class OneofDescriptorProto;
13761 class OneofOptions;
13762 enum FieldDescriptorProto_Label : int32_t;
13763 enum FieldDescriptorProto_Type : int32_t;
13764 
13765 enum FieldDescriptorProto_Type : int32_t {
13766   FieldDescriptorProto_Type_TYPE_DOUBLE = 1,
13767   FieldDescriptorProto_Type_TYPE_FLOAT = 2,
13768   FieldDescriptorProto_Type_TYPE_INT64 = 3,
13769   FieldDescriptorProto_Type_TYPE_UINT64 = 4,
13770   FieldDescriptorProto_Type_TYPE_INT32 = 5,
13771   FieldDescriptorProto_Type_TYPE_FIXED64 = 6,
13772   FieldDescriptorProto_Type_TYPE_FIXED32 = 7,
13773   FieldDescriptorProto_Type_TYPE_BOOL = 8,
13774   FieldDescriptorProto_Type_TYPE_STRING = 9,
13775   FieldDescriptorProto_Type_TYPE_GROUP = 10,
13776   FieldDescriptorProto_Type_TYPE_MESSAGE = 11,
13777   FieldDescriptorProto_Type_TYPE_BYTES = 12,
13778   FieldDescriptorProto_Type_TYPE_UINT32 = 13,
13779   FieldDescriptorProto_Type_TYPE_ENUM = 14,
13780   FieldDescriptorProto_Type_TYPE_SFIXED32 = 15,
13781   FieldDescriptorProto_Type_TYPE_SFIXED64 = 16,
13782   FieldDescriptorProto_Type_TYPE_SINT32 = 17,
13783   FieldDescriptorProto_Type_TYPE_SINT64 = 18,
13784 };
13785 
13786 const FieldDescriptorProto_Type FieldDescriptorProto_Type_MIN = FieldDescriptorProto_Type_TYPE_DOUBLE;
13787 const FieldDescriptorProto_Type FieldDescriptorProto_Type_MAX = FieldDescriptorProto_Type_TYPE_SINT64;
13788 
13789 enum FieldDescriptorProto_Label : int32_t {
13790   FieldDescriptorProto_Label_LABEL_OPTIONAL = 1,
13791   FieldDescriptorProto_Label_LABEL_REQUIRED = 2,
13792   FieldDescriptorProto_Label_LABEL_REPEATED = 3,
13793 };
13794 
13795 const FieldDescriptorProto_Label FieldDescriptorProto_Label_MIN = FieldDescriptorProto_Label_LABEL_OPTIONAL;
13796 const FieldDescriptorProto_Label FieldDescriptorProto_Label_MAX = FieldDescriptorProto_Label_LABEL_REPEATED;
13797 
13798 class OneofOptions_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/0, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
13799  public:
13800   OneofOptions_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
13801   explicit OneofOptions_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
13802   explicit OneofOptions_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
13803 };
13804 
13805 class OneofOptions : public ::protozero::Message {
13806  public:
13807   using Decoder = OneofOptions_Decoder;
13808 };
13809 
13810 class EnumValueDescriptorProto_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
13811  public:
13812   EnumValueDescriptorProto_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
13813   explicit EnumValueDescriptorProto_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
13814   explicit EnumValueDescriptorProto_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
13815   bool has_name() const { return at<1>().valid(); }
13816   ::protozero::ConstChars name() const { return at<1>().as_string(); }
13817   bool has_number() const { return at<2>().valid(); }
13818   int32_t number() const { return at<2>().as_int32(); }
13819 };
13820 
13821 class EnumValueDescriptorProto : public ::protozero::Message {
13822  public:
13823   using Decoder = EnumValueDescriptorProto_Decoder;
13824   enum : int32_t {
13825     kNameFieldNumber = 1,
13826     kNumberFieldNumber = 2,
13827   };
13828   void set_name(const std::string& value) {
13829     AppendBytes(1, value.data(), value.size());
13830   }
13831   void set_name(const char* data, size_t size) {
13832     AppendBytes(1, data, size);
13833   }
13834   void set_number(int32_t value) {
13835     AppendVarInt(2, value);
13836   }
13837 };
13838 
13839 class EnumDescriptorProto_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
13840  public:
13841   EnumDescriptorProto_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
13842   explicit EnumDescriptorProto_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
13843   explicit EnumDescriptorProto_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
13844   bool has_name() const { return at<1>().valid(); }
13845   ::protozero::ConstChars name() const { return at<1>().as_string(); }
13846   bool has_value() const { return at<2>().valid(); }
13847   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> value() const { return GetRepeated<::protozero::ConstBytes>(2); }
13848   bool has_reserved_name() const { return at<5>().valid(); }
13849   ::protozero::RepeatedFieldIterator<::protozero::ConstChars> reserved_name() const { return GetRepeated<::protozero::ConstChars>(5); }
13850 };
13851 
13852 class EnumDescriptorProto : public ::protozero::Message {
13853  public:
13854   using Decoder = EnumDescriptorProto_Decoder;
13855   enum : int32_t {
13856     kNameFieldNumber = 1,
13857     kValueFieldNumber = 2,
13858     kReservedNameFieldNumber = 5,
13859   };
13860   void set_name(const std::string& value) {
13861     AppendBytes(1, value.data(), value.size());
13862   }
13863   void set_name(const char* data, size_t size) {
13864     AppendBytes(1, data, size);
13865   }
13866   template <typename T = EnumValueDescriptorProto> T* add_value() {
13867     return BeginNestedMessage<T>(2);
13868   }
13869 
13870   void add_reserved_name(const std::string& value) {
13871     AppendBytes(5, value.data(), value.size());
13872   }
13873   void add_reserved_name(const char* data, size_t size) {
13874     AppendBytes(5, data, size);
13875   }
13876 };
13877 
13878 class OneofDescriptorProto_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
13879  public:
13880   OneofDescriptorProto_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
13881   explicit OneofDescriptorProto_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
13882   explicit OneofDescriptorProto_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
13883   bool has_name() const { return at<1>().valid(); }
13884   ::protozero::ConstChars name() const { return at<1>().as_string(); }
13885   bool has_options() const { return at<2>().valid(); }
13886   ::protozero::ConstBytes options() const { return at<2>().as_bytes(); }
13887 };
13888 
13889 class OneofDescriptorProto : public ::protozero::Message {
13890  public:
13891   using Decoder = OneofDescriptorProto_Decoder;
13892   enum : int32_t {
13893     kNameFieldNumber = 1,
13894     kOptionsFieldNumber = 2,
13895   };
13896   void set_name(const std::string& value) {
13897     AppendBytes(1, value.data(), value.size());
13898   }
13899   void set_name(const char* data, size_t size) {
13900     AppendBytes(1, data, size);
13901   }
13902   template <typename T = OneofOptions> T* set_options() {
13903     return BeginNestedMessage<T>(2);
13904   }
13905 
13906 };
13907 
13908 class FieldDescriptorProto_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/9, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
13909  public:
13910   FieldDescriptorProto_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
13911   explicit FieldDescriptorProto_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
13912   explicit FieldDescriptorProto_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
13913   bool has_name() const { return at<1>().valid(); }
13914   ::protozero::ConstChars name() const { return at<1>().as_string(); }
13915   bool has_number() const { return at<3>().valid(); }
13916   int32_t number() const { return at<3>().as_int32(); }
13917   bool has_label() const { return at<4>().valid(); }
13918   int32_t label() const { return at<4>().as_int32(); }
13919   bool has_type() const { return at<5>().valid(); }
13920   int32_t type() const { return at<5>().as_int32(); }
13921   bool has_type_name() const { return at<6>().valid(); }
13922   ::protozero::ConstChars type_name() const { return at<6>().as_string(); }
13923   bool has_extendee() const { return at<2>().valid(); }
13924   ::protozero::ConstChars extendee() const { return at<2>().as_string(); }
13925   bool has_default_value() const { return at<7>().valid(); }
13926   ::protozero::ConstChars default_value() const { return at<7>().as_string(); }
13927   bool has_oneof_index() const { return at<9>().valid(); }
13928   int32_t oneof_index() const { return at<9>().as_int32(); }
13929 };
13930 
13931 class FieldDescriptorProto : public ::protozero::Message {
13932  public:
13933   using Decoder = FieldDescriptorProto_Decoder;
13934   enum : int32_t {
13935     kNameFieldNumber = 1,
13936     kNumberFieldNumber = 3,
13937     kLabelFieldNumber = 4,
13938     kTypeFieldNumber = 5,
13939     kTypeNameFieldNumber = 6,
13940     kExtendeeFieldNumber = 2,
13941     kDefaultValueFieldNumber = 7,
13942     kOneofIndexFieldNumber = 9,
13943   };
13944   using Type = ::perfetto::protos::pbzero::FieldDescriptorProto_Type;
13945   using Label = ::perfetto::protos::pbzero::FieldDescriptorProto_Label;
13946   static const Type TYPE_DOUBLE = FieldDescriptorProto_Type_TYPE_DOUBLE;
13947   static const Type TYPE_FLOAT = FieldDescriptorProto_Type_TYPE_FLOAT;
13948   static const Type TYPE_INT64 = FieldDescriptorProto_Type_TYPE_INT64;
13949   static const Type TYPE_UINT64 = FieldDescriptorProto_Type_TYPE_UINT64;
13950   static const Type TYPE_INT32 = FieldDescriptorProto_Type_TYPE_INT32;
13951   static const Type TYPE_FIXED64 = FieldDescriptorProto_Type_TYPE_FIXED64;
13952   static const Type TYPE_FIXED32 = FieldDescriptorProto_Type_TYPE_FIXED32;
13953   static const Type TYPE_BOOL = FieldDescriptorProto_Type_TYPE_BOOL;
13954   static const Type TYPE_STRING = FieldDescriptorProto_Type_TYPE_STRING;
13955   static const Type TYPE_GROUP = FieldDescriptorProto_Type_TYPE_GROUP;
13956   static const Type TYPE_MESSAGE = FieldDescriptorProto_Type_TYPE_MESSAGE;
13957   static const Type TYPE_BYTES = FieldDescriptorProto_Type_TYPE_BYTES;
13958   static const Type TYPE_UINT32 = FieldDescriptorProto_Type_TYPE_UINT32;
13959   static const Type TYPE_ENUM = FieldDescriptorProto_Type_TYPE_ENUM;
13960   static const Type TYPE_SFIXED32 = FieldDescriptorProto_Type_TYPE_SFIXED32;
13961   static const Type TYPE_SFIXED64 = FieldDescriptorProto_Type_TYPE_SFIXED64;
13962   static const Type TYPE_SINT32 = FieldDescriptorProto_Type_TYPE_SINT32;
13963   static const Type TYPE_SINT64 = FieldDescriptorProto_Type_TYPE_SINT64;
13964   static const Label LABEL_OPTIONAL = FieldDescriptorProto_Label_LABEL_OPTIONAL;
13965   static const Label LABEL_REQUIRED = FieldDescriptorProto_Label_LABEL_REQUIRED;
13966   static const Label LABEL_REPEATED = FieldDescriptorProto_Label_LABEL_REPEATED;
13967   void set_name(const std::string& value) {
13968     AppendBytes(1, value.data(), value.size());
13969   }
13970   void set_name(const char* data, size_t size) {
13971     AppendBytes(1, data, size);
13972   }
13973   void set_number(int32_t value) {
13974     AppendVarInt(3, value);
13975   }
13976   void set_label(::perfetto::protos::pbzero::FieldDescriptorProto_Label value) {
13977     AppendTinyVarInt(4, value);
13978   }
13979   void set_type(::perfetto::protos::pbzero::FieldDescriptorProto_Type value) {
13980     AppendTinyVarInt(5, value);
13981   }
13982   void set_type_name(const std::string& value) {
13983     AppendBytes(6, value.data(), value.size());
13984   }
13985   void set_type_name(const char* data, size_t size) {
13986     AppendBytes(6, data, size);
13987   }
13988   void set_extendee(const std::string& value) {
13989     AppendBytes(2, value.data(), value.size());
13990   }
13991   void set_extendee(const char* data, size_t size) {
13992     AppendBytes(2, data, size);
13993   }
13994   void set_default_value(const std::string& value) {
13995     AppendBytes(7, value.data(), value.size());
13996   }
13997   void set_default_value(const char* data, size_t size) {
13998     AppendBytes(7, data, size);
13999   }
14000   void set_oneof_index(int32_t value) {
14001     AppendVarInt(9, value);
14002   }
14003 };
14004 
14005 class DescriptorProto_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/10, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
14006  public:
14007   DescriptorProto_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
14008   explicit DescriptorProto_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
14009   explicit DescriptorProto_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
14010   bool has_name() const { return at<1>().valid(); }
14011   ::protozero::ConstChars name() const { return at<1>().as_string(); }
14012   bool has_field() const { return at<2>().valid(); }
14013   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> field() const { return GetRepeated<::protozero::ConstBytes>(2); }
14014   bool has_extension() const { return at<6>().valid(); }
14015   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> extension() const { return GetRepeated<::protozero::ConstBytes>(6); }
14016   bool has_nested_type() const { return at<3>().valid(); }
14017   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> nested_type() const { return GetRepeated<::protozero::ConstBytes>(3); }
14018   bool has_enum_type() const { return at<4>().valid(); }
14019   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> enum_type() const { return GetRepeated<::protozero::ConstBytes>(4); }
14020   bool has_oneof_decl() const { return at<8>().valid(); }
14021   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> oneof_decl() const { return GetRepeated<::protozero::ConstBytes>(8); }
14022   bool has_reserved_range() const { return at<9>().valid(); }
14023   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> reserved_range() const { return GetRepeated<::protozero::ConstBytes>(9); }
14024   bool has_reserved_name() const { return at<10>().valid(); }
14025   ::protozero::RepeatedFieldIterator<::protozero::ConstChars> reserved_name() const { return GetRepeated<::protozero::ConstChars>(10); }
14026 };
14027 
14028 class DescriptorProto : public ::protozero::Message {
14029  public:
14030   using Decoder = DescriptorProto_Decoder;
14031   enum : int32_t {
14032     kNameFieldNumber = 1,
14033     kFieldFieldNumber = 2,
14034     kExtensionFieldNumber = 6,
14035     kNestedTypeFieldNumber = 3,
14036     kEnumTypeFieldNumber = 4,
14037     kOneofDeclFieldNumber = 8,
14038     kReservedRangeFieldNumber = 9,
14039     kReservedNameFieldNumber = 10,
14040   };
14041   using ReservedRange = ::perfetto::protos::pbzero::DescriptorProto_ReservedRange;
14042   void set_name(const std::string& value) {
14043     AppendBytes(1, value.data(), value.size());
14044   }
14045   void set_name(const char* data, size_t size) {
14046     AppendBytes(1, data, size);
14047   }
14048   template <typename T = FieldDescriptorProto> T* add_field() {
14049     return BeginNestedMessage<T>(2);
14050   }
14051 
14052   template <typename T = FieldDescriptorProto> T* add_extension() {
14053     return BeginNestedMessage<T>(6);
14054   }
14055 
14056   template <typename T = DescriptorProto> T* add_nested_type() {
14057     return BeginNestedMessage<T>(3);
14058   }
14059 
14060   template <typename T = EnumDescriptorProto> T* add_enum_type() {
14061     return BeginNestedMessage<T>(4);
14062   }
14063 
14064   template <typename T = OneofDescriptorProto> T* add_oneof_decl() {
14065     return BeginNestedMessage<T>(8);
14066   }
14067 
14068   template <typename T = DescriptorProto_ReservedRange> T* add_reserved_range() {
14069     return BeginNestedMessage<T>(9);
14070   }
14071 
14072   void add_reserved_name(const std::string& value) {
14073     AppendBytes(10, value.data(), value.size());
14074   }
14075   void add_reserved_name(const char* data, size_t size) {
14076     AppendBytes(10, data, size);
14077   }
14078 };
14079 
14080 class DescriptorProto_ReservedRange_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
14081  public:
14082   DescriptorProto_ReservedRange_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
14083   explicit DescriptorProto_ReservedRange_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
14084   explicit DescriptorProto_ReservedRange_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
14085   bool has_start() const { return at<1>().valid(); }
14086   int32_t start() const { return at<1>().as_int32(); }
14087   bool has_end() const { return at<2>().valid(); }
14088   int32_t end() const { return at<2>().as_int32(); }
14089 };
14090 
14091 class DescriptorProto_ReservedRange : public ::protozero::Message {
14092  public:
14093   using Decoder = DescriptorProto_ReservedRange_Decoder;
14094   enum : int32_t {
14095     kStartFieldNumber = 1,
14096     kEndFieldNumber = 2,
14097   };
14098   void set_start(int32_t value) {
14099     AppendVarInt(1, value);
14100   }
14101   void set_end(int32_t value) {
14102     AppendVarInt(2, value);
14103   }
14104 };
14105 
14106 class FileDescriptorProto_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/11, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
14107  public:
14108   FileDescriptorProto_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
14109   explicit FileDescriptorProto_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
14110   explicit FileDescriptorProto_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
14111   bool has_name() const { return at<1>().valid(); }
14112   ::protozero::ConstChars name() const { return at<1>().as_string(); }
14113   bool has_package() const { return at<2>().valid(); }
14114   ::protozero::ConstChars package() const { return at<2>().as_string(); }
14115   bool has_dependency() const { return at<3>().valid(); }
14116   ::protozero::RepeatedFieldIterator<::protozero::ConstChars> dependency() const { return GetRepeated<::protozero::ConstChars>(3); }
14117   bool has_public_dependency() const { return at<10>().valid(); }
14118   ::protozero::RepeatedFieldIterator<int32_t> public_dependency() const { return GetRepeated<int32_t>(10); }
14119   bool has_weak_dependency() const { return at<11>().valid(); }
14120   ::protozero::RepeatedFieldIterator<int32_t> weak_dependency() const { return GetRepeated<int32_t>(11); }
14121   bool has_message_type() const { return at<4>().valid(); }
14122   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> message_type() const { return GetRepeated<::protozero::ConstBytes>(4); }
14123   bool has_enum_type() const { return at<5>().valid(); }
14124   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> enum_type() const { return GetRepeated<::protozero::ConstBytes>(5); }
14125   bool has_extension() const { return at<7>().valid(); }
14126   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> extension() const { return GetRepeated<::protozero::ConstBytes>(7); }
14127 };
14128 
14129 class FileDescriptorProto : public ::protozero::Message {
14130  public:
14131   using Decoder = FileDescriptorProto_Decoder;
14132   enum : int32_t {
14133     kNameFieldNumber = 1,
14134     kPackageFieldNumber = 2,
14135     kDependencyFieldNumber = 3,
14136     kPublicDependencyFieldNumber = 10,
14137     kWeakDependencyFieldNumber = 11,
14138     kMessageTypeFieldNumber = 4,
14139     kEnumTypeFieldNumber = 5,
14140     kExtensionFieldNumber = 7,
14141   };
14142   void set_name(const std::string& value) {
14143     AppendBytes(1, value.data(), value.size());
14144   }
14145   void set_name(const char* data, size_t size) {
14146     AppendBytes(1, data, size);
14147   }
14148   void set_package(const std::string& value) {
14149     AppendBytes(2, value.data(), value.size());
14150   }
14151   void set_package(const char* data, size_t size) {
14152     AppendBytes(2, data, size);
14153   }
14154   void add_dependency(const std::string& value) {
14155     AppendBytes(3, value.data(), value.size());
14156   }
14157   void add_dependency(const char* data, size_t size) {
14158     AppendBytes(3, data, size);
14159   }
14160   void add_public_dependency(int32_t value) {
14161     AppendVarInt(10, value);
14162   }
14163   void add_weak_dependency(int32_t value) {
14164     AppendVarInt(11, value);
14165   }
14166   template <typename T = DescriptorProto> T* add_message_type() {
14167     return BeginNestedMessage<T>(4);
14168   }
14169 
14170   template <typename T = EnumDescriptorProto> T* add_enum_type() {
14171     return BeginNestedMessage<T>(5);
14172   }
14173 
14174   template <typename T = FieldDescriptorProto> T* add_extension() {
14175     return BeginNestedMessage<T>(7);
14176   }
14177 
14178 };
14179 
14180 class FileDescriptorSet_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
14181  public:
14182   FileDescriptorSet_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
14183   explicit FileDescriptorSet_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
14184   explicit FileDescriptorSet_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
14185   bool has_file() const { return at<1>().valid(); }
14186   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> file() const { return GetRepeated<::protozero::ConstBytes>(1); }
14187 };
14188 
14189 class FileDescriptorSet : public ::protozero::Message {
14190  public:
14191   using Decoder = FileDescriptorSet_Decoder;
14192   enum : int32_t {
14193     kFileFieldNumber = 1,
14194   };
14195   template <typename T = FileDescriptorProto> T* add_file() {
14196     return BeginNestedMessage<T>(1);
14197   }
14198 
14199 };
14200 
14201 } // Namespace.
14202 } // Namespace.
14203 } // Namespace.
14204 #endif  // Include guard.
14205 // gen_amalgamated begin header: gen/protos/perfetto/common/gpu_counter_descriptor.pbzero.h
14206 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
14207 
14208 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_GPU_COUNTER_DESCRIPTOR_PROTO_H_
14209 #define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_GPU_COUNTER_DESCRIPTOR_PROTO_H_
14210 
14211 #include <stddef.h>
14212 #include <stdint.h>
14213 
14214 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
14215 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
14216 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
14217 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
14218 
14219 namespace perfetto {
14220 namespace protos {
14221 namespace pbzero {
14222 
14223 class GpuCounterDescriptor_GpuCounterBlock;
14224 class GpuCounterDescriptor_GpuCounterSpec;
14225 enum GpuCounterDescriptor_GpuCounterGroup : int32_t;
14226 enum GpuCounterDescriptor_MeasureUnit : int32_t;
14227 
14228 enum GpuCounterDescriptor_GpuCounterGroup : int32_t {
14229   GpuCounterDescriptor_GpuCounterGroup_UNCLASSIFIED = 0,
14230   GpuCounterDescriptor_GpuCounterGroup_SYSTEM = 1,
14231   GpuCounterDescriptor_GpuCounterGroup_VERTICES = 2,
14232   GpuCounterDescriptor_GpuCounterGroup_FRAGMENTS = 3,
14233   GpuCounterDescriptor_GpuCounterGroup_PRIMITIVES = 4,
14234   GpuCounterDescriptor_GpuCounterGroup_MEMORY = 5,
14235   GpuCounterDescriptor_GpuCounterGroup_COMPUTE = 6,
14236 };
14237 
14238 const GpuCounterDescriptor_GpuCounterGroup GpuCounterDescriptor_GpuCounterGroup_MIN = GpuCounterDescriptor_GpuCounterGroup_UNCLASSIFIED;
14239 const GpuCounterDescriptor_GpuCounterGroup GpuCounterDescriptor_GpuCounterGroup_MAX = GpuCounterDescriptor_GpuCounterGroup_COMPUTE;
14240 
14241 enum GpuCounterDescriptor_MeasureUnit : int32_t {
14242   GpuCounterDescriptor_MeasureUnit_NONE = 0,
14243   GpuCounterDescriptor_MeasureUnit_BIT = 1,
14244   GpuCounterDescriptor_MeasureUnit_KILOBIT = 2,
14245   GpuCounterDescriptor_MeasureUnit_MEGABIT = 3,
14246   GpuCounterDescriptor_MeasureUnit_GIGABIT = 4,
14247   GpuCounterDescriptor_MeasureUnit_TERABIT = 5,
14248   GpuCounterDescriptor_MeasureUnit_PETABIT = 6,
14249   GpuCounterDescriptor_MeasureUnit_BYTE = 7,
14250   GpuCounterDescriptor_MeasureUnit_KILOBYTE = 8,
14251   GpuCounterDescriptor_MeasureUnit_MEGABYTE = 9,
14252   GpuCounterDescriptor_MeasureUnit_GIGABYTE = 10,
14253   GpuCounterDescriptor_MeasureUnit_TERABYTE = 11,
14254   GpuCounterDescriptor_MeasureUnit_PETABYTE = 12,
14255   GpuCounterDescriptor_MeasureUnit_HERTZ = 13,
14256   GpuCounterDescriptor_MeasureUnit_KILOHERTZ = 14,
14257   GpuCounterDescriptor_MeasureUnit_MEGAHERTZ = 15,
14258   GpuCounterDescriptor_MeasureUnit_GIGAHERTZ = 16,
14259   GpuCounterDescriptor_MeasureUnit_TERAHERTZ = 17,
14260   GpuCounterDescriptor_MeasureUnit_PETAHERTZ = 18,
14261   GpuCounterDescriptor_MeasureUnit_NANOSECOND = 19,
14262   GpuCounterDescriptor_MeasureUnit_MICROSECOND = 20,
14263   GpuCounterDescriptor_MeasureUnit_MILLISECOND = 21,
14264   GpuCounterDescriptor_MeasureUnit_SECOND = 22,
14265   GpuCounterDescriptor_MeasureUnit_MINUTE = 23,
14266   GpuCounterDescriptor_MeasureUnit_HOUR = 24,
14267   GpuCounterDescriptor_MeasureUnit_VERTEX = 25,
14268   GpuCounterDescriptor_MeasureUnit_PIXEL = 26,
14269   GpuCounterDescriptor_MeasureUnit_TRIANGLE = 27,
14270   GpuCounterDescriptor_MeasureUnit_PRIMITIVE = 38,
14271   GpuCounterDescriptor_MeasureUnit_FRAGMENT = 39,
14272   GpuCounterDescriptor_MeasureUnit_MILLIWATT = 28,
14273   GpuCounterDescriptor_MeasureUnit_WATT = 29,
14274   GpuCounterDescriptor_MeasureUnit_KILOWATT = 30,
14275   GpuCounterDescriptor_MeasureUnit_JOULE = 31,
14276   GpuCounterDescriptor_MeasureUnit_VOLT = 32,
14277   GpuCounterDescriptor_MeasureUnit_AMPERE = 33,
14278   GpuCounterDescriptor_MeasureUnit_CELSIUS = 34,
14279   GpuCounterDescriptor_MeasureUnit_FAHRENHEIT = 35,
14280   GpuCounterDescriptor_MeasureUnit_KELVIN = 36,
14281   GpuCounterDescriptor_MeasureUnit_PERCENT = 37,
14282   GpuCounterDescriptor_MeasureUnit_INSTRUCTION = 40,
14283 };
14284 
14285 const GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor_MeasureUnit_MIN = GpuCounterDescriptor_MeasureUnit_NONE;
14286 const GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor_MeasureUnit_MAX = GpuCounterDescriptor_MeasureUnit_INSTRUCTION;
14287 
14288 class GpuCounterDescriptor_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
14289  public:
14290   GpuCounterDescriptor_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
14291   explicit GpuCounterDescriptor_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
14292   explicit GpuCounterDescriptor_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
14293   bool has_specs() const { return at<1>().valid(); }
14294   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> specs() const { return GetRepeated<::protozero::ConstBytes>(1); }
14295   bool has_blocks() const { return at<2>().valid(); }
14296   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> blocks() const { return GetRepeated<::protozero::ConstBytes>(2); }
14297   bool has_min_sampling_period_ns() const { return at<3>().valid(); }
14298   uint64_t min_sampling_period_ns() const { return at<3>().as_uint64(); }
14299   bool has_max_sampling_period_ns() const { return at<4>().valid(); }
14300   uint64_t max_sampling_period_ns() const { return at<4>().as_uint64(); }
14301   bool has_supports_instrumented_sampling() const { return at<5>().valid(); }
14302   bool supports_instrumented_sampling() const { return at<5>().as_bool(); }
14303 };
14304 
14305 class GpuCounterDescriptor : public ::protozero::Message {
14306  public:
14307   using Decoder = GpuCounterDescriptor_Decoder;
14308   enum : int32_t {
14309     kSpecsFieldNumber = 1,
14310     kBlocksFieldNumber = 2,
14311     kMinSamplingPeriodNsFieldNumber = 3,
14312     kMaxSamplingPeriodNsFieldNumber = 4,
14313     kSupportsInstrumentedSamplingFieldNumber = 5,
14314   };
14315   using GpuCounterSpec = ::perfetto::protos::pbzero::GpuCounterDescriptor_GpuCounterSpec;
14316   using GpuCounterBlock = ::perfetto::protos::pbzero::GpuCounterDescriptor_GpuCounterBlock;
14317   using GpuCounterGroup = ::perfetto::protos::pbzero::GpuCounterDescriptor_GpuCounterGroup;
14318   using MeasureUnit = ::perfetto::protos::pbzero::GpuCounterDescriptor_MeasureUnit;
14319   static const GpuCounterGroup UNCLASSIFIED = GpuCounterDescriptor_GpuCounterGroup_UNCLASSIFIED;
14320   static const GpuCounterGroup SYSTEM = GpuCounterDescriptor_GpuCounterGroup_SYSTEM;
14321   static const GpuCounterGroup VERTICES = GpuCounterDescriptor_GpuCounterGroup_VERTICES;
14322   static const GpuCounterGroup FRAGMENTS = GpuCounterDescriptor_GpuCounterGroup_FRAGMENTS;
14323   static const GpuCounterGroup PRIMITIVES = GpuCounterDescriptor_GpuCounterGroup_PRIMITIVES;
14324   static const GpuCounterGroup MEMORY = GpuCounterDescriptor_GpuCounterGroup_MEMORY;
14325   static const GpuCounterGroup COMPUTE = GpuCounterDescriptor_GpuCounterGroup_COMPUTE;
14326   static const MeasureUnit NONE = GpuCounterDescriptor_MeasureUnit_NONE;
14327   static const MeasureUnit BIT = GpuCounterDescriptor_MeasureUnit_BIT;
14328   static const MeasureUnit KILOBIT = GpuCounterDescriptor_MeasureUnit_KILOBIT;
14329   static const MeasureUnit MEGABIT = GpuCounterDescriptor_MeasureUnit_MEGABIT;
14330   static const MeasureUnit GIGABIT = GpuCounterDescriptor_MeasureUnit_GIGABIT;
14331   static const MeasureUnit TERABIT = GpuCounterDescriptor_MeasureUnit_TERABIT;
14332   static const MeasureUnit PETABIT = GpuCounterDescriptor_MeasureUnit_PETABIT;
14333   static const MeasureUnit BYTE = GpuCounterDescriptor_MeasureUnit_BYTE;
14334   static const MeasureUnit KILOBYTE = GpuCounterDescriptor_MeasureUnit_KILOBYTE;
14335   static const MeasureUnit MEGABYTE = GpuCounterDescriptor_MeasureUnit_MEGABYTE;
14336   static const MeasureUnit GIGABYTE = GpuCounterDescriptor_MeasureUnit_GIGABYTE;
14337   static const MeasureUnit TERABYTE = GpuCounterDescriptor_MeasureUnit_TERABYTE;
14338   static const MeasureUnit PETABYTE = GpuCounterDescriptor_MeasureUnit_PETABYTE;
14339   static const MeasureUnit HERTZ = GpuCounterDescriptor_MeasureUnit_HERTZ;
14340   static const MeasureUnit KILOHERTZ = GpuCounterDescriptor_MeasureUnit_KILOHERTZ;
14341   static const MeasureUnit MEGAHERTZ = GpuCounterDescriptor_MeasureUnit_MEGAHERTZ;
14342   static const MeasureUnit GIGAHERTZ = GpuCounterDescriptor_MeasureUnit_GIGAHERTZ;
14343   static const MeasureUnit TERAHERTZ = GpuCounterDescriptor_MeasureUnit_TERAHERTZ;
14344   static const MeasureUnit PETAHERTZ = GpuCounterDescriptor_MeasureUnit_PETAHERTZ;
14345   static const MeasureUnit NANOSECOND = GpuCounterDescriptor_MeasureUnit_NANOSECOND;
14346   static const MeasureUnit MICROSECOND = GpuCounterDescriptor_MeasureUnit_MICROSECOND;
14347   static const MeasureUnit MILLISECOND = GpuCounterDescriptor_MeasureUnit_MILLISECOND;
14348   static const MeasureUnit SECOND = GpuCounterDescriptor_MeasureUnit_SECOND;
14349   static const MeasureUnit MINUTE = GpuCounterDescriptor_MeasureUnit_MINUTE;
14350   static const MeasureUnit HOUR = GpuCounterDescriptor_MeasureUnit_HOUR;
14351   static const MeasureUnit VERTEX = GpuCounterDescriptor_MeasureUnit_VERTEX;
14352   static const MeasureUnit PIXEL = GpuCounterDescriptor_MeasureUnit_PIXEL;
14353   static const MeasureUnit TRIANGLE = GpuCounterDescriptor_MeasureUnit_TRIANGLE;
14354   static const MeasureUnit PRIMITIVE = GpuCounterDescriptor_MeasureUnit_PRIMITIVE;
14355   static const MeasureUnit FRAGMENT = GpuCounterDescriptor_MeasureUnit_FRAGMENT;
14356   static const MeasureUnit MILLIWATT = GpuCounterDescriptor_MeasureUnit_MILLIWATT;
14357   static const MeasureUnit WATT = GpuCounterDescriptor_MeasureUnit_WATT;
14358   static const MeasureUnit KILOWATT = GpuCounterDescriptor_MeasureUnit_KILOWATT;
14359   static const MeasureUnit JOULE = GpuCounterDescriptor_MeasureUnit_JOULE;
14360   static const MeasureUnit VOLT = GpuCounterDescriptor_MeasureUnit_VOLT;
14361   static const MeasureUnit AMPERE = GpuCounterDescriptor_MeasureUnit_AMPERE;
14362   static const MeasureUnit CELSIUS = GpuCounterDescriptor_MeasureUnit_CELSIUS;
14363   static const MeasureUnit FAHRENHEIT = GpuCounterDescriptor_MeasureUnit_FAHRENHEIT;
14364   static const MeasureUnit KELVIN = GpuCounterDescriptor_MeasureUnit_KELVIN;
14365   static const MeasureUnit PERCENT = GpuCounterDescriptor_MeasureUnit_PERCENT;
14366   static const MeasureUnit INSTRUCTION = GpuCounterDescriptor_MeasureUnit_INSTRUCTION;
14367   template <typename T = GpuCounterDescriptor_GpuCounterSpec> T* add_specs() {
14368     return BeginNestedMessage<T>(1);
14369   }
14370 
14371   template <typename T = GpuCounterDescriptor_GpuCounterBlock> T* add_blocks() {
14372     return BeginNestedMessage<T>(2);
14373   }
14374 
14375   void set_min_sampling_period_ns(uint64_t value) {
14376     AppendVarInt(3, value);
14377   }
14378   void set_max_sampling_period_ns(uint64_t value) {
14379     AppendVarInt(4, value);
14380   }
14381   void set_supports_instrumented_sampling(bool value) {
14382     AppendTinyVarInt(5, value);
14383   }
14384 };
14385 
14386 class GpuCounterDescriptor_GpuCounterBlock_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
14387  public:
14388   GpuCounterDescriptor_GpuCounterBlock_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
14389   explicit GpuCounterDescriptor_GpuCounterBlock_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
14390   explicit GpuCounterDescriptor_GpuCounterBlock_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
14391   bool has_block_id() const { return at<1>().valid(); }
14392   uint32_t block_id() const { return at<1>().as_uint32(); }
14393   bool has_block_capacity() const { return at<2>().valid(); }
14394   uint32_t block_capacity() const { return at<2>().as_uint32(); }
14395   bool has_name() const { return at<3>().valid(); }
14396   ::protozero::ConstChars name() const { return at<3>().as_string(); }
14397   bool has_description() const { return at<4>().valid(); }
14398   ::protozero::ConstChars description() const { return at<4>().as_string(); }
14399   bool has_counter_ids() const { return at<5>().valid(); }
14400   ::protozero::RepeatedFieldIterator<uint32_t> counter_ids() const { return GetRepeated<uint32_t>(5); }
14401 };
14402 
14403 class GpuCounterDescriptor_GpuCounterBlock : public ::protozero::Message {
14404  public:
14405   using Decoder = GpuCounterDescriptor_GpuCounterBlock_Decoder;
14406   enum : int32_t {
14407     kBlockIdFieldNumber = 1,
14408     kBlockCapacityFieldNumber = 2,
14409     kNameFieldNumber = 3,
14410     kDescriptionFieldNumber = 4,
14411     kCounterIdsFieldNumber = 5,
14412   };
14413   void set_block_id(uint32_t value) {
14414     AppendVarInt(1, value);
14415   }
14416   void set_block_capacity(uint32_t value) {
14417     AppendVarInt(2, value);
14418   }
14419   void set_name(const std::string& value) {
14420     AppendBytes(3, value.data(), value.size());
14421   }
14422   void set_name(const char* data, size_t size) {
14423     AppendBytes(3, data, size);
14424   }
14425   void set_description(const std::string& value) {
14426     AppendBytes(4, value.data(), value.size());
14427   }
14428   void set_description(const char* data, size_t size) {
14429     AppendBytes(4, data, size);
14430   }
14431   void add_counter_ids(uint32_t value) {
14432     AppendVarInt(5, value);
14433   }
14434 };
14435 
14436 class GpuCounterDescriptor_GpuCounterSpec_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/10, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
14437  public:
14438   GpuCounterDescriptor_GpuCounterSpec_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
14439   explicit GpuCounterDescriptor_GpuCounterSpec_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
14440   explicit GpuCounterDescriptor_GpuCounterSpec_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
14441   bool has_counter_id() const { return at<1>().valid(); }
14442   uint32_t counter_id() const { return at<1>().as_uint32(); }
14443   bool has_name() const { return at<2>().valid(); }
14444   ::protozero::ConstChars name() const { return at<2>().as_string(); }
14445   bool has_description() const { return at<3>().valid(); }
14446   ::protozero::ConstChars description() const { return at<3>().as_string(); }
14447   bool has_int_peak_value() const { return at<5>().valid(); }
14448   int64_t int_peak_value() const { return at<5>().as_int64(); }
14449   bool has_double_peak_value() const { return at<6>().valid(); }
14450   double double_peak_value() const { return at<6>().as_double(); }
14451   bool has_numerator_units() const { return at<7>().valid(); }
14452   ::protozero::RepeatedFieldIterator<int32_t> numerator_units() const { return GetRepeated<int32_t>(7); }
14453   bool has_denominator_units() const { return at<8>().valid(); }
14454   ::protozero::RepeatedFieldIterator<int32_t> denominator_units() const { return GetRepeated<int32_t>(8); }
14455   bool has_select_by_default() const { return at<9>().valid(); }
14456   bool select_by_default() const { return at<9>().as_bool(); }
14457   bool has_groups() const { return at<10>().valid(); }
14458   ::protozero::RepeatedFieldIterator<int32_t> groups() const { return GetRepeated<int32_t>(10); }
14459 };
14460 
14461 class GpuCounterDescriptor_GpuCounterSpec : public ::protozero::Message {
14462  public:
14463   using Decoder = GpuCounterDescriptor_GpuCounterSpec_Decoder;
14464   enum : int32_t {
14465     kCounterIdFieldNumber = 1,
14466     kNameFieldNumber = 2,
14467     kDescriptionFieldNumber = 3,
14468     kIntPeakValueFieldNumber = 5,
14469     kDoublePeakValueFieldNumber = 6,
14470     kNumeratorUnitsFieldNumber = 7,
14471     kDenominatorUnitsFieldNumber = 8,
14472     kSelectByDefaultFieldNumber = 9,
14473     kGroupsFieldNumber = 10,
14474   };
14475   void set_counter_id(uint32_t value) {
14476     AppendVarInt(1, value);
14477   }
14478   void set_name(const std::string& value) {
14479     AppendBytes(2, value.data(), value.size());
14480   }
14481   void set_name(const char* data, size_t size) {
14482     AppendBytes(2, data, size);
14483   }
14484   void set_description(const std::string& value) {
14485     AppendBytes(3, value.data(), value.size());
14486   }
14487   void set_description(const char* data, size_t size) {
14488     AppendBytes(3, data, size);
14489   }
14490   void set_int_peak_value(int64_t value) {
14491     AppendVarInt(5, value);
14492   }
14493   void set_double_peak_value(double value) {
14494     AppendFixed(6, value);
14495   }
14496   void add_numerator_units(::perfetto::protos::pbzero::GpuCounterDescriptor_MeasureUnit value) {
14497     AppendTinyVarInt(7, value);
14498   }
14499   void add_denominator_units(::perfetto::protos::pbzero::GpuCounterDescriptor_MeasureUnit value) {
14500     AppendTinyVarInt(8, value);
14501   }
14502   void set_select_by_default(bool value) {
14503     AppendTinyVarInt(9, value);
14504   }
14505   void add_groups(::perfetto::protos::pbzero::GpuCounterDescriptor_GpuCounterGroup value) {
14506     AppendTinyVarInt(10, value);
14507   }
14508 };
14509 
14510 } // Namespace.
14511 } // Namespace.
14512 } // Namespace.
14513 #endif  // Include guard.
14514 // gen_amalgamated begin header: gen/protos/perfetto/common/observable_events.pbzero.h
14515 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
14516 
14517 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_OBSERVABLE_EVENTS_PROTO_H_
14518 #define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_OBSERVABLE_EVENTS_PROTO_H_
14519 
14520 #include <stddef.h>
14521 #include <stdint.h>
14522 
14523 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
14524 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
14525 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
14526 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
14527 
14528 namespace perfetto {
14529 namespace protos {
14530 namespace pbzero {
14531 
14532 class ObservableEvents_DataSourceInstanceStateChange;
14533 enum ObservableEvents_DataSourceInstanceState : int32_t;
14534 
14535 enum ObservableEvents_Type : int32_t {
14536   ObservableEvents_Type_TYPE_UNSPECIFIED = 0,
14537   ObservableEvents_Type_TYPE_DATA_SOURCES_INSTANCES = 1,
14538   ObservableEvents_Type_TYPE_ALL_DATA_SOURCES_STARTED = 2,
14539 };
14540 
14541 const ObservableEvents_Type ObservableEvents_Type_MIN = ObservableEvents_Type_TYPE_UNSPECIFIED;
14542 const ObservableEvents_Type ObservableEvents_Type_MAX = ObservableEvents_Type_TYPE_ALL_DATA_SOURCES_STARTED;
14543 
14544 enum ObservableEvents_DataSourceInstanceState : int32_t {
14545   ObservableEvents_DataSourceInstanceState_DATA_SOURCE_INSTANCE_STATE_STOPPED = 1,
14546   ObservableEvents_DataSourceInstanceState_DATA_SOURCE_INSTANCE_STATE_STARTED = 2,
14547 };
14548 
14549 const ObservableEvents_DataSourceInstanceState ObservableEvents_DataSourceInstanceState_MIN = ObservableEvents_DataSourceInstanceState_DATA_SOURCE_INSTANCE_STATE_STOPPED;
14550 const ObservableEvents_DataSourceInstanceState ObservableEvents_DataSourceInstanceState_MAX = ObservableEvents_DataSourceInstanceState_DATA_SOURCE_INSTANCE_STATE_STARTED;
14551 
14552 class ObservableEvents_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
14553  public:
14554   ObservableEvents_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
14555   explicit ObservableEvents_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
14556   explicit ObservableEvents_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
14557   bool has_instance_state_changes() const { return at<1>().valid(); }
14558   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> instance_state_changes() const { return GetRepeated<::protozero::ConstBytes>(1); }
14559   bool has_all_data_sources_started() const { return at<2>().valid(); }
14560   bool all_data_sources_started() const { return at<2>().as_bool(); }
14561 };
14562 
14563 class ObservableEvents : public ::protozero::Message {
14564  public:
14565   using Decoder = ObservableEvents_Decoder;
14566   enum : int32_t {
14567     kInstanceStateChangesFieldNumber = 1,
14568     kAllDataSourcesStartedFieldNumber = 2,
14569   };
14570   using DataSourceInstanceStateChange = ::perfetto::protos::pbzero::ObservableEvents_DataSourceInstanceStateChange;
14571   using Type = ::perfetto::protos::pbzero::ObservableEvents_Type;
14572   using DataSourceInstanceState = ::perfetto::protos::pbzero::ObservableEvents_DataSourceInstanceState;
14573   static const Type TYPE_UNSPECIFIED = ObservableEvents_Type_TYPE_UNSPECIFIED;
14574   static const Type TYPE_DATA_SOURCES_INSTANCES = ObservableEvents_Type_TYPE_DATA_SOURCES_INSTANCES;
14575   static const Type TYPE_ALL_DATA_SOURCES_STARTED = ObservableEvents_Type_TYPE_ALL_DATA_SOURCES_STARTED;
14576   static const DataSourceInstanceState DATA_SOURCE_INSTANCE_STATE_STOPPED = ObservableEvents_DataSourceInstanceState_DATA_SOURCE_INSTANCE_STATE_STOPPED;
14577   static const DataSourceInstanceState DATA_SOURCE_INSTANCE_STATE_STARTED = ObservableEvents_DataSourceInstanceState_DATA_SOURCE_INSTANCE_STATE_STARTED;
14578   template <typename T = ObservableEvents_DataSourceInstanceStateChange> T* add_instance_state_changes() {
14579     return BeginNestedMessage<T>(1);
14580   }
14581 
14582   void set_all_data_sources_started(bool value) {
14583     AppendTinyVarInt(2, value);
14584   }
14585 };
14586 
14587 class ObservableEvents_DataSourceInstanceStateChange_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
14588  public:
14589   ObservableEvents_DataSourceInstanceStateChange_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
14590   explicit ObservableEvents_DataSourceInstanceStateChange_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
14591   explicit ObservableEvents_DataSourceInstanceStateChange_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
14592   bool has_producer_name() const { return at<1>().valid(); }
14593   ::protozero::ConstChars producer_name() const { return at<1>().as_string(); }
14594   bool has_data_source_name() const { return at<2>().valid(); }
14595   ::protozero::ConstChars data_source_name() const { return at<2>().as_string(); }
14596   bool has_state() const { return at<3>().valid(); }
14597   int32_t state() const { return at<3>().as_int32(); }
14598 };
14599 
14600 class ObservableEvents_DataSourceInstanceStateChange : public ::protozero::Message {
14601  public:
14602   using Decoder = ObservableEvents_DataSourceInstanceStateChange_Decoder;
14603   enum : int32_t {
14604     kProducerNameFieldNumber = 1,
14605     kDataSourceNameFieldNumber = 2,
14606     kStateFieldNumber = 3,
14607   };
14608   void set_producer_name(const std::string& value) {
14609     AppendBytes(1, value.data(), value.size());
14610   }
14611   void set_producer_name(const char* data, size_t size) {
14612     AppendBytes(1, data, size);
14613   }
14614   void set_data_source_name(const std::string& value) {
14615     AppendBytes(2, value.data(), value.size());
14616   }
14617   void set_data_source_name(const char* data, size_t size) {
14618     AppendBytes(2, data, size);
14619   }
14620   void set_state(::perfetto::protos::pbzero::ObservableEvents_DataSourceInstanceState value) {
14621     AppendTinyVarInt(3, value);
14622   }
14623 };
14624 
14625 } // Namespace.
14626 } // Namespace.
14627 } // Namespace.
14628 #endif  // Include guard.
14629 // gen_amalgamated begin header: gen/protos/perfetto/common/sys_stats_counters.pbzero.h
14630 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
14631 
14632 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_SYS_STATS_COUNTERS_PROTO_H_
14633 #define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_SYS_STATS_COUNTERS_PROTO_H_
14634 
14635 #include <stddef.h>
14636 #include <stdint.h>
14637 
14638 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
14639 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
14640 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
14641 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
14642 
14643 namespace perfetto {
14644 namespace protos {
14645 namespace pbzero {
14646 
14647 
14648 enum MeminfoCounters : int32_t {
14649   MEMINFO_UNSPECIFIED = 0,
14650   MEMINFO_MEM_TOTAL = 1,
14651   MEMINFO_MEM_FREE = 2,
14652   MEMINFO_MEM_AVAILABLE = 3,
14653   MEMINFO_BUFFERS = 4,
14654   MEMINFO_CACHED = 5,
14655   MEMINFO_SWAP_CACHED = 6,
14656   MEMINFO_ACTIVE = 7,
14657   MEMINFO_INACTIVE = 8,
14658   MEMINFO_ACTIVE_ANON = 9,
14659   MEMINFO_INACTIVE_ANON = 10,
14660   MEMINFO_ACTIVE_FILE = 11,
14661   MEMINFO_INACTIVE_FILE = 12,
14662   MEMINFO_UNEVICTABLE = 13,
14663   MEMINFO_MLOCKED = 14,
14664   MEMINFO_SWAP_TOTAL = 15,
14665   MEMINFO_SWAP_FREE = 16,
14666   MEMINFO_DIRTY = 17,
14667   MEMINFO_WRITEBACK = 18,
14668   MEMINFO_ANON_PAGES = 19,
14669   MEMINFO_MAPPED = 20,
14670   MEMINFO_SHMEM = 21,
14671   MEMINFO_SLAB = 22,
14672   MEMINFO_SLAB_RECLAIMABLE = 23,
14673   MEMINFO_SLAB_UNRECLAIMABLE = 24,
14674   MEMINFO_KERNEL_STACK = 25,
14675   MEMINFO_PAGE_TABLES = 26,
14676   MEMINFO_COMMIT_LIMIT = 27,
14677   MEMINFO_COMMITED_AS = 28,
14678   MEMINFO_VMALLOC_TOTAL = 29,
14679   MEMINFO_VMALLOC_USED = 30,
14680   MEMINFO_VMALLOC_CHUNK = 31,
14681   MEMINFO_CMA_TOTAL = 32,
14682   MEMINFO_CMA_FREE = 33,
14683 };
14684 
14685 const MeminfoCounters MeminfoCounters_MIN = MEMINFO_UNSPECIFIED;
14686 const MeminfoCounters MeminfoCounters_MAX = MEMINFO_CMA_FREE;
14687 
14688 enum VmstatCounters : int32_t {
14689   VMSTAT_UNSPECIFIED = 0,
14690   VMSTAT_NR_FREE_PAGES = 1,
14691   VMSTAT_NR_ALLOC_BATCH = 2,
14692   VMSTAT_NR_INACTIVE_ANON = 3,
14693   VMSTAT_NR_ACTIVE_ANON = 4,
14694   VMSTAT_NR_INACTIVE_FILE = 5,
14695   VMSTAT_NR_ACTIVE_FILE = 6,
14696   VMSTAT_NR_UNEVICTABLE = 7,
14697   VMSTAT_NR_MLOCK = 8,
14698   VMSTAT_NR_ANON_PAGES = 9,
14699   VMSTAT_NR_MAPPED = 10,
14700   VMSTAT_NR_FILE_PAGES = 11,
14701   VMSTAT_NR_DIRTY = 12,
14702   VMSTAT_NR_WRITEBACK = 13,
14703   VMSTAT_NR_SLAB_RECLAIMABLE = 14,
14704   VMSTAT_NR_SLAB_UNRECLAIMABLE = 15,
14705   VMSTAT_NR_PAGE_TABLE_PAGES = 16,
14706   VMSTAT_NR_KERNEL_STACK = 17,
14707   VMSTAT_NR_OVERHEAD = 18,
14708   VMSTAT_NR_UNSTABLE = 19,
14709   VMSTAT_NR_BOUNCE = 20,
14710   VMSTAT_NR_VMSCAN_WRITE = 21,
14711   VMSTAT_NR_VMSCAN_IMMEDIATE_RECLAIM = 22,
14712   VMSTAT_NR_WRITEBACK_TEMP = 23,
14713   VMSTAT_NR_ISOLATED_ANON = 24,
14714   VMSTAT_NR_ISOLATED_FILE = 25,
14715   VMSTAT_NR_SHMEM = 26,
14716   VMSTAT_NR_DIRTIED = 27,
14717   VMSTAT_NR_WRITTEN = 28,
14718   VMSTAT_NR_PAGES_SCANNED = 29,
14719   VMSTAT_WORKINGSET_REFAULT = 30,
14720   VMSTAT_WORKINGSET_ACTIVATE = 31,
14721   VMSTAT_WORKINGSET_NODERECLAIM = 32,
14722   VMSTAT_NR_ANON_TRANSPARENT_HUGEPAGES = 33,
14723   VMSTAT_NR_FREE_CMA = 34,
14724   VMSTAT_NR_SWAPCACHE = 35,
14725   VMSTAT_NR_DIRTY_THRESHOLD = 36,
14726   VMSTAT_NR_DIRTY_BACKGROUND_THRESHOLD = 37,
14727   VMSTAT_PGPGIN = 38,
14728   VMSTAT_PGPGOUT = 39,
14729   VMSTAT_PGPGOUTCLEAN = 40,
14730   VMSTAT_PSWPIN = 41,
14731   VMSTAT_PSWPOUT = 42,
14732   VMSTAT_PGALLOC_DMA = 43,
14733   VMSTAT_PGALLOC_NORMAL = 44,
14734   VMSTAT_PGALLOC_MOVABLE = 45,
14735   VMSTAT_PGFREE = 46,
14736   VMSTAT_PGACTIVATE = 47,
14737   VMSTAT_PGDEACTIVATE = 48,
14738   VMSTAT_PGFAULT = 49,
14739   VMSTAT_PGMAJFAULT = 50,
14740   VMSTAT_PGREFILL_DMA = 51,
14741   VMSTAT_PGREFILL_NORMAL = 52,
14742   VMSTAT_PGREFILL_MOVABLE = 53,
14743   VMSTAT_PGSTEAL_KSWAPD_DMA = 54,
14744   VMSTAT_PGSTEAL_KSWAPD_NORMAL = 55,
14745   VMSTAT_PGSTEAL_KSWAPD_MOVABLE = 56,
14746   VMSTAT_PGSTEAL_DIRECT_DMA = 57,
14747   VMSTAT_PGSTEAL_DIRECT_NORMAL = 58,
14748   VMSTAT_PGSTEAL_DIRECT_MOVABLE = 59,
14749   VMSTAT_PGSCAN_KSWAPD_DMA = 60,
14750   VMSTAT_PGSCAN_KSWAPD_NORMAL = 61,
14751   VMSTAT_PGSCAN_KSWAPD_MOVABLE = 62,
14752   VMSTAT_PGSCAN_DIRECT_DMA = 63,
14753   VMSTAT_PGSCAN_DIRECT_NORMAL = 64,
14754   VMSTAT_PGSCAN_DIRECT_MOVABLE = 65,
14755   VMSTAT_PGSCAN_DIRECT_THROTTLE = 66,
14756   VMSTAT_PGINODESTEAL = 67,
14757   VMSTAT_SLABS_SCANNED = 68,
14758   VMSTAT_KSWAPD_INODESTEAL = 69,
14759   VMSTAT_KSWAPD_LOW_WMARK_HIT_QUICKLY = 70,
14760   VMSTAT_KSWAPD_HIGH_WMARK_HIT_QUICKLY = 71,
14761   VMSTAT_PAGEOUTRUN = 72,
14762   VMSTAT_ALLOCSTALL = 73,
14763   VMSTAT_PGROTATED = 74,
14764   VMSTAT_DROP_PAGECACHE = 75,
14765   VMSTAT_DROP_SLAB = 76,
14766   VMSTAT_PGMIGRATE_SUCCESS = 77,
14767   VMSTAT_PGMIGRATE_FAIL = 78,
14768   VMSTAT_COMPACT_MIGRATE_SCANNED = 79,
14769   VMSTAT_COMPACT_FREE_SCANNED = 80,
14770   VMSTAT_COMPACT_ISOLATED = 81,
14771   VMSTAT_COMPACT_STALL = 82,
14772   VMSTAT_COMPACT_FAIL = 83,
14773   VMSTAT_COMPACT_SUCCESS = 84,
14774   VMSTAT_COMPACT_DAEMON_WAKE = 85,
14775   VMSTAT_UNEVICTABLE_PGS_CULLED = 86,
14776   VMSTAT_UNEVICTABLE_PGS_SCANNED = 87,
14777   VMSTAT_UNEVICTABLE_PGS_RESCUED = 88,
14778   VMSTAT_UNEVICTABLE_PGS_MLOCKED = 89,
14779   VMSTAT_UNEVICTABLE_PGS_MUNLOCKED = 90,
14780   VMSTAT_UNEVICTABLE_PGS_CLEARED = 91,
14781   VMSTAT_UNEVICTABLE_PGS_STRANDED = 92,
14782   VMSTAT_NR_ZSPAGES = 93,
14783   VMSTAT_NR_ION_HEAP = 94,
14784   VMSTAT_NR_GPU_HEAP = 95,
14785 };
14786 
14787 const VmstatCounters VmstatCounters_MIN = VMSTAT_UNSPECIFIED;
14788 const VmstatCounters VmstatCounters_MAX = VMSTAT_NR_GPU_HEAP;
14789 
14790 } // Namespace.
14791 } // Namespace.
14792 } // Namespace.
14793 #endif  // Include guard.
14794 // gen_amalgamated begin header: gen/protos/perfetto/common/trace_stats.pbzero.h
14795 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
14796 
14797 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACE_STATS_PROTO_H_
14798 #define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACE_STATS_PROTO_H_
14799 
14800 #include <stddef.h>
14801 #include <stdint.h>
14802 
14803 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
14804 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
14805 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
14806 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
14807 
14808 namespace perfetto {
14809 namespace protos {
14810 namespace pbzero {
14811 
14812 class TraceStats_BufferStats;
14813 
14814 class TraceStats_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/10, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
14815  public:
14816   TraceStats_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
14817   explicit TraceStats_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
14818   explicit TraceStats_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
14819   bool has_buffer_stats() const { return at<1>().valid(); }
14820   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> buffer_stats() const { return GetRepeated<::protozero::ConstBytes>(1); }
14821   bool has_producers_connected() const { return at<2>().valid(); }
14822   uint32_t producers_connected() const { return at<2>().as_uint32(); }
14823   bool has_producers_seen() const { return at<3>().valid(); }
14824   uint64_t producers_seen() const { return at<3>().as_uint64(); }
14825   bool has_data_sources_registered() const { return at<4>().valid(); }
14826   uint32_t data_sources_registered() const { return at<4>().as_uint32(); }
14827   bool has_data_sources_seen() const { return at<5>().valid(); }
14828   uint64_t data_sources_seen() const { return at<5>().as_uint64(); }
14829   bool has_tracing_sessions() const { return at<6>().valid(); }
14830   uint32_t tracing_sessions() const { return at<6>().as_uint32(); }
14831   bool has_total_buffers() const { return at<7>().valid(); }
14832   uint32_t total_buffers() const { return at<7>().as_uint32(); }
14833   bool has_chunks_discarded() const { return at<8>().valid(); }
14834   uint64_t chunks_discarded() const { return at<8>().as_uint64(); }
14835   bool has_patches_discarded() const { return at<9>().valid(); }
14836   uint64_t patches_discarded() const { return at<9>().as_uint64(); }
14837   bool has_invalid_packets() const { return at<10>().valid(); }
14838   uint64_t invalid_packets() const { return at<10>().as_uint64(); }
14839 };
14840 
14841 class TraceStats : public ::protozero::Message {
14842  public:
14843   using Decoder = TraceStats_Decoder;
14844   enum : int32_t {
14845     kBufferStatsFieldNumber = 1,
14846     kProducersConnectedFieldNumber = 2,
14847     kProducersSeenFieldNumber = 3,
14848     kDataSourcesRegisteredFieldNumber = 4,
14849     kDataSourcesSeenFieldNumber = 5,
14850     kTracingSessionsFieldNumber = 6,
14851     kTotalBuffersFieldNumber = 7,
14852     kChunksDiscardedFieldNumber = 8,
14853     kPatchesDiscardedFieldNumber = 9,
14854     kInvalidPacketsFieldNumber = 10,
14855   };
14856   using BufferStats = ::perfetto::protos::pbzero::TraceStats_BufferStats;
14857   template <typename T = TraceStats_BufferStats> T* add_buffer_stats() {
14858     return BeginNestedMessage<T>(1);
14859   }
14860 
14861   void set_producers_connected(uint32_t value) {
14862     AppendVarInt(2, value);
14863   }
14864   void set_producers_seen(uint64_t value) {
14865     AppendVarInt(3, value);
14866   }
14867   void set_data_sources_registered(uint32_t value) {
14868     AppendVarInt(4, value);
14869   }
14870   void set_data_sources_seen(uint64_t value) {
14871     AppendVarInt(5, value);
14872   }
14873   void set_tracing_sessions(uint32_t value) {
14874     AppendVarInt(6, value);
14875   }
14876   void set_total_buffers(uint32_t value) {
14877     AppendVarInt(7, value);
14878   }
14879   void set_chunks_discarded(uint64_t value) {
14880     AppendVarInt(8, value);
14881   }
14882   void set_patches_discarded(uint64_t value) {
14883     AppendVarInt(9, value);
14884   }
14885   void set_invalid_packets(uint64_t value) {
14886     AppendVarInt(10, value);
14887   }
14888 };
14889 
14890 class TraceStats_BufferStats_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/19, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
14891  public:
14892   TraceStats_BufferStats_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
14893   explicit TraceStats_BufferStats_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
14894   explicit TraceStats_BufferStats_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
14895   bool has_buffer_size() const { return at<12>().valid(); }
14896   uint64_t buffer_size() const { return at<12>().as_uint64(); }
14897   bool has_bytes_written() const { return at<1>().valid(); }
14898   uint64_t bytes_written() const { return at<1>().as_uint64(); }
14899   bool has_bytes_overwritten() const { return at<13>().valid(); }
14900   uint64_t bytes_overwritten() const { return at<13>().as_uint64(); }
14901   bool has_bytes_read() const { return at<14>().valid(); }
14902   uint64_t bytes_read() const { return at<14>().as_uint64(); }
14903   bool has_padding_bytes_written() const { return at<15>().valid(); }
14904   uint64_t padding_bytes_written() const { return at<15>().as_uint64(); }
14905   bool has_padding_bytes_cleared() const { return at<16>().valid(); }
14906   uint64_t padding_bytes_cleared() const { return at<16>().as_uint64(); }
14907   bool has_chunks_written() const { return at<2>().valid(); }
14908   uint64_t chunks_written() const { return at<2>().as_uint64(); }
14909   bool has_chunks_rewritten() const { return at<10>().valid(); }
14910   uint64_t chunks_rewritten() const { return at<10>().as_uint64(); }
14911   bool has_chunks_overwritten() const { return at<3>().valid(); }
14912   uint64_t chunks_overwritten() const { return at<3>().as_uint64(); }
14913   bool has_chunks_discarded() const { return at<18>().valid(); }
14914   uint64_t chunks_discarded() const { return at<18>().as_uint64(); }
14915   bool has_chunks_read() const { return at<17>().valid(); }
14916   uint64_t chunks_read() const { return at<17>().as_uint64(); }
14917   bool has_chunks_committed_out_of_order() const { return at<11>().valid(); }
14918   uint64_t chunks_committed_out_of_order() const { return at<11>().as_uint64(); }
14919   bool has_write_wrap_count() const { return at<4>().valid(); }
14920   uint64_t write_wrap_count() const { return at<4>().as_uint64(); }
14921   bool has_patches_succeeded() const { return at<5>().valid(); }
14922   uint64_t patches_succeeded() const { return at<5>().as_uint64(); }
14923   bool has_patches_failed() const { return at<6>().valid(); }
14924   uint64_t patches_failed() const { return at<6>().as_uint64(); }
14925   bool has_readaheads_succeeded() const { return at<7>().valid(); }
14926   uint64_t readaheads_succeeded() const { return at<7>().as_uint64(); }
14927   bool has_readaheads_failed() const { return at<8>().valid(); }
14928   uint64_t readaheads_failed() const { return at<8>().as_uint64(); }
14929   bool has_abi_violations() const { return at<9>().valid(); }
14930   uint64_t abi_violations() const { return at<9>().as_uint64(); }
14931   bool has_trace_writer_packet_loss() const { return at<19>().valid(); }
14932   uint64_t trace_writer_packet_loss() const { return at<19>().as_uint64(); }
14933 };
14934 
14935 class TraceStats_BufferStats : public ::protozero::Message {
14936  public:
14937   using Decoder = TraceStats_BufferStats_Decoder;
14938   enum : int32_t {
14939     kBufferSizeFieldNumber = 12,
14940     kBytesWrittenFieldNumber = 1,
14941     kBytesOverwrittenFieldNumber = 13,
14942     kBytesReadFieldNumber = 14,
14943     kPaddingBytesWrittenFieldNumber = 15,
14944     kPaddingBytesClearedFieldNumber = 16,
14945     kChunksWrittenFieldNumber = 2,
14946     kChunksRewrittenFieldNumber = 10,
14947     kChunksOverwrittenFieldNumber = 3,
14948     kChunksDiscardedFieldNumber = 18,
14949     kChunksReadFieldNumber = 17,
14950     kChunksCommittedOutOfOrderFieldNumber = 11,
14951     kWriteWrapCountFieldNumber = 4,
14952     kPatchesSucceededFieldNumber = 5,
14953     kPatchesFailedFieldNumber = 6,
14954     kReadaheadsSucceededFieldNumber = 7,
14955     kReadaheadsFailedFieldNumber = 8,
14956     kAbiViolationsFieldNumber = 9,
14957     kTraceWriterPacketLossFieldNumber = 19,
14958   };
14959   void set_buffer_size(uint64_t value) {
14960     AppendVarInt(12, value);
14961   }
14962   void set_bytes_written(uint64_t value) {
14963     AppendVarInt(1, value);
14964   }
14965   void set_bytes_overwritten(uint64_t value) {
14966     AppendVarInt(13, value);
14967   }
14968   void set_bytes_read(uint64_t value) {
14969     AppendVarInt(14, value);
14970   }
14971   void set_padding_bytes_written(uint64_t value) {
14972     AppendVarInt(15, value);
14973   }
14974   void set_padding_bytes_cleared(uint64_t value) {
14975     AppendVarInt(16, value);
14976   }
14977   void set_chunks_written(uint64_t value) {
14978     AppendVarInt(2, value);
14979   }
14980   void set_chunks_rewritten(uint64_t value) {
14981     AppendVarInt(10, value);
14982   }
14983   void set_chunks_overwritten(uint64_t value) {
14984     AppendVarInt(3, value);
14985   }
14986   void set_chunks_discarded(uint64_t value) {
14987     AppendVarInt(18, value);
14988   }
14989   void set_chunks_read(uint64_t value) {
14990     AppendVarInt(17, value);
14991   }
14992   void set_chunks_committed_out_of_order(uint64_t value) {
14993     AppendVarInt(11, value);
14994   }
14995   void set_write_wrap_count(uint64_t value) {
14996     AppendVarInt(4, value);
14997   }
14998   void set_patches_succeeded(uint64_t value) {
14999     AppendVarInt(5, value);
15000   }
15001   void set_patches_failed(uint64_t value) {
15002     AppendVarInt(6, value);
15003   }
15004   void set_readaheads_succeeded(uint64_t value) {
15005     AppendVarInt(7, value);
15006   }
15007   void set_readaheads_failed(uint64_t value) {
15008     AppendVarInt(8, value);
15009   }
15010   void set_abi_violations(uint64_t value) {
15011     AppendVarInt(9, value);
15012   }
15013   void set_trace_writer_packet_loss(uint64_t value) {
15014     AppendVarInt(19, value);
15015   }
15016 };
15017 
15018 } // Namespace.
15019 } // Namespace.
15020 } // Namespace.
15021 #endif  // Include guard.
15022 // gen_amalgamated begin header: gen/protos/perfetto/common/tracing_service_capabilities.pbzero.h
15023 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
15024 
15025 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACING_SERVICE_CAPABILITIES_PROTO_H_
15026 #define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACING_SERVICE_CAPABILITIES_PROTO_H_
15027 
15028 #include <stddef.h>
15029 #include <stdint.h>
15030 
15031 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
15032 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
15033 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
15034 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
15035 
15036 namespace perfetto {
15037 namespace protos {
15038 namespace pbzero {
15039 
15040 enum ObservableEvents_Type : int32_t;
15041 
15042 class TracingServiceCapabilities_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
15043  public:
15044   TracingServiceCapabilities_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
15045   explicit TracingServiceCapabilities_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
15046   explicit TracingServiceCapabilities_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
15047   bool has_has_query_capabilities() const { return at<1>().valid(); }
15048   bool has_query_capabilities() const { return at<1>().as_bool(); }
15049   bool has_observable_events() const { return at<2>().valid(); }
15050   ::protozero::RepeatedFieldIterator<int32_t> observable_events() const { return GetRepeated<int32_t>(2); }
15051   bool has_has_trace_config_output_path() const { return at<3>().valid(); }
15052   bool has_trace_config_output_path() const { return at<3>().as_bool(); }
15053 };
15054 
15055 class TracingServiceCapabilities : public ::protozero::Message {
15056  public:
15057   using Decoder = TracingServiceCapabilities_Decoder;
15058   enum : int32_t {
15059     kHasQueryCapabilitiesFieldNumber = 1,
15060     kObservableEventsFieldNumber = 2,
15061     kHasTraceConfigOutputPathFieldNumber = 3,
15062   };
15063   void set_has_query_capabilities(bool value) {
15064     AppendTinyVarInt(1, value);
15065   }
15066   void add_observable_events(::perfetto::protos::pbzero::ObservableEvents_Type value) {
15067     AppendTinyVarInt(2, value);
15068   }
15069   void set_has_trace_config_output_path(bool value) {
15070     AppendTinyVarInt(3, value);
15071   }
15072 };
15073 
15074 } // Namespace.
15075 } // Namespace.
15076 } // Namespace.
15077 #endif  // Include guard.
15078 // gen_amalgamated begin header: gen/protos/perfetto/common/tracing_service_state.pbzero.h
15079 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
15080 
15081 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACING_SERVICE_STATE_PROTO_H_
15082 #define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACING_SERVICE_STATE_PROTO_H_
15083 
15084 #include <stddef.h>
15085 #include <stdint.h>
15086 
15087 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
15088 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
15089 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
15090 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
15091 
15092 namespace perfetto {
15093 namespace protos {
15094 namespace pbzero {
15095 
15096 class DataSourceDescriptor;
15097 class TracingServiceState_DataSource;
15098 class TracingServiceState_Producer;
15099 
15100 class TracingServiceState_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
15101  public:
15102   TracingServiceState_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
15103   explicit TracingServiceState_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
15104   explicit TracingServiceState_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
15105   bool has_producers() const { return at<1>().valid(); }
15106   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> producers() const { return GetRepeated<::protozero::ConstBytes>(1); }
15107   bool has_data_sources() const { return at<2>().valid(); }
15108   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> data_sources() const { return GetRepeated<::protozero::ConstBytes>(2); }
15109   bool has_num_sessions() const { return at<3>().valid(); }
15110   int32_t num_sessions() const { return at<3>().as_int32(); }
15111   bool has_num_sessions_started() const { return at<4>().valid(); }
15112   int32_t num_sessions_started() const { return at<4>().as_int32(); }
15113 };
15114 
15115 class TracingServiceState : public ::protozero::Message {
15116  public:
15117   using Decoder = TracingServiceState_Decoder;
15118   enum : int32_t {
15119     kProducersFieldNumber = 1,
15120     kDataSourcesFieldNumber = 2,
15121     kNumSessionsFieldNumber = 3,
15122     kNumSessionsStartedFieldNumber = 4,
15123   };
15124   using Producer = ::perfetto::protos::pbzero::TracingServiceState_Producer;
15125   using DataSource = ::perfetto::protos::pbzero::TracingServiceState_DataSource;
15126   template <typename T = TracingServiceState_Producer> T* add_producers() {
15127     return BeginNestedMessage<T>(1);
15128   }
15129 
15130   template <typename T = TracingServiceState_DataSource> T* add_data_sources() {
15131     return BeginNestedMessage<T>(2);
15132   }
15133 
15134   void set_num_sessions(int32_t value) {
15135     AppendVarInt(3, value);
15136   }
15137   void set_num_sessions_started(int32_t value) {
15138     AppendVarInt(4, value);
15139   }
15140 };
15141 
15142 class TracingServiceState_DataSource_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
15143  public:
15144   TracingServiceState_DataSource_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
15145   explicit TracingServiceState_DataSource_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
15146   explicit TracingServiceState_DataSource_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
15147   bool has_ds_descriptor() const { return at<1>().valid(); }
15148   ::protozero::ConstBytes ds_descriptor() const { return at<1>().as_bytes(); }
15149   bool has_producer_id() const { return at<2>().valid(); }
15150   int32_t producer_id() const { return at<2>().as_int32(); }
15151 };
15152 
15153 class TracingServiceState_DataSource : public ::protozero::Message {
15154  public:
15155   using Decoder = TracingServiceState_DataSource_Decoder;
15156   enum : int32_t {
15157     kDsDescriptorFieldNumber = 1,
15158     kProducerIdFieldNumber = 2,
15159   };
15160   template <typename T = DataSourceDescriptor> T* set_ds_descriptor() {
15161     return BeginNestedMessage<T>(1);
15162   }
15163 
15164   void set_producer_id(int32_t value) {
15165     AppendVarInt(2, value);
15166   }
15167 };
15168 
15169 class TracingServiceState_Producer_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
15170  public:
15171   TracingServiceState_Producer_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
15172   explicit TracingServiceState_Producer_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
15173   explicit TracingServiceState_Producer_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
15174   bool has_id() const { return at<1>().valid(); }
15175   int32_t id() const { return at<1>().as_int32(); }
15176   bool has_name() const { return at<2>().valid(); }
15177   ::protozero::ConstChars name() const { return at<2>().as_string(); }
15178   bool has_uid() const { return at<3>().valid(); }
15179   int32_t uid() const { return at<3>().as_int32(); }
15180 };
15181 
15182 class TracingServiceState_Producer : public ::protozero::Message {
15183  public:
15184   using Decoder = TracingServiceState_Producer_Decoder;
15185   enum : int32_t {
15186     kIdFieldNumber = 1,
15187     kNameFieldNumber = 2,
15188     kUidFieldNumber = 3,
15189   };
15190   void set_id(int32_t value) {
15191     AppendVarInt(1, value);
15192   }
15193   void set_name(const std::string& value) {
15194     AppendBytes(2, value.data(), value.size());
15195   }
15196   void set_name(const char* data, size_t size) {
15197     AppendBytes(2, data, size);
15198   }
15199   void set_uid(int32_t value) {
15200     AppendVarInt(3, value);
15201   }
15202 };
15203 
15204 } // Namespace.
15205 } // Namespace.
15206 } // Namespace.
15207 #endif  // Include guard.
15208 // gen_amalgamated begin header: gen/protos/perfetto/common/track_event_descriptor.pbzero.h
15209 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
15210 
15211 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACK_EVENT_DESCRIPTOR_PROTO_H_
15212 #define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_TRACK_EVENT_DESCRIPTOR_PROTO_H_
15213 
15214 #include <stddef.h>
15215 #include <stdint.h>
15216 
15217 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
15218 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
15219 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
15220 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
15221 
15222 namespace perfetto {
15223 namespace protos {
15224 namespace pbzero {
15225 
15226 class TrackEventCategory;
15227 
15228 class TrackEventDescriptor_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
15229  public:
15230   TrackEventDescriptor_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
15231   explicit TrackEventDescriptor_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
15232   explicit TrackEventDescriptor_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
15233   bool has_available_categories() const { return at<1>().valid(); }
15234   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> available_categories() const { return GetRepeated<::protozero::ConstBytes>(1); }
15235 };
15236 
15237 class TrackEventDescriptor : public ::protozero::Message {
15238  public:
15239   using Decoder = TrackEventDescriptor_Decoder;
15240   enum : int32_t {
15241     kAvailableCategoriesFieldNumber = 1,
15242   };
15243   template <typename T = TrackEventCategory> T* add_available_categories() {
15244     return BeginNestedMessage<T>(1);
15245   }
15246 
15247 };
15248 
15249 class TrackEventCategory_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
15250  public:
15251   TrackEventCategory_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
15252   explicit TrackEventCategory_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
15253   explicit TrackEventCategory_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
15254   bool has_name() const { return at<1>().valid(); }
15255   ::protozero::ConstChars name() const { return at<1>().as_string(); }
15256   bool has_description() const { return at<2>().valid(); }
15257   ::protozero::ConstChars description() const { return at<2>().as_string(); }
15258   bool has_tags() const { return at<3>().valid(); }
15259   ::protozero::RepeatedFieldIterator<::protozero::ConstChars> tags() const { return GetRepeated<::protozero::ConstChars>(3); }
15260 };
15261 
15262 class TrackEventCategory : public ::protozero::Message {
15263  public:
15264   using Decoder = TrackEventCategory_Decoder;
15265   enum : int32_t {
15266     kNameFieldNumber = 1,
15267     kDescriptionFieldNumber = 2,
15268     kTagsFieldNumber = 3,
15269   };
15270   void set_name(const std::string& value) {
15271     AppendBytes(1, value.data(), value.size());
15272   }
15273   void set_name(const char* data, size_t size) {
15274     AppendBytes(1, data, size);
15275   }
15276   void set_description(const std::string& value) {
15277     AppendBytes(2, value.data(), value.size());
15278   }
15279   void set_description(const char* data, size_t size) {
15280     AppendBytes(2, data, size);
15281   }
15282   void add_tags(const std::string& value) {
15283     AppendBytes(3, value.data(), value.size());
15284   }
15285   void add_tags(const char* data, size_t size) {
15286     AppendBytes(3, data, size);
15287   }
15288 };
15289 
15290 } // Namespace.
15291 } // Namespace.
15292 } // Namespace.
15293 #endif  // Include guard.
15294 // gen_amalgamated begin header: gen/protos/perfetto/config/track_event/track_event_config.gen.h
15295 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
15296 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TRACK_EVENT_TRACK_EVENT_CONFIG_PROTO_CPP_H_
15297 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TRACK_EVENT_TRACK_EVENT_CONFIG_PROTO_CPP_H_
15298 
15299 #include <stdint.h>
15300 #include <bitset>
15301 #include <vector>
15302 #include <string>
15303 #include <type_traits>
15304 
15305 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
15306 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
15307 // gen_amalgamated expanded: #include "perfetto/base/export.h"
15308 
15309 namespace perfetto {
15310 namespace protos {
15311 namespace gen {
15312 class TrackEventConfig;
15313 }  // namespace perfetto
15314 }  // namespace protos
15315 }  // namespace gen
15316 
15317 namespace protozero {
15318 class Message;
15319 }  // namespace protozero
15320 
15321 namespace perfetto {
15322 namespace protos {
15323 namespace gen {
15324 
15325 class PERFETTO_EXPORT TrackEventConfig : public ::protozero::CppMessageObj {
15326  public:
15327   enum FieldNumbers {
15328     kDisabledCategoriesFieldNumber = 1,
15329     kEnabledCategoriesFieldNumber = 2,
15330     kDisabledTagsFieldNumber = 3,
15331     kEnabledTagsFieldNumber = 4,
15332   };
15333 
15334   TrackEventConfig();
15335   ~TrackEventConfig() override;
15336   TrackEventConfig(TrackEventConfig&&) noexcept;
15337   TrackEventConfig& operator=(TrackEventConfig&&);
15338   TrackEventConfig(const TrackEventConfig&);
15339   TrackEventConfig& operator=(const TrackEventConfig&);
15340   bool operator==(const TrackEventConfig&) const;
15341   bool operator!=(const TrackEventConfig& other) const { return !(*this == other); }
15342 
15343   bool ParseFromArray(const void*, size_t) override;
15344   std::string SerializeAsString() const override;
15345   std::vector<uint8_t> SerializeAsArray() const override;
15346   void Serialize(::protozero::Message*) const;
15347 
15348   int disabled_categories_size() const { return static_cast<int>(disabled_categories_.size()); }
15349   const std::vector<std::string>& disabled_categories() const { return disabled_categories_; }
15350   std::vector<std::string>* mutable_disabled_categories() { return &disabled_categories_; }
15351   void clear_disabled_categories() { disabled_categories_.clear(); }
15352   void add_disabled_categories(std::string value) { disabled_categories_.emplace_back(value); }
15353   std::string* add_disabled_categories() { disabled_categories_.emplace_back(); return &disabled_categories_.back(); }
15354 
15355   int enabled_categories_size() const { return static_cast<int>(enabled_categories_.size()); }
15356   const std::vector<std::string>& enabled_categories() const { return enabled_categories_; }
15357   std::vector<std::string>* mutable_enabled_categories() { return &enabled_categories_; }
15358   void clear_enabled_categories() { enabled_categories_.clear(); }
15359   void add_enabled_categories(std::string value) { enabled_categories_.emplace_back(value); }
15360   std::string* add_enabled_categories() { enabled_categories_.emplace_back(); return &enabled_categories_.back(); }
15361 
15362   int disabled_tags_size() const { return static_cast<int>(disabled_tags_.size()); }
15363   const std::vector<std::string>& disabled_tags() const { return disabled_tags_; }
15364   std::vector<std::string>* mutable_disabled_tags() { return &disabled_tags_; }
15365   void clear_disabled_tags() { disabled_tags_.clear(); }
15366   void add_disabled_tags(std::string value) { disabled_tags_.emplace_back(value); }
15367   std::string* add_disabled_tags() { disabled_tags_.emplace_back(); return &disabled_tags_.back(); }
15368 
15369   int enabled_tags_size() const { return static_cast<int>(enabled_tags_.size()); }
15370   const std::vector<std::string>& enabled_tags() const { return enabled_tags_; }
15371   std::vector<std::string>* mutable_enabled_tags() { return &enabled_tags_; }
15372   void clear_enabled_tags() { enabled_tags_.clear(); }
15373   void add_enabled_tags(std::string value) { enabled_tags_.emplace_back(value); }
15374   std::string* add_enabled_tags() { enabled_tags_.emplace_back(); return &enabled_tags_.back(); }
15375 
15376  private:
15377   std::vector<std::string> disabled_categories_;
15378   std::vector<std::string> enabled_categories_;
15379   std::vector<std::string> disabled_tags_;
15380   std::vector<std::string> enabled_tags_;
15381 
15382   // Allows to preserve unknown protobuf fields for compatibility
15383   // with future versions of .proto files.
15384   std::string unknown_fields_;
15385 
15386   std::bitset<5> _has_field_{};
15387 };
15388 
15389 }  // namespace perfetto
15390 }  // namespace protos
15391 }  // namespace gen
15392 
15393 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TRACK_EVENT_TRACK_EVENT_CONFIG_PROTO_CPP_H_
15394 // gen_amalgamated begin header: gen/protos/perfetto/config/android/android_log_config.pbzero.h
15395 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
15396 
15397 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_ANDROID_ANDROID_LOG_CONFIG_PROTO_H_
15398 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_ANDROID_ANDROID_LOG_CONFIG_PROTO_H_
15399 
15400 #include <stddef.h>
15401 #include <stdint.h>
15402 
15403 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
15404 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
15405 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
15406 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
15407 
15408 namespace perfetto {
15409 namespace protos {
15410 namespace pbzero {
15411 
15412 enum AndroidLogId : int32_t;
15413 enum AndroidLogPriority : int32_t;
15414 
15415 class AndroidLogConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
15416  public:
15417   AndroidLogConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
15418   explicit AndroidLogConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
15419   explicit AndroidLogConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
15420   bool has_log_ids() const { return at<1>().valid(); }
15421   ::protozero::RepeatedFieldIterator<int32_t> log_ids() const { return GetRepeated<int32_t>(1); }
15422   bool has_min_prio() const { return at<3>().valid(); }
15423   int32_t min_prio() const { return at<3>().as_int32(); }
15424   bool has_filter_tags() const { return at<4>().valid(); }
15425   ::protozero::RepeatedFieldIterator<::protozero::ConstChars> filter_tags() const { return GetRepeated<::protozero::ConstChars>(4); }
15426 };
15427 
15428 class AndroidLogConfig : public ::protozero::Message {
15429  public:
15430   using Decoder = AndroidLogConfig_Decoder;
15431   enum : int32_t {
15432     kLogIdsFieldNumber = 1,
15433     kMinPrioFieldNumber = 3,
15434     kFilterTagsFieldNumber = 4,
15435   };
15436   void add_log_ids(::perfetto::protos::pbzero::AndroidLogId value) {
15437     AppendTinyVarInt(1, value);
15438   }
15439   void set_min_prio(::perfetto::protos::pbzero::AndroidLogPriority value) {
15440     AppendTinyVarInt(3, value);
15441   }
15442   void add_filter_tags(const std::string& value) {
15443     AppendBytes(4, value.data(), value.size());
15444   }
15445   void add_filter_tags(const char* data, size_t size) {
15446     AppendBytes(4, data, size);
15447   }
15448 };
15449 
15450 } // Namespace.
15451 } // Namespace.
15452 } // Namespace.
15453 #endif  // Include guard.
15454 // gen_amalgamated begin header: gen/protos/perfetto/config/android/android_polled_state_config.pbzero.h
15455 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
15456 
15457 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_ANDROID_ANDROID_POLLED_STATE_CONFIG_PROTO_H_
15458 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_ANDROID_ANDROID_POLLED_STATE_CONFIG_PROTO_H_
15459 
15460 #include <stddef.h>
15461 #include <stdint.h>
15462 
15463 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
15464 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
15465 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
15466 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
15467 
15468 namespace perfetto {
15469 namespace protos {
15470 namespace pbzero {
15471 
15472 
15473 class AndroidPolledStateConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
15474  public:
15475   AndroidPolledStateConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
15476   explicit AndroidPolledStateConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
15477   explicit AndroidPolledStateConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
15478   bool has_poll_ms() const { return at<1>().valid(); }
15479   uint32_t poll_ms() const { return at<1>().as_uint32(); }
15480 };
15481 
15482 class AndroidPolledStateConfig : public ::protozero::Message {
15483  public:
15484   using Decoder = AndroidPolledStateConfig_Decoder;
15485   enum : int32_t {
15486     kPollMsFieldNumber = 1,
15487   };
15488   void set_poll_ms(uint32_t value) {
15489     AppendVarInt(1, value);
15490   }
15491 };
15492 
15493 } // Namespace.
15494 } // Namespace.
15495 } // Namespace.
15496 #endif  // Include guard.
15497 // gen_amalgamated begin header: gen/protos/perfetto/config/android/packages_list_config.pbzero.h
15498 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
15499 
15500 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_ANDROID_PACKAGES_LIST_CONFIG_PROTO_H_
15501 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_ANDROID_PACKAGES_LIST_CONFIG_PROTO_H_
15502 
15503 #include <stddef.h>
15504 #include <stdint.h>
15505 
15506 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
15507 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
15508 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
15509 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
15510 
15511 namespace perfetto {
15512 namespace protos {
15513 namespace pbzero {
15514 
15515 
15516 class PackagesListConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
15517  public:
15518   PackagesListConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
15519   explicit PackagesListConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
15520   explicit PackagesListConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
15521   bool has_package_name_filter() const { return at<1>().valid(); }
15522   ::protozero::RepeatedFieldIterator<::protozero::ConstChars> package_name_filter() const { return GetRepeated<::protozero::ConstChars>(1); }
15523 };
15524 
15525 class PackagesListConfig : public ::protozero::Message {
15526  public:
15527   using Decoder = PackagesListConfig_Decoder;
15528   enum : int32_t {
15529     kPackageNameFilterFieldNumber = 1,
15530   };
15531   void add_package_name_filter(const std::string& value) {
15532     AppendBytes(1, value.data(), value.size());
15533   }
15534   void add_package_name_filter(const char* data, size_t size) {
15535     AppendBytes(1, data, size);
15536   }
15537 };
15538 
15539 } // Namespace.
15540 } // Namespace.
15541 } // Namespace.
15542 #endif  // Include guard.
15543 // gen_amalgamated begin header: gen/protos/perfetto/config/ftrace/ftrace_config.pbzero.h
15544 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
15545 
15546 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_FTRACE_FTRACE_CONFIG_PROTO_H_
15547 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_FTRACE_FTRACE_CONFIG_PROTO_H_
15548 
15549 #include <stddef.h>
15550 #include <stdint.h>
15551 
15552 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
15553 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
15554 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
15555 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
15556 
15557 namespace perfetto {
15558 namespace protos {
15559 namespace pbzero {
15560 
15561 class FtraceConfig_CompactSchedConfig;
15562 
15563 class FtraceConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/12, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
15564  public:
15565   FtraceConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
15566   explicit FtraceConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
15567   explicit FtraceConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
15568   bool has_ftrace_events() const { return at<1>().valid(); }
15569   ::protozero::RepeatedFieldIterator<::protozero::ConstChars> ftrace_events() const { return GetRepeated<::protozero::ConstChars>(1); }
15570   bool has_atrace_categories() const { return at<2>().valid(); }
15571   ::protozero::RepeatedFieldIterator<::protozero::ConstChars> atrace_categories() const { return GetRepeated<::protozero::ConstChars>(2); }
15572   bool has_atrace_apps() const { return at<3>().valid(); }
15573   ::protozero::RepeatedFieldIterator<::protozero::ConstChars> atrace_apps() const { return GetRepeated<::protozero::ConstChars>(3); }
15574   bool has_buffer_size_kb() const { return at<10>().valid(); }
15575   uint32_t buffer_size_kb() const { return at<10>().as_uint32(); }
15576   bool has_drain_period_ms() const { return at<11>().valid(); }
15577   uint32_t drain_period_ms() const { return at<11>().as_uint32(); }
15578   bool has_compact_sched() const { return at<12>().valid(); }
15579   ::protozero::ConstBytes compact_sched() const { return at<12>().as_bytes(); }
15580 };
15581 
15582 class FtraceConfig : public ::protozero::Message {
15583  public:
15584   using Decoder = FtraceConfig_Decoder;
15585   enum : int32_t {
15586     kFtraceEventsFieldNumber = 1,
15587     kAtraceCategoriesFieldNumber = 2,
15588     kAtraceAppsFieldNumber = 3,
15589     kBufferSizeKbFieldNumber = 10,
15590     kDrainPeriodMsFieldNumber = 11,
15591     kCompactSchedFieldNumber = 12,
15592   };
15593   using CompactSchedConfig = ::perfetto::protos::pbzero::FtraceConfig_CompactSchedConfig;
15594   void add_ftrace_events(const std::string& value) {
15595     AppendBytes(1, value.data(), value.size());
15596   }
15597   void add_ftrace_events(const char* data, size_t size) {
15598     AppendBytes(1, data, size);
15599   }
15600   void add_atrace_categories(const std::string& value) {
15601     AppendBytes(2, value.data(), value.size());
15602   }
15603   void add_atrace_categories(const char* data, size_t size) {
15604     AppendBytes(2, data, size);
15605   }
15606   void add_atrace_apps(const std::string& value) {
15607     AppendBytes(3, value.data(), value.size());
15608   }
15609   void add_atrace_apps(const char* data, size_t size) {
15610     AppendBytes(3, data, size);
15611   }
15612   void set_buffer_size_kb(uint32_t value) {
15613     AppendVarInt(10, value);
15614   }
15615   void set_drain_period_ms(uint32_t value) {
15616     AppendVarInt(11, value);
15617   }
15618   template <typename T = FtraceConfig_CompactSchedConfig> T* set_compact_sched() {
15619     return BeginNestedMessage<T>(12);
15620   }
15621 
15622 };
15623 
15624 class FtraceConfig_CompactSchedConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
15625  public:
15626   FtraceConfig_CompactSchedConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
15627   explicit FtraceConfig_CompactSchedConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
15628   explicit FtraceConfig_CompactSchedConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
15629   bool has_enabled() const { return at<1>().valid(); }
15630   bool enabled() const { return at<1>().as_bool(); }
15631 };
15632 
15633 class FtraceConfig_CompactSchedConfig : public ::protozero::Message {
15634  public:
15635   using Decoder = FtraceConfig_CompactSchedConfig_Decoder;
15636   enum : int32_t {
15637     kEnabledFieldNumber = 1,
15638   };
15639   void set_enabled(bool value) {
15640     AppendTinyVarInt(1, value);
15641   }
15642 };
15643 
15644 } // Namespace.
15645 } // Namespace.
15646 } // Namespace.
15647 #endif  // Include guard.
15648 // gen_amalgamated begin header: gen/protos/perfetto/config/gpu/gpu_counter_config.pbzero.h
15649 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
15650 
15651 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_GPU_GPU_COUNTER_CONFIG_PROTO_H_
15652 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_GPU_GPU_COUNTER_CONFIG_PROTO_H_
15653 
15654 #include <stddef.h>
15655 #include <stdint.h>
15656 
15657 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
15658 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
15659 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
15660 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
15661 
15662 namespace perfetto {
15663 namespace protos {
15664 namespace pbzero {
15665 
15666 
15667 class GpuCounterConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
15668  public:
15669   GpuCounterConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
15670   explicit GpuCounterConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
15671   explicit GpuCounterConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
15672   bool has_counter_period_ns() const { return at<1>().valid(); }
15673   uint64_t counter_period_ns() const { return at<1>().as_uint64(); }
15674   bool has_counter_ids() const { return at<2>().valid(); }
15675   ::protozero::RepeatedFieldIterator<uint32_t> counter_ids() const { return GetRepeated<uint32_t>(2); }
15676   bool has_instrumented_sampling() const { return at<3>().valid(); }
15677   bool instrumented_sampling() const { return at<3>().as_bool(); }
15678   bool has_fix_gpu_clock() const { return at<4>().valid(); }
15679   bool fix_gpu_clock() const { return at<4>().as_bool(); }
15680 };
15681 
15682 class GpuCounterConfig : public ::protozero::Message {
15683  public:
15684   using Decoder = GpuCounterConfig_Decoder;
15685   enum : int32_t {
15686     kCounterPeriodNsFieldNumber = 1,
15687     kCounterIdsFieldNumber = 2,
15688     kInstrumentedSamplingFieldNumber = 3,
15689     kFixGpuClockFieldNumber = 4,
15690   };
15691   void set_counter_period_ns(uint64_t value) {
15692     AppendVarInt(1, value);
15693   }
15694   void add_counter_ids(uint32_t value) {
15695     AppendVarInt(2, value);
15696   }
15697   void set_instrumented_sampling(bool value) {
15698     AppendTinyVarInt(3, value);
15699   }
15700   void set_fix_gpu_clock(bool value) {
15701     AppendTinyVarInt(4, value);
15702   }
15703 };
15704 
15705 } // Namespace.
15706 } // Namespace.
15707 } // Namespace.
15708 #endif  // Include guard.
15709 // gen_amalgamated begin header: gen/protos/perfetto/config/gpu/vulkan_memory_config.pbzero.h
15710 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
15711 
15712 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_GPU_VULKAN_MEMORY_CONFIG_PROTO_H_
15713 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_GPU_VULKAN_MEMORY_CONFIG_PROTO_H_
15714 
15715 #include <stddef.h>
15716 #include <stdint.h>
15717 
15718 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
15719 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
15720 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
15721 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
15722 
15723 namespace perfetto {
15724 namespace protos {
15725 namespace pbzero {
15726 
15727 
15728 class VulkanMemoryConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
15729  public:
15730   VulkanMemoryConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
15731   explicit VulkanMemoryConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
15732   explicit VulkanMemoryConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
15733   bool has_track_driver_memory_usage() const { return at<1>().valid(); }
15734   bool track_driver_memory_usage() const { return at<1>().as_bool(); }
15735   bool has_track_device_memory_usage() const { return at<2>().valid(); }
15736   bool track_device_memory_usage() const { return at<2>().as_bool(); }
15737 };
15738 
15739 class VulkanMemoryConfig : public ::protozero::Message {
15740  public:
15741   using Decoder = VulkanMemoryConfig_Decoder;
15742   enum : int32_t {
15743     kTrackDriverMemoryUsageFieldNumber = 1,
15744     kTrackDeviceMemoryUsageFieldNumber = 2,
15745   };
15746   void set_track_driver_memory_usage(bool value) {
15747     AppendTinyVarInt(1, value);
15748   }
15749   void set_track_device_memory_usage(bool value) {
15750     AppendTinyVarInt(2, value);
15751   }
15752 };
15753 
15754 } // Namespace.
15755 } // Namespace.
15756 } // Namespace.
15757 #endif  // Include guard.
15758 // gen_amalgamated begin header: gen/protos/perfetto/config/inode_file/inode_file_config.pbzero.h
15759 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
15760 
15761 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_INODE_FILE_INODE_FILE_CONFIG_PROTO_H_
15762 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_INODE_FILE_INODE_FILE_CONFIG_PROTO_H_
15763 
15764 #include <stddef.h>
15765 #include <stdint.h>
15766 
15767 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
15768 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
15769 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
15770 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
15771 
15772 namespace perfetto {
15773 namespace protos {
15774 namespace pbzero {
15775 
15776 class InodeFileConfig_MountPointMappingEntry;
15777 
15778 class InodeFileConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
15779  public:
15780   InodeFileConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
15781   explicit InodeFileConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
15782   explicit InodeFileConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
15783   bool has_scan_interval_ms() const { return at<1>().valid(); }
15784   uint32_t scan_interval_ms() const { return at<1>().as_uint32(); }
15785   bool has_scan_delay_ms() const { return at<2>().valid(); }
15786   uint32_t scan_delay_ms() const { return at<2>().as_uint32(); }
15787   bool has_scan_batch_size() const { return at<3>().valid(); }
15788   uint32_t scan_batch_size() const { return at<3>().as_uint32(); }
15789   bool has_do_not_scan() const { return at<4>().valid(); }
15790   bool do_not_scan() const { return at<4>().as_bool(); }
15791   bool has_scan_mount_points() const { return at<5>().valid(); }
15792   ::protozero::RepeatedFieldIterator<::protozero::ConstChars> scan_mount_points() const { return GetRepeated<::protozero::ConstChars>(5); }
15793   bool has_mount_point_mapping() const { return at<6>().valid(); }
15794   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> mount_point_mapping() const { return GetRepeated<::protozero::ConstBytes>(6); }
15795 };
15796 
15797 class InodeFileConfig : public ::protozero::Message {
15798  public:
15799   using Decoder = InodeFileConfig_Decoder;
15800   enum : int32_t {
15801     kScanIntervalMsFieldNumber = 1,
15802     kScanDelayMsFieldNumber = 2,
15803     kScanBatchSizeFieldNumber = 3,
15804     kDoNotScanFieldNumber = 4,
15805     kScanMountPointsFieldNumber = 5,
15806     kMountPointMappingFieldNumber = 6,
15807   };
15808   using MountPointMappingEntry = ::perfetto::protos::pbzero::InodeFileConfig_MountPointMappingEntry;
15809   void set_scan_interval_ms(uint32_t value) {
15810     AppendVarInt(1, value);
15811   }
15812   void set_scan_delay_ms(uint32_t value) {
15813     AppendVarInt(2, value);
15814   }
15815   void set_scan_batch_size(uint32_t value) {
15816     AppendVarInt(3, value);
15817   }
15818   void set_do_not_scan(bool value) {
15819     AppendTinyVarInt(4, value);
15820   }
15821   void add_scan_mount_points(const std::string& value) {
15822     AppendBytes(5, value.data(), value.size());
15823   }
15824   void add_scan_mount_points(const char* data, size_t size) {
15825     AppendBytes(5, data, size);
15826   }
15827   template <typename T = InodeFileConfig_MountPointMappingEntry> T* add_mount_point_mapping() {
15828     return BeginNestedMessage<T>(6);
15829   }
15830 
15831 };
15832 
15833 class InodeFileConfig_MountPointMappingEntry_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
15834  public:
15835   InodeFileConfig_MountPointMappingEntry_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
15836   explicit InodeFileConfig_MountPointMappingEntry_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
15837   explicit InodeFileConfig_MountPointMappingEntry_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
15838   bool has_mountpoint() const { return at<1>().valid(); }
15839   ::protozero::ConstChars mountpoint() const { return at<1>().as_string(); }
15840   bool has_scan_roots() const { return at<2>().valid(); }
15841   ::protozero::RepeatedFieldIterator<::protozero::ConstChars> scan_roots() const { return GetRepeated<::protozero::ConstChars>(2); }
15842 };
15843 
15844 class InodeFileConfig_MountPointMappingEntry : public ::protozero::Message {
15845  public:
15846   using Decoder = InodeFileConfig_MountPointMappingEntry_Decoder;
15847   enum : int32_t {
15848     kMountpointFieldNumber = 1,
15849     kScanRootsFieldNumber = 2,
15850   };
15851   void set_mountpoint(const std::string& value) {
15852     AppendBytes(1, value.data(), value.size());
15853   }
15854   void set_mountpoint(const char* data, size_t size) {
15855     AppendBytes(1, data, size);
15856   }
15857   void add_scan_roots(const std::string& value) {
15858     AppendBytes(2, value.data(), value.size());
15859   }
15860   void add_scan_roots(const char* data, size_t size) {
15861     AppendBytes(2, data, size);
15862   }
15863 };
15864 
15865 } // Namespace.
15866 } // Namespace.
15867 } // Namespace.
15868 #endif  // Include guard.
15869 // gen_amalgamated begin header: gen/protos/perfetto/config/power/android_power_config.pbzero.h
15870 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
15871 
15872 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_POWER_ANDROID_POWER_CONFIG_PROTO_H_
15873 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_POWER_ANDROID_POWER_CONFIG_PROTO_H_
15874 
15875 #include <stddef.h>
15876 #include <stdint.h>
15877 
15878 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
15879 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
15880 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
15881 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
15882 
15883 namespace perfetto {
15884 namespace protos {
15885 namespace pbzero {
15886 
15887 enum AndroidPowerConfig_BatteryCounters : int32_t;
15888 
15889 enum AndroidPowerConfig_BatteryCounters : int32_t {
15890   AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_UNSPECIFIED = 0,
15891   AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CHARGE = 1,
15892   AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CAPACITY_PERCENT = 2,
15893   AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CURRENT = 3,
15894   AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CURRENT_AVG = 4,
15895 };
15896 
15897 const AndroidPowerConfig_BatteryCounters AndroidPowerConfig_BatteryCounters_MIN = AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_UNSPECIFIED;
15898 const AndroidPowerConfig_BatteryCounters AndroidPowerConfig_BatteryCounters_MAX = AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CURRENT_AVG;
15899 
15900 class AndroidPowerConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
15901  public:
15902   AndroidPowerConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
15903   explicit AndroidPowerConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
15904   explicit AndroidPowerConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
15905   bool has_battery_poll_ms() const { return at<1>().valid(); }
15906   uint32_t battery_poll_ms() const { return at<1>().as_uint32(); }
15907   bool has_battery_counters() const { return at<2>().valid(); }
15908   ::protozero::RepeatedFieldIterator<int32_t> battery_counters() const { return GetRepeated<int32_t>(2); }
15909   bool has_collect_power_rails() const { return at<3>().valid(); }
15910   bool collect_power_rails() const { return at<3>().as_bool(); }
15911 };
15912 
15913 class AndroidPowerConfig : public ::protozero::Message {
15914  public:
15915   using Decoder = AndroidPowerConfig_Decoder;
15916   enum : int32_t {
15917     kBatteryPollMsFieldNumber = 1,
15918     kBatteryCountersFieldNumber = 2,
15919     kCollectPowerRailsFieldNumber = 3,
15920   };
15921   using BatteryCounters = ::perfetto::protos::pbzero::AndroidPowerConfig_BatteryCounters;
15922   static const BatteryCounters BATTERY_COUNTER_UNSPECIFIED = AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_UNSPECIFIED;
15923   static const BatteryCounters BATTERY_COUNTER_CHARGE = AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CHARGE;
15924   static const BatteryCounters BATTERY_COUNTER_CAPACITY_PERCENT = AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CAPACITY_PERCENT;
15925   static const BatteryCounters BATTERY_COUNTER_CURRENT = AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CURRENT;
15926   static const BatteryCounters BATTERY_COUNTER_CURRENT_AVG = AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CURRENT_AVG;
15927   void set_battery_poll_ms(uint32_t value) {
15928     AppendVarInt(1, value);
15929   }
15930   void add_battery_counters(::perfetto::protos::pbzero::AndroidPowerConfig_BatteryCounters value) {
15931     AppendTinyVarInt(2, value);
15932   }
15933   void set_collect_power_rails(bool value) {
15934     AppendTinyVarInt(3, value);
15935   }
15936 };
15937 
15938 } // Namespace.
15939 } // Namespace.
15940 } // Namespace.
15941 #endif  // Include guard.
15942 // gen_amalgamated begin header: gen/protos/perfetto/config/process_stats/process_stats_config.pbzero.h
15943 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
15944 
15945 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROCESS_STATS_PROCESS_STATS_CONFIG_PROTO_H_
15946 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROCESS_STATS_PROCESS_STATS_CONFIG_PROTO_H_
15947 
15948 #include <stddef.h>
15949 #include <stdint.h>
15950 
15951 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
15952 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
15953 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
15954 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
15955 
15956 namespace perfetto {
15957 namespace protos {
15958 namespace pbzero {
15959 
15960 enum ProcessStatsConfig_Quirks : int32_t;
15961 
15962 enum ProcessStatsConfig_Quirks : int32_t {
15963   ProcessStatsConfig_Quirks_QUIRKS_UNSPECIFIED = 0,
15964   ProcessStatsConfig_Quirks_DISABLE_INITIAL_DUMP = 1,
15965   ProcessStatsConfig_Quirks_DISABLE_ON_DEMAND = 2,
15966 };
15967 
15968 const ProcessStatsConfig_Quirks ProcessStatsConfig_Quirks_MIN = ProcessStatsConfig_Quirks_QUIRKS_UNSPECIFIED;
15969 const ProcessStatsConfig_Quirks ProcessStatsConfig_Quirks_MAX = ProcessStatsConfig_Quirks_DISABLE_ON_DEMAND;
15970 
15971 class ProcessStatsConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
15972  public:
15973   ProcessStatsConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
15974   explicit ProcessStatsConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
15975   explicit ProcessStatsConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
15976   bool has_quirks() const { return at<1>().valid(); }
15977   ::protozero::RepeatedFieldIterator<int32_t> quirks() const { return GetRepeated<int32_t>(1); }
15978   bool has_scan_all_processes_on_start() const { return at<2>().valid(); }
15979   bool scan_all_processes_on_start() const { return at<2>().as_bool(); }
15980   bool has_record_thread_names() const { return at<3>().valid(); }
15981   bool record_thread_names() const { return at<3>().as_bool(); }
15982   bool has_proc_stats_poll_ms() const { return at<4>().valid(); }
15983   uint32_t proc_stats_poll_ms() const { return at<4>().as_uint32(); }
15984   bool has_proc_stats_cache_ttl_ms() const { return at<6>().valid(); }
15985   uint32_t proc_stats_cache_ttl_ms() const { return at<6>().as_uint32(); }
15986   bool has_record_thread_time_in_state() const { return at<7>().valid(); }
15987   bool record_thread_time_in_state() const { return at<7>().as_bool(); }
15988   bool has_thread_time_in_state_cache_size() const { return at<8>().valid(); }
15989   uint32_t thread_time_in_state_cache_size() const { return at<8>().as_uint32(); }
15990 };
15991 
15992 class ProcessStatsConfig : public ::protozero::Message {
15993  public:
15994   using Decoder = ProcessStatsConfig_Decoder;
15995   enum : int32_t {
15996     kQuirksFieldNumber = 1,
15997     kScanAllProcessesOnStartFieldNumber = 2,
15998     kRecordThreadNamesFieldNumber = 3,
15999     kProcStatsPollMsFieldNumber = 4,
16000     kProcStatsCacheTtlMsFieldNumber = 6,
16001     kRecordThreadTimeInStateFieldNumber = 7,
16002     kThreadTimeInStateCacheSizeFieldNumber = 8,
16003   };
16004   using Quirks = ::perfetto::protos::pbzero::ProcessStatsConfig_Quirks;
16005   static const Quirks QUIRKS_UNSPECIFIED = ProcessStatsConfig_Quirks_QUIRKS_UNSPECIFIED;
16006   static const Quirks DISABLE_INITIAL_DUMP = ProcessStatsConfig_Quirks_DISABLE_INITIAL_DUMP;
16007   static const Quirks DISABLE_ON_DEMAND = ProcessStatsConfig_Quirks_DISABLE_ON_DEMAND;
16008   void add_quirks(::perfetto::protos::pbzero::ProcessStatsConfig_Quirks value) {
16009     AppendTinyVarInt(1, value);
16010   }
16011   void set_scan_all_processes_on_start(bool value) {
16012     AppendTinyVarInt(2, value);
16013   }
16014   void set_record_thread_names(bool value) {
16015     AppendTinyVarInt(3, value);
16016   }
16017   void set_proc_stats_poll_ms(uint32_t value) {
16018     AppendVarInt(4, value);
16019   }
16020   void set_proc_stats_cache_ttl_ms(uint32_t value) {
16021     AppendVarInt(6, value);
16022   }
16023   void set_record_thread_time_in_state(bool value) {
16024     AppendTinyVarInt(7, value);
16025   }
16026   void set_thread_time_in_state_cache_size(uint32_t value) {
16027     AppendVarInt(8, value);
16028   }
16029 };
16030 
16031 } // Namespace.
16032 } // Namespace.
16033 } // Namespace.
16034 #endif  // Include guard.
16035 // gen_amalgamated begin header: gen/protos/perfetto/config/profiling/heapprofd_config.pbzero.h
16036 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
16037 
16038 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROFILING_HEAPPROFD_CONFIG_PROTO_H_
16039 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROFILING_HEAPPROFD_CONFIG_PROTO_H_
16040 
16041 #include <stddef.h>
16042 #include <stdint.h>
16043 
16044 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
16045 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
16046 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
16047 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
16048 
16049 namespace perfetto {
16050 namespace protos {
16051 namespace pbzero {
16052 
16053 class HeapprofdConfig_ContinuousDumpConfig;
16054 
16055 class HeapprofdConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/21, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
16056  public:
16057   HeapprofdConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
16058   explicit HeapprofdConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
16059   explicit HeapprofdConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
16060   bool has_sampling_interval_bytes() const { return at<1>().valid(); }
16061   uint64_t sampling_interval_bytes() const { return at<1>().as_uint64(); }
16062   bool has_process_cmdline() const { return at<2>().valid(); }
16063   ::protozero::RepeatedFieldIterator<::protozero::ConstChars> process_cmdline() const { return GetRepeated<::protozero::ConstChars>(2); }
16064   bool has_pid() const { return at<4>().valid(); }
16065   ::protozero::RepeatedFieldIterator<uint64_t> pid() const { return GetRepeated<uint64_t>(4); }
16066   bool has_heaps() const { return at<20>().valid(); }
16067   ::protozero::RepeatedFieldIterator<::protozero::ConstChars> heaps() const { return GetRepeated<::protozero::ConstChars>(20); }
16068   bool has_all_heaps() const { return at<21>().valid(); }
16069   bool all_heaps() const { return at<21>().as_bool(); }
16070   bool has_all() const { return at<5>().valid(); }
16071   bool all() const { return at<5>().as_bool(); }
16072   bool has_min_anonymous_memory_kb() const { return at<15>().valid(); }
16073   uint32_t min_anonymous_memory_kb() const { return at<15>().as_uint32(); }
16074   bool has_max_heapprofd_memory_kb() const { return at<16>().valid(); }
16075   uint32_t max_heapprofd_memory_kb() const { return at<16>().as_uint32(); }
16076   bool has_max_heapprofd_cpu_secs() const { return at<17>().valid(); }
16077   uint64_t max_heapprofd_cpu_secs() const { return at<17>().as_uint64(); }
16078   bool has_skip_symbol_prefix() const { return at<7>().valid(); }
16079   ::protozero::RepeatedFieldIterator<::protozero::ConstChars> skip_symbol_prefix() const { return GetRepeated<::protozero::ConstChars>(7); }
16080   bool has_continuous_dump_config() const { return at<6>().valid(); }
16081   ::protozero::ConstBytes continuous_dump_config() const { return at<6>().as_bytes(); }
16082   bool has_shmem_size_bytes() const { return at<8>().valid(); }
16083   uint64_t shmem_size_bytes() const { return at<8>().as_uint64(); }
16084   bool has_block_client() const { return at<9>().valid(); }
16085   bool block_client() const { return at<9>().as_bool(); }
16086   bool has_block_client_timeout_us() const { return at<14>().valid(); }
16087   uint32_t block_client_timeout_us() const { return at<14>().as_uint32(); }
16088   bool has_no_startup() const { return at<10>().valid(); }
16089   bool no_startup() const { return at<10>().as_bool(); }
16090   bool has_no_running() const { return at<11>().valid(); }
16091   bool no_running() const { return at<11>().as_bool(); }
16092   bool has_idle_allocations() const { return at<12>().valid(); }
16093   bool idle_allocations() const { return at<12>().as_bool(); }
16094   bool has_dump_at_max() const { return at<13>().valid(); }
16095   bool dump_at_max() const { return at<13>().as_bool(); }
16096   bool has_disable_fork_teardown() const { return at<18>().valid(); }
16097   bool disable_fork_teardown() const { return at<18>().as_bool(); }
16098   bool has_disable_vfork_detection() const { return at<19>().valid(); }
16099   bool disable_vfork_detection() const { return at<19>().as_bool(); }
16100 };
16101 
16102 class HeapprofdConfig : public ::protozero::Message {
16103  public:
16104   using Decoder = HeapprofdConfig_Decoder;
16105   enum : int32_t {
16106     kSamplingIntervalBytesFieldNumber = 1,
16107     kProcessCmdlineFieldNumber = 2,
16108     kPidFieldNumber = 4,
16109     kHeapsFieldNumber = 20,
16110     kAllHeapsFieldNumber = 21,
16111     kAllFieldNumber = 5,
16112     kMinAnonymousMemoryKbFieldNumber = 15,
16113     kMaxHeapprofdMemoryKbFieldNumber = 16,
16114     kMaxHeapprofdCpuSecsFieldNumber = 17,
16115     kSkipSymbolPrefixFieldNumber = 7,
16116     kContinuousDumpConfigFieldNumber = 6,
16117     kShmemSizeBytesFieldNumber = 8,
16118     kBlockClientFieldNumber = 9,
16119     kBlockClientTimeoutUsFieldNumber = 14,
16120     kNoStartupFieldNumber = 10,
16121     kNoRunningFieldNumber = 11,
16122     kIdleAllocationsFieldNumber = 12,
16123     kDumpAtMaxFieldNumber = 13,
16124     kDisableForkTeardownFieldNumber = 18,
16125     kDisableVforkDetectionFieldNumber = 19,
16126   };
16127   using ContinuousDumpConfig = ::perfetto::protos::pbzero::HeapprofdConfig_ContinuousDumpConfig;
16128   void set_sampling_interval_bytes(uint64_t value) {
16129     AppendVarInt(1, value);
16130   }
16131   void add_process_cmdline(const std::string& value) {
16132     AppendBytes(2, value.data(), value.size());
16133   }
16134   void add_process_cmdline(const char* data, size_t size) {
16135     AppendBytes(2, data, size);
16136   }
16137   void add_pid(uint64_t value) {
16138     AppendVarInt(4, value);
16139   }
16140   void add_heaps(const std::string& value) {
16141     AppendBytes(20, value.data(), value.size());
16142   }
16143   void add_heaps(const char* data, size_t size) {
16144     AppendBytes(20, data, size);
16145   }
16146   void set_all_heaps(bool value) {
16147     AppendTinyVarInt(21, value);
16148   }
16149   void set_all(bool value) {
16150     AppendTinyVarInt(5, value);
16151   }
16152   void set_min_anonymous_memory_kb(uint32_t value) {
16153     AppendVarInt(15, value);
16154   }
16155   void set_max_heapprofd_memory_kb(uint32_t value) {
16156     AppendVarInt(16, value);
16157   }
16158   void set_max_heapprofd_cpu_secs(uint64_t value) {
16159     AppendVarInt(17, value);
16160   }
16161   void add_skip_symbol_prefix(const std::string& value) {
16162     AppendBytes(7, value.data(), value.size());
16163   }
16164   void add_skip_symbol_prefix(const char* data, size_t size) {
16165     AppendBytes(7, data, size);
16166   }
16167   template <typename T = HeapprofdConfig_ContinuousDumpConfig> T* set_continuous_dump_config() {
16168     return BeginNestedMessage<T>(6);
16169   }
16170 
16171   void set_shmem_size_bytes(uint64_t value) {
16172     AppendVarInt(8, value);
16173   }
16174   void set_block_client(bool value) {
16175     AppendTinyVarInt(9, value);
16176   }
16177   void set_block_client_timeout_us(uint32_t value) {
16178     AppendVarInt(14, value);
16179   }
16180   void set_no_startup(bool value) {
16181     AppendTinyVarInt(10, value);
16182   }
16183   void set_no_running(bool value) {
16184     AppendTinyVarInt(11, value);
16185   }
16186   void set_idle_allocations(bool value) {
16187     AppendTinyVarInt(12, value);
16188   }
16189   void set_dump_at_max(bool value) {
16190     AppendTinyVarInt(13, value);
16191   }
16192   void set_disable_fork_teardown(bool value) {
16193     AppendTinyVarInt(18, value);
16194   }
16195   void set_disable_vfork_detection(bool value) {
16196     AppendTinyVarInt(19, value);
16197   }
16198 };
16199 
16200 class HeapprofdConfig_ContinuousDumpConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
16201  public:
16202   HeapprofdConfig_ContinuousDumpConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
16203   explicit HeapprofdConfig_ContinuousDumpConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
16204   explicit HeapprofdConfig_ContinuousDumpConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
16205   bool has_dump_phase_ms() const { return at<5>().valid(); }
16206   uint32_t dump_phase_ms() const { return at<5>().as_uint32(); }
16207   bool has_dump_interval_ms() const { return at<6>().valid(); }
16208   uint32_t dump_interval_ms() const { return at<6>().as_uint32(); }
16209 };
16210 
16211 class HeapprofdConfig_ContinuousDumpConfig : public ::protozero::Message {
16212  public:
16213   using Decoder = HeapprofdConfig_ContinuousDumpConfig_Decoder;
16214   enum : int32_t {
16215     kDumpPhaseMsFieldNumber = 5,
16216     kDumpIntervalMsFieldNumber = 6,
16217   };
16218   void set_dump_phase_ms(uint32_t value) {
16219     AppendVarInt(5, value);
16220   }
16221   void set_dump_interval_ms(uint32_t value) {
16222     AppendVarInt(6, value);
16223   }
16224 };
16225 
16226 } // Namespace.
16227 } // Namespace.
16228 } // Namespace.
16229 #endif  // Include guard.
16230 // gen_amalgamated begin header: gen/protos/perfetto/config/profiling/java_hprof_config.pbzero.h
16231 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
16232 
16233 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROFILING_JAVA_HPROF_CONFIG_PROTO_H_
16234 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROFILING_JAVA_HPROF_CONFIG_PROTO_H_
16235 
16236 #include <stddef.h>
16237 #include <stdint.h>
16238 
16239 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
16240 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
16241 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
16242 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
16243 
16244 namespace perfetto {
16245 namespace protos {
16246 namespace pbzero {
16247 
16248 class JavaHprofConfig_ContinuousDumpConfig;
16249 
16250 class JavaHprofConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
16251  public:
16252   JavaHprofConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
16253   explicit JavaHprofConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
16254   explicit JavaHprofConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
16255   bool has_process_cmdline() const { return at<1>().valid(); }
16256   ::protozero::RepeatedFieldIterator<::protozero::ConstChars> process_cmdline() const { return GetRepeated<::protozero::ConstChars>(1); }
16257   bool has_pid() const { return at<2>().valid(); }
16258   ::protozero::RepeatedFieldIterator<uint64_t> pid() const { return GetRepeated<uint64_t>(2); }
16259   bool has_continuous_dump_config() const { return at<3>().valid(); }
16260   ::protozero::ConstBytes continuous_dump_config() const { return at<3>().as_bytes(); }
16261   bool has_min_anonymous_memory_kb() const { return at<4>().valid(); }
16262   uint32_t min_anonymous_memory_kb() const { return at<4>().as_uint32(); }
16263   bool has_dump_smaps() const { return at<5>().valid(); }
16264   bool dump_smaps() const { return at<5>().as_bool(); }
16265 };
16266 
16267 class JavaHprofConfig : public ::protozero::Message {
16268  public:
16269   using Decoder = JavaHprofConfig_Decoder;
16270   enum : int32_t {
16271     kProcessCmdlineFieldNumber = 1,
16272     kPidFieldNumber = 2,
16273     kContinuousDumpConfigFieldNumber = 3,
16274     kMinAnonymousMemoryKbFieldNumber = 4,
16275     kDumpSmapsFieldNumber = 5,
16276   };
16277   using ContinuousDumpConfig = ::perfetto::protos::pbzero::JavaHprofConfig_ContinuousDumpConfig;
16278   void add_process_cmdline(const std::string& value) {
16279     AppendBytes(1, value.data(), value.size());
16280   }
16281   void add_process_cmdline(const char* data, size_t size) {
16282     AppendBytes(1, data, size);
16283   }
16284   void add_pid(uint64_t value) {
16285     AppendVarInt(2, value);
16286   }
16287   template <typename T = JavaHprofConfig_ContinuousDumpConfig> T* set_continuous_dump_config() {
16288     return BeginNestedMessage<T>(3);
16289   }
16290 
16291   void set_min_anonymous_memory_kb(uint32_t value) {
16292     AppendVarInt(4, value);
16293   }
16294   void set_dump_smaps(bool value) {
16295     AppendTinyVarInt(5, value);
16296   }
16297 };
16298 
16299 class JavaHprofConfig_ContinuousDumpConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
16300  public:
16301   JavaHprofConfig_ContinuousDumpConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
16302   explicit JavaHprofConfig_ContinuousDumpConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
16303   explicit JavaHprofConfig_ContinuousDumpConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
16304   bool has_dump_phase_ms() const { return at<1>().valid(); }
16305   uint32_t dump_phase_ms() const { return at<1>().as_uint32(); }
16306   bool has_dump_interval_ms() const { return at<2>().valid(); }
16307   uint32_t dump_interval_ms() const { return at<2>().as_uint32(); }
16308 };
16309 
16310 class JavaHprofConfig_ContinuousDumpConfig : public ::protozero::Message {
16311  public:
16312   using Decoder = JavaHprofConfig_ContinuousDumpConfig_Decoder;
16313   enum : int32_t {
16314     kDumpPhaseMsFieldNumber = 1,
16315     kDumpIntervalMsFieldNumber = 2,
16316   };
16317   void set_dump_phase_ms(uint32_t value) {
16318     AppendVarInt(1, value);
16319   }
16320   void set_dump_interval_ms(uint32_t value) {
16321     AppendVarInt(2, value);
16322   }
16323 };
16324 
16325 } // Namespace.
16326 } // Namespace.
16327 } // Namespace.
16328 #endif  // Include guard.
16329 // gen_amalgamated begin header: gen/protos/perfetto/config/profiling/perf_event_config.pbzero.h
16330 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
16331 
16332 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROFILING_PERF_EVENT_CONFIG_PROTO_H_
16333 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROFILING_PERF_EVENT_CONFIG_PROTO_H_
16334 
16335 #include <stddef.h>
16336 #include <stdint.h>
16337 
16338 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
16339 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
16340 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
16341 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
16342 
16343 namespace perfetto {
16344 namespace protos {
16345 namespace pbzero {
16346 
16347 
16348 class PerfEventConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/10, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
16349  public:
16350   PerfEventConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
16351   explicit PerfEventConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
16352   explicit PerfEventConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
16353   bool has_all_cpus() const { return at<1>().valid(); }
16354   bool all_cpus() const { return at<1>().as_bool(); }
16355   bool has_sampling_frequency() const { return at<2>().valid(); }
16356   uint32_t sampling_frequency() const { return at<2>().as_uint32(); }
16357   bool has_ring_buffer_read_period_ms() const { return at<8>().valid(); }
16358   uint32_t ring_buffer_read_period_ms() const { return at<8>().as_uint32(); }
16359   bool has_ring_buffer_pages() const { return at<3>().valid(); }
16360   uint32_t ring_buffer_pages() const { return at<3>().as_uint32(); }
16361   bool has_target_pid() const { return at<4>().valid(); }
16362   ::protozero::RepeatedFieldIterator<int32_t> target_pid() const { return GetRepeated<int32_t>(4); }
16363   bool has_target_cmdline() const { return at<5>().valid(); }
16364   ::protozero::RepeatedFieldIterator<::protozero::ConstChars> target_cmdline() const { return GetRepeated<::protozero::ConstChars>(5); }
16365   bool has_exclude_pid() const { return at<6>().valid(); }
16366   ::protozero::RepeatedFieldIterator<int32_t> exclude_pid() const { return GetRepeated<int32_t>(6); }
16367   bool has_exclude_cmdline() const { return at<7>().valid(); }
16368   ::protozero::RepeatedFieldIterator<::protozero::ConstChars> exclude_cmdline() const { return GetRepeated<::protozero::ConstChars>(7); }
16369   bool has_remote_descriptor_timeout_ms() const { return at<9>().valid(); }
16370   uint32_t remote_descriptor_timeout_ms() const { return at<9>().as_uint32(); }
16371   bool has_unwind_state_clear_period_ms() const { return at<10>().valid(); }
16372   uint32_t unwind_state_clear_period_ms() const { return at<10>().as_uint32(); }
16373 };
16374 
16375 class PerfEventConfig : public ::protozero::Message {
16376  public:
16377   using Decoder = PerfEventConfig_Decoder;
16378   enum : int32_t {
16379     kAllCpusFieldNumber = 1,
16380     kSamplingFrequencyFieldNumber = 2,
16381     kRingBufferReadPeriodMsFieldNumber = 8,
16382     kRingBufferPagesFieldNumber = 3,
16383     kTargetPidFieldNumber = 4,
16384     kTargetCmdlineFieldNumber = 5,
16385     kExcludePidFieldNumber = 6,
16386     kExcludeCmdlineFieldNumber = 7,
16387     kRemoteDescriptorTimeoutMsFieldNumber = 9,
16388     kUnwindStateClearPeriodMsFieldNumber = 10,
16389   };
16390   void set_all_cpus(bool value) {
16391     AppendTinyVarInt(1, value);
16392   }
16393   void set_sampling_frequency(uint32_t value) {
16394     AppendVarInt(2, value);
16395   }
16396   void set_ring_buffer_read_period_ms(uint32_t value) {
16397     AppendVarInt(8, value);
16398   }
16399   void set_ring_buffer_pages(uint32_t value) {
16400     AppendVarInt(3, value);
16401   }
16402   void add_target_pid(int32_t value) {
16403     AppendVarInt(4, value);
16404   }
16405   void add_target_cmdline(const std::string& value) {
16406     AppendBytes(5, value.data(), value.size());
16407   }
16408   void add_target_cmdline(const char* data, size_t size) {
16409     AppendBytes(5, data, size);
16410   }
16411   void add_exclude_pid(int32_t value) {
16412     AppendVarInt(6, value);
16413   }
16414   void add_exclude_cmdline(const std::string& value) {
16415     AppendBytes(7, value.data(), value.size());
16416   }
16417   void add_exclude_cmdline(const char* data, size_t size) {
16418     AppendBytes(7, data, size);
16419   }
16420   void set_remote_descriptor_timeout_ms(uint32_t value) {
16421     AppendVarInt(9, value);
16422   }
16423   void set_unwind_state_clear_period_ms(uint32_t value) {
16424     AppendVarInt(10, value);
16425   }
16426 };
16427 
16428 } // Namespace.
16429 } // Namespace.
16430 } // Namespace.
16431 #endif  // Include guard.
16432 // gen_amalgamated begin header: gen/protos/perfetto/config/sys_stats/sys_stats_config.pbzero.h
16433 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
16434 
16435 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_SYS_STATS_SYS_STATS_CONFIG_PROTO_H_
16436 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_SYS_STATS_SYS_STATS_CONFIG_PROTO_H_
16437 
16438 #include <stddef.h>
16439 #include <stdint.h>
16440 
16441 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
16442 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
16443 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
16444 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
16445 
16446 namespace perfetto {
16447 namespace protos {
16448 namespace pbzero {
16449 
16450 enum MeminfoCounters : int32_t;
16451 enum SysStatsConfig_StatCounters : int32_t;
16452 enum VmstatCounters : int32_t;
16453 
16454 enum SysStatsConfig_StatCounters : int32_t {
16455   SysStatsConfig_StatCounters_STAT_UNSPECIFIED = 0,
16456   SysStatsConfig_StatCounters_STAT_CPU_TIMES = 1,
16457   SysStatsConfig_StatCounters_STAT_IRQ_COUNTS = 2,
16458   SysStatsConfig_StatCounters_STAT_SOFTIRQ_COUNTS = 3,
16459   SysStatsConfig_StatCounters_STAT_FORK_COUNT = 4,
16460 };
16461 
16462 const SysStatsConfig_StatCounters SysStatsConfig_StatCounters_MIN = SysStatsConfig_StatCounters_STAT_UNSPECIFIED;
16463 const SysStatsConfig_StatCounters SysStatsConfig_StatCounters_MAX = SysStatsConfig_StatCounters_STAT_FORK_COUNT;
16464 
16465 class SysStatsConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
16466  public:
16467   SysStatsConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
16468   explicit SysStatsConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
16469   explicit SysStatsConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
16470   bool has_meminfo_period_ms() const { return at<1>().valid(); }
16471   uint32_t meminfo_period_ms() const { return at<1>().as_uint32(); }
16472   bool has_meminfo_counters() const { return at<2>().valid(); }
16473   ::protozero::RepeatedFieldIterator<int32_t> meminfo_counters() const { return GetRepeated<int32_t>(2); }
16474   bool has_vmstat_period_ms() const { return at<3>().valid(); }
16475   uint32_t vmstat_period_ms() const { return at<3>().as_uint32(); }
16476   bool has_vmstat_counters() const { return at<4>().valid(); }
16477   ::protozero::RepeatedFieldIterator<int32_t> vmstat_counters() const { return GetRepeated<int32_t>(4); }
16478   bool has_stat_period_ms() const { return at<5>().valid(); }
16479   uint32_t stat_period_ms() const { return at<5>().as_uint32(); }
16480   bool has_stat_counters() const { return at<6>().valid(); }
16481   ::protozero::RepeatedFieldIterator<int32_t> stat_counters() const { return GetRepeated<int32_t>(6); }
16482 };
16483 
16484 class SysStatsConfig : public ::protozero::Message {
16485  public:
16486   using Decoder = SysStatsConfig_Decoder;
16487   enum : int32_t {
16488     kMeminfoPeriodMsFieldNumber = 1,
16489     kMeminfoCountersFieldNumber = 2,
16490     kVmstatPeriodMsFieldNumber = 3,
16491     kVmstatCountersFieldNumber = 4,
16492     kStatPeriodMsFieldNumber = 5,
16493     kStatCountersFieldNumber = 6,
16494   };
16495   using StatCounters = ::perfetto::protos::pbzero::SysStatsConfig_StatCounters;
16496   static const StatCounters STAT_UNSPECIFIED = SysStatsConfig_StatCounters_STAT_UNSPECIFIED;
16497   static const StatCounters STAT_CPU_TIMES = SysStatsConfig_StatCounters_STAT_CPU_TIMES;
16498   static const StatCounters STAT_IRQ_COUNTS = SysStatsConfig_StatCounters_STAT_IRQ_COUNTS;
16499   static const StatCounters STAT_SOFTIRQ_COUNTS = SysStatsConfig_StatCounters_STAT_SOFTIRQ_COUNTS;
16500   static const StatCounters STAT_FORK_COUNT = SysStatsConfig_StatCounters_STAT_FORK_COUNT;
16501   void set_meminfo_period_ms(uint32_t value) {
16502     AppendVarInt(1, value);
16503   }
16504   void add_meminfo_counters(::perfetto::protos::pbzero::MeminfoCounters value) {
16505     AppendTinyVarInt(2, value);
16506   }
16507   void set_vmstat_period_ms(uint32_t value) {
16508     AppendVarInt(3, value);
16509   }
16510   void add_vmstat_counters(::perfetto::protos::pbzero::VmstatCounters value) {
16511     AppendTinyVarInt(4, value);
16512   }
16513   void set_stat_period_ms(uint32_t value) {
16514     AppendVarInt(5, value);
16515   }
16516   void add_stat_counters(::perfetto::protos::pbzero::SysStatsConfig_StatCounters value) {
16517     AppendTinyVarInt(6, value);
16518   }
16519 };
16520 
16521 } // Namespace.
16522 } // Namespace.
16523 } // Namespace.
16524 #endif  // Include guard.
16525 // gen_amalgamated begin header: gen/protos/perfetto/config/track_event/track_event_config.pbzero.h
16526 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
16527 
16528 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TRACK_EVENT_TRACK_EVENT_CONFIG_PROTO_H_
16529 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TRACK_EVENT_TRACK_EVENT_CONFIG_PROTO_H_
16530 
16531 #include <stddef.h>
16532 #include <stdint.h>
16533 
16534 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
16535 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
16536 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
16537 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
16538 
16539 namespace perfetto {
16540 namespace protos {
16541 namespace pbzero {
16542 
16543 
16544 class TrackEventConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
16545  public:
16546   TrackEventConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
16547   explicit TrackEventConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
16548   explicit TrackEventConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
16549   bool has_disabled_categories() const { return at<1>().valid(); }
16550   ::protozero::RepeatedFieldIterator<::protozero::ConstChars> disabled_categories() const { return GetRepeated<::protozero::ConstChars>(1); }
16551   bool has_enabled_categories() const { return at<2>().valid(); }
16552   ::protozero::RepeatedFieldIterator<::protozero::ConstChars> enabled_categories() const { return GetRepeated<::protozero::ConstChars>(2); }
16553   bool has_disabled_tags() const { return at<3>().valid(); }
16554   ::protozero::RepeatedFieldIterator<::protozero::ConstChars> disabled_tags() const { return GetRepeated<::protozero::ConstChars>(3); }
16555   bool has_enabled_tags() const { return at<4>().valid(); }
16556   ::protozero::RepeatedFieldIterator<::protozero::ConstChars> enabled_tags() const { return GetRepeated<::protozero::ConstChars>(4); }
16557 };
16558 
16559 class TrackEventConfig : public ::protozero::Message {
16560  public:
16561   using Decoder = TrackEventConfig_Decoder;
16562   enum : int32_t {
16563     kDisabledCategoriesFieldNumber = 1,
16564     kEnabledCategoriesFieldNumber = 2,
16565     kDisabledTagsFieldNumber = 3,
16566     kEnabledTagsFieldNumber = 4,
16567   };
16568   void add_disabled_categories(const std::string& value) {
16569     AppendBytes(1, value.data(), value.size());
16570   }
16571   void add_disabled_categories(const char* data, size_t size) {
16572     AppendBytes(1, data, size);
16573   }
16574   void add_enabled_categories(const std::string& value) {
16575     AppendBytes(2, value.data(), value.size());
16576   }
16577   void add_enabled_categories(const char* data, size_t size) {
16578     AppendBytes(2, data, size);
16579   }
16580   void add_disabled_tags(const std::string& value) {
16581     AppendBytes(3, value.data(), value.size());
16582   }
16583   void add_disabled_tags(const char* data, size_t size) {
16584     AppendBytes(3, data, size);
16585   }
16586   void add_enabled_tags(const std::string& value) {
16587     AppendBytes(4, value.data(), value.size());
16588   }
16589   void add_enabled_tags(const char* data, size_t size) {
16590     AppendBytes(4, data, size);
16591   }
16592 };
16593 
16594 } // Namespace.
16595 } // Namespace.
16596 } // Namespace.
16597 #endif  // Include guard.
16598 // gen_amalgamated begin header: gen/protos/perfetto/config/chrome/chrome_config.pbzero.h
16599 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
16600 
16601 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_CHROME_CHROME_CONFIG_PROTO_H_
16602 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_CHROME_CHROME_CONFIG_PROTO_H_
16603 
16604 #include <stddef.h>
16605 #include <stdint.h>
16606 
16607 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
16608 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
16609 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
16610 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
16611 
16612 namespace perfetto {
16613 namespace protos {
16614 namespace pbzero {
16615 
16616 
16617 class ChromeConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
16618  public:
16619   ChromeConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
16620   explicit ChromeConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
16621   explicit ChromeConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
16622   bool has_trace_config() const { return at<1>().valid(); }
16623   ::protozero::ConstChars trace_config() const { return at<1>().as_string(); }
16624   bool has_privacy_filtering_enabled() const { return at<2>().valid(); }
16625   bool privacy_filtering_enabled() const { return at<2>().as_bool(); }
16626   bool has_convert_to_legacy_json() const { return at<3>().valid(); }
16627   bool convert_to_legacy_json() const { return at<3>().as_bool(); }
16628 };
16629 
16630 class ChromeConfig : public ::protozero::Message {
16631  public:
16632   using Decoder = ChromeConfig_Decoder;
16633   enum : int32_t {
16634     kTraceConfigFieldNumber = 1,
16635     kPrivacyFilteringEnabledFieldNumber = 2,
16636     kConvertToLegacyJsonFieldNumber = 3,
16637   };
16638   void set_trace_config(const std::string& value) {
16639     AppendBytes(1, value.data(), value.size());
16640   }
16641   void set_trace_config(const char* data, size_t size) {
16642     AppendBytes(1, data, size);
16643   }
16644   void set_privacy_filtering_enabled(bool value) {
16645     AppendTinyVarInt(2, value);
16646   }
16647   void set_convert_to_legacy_json(bool value) {
16648     AppendTinyVarInt(3, value);
16649   }
16650 };
16651 
16652 } // Namespace.
16653 } // Namespace.
16654 } // Namespace.
16655 #endif  // Include guard.
16656 // gen_amalgamated begin header: gen/protos/perfetto/config/data_source_config.pbzero.h
16657 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
16658 
16659 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_DATA_SOURCE_CONFIG_PROTO_H_
16660 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_DATA_SOURCE_CONFIG_PROTO_H_
16661 
16662 #include <stddef.h>
16663 #include <stdint.h>
16664 
16665 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
16666 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
16667 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
16668 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
16669 
16670 namespace perfetto {
16671 namespace protos {
16672 namespace pbzero {
16673 
16674 class AndroidLogConfig;
16675 class AndroidPolledStateConfig;
16676 class AndroidPowerConfig;
16677 class ChromeConfig;
16678 class FtraceConfig;
16679 class GpuCounterConfig;
16680 class HeapprofdConfig;
16681 class InodeFileConfig;
16682 class JavaHprofConfig;
16683 class PackagesListConfig;
16684 class PerfEventConfig;
16685 class ProcessStatsConfig;
16686 class SysStatsConfig;
16687 class TestConfig;
16688 class TrackEventConfig;
16689 class VulkanMemoryConfig;
16690 
16691 class DataSourceConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/114, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
16692  public:
16693   DataSourceConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
16694   explicit DataSourceConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
16695   explicit DataSourceConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
16696   bool has_name() const { return at<1>().valid(); }
16697   ::protozero::ConstChars name() const { return at<1>().as_string(); }
16698   bool has_target_buffer() const { return at<2>().valid(); }
16699   uint32_t target_buffer() const { return at<2>().as_uint32(); }
16700   bool has_trace_duration_ms() const { return at<3>().valid(); }
16701   uint32_t trace_duration_ms() const { return at<3>().as_uint32(); }
16702   bool has_stop_timeout_ms() const { return at<7>().valid(); }
16703   uint32_t stop_timeout_ms() const { return at<7>().as_uint32(); }
16704   bool has_enable_extra_guardrails() const { return at<6>().valid(); }
16705   bool enable_extra_guardrails() const { return at<6>().as_bool(); }
16706   bool has_tracing_session_id() const { return at<4>().valid(); }
16707   uint64_t tracing_session_id() const { return at<4>().as_uint64(); }
16708   bool has_ftrace_config() const { return at<100>().valid(); }
16709   ::protozero::ConstBytes ftrace_config() const { return at<100>().as_bytes(); }
16710   bool has_inode_file_config() const { return at<102>().valid(); }
16711   ::protozero::ConstBytes inode_file_config() const { return at<102>().as_bytes(); }
16712   bool has_process_stats_config() const { return at<103>().valid(); }
16713   ::protozero::ConstBytes process_stats_config() const { return at<103>().as_bytes(); }
16714   bool has_sys_stats_config() const { return at<104>().valid(); }
16715   ::protozero::ConstBytes sys_stats_config() const { return at<104>().as_bytes(); }
16716   bool has_heapprofd_config() const { return at<105>().valid(); }
16717   ::protozero::ConstBytes heapprofd_config() const { return at<105>().as_bytes(); }
16718   bool has_java_hprof_config() const { return at<110>().valid(); }
16719   ::protozero::ConstBytes java_hprof_config() const { return at<110>().as_bytes(); }
16720   bool has_android_power_config() const { return at<106>().valid(); }
16721   ::protozero::ConstBytes android_power_config() const { return at<106>().as_bytes(); }
16722   bool has_android_log_config() const { return at<107>().valid(); }
16723   ::protozero::ConstBytes android_log_config() const { return at<107>().as_bytes(); }
16724   bool has_gpu_counter_config() const { return at<108>().valid(); }
16725   ::protozero::ConstBytes gpu_counter_config() const { return at<108>().as_bytes(); }
16726   bool has_packages_list_config() const { return at<109>().valid(); }
16727   ::protozero::ConstBytes packages_list_config() const { return at<109>().as_bytes(); }
16728   bool has_perf_event_config() const { return at<111>().valid(); }
16729   ::protozero::ConstBytes perf_event_config() const { return at<111>().as_bytes(); }
16730   bool has_vulkan_memory_config() const { return at<112>().valid(); }
16731   ::protozero::ConstBytes vulkan_memory_config() const { return at<112>().as_bytes(); }
16732   bool has_track_event_config() const { return at<113>().valid(); }
16733   ::protozero::ConstBytes track_event_config() const { return at<113>().as_bytes(); }
16734   bool has_android_polled_state_config() const { return at<114>().valid(); }
16735   ::protozero::ConstBytes android_polled_state_config() const { return at<114>().as_bytes(); }
16736   bool has_chrome_config() const { return at<101>().valid(); }
16737   ::protozero::ConstBytes chrome_config() const { return at<101>().as_bytes(); }
16738   // field legacy_config omitted because its id is too high
16739   // field for_testing omitted because its id is too high
16740 };
16741 
16742 class DataSourceConfig : public ::protozero::Message {
16743  public:
16744   using Decoder = DataSourceConfig_Decoder;
16745   enum : int32_t {
16746     kNameFieldNumber = 1,
16747     kTargetBufferFieldNumber = 2,
16748     kTraceDurationMsFieldNumber = 3,
16749     kStopTimeoutMsFieldNumber = 7,
16750     kEnableExtraGuardrailsFieldNumber = 6,
16751     kTracingSessionIdFieldNumber = 4,
16752     kFtraceConfigFieldNumber = 100,
16753     kInodeFileConfigFieldNumber = 102,
16754     kProcessStatsConfigFieldNumber = 103,
16755     kSysStatsConfigFieldNumber = 104,
16756     kHeapprofdConfigFieldNumber = 105,
16757     kJavaHprofConfigFieldNumber = 110,
16758     kAndroidPowerConfigFieldNumber = 106,
16759     kAndroidLogConfigFieldNumber = 107,
16760     kGpuCounterConfigFieldNumber = 108,
16761     kPackagesListConfigFieldNumber = 109,
16762     kPerfEventConfigFieldNumber = 111,
16763     kVulkanMemoryConfigFieldNumber = 112,
16764     kTrackEventConfigFieldNumber = 113,
16765     kAndroidPolledStateConfigFieldNumber = 114,
16766     kChromeConfigFieldNumber = 101,
16767     kLegacyConfigFieldNumber = 1000,
16768     kForTestingFieldNumber = 1001,
16769   };
16770   void set_name(const std::string& value) {
16771     AppendBytes(1, value.data(), value.size());
16772   }
16773   void set_name(const char* data, size_t size) {
16774     AppendBytes(1, data, size);
16775   }
16776   void set_target_buffer(uint32_t value) {
16777     AppendVarInt(2, value);
16778   }
16779   void set_trace_duration_ms(uint32_t value) {
16780     AppendVarInt(3, value);
16781   }
16782   void set_stop_timeout_ms(uint32_t value) {
16783     AppendVarInt(7, value);
16784   }
16785   void set_enable_extra_guardrails(bool value) {
16786     AppendTinyVarInt(6, value);
16787   }
16788   void set_tracing_session_id(uint64_t value) {
16789     AppendVarInt(4, value);
16790   }
16791   template <typename T = FtraceConfig> T* set_ftrace_config() {
16792     return BeginNestedMessage<T>(100);
16793   }
16794 
16795   void set_ftrace_config_raw(const std::string& raw) {
16796     return AppendBytes(100, raw.data(), raw.size());
16797   }
16798 
16799   template <typename T = InodeFileConfig> T* set_inode_file_config() {
16800     return BeginNestedMessage<T>(102);
16801   }
16802 
16803   void set_inode_file_config_raw(const std::string& raw) {
16804     return AppendBytes(102, raw.data(), raw.size());
16805   }
16806 
16807   template <typename T = ProcessStatsConfig> T* set_process_stats_config() {
16808     return BeginNestedMessage<T>(103);
16809   }
16810 
16811   void set_process_stats_config_raw(const std::string& raw) {
16812     return AppendBytes(103, raw.data(), raw.size());
16813   }
16814 
16815   template <typename T = SysStatsConfig> T* set_sys_stats_config() {
16816     return BeginNestedMessage<T>(104);
16817   }
16818 
16819   void set_sys_stats_config_raw(const std::string& raw) {
16820     return AppendBytes(104, raw.data(), raw.size());
16821   }
16822 
16823   template <typename T = HeapprofdConfig> T* set_heapprofd_config() {
16824     return BeginNestedMessage<T>(105);
16825   }
16826 
16827   void set_heapprofd_config_raw(const std::string& raw) {
16828     return AppendBytes(105, raw.data(), raw.size());
16829   }
16830 
16831   template <typename T = JavaHprofConfig> T* set_java_hprof_config() {
16832     return BeginNestedMessage<T>(110);
16833   }
16834 
16835   void set_java_hprof_config_raw(const std::string& raw) {
16836     return AppendBytes(110, raw.data(), raw.size());
16837   }
16838 
16839   template <typename T = AndroidPowerConfig> T* set_android_power_config() {
16840     return BeginNestedMessage<T>(106);
16841   }
16842 
16843   void set_android_power_config_raw(const std::string& raw) {
16844     return AppendBytes(106, raw.data(), raw.size());
16845   }
16846 
16847   template <typename T = AndroidLogConfig> T* set_android_log_config() {
16848     return BeginNestedMessage<T>(107);
16849   }
16850 
16851   void set_android_log_config_raw(const std::string& raw) {
16852     return AppendBytes(107, raw.data(), raw.size());
16853   }
16854 
16855   template <typename T = GpuCounterConfig> T* set_gpu_counter_config() {
16856     return BeginNestedMessage<T>(108);
16857   }
16858 
16859   void set_gpu_counter_config_raw(const std::string& raw) {
16860     return AppendBytes(108, raw.data(), raw.size());
16861   }
16862 
16863   template <typename T = PackagesListConfig> T* set_packages_list_config() {
16864     return BeginNestedMessage<T>(109);
16865   }
16866 
16867   void set_packages_list_config_raw(const std::string& raw) {
16868     return AppendBytes(109, raw.data(), raw.size());
16869   }
16870 
16871   template <typename T = PerfEventConfig> T* set_perf_event_config() {
16872     return BeginNestedMessage<T>(111);
16873   }
16874 
16875   void set_perf_event_config_raw(const std::string& raw) {
16876     return AppendBytes(111, raw.data(), raw.size());
16877   }
16878 
16879   template <typename T = VulkanMemoryConfig> T* set_vulkan_memory_config() {
16880     return BeginNestedMessage<T>(112);
16881   }
16882 
16883   void set_vulkan_memory_config_raw(const std::string& raw) {
16884     return AppendBytes(112, raw.data(), raw.size());
16885   }
16886 
16887   template <typename T = TrackEventConfig> T* set_track_event_config() {
16888     return BeginNestedMessage<T>(113);
16889   }
16890 
16891   void set_track_event_config_raw(const std::string& raw) {
16892     return AppendBytes(113, raw.data(), raw.size());
16893   }
16894 
16895   template <typename T = AndroidPolledStateConfig> T* set_android_polled_state_config() {
16896     return BeginNestedMessage<T>(114);
16897   }
16898 
16899   void set_android_polled_state_config_raw(const std::string& raw) {
16900     return AppendBytes(114, raw.data(), raw.size());
16901   }
16902 
16903   template <typename T = ChromeConfig> T* set_chrome_config() {
16904     return BeginNestedMessage<T>(101);
16905   }
16906 
16907   void set_legacy_config(const std::string& value) {
16908     AppendBytes(1000, value.data(), value.size());
16909   }
16910   void set_legacy_config(const char* data, size_t size) {
16911     AppendBytes(1000, data, size);
16912   }
16913   template <typename T = TestConfig> T* set_for_testing() {
16914     return BeginNestedMessage<T>(1001);
16915   }
16916 
16917 };
16918 
16919 } // Namespace.
16920 } // Namespace.
16921 } // Namespace.
16922 #endif  // Include guard.
16923 // gen_amalgamated begin header: gen/protos/perfetto/config/stress_test_config.pbzero.h
16924 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
16925 
16926 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_STRESS_TEST_CONFIG_PROTO_H_
16927 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_STRESS_TEST_CONFIG_PROTO_H_
16928 
16929 #include <stddef.h>
16930 #include <stdint.h>
16931 
16932 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
16933 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
16934 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
16935 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
16936 
16937 namespace perfetto {
16938 namespace protos {
16939 namespace pbzero {
16940 
16941 class StressTestConfig_WriterTiming;
16942 class TraceConfig;
16943 
16944 class StressTestConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/11, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
16945  public:
16946   StressTestConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
16947   explicit StressTestConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
16948   explicit StressTestConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
16949   bool has_trace_config() const { return at<1>().valid(); }
16950   ::protozero::ConstBytes trace_config() const { return at<1>().as_bytes(); }
16951   bool has_shmem_size_kb() const { return at<2>().valid(); }
16952   uint32_t shmem_size_kb() const { return at<2>().as_uint32(); }
16953   bool has_shmem_page_size_kb() const { return at<3>().valid(); }
16954   uint32_t shmem_page_size_kb() const { return at<3>().as_uint32(); }
16955   bool has_num_processes() const { return at<4>().valid(); }
16956   uint32_t num_processes() const { return at<4>().as_uint32(); }
16957   bool has_num_threads() const { return at<5>().valid(); }
16958   uint32_t num_threads() const { return at<5>().as_uint32(); }
16959   bool has_max_events() const { return at<6>().valid(); }
16960   uint32_t max_events() const { return at<6>().as_uint32(); }
16961   bool has_nesting() const { return at<7>().valid(); }
16962   uint32_t nesting() const { return at<7>().as_uint32(); }
16963   bool has_steady_state_timings() const { return at<8>().valid(); }
16964   ::protozero::ConstBytes steady_state_timings() const { return at<8>().as_bytes(); }
16965   bool has_burst_period_ms() const { return at<9>().valid(); }
16966   uint32_t burst_period_ms() const { return at<9>().as_uint32(); }
16967   bool has_burst_duration_ms() const { return at<10>().valid(); }
16968   uint32_t burst_duration_ms() const { return at<10>().as_uint32(); }
16969   bool has_burst_timings() const { return at<11>().valid(); }
16970   ::protozero::ConstBytes burst_timings() const { return at<11>().as_bytes(); }
16971 };
16972 
16973 class StressTestConfig : public ::protozero::Message {
16974  public:
16975   using Decoder = StressTestConfig_Decoder;
16976   enum : int32_t {
16977     kTraceConfigFieldNumber = 1,
16978     kShmemSizeKbFieldNumber = 2,
16979     kShmemPageSizeKbFieldNumber = 3,
16980     kNumProcessesFieldNumber = 4,
16981     kNumThreadsFieldNumber = 5,
16982     kMaxEventsFieldNumber = 6,
16983     kNestingFieldNumber = 7,
16984     kSteadyStateTimingsFieldNumber = 8,
16985     kBurstPeriodMsFieldNumber = 9,
16986     kBurstDurationMsFieldNumber = 10,
16987     kBurstTimingsFieldNumber = 11,
16988   };
16989   using WriterTiming = ::perfetto::protos::pbzero::StressTestConfig_WriterTiming;
16990   template <typename T = TraceConfig> T* set_trace_config() {
16991     return BeginNestedMessage<T>(1);
16992   }
16993 
16994   void set_shmem_size_kb(uint32_t value) {
16995     AppendVarInt(2, value);
16996   }
16997   void set_shmem_page_size_kb(uint32_t value) {
16998     AppendVarInt(3, value);
16999   }
17000   void set_num_processes(uint32_t value) {
17001     AppendVarInt(4, value);
17002   }
17003   void set_num_threads(uint32_t value) {
17004     AppendVarInt(5, value);
17005   }
17006   void set_max_events(uint32_t value) {
17007     AppendVarInt(6, value);
17008   }
17009   void set_nesting(uint32_t value) {
17010     AppendVarInt(7, value);
17011   }
17012   template <typename T = StressTestConfig_WriterTiming> T* set_steady_state_timings() {
17013     return BeginNestedMessage<T>(8);
17014   }
17015 
17016   void set_burst_period_ms(uint32_t value) {
17017     AppendVarInt(9, value);
17018   }
17019   void set_burst_duration_ms(uint32_t value) {
17020     AppendVarInt(10, value);
17021   }
17022   template <typename T = StressTestConfig_WriterTiming> T* set_burst_timings() {
17023     return BeginNestedMessage<T>(11);
17024   }
17025 
17026 };
17027 
17028 class StressTestConfig_WriterTiming_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
17029  public:
17030   StressTestConfig_WriterTiming_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
17031   explicit StressTestConfig_WriterTiming_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
17032   explicit StressTestConfig_WriterTiming_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
17033   bool has_payload_mean() const { return at<1>().valid(); }
17034   double payload_mean() const { return at<1>().as_double(); }
17035   bool has_payload_stddev() const { return at<2>().valid(); }
17036   double payload_stddev() const { return at<2>().as_double(); }
17037   bool has_rate_mean() const { return at<3>().valid(); }
17038   double rate_mean() const { return at<3>().as_double(); }
17039   bool has_rate_stddev() const { return at<4>().valid(); }
17040   double rate_stddev() const { return at<4>().as_double(); }
17041   bool has_payload_write_time_ms() const { return at<5>().valid(); }
17042   uint32_t payload_write_time_ms() const { return at<5>().as_uint32(); }
17043 };
17044 
17045 class StressTestConfig_WriterTiming : public ::protozero::Message {
17046  public:
17047   using Decoder = StressTestConfig_WriterTiming_Decoder;
17048   enum : int32_t {
17049     kPayloadMeanFieldNumber = 1,
17050     kPayloadStddevFieldNumber = 2,
17051     kRateMeanFieldNumber = 3,
17052     kRateStddevFieldNumber = 4,
17053     kPayloadWriteTimeMsFieldNumber = 5,
17054   };
17055   void set_payload_mean(double value) {
17056     AppendFixed(1, value);
17057   }
17058   void set_payload_stddev(double value) {
17059     AppendFixed(2, value);
17060   }
17061   void set_rate_mean(double value) {
17062     AppendFixed(3, value);
17063   }
17064   void set_rate_stddev(double value) {
17065     AppendFixed(4, value);
17066   }
17067   void set_payload_write_time_ms(uint32_t value) {
17068     AppendVarInt(5, value);
17069   }
17070 };
17071 
17072 } // Namespace.
17073 } // Namespace.
17074 } // Namespace.
17075 #endif  // Include guard.
17076 // gen_amalgamated begin header: gen/protos/perfetto/config/test_config.pbzero.h
17077 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
17078 
17079 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TEST_CONFIG_PROTO_H_
17080 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TEST_CONFIG_PROTO_H_
17081 
17082 #include <stddef.h>
17083 #include <stdint.h>
17084 
17085 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
17086 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
17087 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
17088 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
17089 
17090 namespace perfetto {
17091 namespace protos {
17092 namespace pbzero {
17093 
17094 class TestConfig_DummyFields;
17095 
17096 class TestConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
17097  public:
17098   TestConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
17099   explicit TestConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
17100   explicit TestConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
17101   bool has_message_count() const { return at<1>().valid(); }
17102   uint32_t message_count() const { return at<1>().as_uint32(); }
17103   bool has_max_messages_per_second() const { return at<2>().valid(); }
17104   uint32_t max_messages_per_second() const { return at<2>().as_uint32(); }
17105   bool has_seed() const { return at<3>().valid(); }
17106   uint32_t seed() const { return at<3>().as_uint32(); }
17107   bool has_message_size() const { return at<4>().valid(); }
17108   uint32_t message_size() const { return at<4>().as_uint32(); }
17109   bool has_send_batch_on_register() const { return at<5>().valid(); }
17110   bool send_batch_on_register() const { return at<5>().as_bool(); }
17111   bool has_dummy_fields() const { return at<6>().valid(); }
17112   ::protozero::ConstBytes dummy_fields() const { return at<6>().as_bytes(); }
17113 };
17114 
17115 class TestConfig : public ::protozero::Message {
17116  public:
17117   using Decoder = TestConfig_Decoder;
17118   enum : int32_t {
17119     kMessageCountFieldNumber = 1,
17120     kMaxMessagesPerSecondFieldNumber = 2,
17121     kSeedFieldNumber = 3,
17122     kMessageSizeFieldNumber = 4,
17123     kSendBatchOnRegisterFieldNumber = 5,
17124     kDummyFieldsFieldNumber = 6,
17125   };
17126   using DummyFields = ::perfetto::protos::pbzero::TestConfig_DummyFields;
17127   void set_message_count(uint32_t value) {
17128     AppendVarInt(1, value);
17129   }
17130   void set_max_messages_per_second(uint32_t value) {
17131     AppendVarInt(2, value);
17132   }
17133   void set_seed(uint32_t value) {
17134     AppendVarInt(3, value);
17135   }
17136   void set_message_size(uint32_t value) {
17137     AppendVarInt(4, value);
17138   }
17139   void set_send_batch_on_register(bool value) {
17140     AppendTinyVarInt(5, value);
17141   }
17142   template <typename T = TestConfig_DummyFields> T* set_dummy_fields() {
17143     return BeginNestedMessage<T>(6);
17144   }
17145 
17146 };
17147 
17148 class TestConfig_DummyFields_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/14, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
17149  public:
17150   TestConfig_DummyFields_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
17151   explicit TestConfig_DummyFields_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
17152   explicit TestConfig_DummyFields_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
17153   bool has_field_uint32() const { return at<1>().valid(); }
17154   uint32_t field_uint32() const { return at<1>().as_uint32(); }
17155   bool has_field_int32() const { return at<2>().valid(); }
17156   int32_t field_int32() const { return at<2>().as_int32(); }
17157   bool has_field_uint64() const { return at<3>().valid(); }
17158   uint64_t field_uint64() const { return at<3>().as_uint64(); }
17159   bool has_field_int64() const { return at<4>().valid(); }
17160   int64_t field_int64() const { return at<4>().as_int64(); }
17161   bool has_field_fixed64() const { return at<5>().valid(); }
17162   uint64_t field_fixed64() const { return at<5>().as_uint64(); }
17163   bool has_field_sfixed64() const { return at<6>().valid(); }
17164   int64_t field_sfixed64() const { return at<6>().as_int64(); }
17165   bool has_field_fixed32() const { return at<7>().valid(); }
17166   uint32_t field_fixed32() const { return at<7>().as_uint32(); }
17167   bool has_field_sfixed32() const { return at<8>().valid(); }
17168   int32_t field_sfixed32() const { return at<8>().as_int32(); }
17169   bool has_field_double() const { return at<9>().valid(); }
17170   double field_double() const { return at<9>().as_double(); }
17171   bool has_field_float() const { return at<10>().valid(); }
17172   float field_float() const { return at<10>().as_float(); }
17173   bool has_field_sint64() const { return at<11>().valid(); }
17174   int64_t field_sint64() const { return at<11>().as_int64(); }
17175   bool has_field_sint32() const { return at<12>().valid(); }
17176   int32_t field_sint32() const { return at<12>().as_int32(); }
17177   bool has_field_string() const { return at<13>().valid(); }
17178   ::protozero::ConstChars field_string() const { return at<13>().as_string(); }
17179   bool has_field_bytes() const { return at<14>().valid(); }
17180   ::protozero::ConstBytes field_bytes() const { return at<14>().as_bytes(); }
17181 };
17182 
17183 class TestConfig_DummyFields : public ::protozero::Message {
17184  public:
17185   using Decoder = TestConfig_DummyFields_Decoder;
17186   enum : int32_t {
17187     kFieldUint32FieldNumber = 1,
17188     kFieldInt32FieldNumber = 2,
17189     kFieldUint64FieldNumber = 3,
17190     kFieldInt64FieldNumber = 4,
17191     kFieldFixed64FieldNumber = 5,
17192     kFieldSfixed64FieldNumber = 6,
17193     kFieldFixed32FieldNumber = 7,
17194     kFieldSfixed32FieldNumber = 8,
17195     kFieldDoubleFieldNumber = 9,
17196     kFieldFloatFieldNumber = 10,
17197     kFieldSint64FieldNumber = 11,
17198     kFieldSint32FieldNumber = 12,
17199     kFieldStringFieldNumber = 13,
17200     kFieldBytesFieldNumber = 14,
17201   };
17202   void set_field_uint32(uint32_t value) {
17203     AppendVarInt(1, value);
17204   }
17205   void set_field_int32(int32_t value) {
17206     AppendVarInt(2, value);
17207   }
17208   void set_field_uint64(uint64_t value) {
17209     AppendVarInt(3, value);
17210   }
17211   void set_field_int64(int64_t value) {
17212     AppendVarInt(4, value);
17213   }
17214   void set_field_fixed64(uint64_t value) {
17215     AppendFixed(5, value);
17216   }
17217   void set_field_sfixed64(int64_t value) {
17218     AppendFixed(6, value);
17219   }
17220   void set_field_fixed32(uint32_t value) {
17221     AppendFixed(7, value);
17222   }
17223   void set_field_sfixed32(int32_t value) {
17224     AppendFixed(8, value);
17225   }
17226   void set_field_double(double value) {
17227     AppendFixed(9, value);
17228   }
17229   void set_field_float(float value) {
17230     AppendFixed(10, value);
17231   }
17232   void set_field_sint64(int64_t value) {
17233     AppendSignedVarInt(11, value);
17234   }
17235   void set_field_sint32(int32_t value) {
17236     AppendSignedVarInt(12, value);
17237   }
17238   void set_field_string(const std::string& value) {
17239     AppendBytes(13, value.data(), value.size());
17240   }
17241   void set_field_string(const char* data, size_t size) {
17242     AppendBytes(13, data, size);
17243   }
17244   void set_field_bytes(const std::string& value) {
17245     AppendBytes(14, value.data(), value.size());
17246   }
17247   void set_field_bytes(const uint8_t* data, size_t size) {
17248     AppendBytes(14, data, size);
17249   }
17250 };
17251 
17252 } // Namespace.
17253 } // Namespace.
17254 } // Namespace.
17255 #endif  // Include guard.
17256 // gen_amalgamated begin header: gen/protos/perfetto/config/trace_config.pbzero.h
17257 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
17258 
17259 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TRACE_CONFIG_PROTO_H_
17260 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TRACE_CONFIG_PROTO_H_
17261 
17262 #include <stddef.h>
17263 #include <stdint.h>
17264 
17265 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
17266 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
17267 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
17268 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
17269 
17270 namespace perfetto {
17271 namespace protos {
17272 namespace pbzero {
17273 
17274 class DataSourceConfig;
17275 class TraceConfig_BufferConfig;
17276 class TraceConfig_BuiltinDataSource;
17277 class TraceConfig_DataSource;
17278 class TraceConfig_GuardrailOverrides;
17279 class TraceConfig_IncidentReportConfig;
17280 class TraceConfig_IncrementalStateConfig;
17281 class TraceConfig_ProducerConfig;
17282 class TraceConfig_StatsdMetadata;
17283 class TraceConfig_TriggerConfig;
17284 class TraceConfig_TriggerConfig_Trigger;
17285 enum BuiltinClock : int32_t;
17286 enum TraceConfig_BufferConfig_FillPolicy : int32_t;
17287 enum TraceConfig_CompressionType : int32_t;
17288 enum TraceConfig_LockdownModeOperation : int32_t;
17289 enum TraceConfig_TriggerConfig_TriggerMode : int32_t;
17290 
17291 enum TraceConfig_LockdownModeOperation : int32_t {
17292   TraceConfig_LockdownModeOperation_LOCKDOWN_UNCHANGED = 0,
17293   TraceConfig_LockdownModeOperation_LOCKDOWN_CLEAR = 1,
17294   TraceConfig_LockdownModeOperation_LOCKDOWN_SET = 2,
17295 };
17296 
17297 const TraceConfig_LockdownModeOperation TraceConfig_LockdownModeOperation_MIN = TraceConfig_LockdownModeOperation_LOCKDOWN_UNCHANGED;
17298 const TraceConfig_LockdownModeOperation TraceConfig_LockdownModeOperation_MAX = TraceConfig_LockdownModeOperation_LOCKDOWN_SET;
17299 
17300 enum TraceConfig_CompressionType : int32_t {
17301   TraceConfig_CompressionType_COMPRESSION_TYPE_UNSPECIFIED = 0,
17302   TraceConfig_CompressionType_COMPRESSION_TYPE_DEFLATE = 1,
17303 };
17304 
17305 const TraceConfig_CompressionType TraceConfig_CompressionType_MIN = TraceConfig_CompressionType_COMPRESSION_TYPE_UNSPECIFIED;
17306 const TraceConfig_CompressionType TraceConfig_CompressionType_MAX = TraceConfig_CompressionType_COMPRESSION_TYPE_DEFLATE;
17307 
17308 enum TraceConfig_TriggerConfig_TriggerMode : int32_t {
17309   TraceConfig_TriggerConfig_TriggerMode_UNSPECIFIED = 0,
17310   TraceConfig_TriggerConfig_TriggerMode_START_TRACING = 1,
17311   TraceConfig_TriggerConfig_TriggerMode_STOP_TRACING = 2,
17312 };
17313 
17314 const TraceConfig_TriggerConfig_TriggerMode TraceConfig_TriggerConfig_TriggerMode_MIN = TraceConfig_TriggerConfig_TriggerMode_UNSPECIFIED;
17315 const TraceConfig_TriggerConfig_TriggerMode TraceConfig_TriggerConfig_TriggerMode_MAX = TraceConfig_TriggerConfig_TriggerMode_STOP_TRACING;
17316 
17317 enum TraceConfig_BufferConfig_FillPolicy : int32_t {
17318   TraceConfig_BufferConfig_FillPolicy_UNSPECIFIED = 0,
17319   TraceConfig_BufferConfig_FillPolicy_RING_BUFFER = 1,
17320   TraceConfig_BufferConfig_FillPolicy_DISCARD = 2,
17321 };
17322 
17323 const TraceConfig_BufferConfig_FillPolicy TraceConfig_BufferConfig_FillPolicy_MIN = TraceConfig_BufferConfig_FillPolicy_UNSPECIFIED;
17324 const TraceConfig_BufferConfig_FillPolicy TraceConfig_BufferConfig_FillPolicy_MAX = TraceConfig_BufferConfig_FillPolicy_DISCARD;
17325 
17326 class TraceConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/29, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
17327  public:
17328   TraceConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
17329   explicit TraceConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
17330   explicit TraceConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
17331   bool has_buffers() const { return at<1>().valid(); }
17332   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> buffers() const { return GetRepeated<::protozero::ConstBytes>(1); }
17333   bool has_data_sources() const { return at<2>().valid(); }
17334   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> data_sources() const { return GetRepeated<::protozero::ConstBytes>(2); }
17335   bool has_builtin_data_sources() const { return at<20>().valid(); }
17336   ::protozero::ConstBytes builtin_data_sources() const { return at<20>().as_bytes(); }
17337   bool has_duration_ms() const { return at<3>().valid(); }
17338   uint32_t duration_ms() const { return at<3>().as_uint32(); }
17339   bool has_enable_extra_guardrails() const { return at<4>().valid(); }
17340   bool enable_extra_guardrails() const { return at<4>().as_bool(); }
17341   bool has_lockdown_mode() const { return at<5>().valid(); }
17342   int32_t lockdown_mode() const { return at<5>().as_int32(); }
17343   bool has_producers() const { return at<6>().valid(); }
17344   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> producers() const { return GetRepeated<::protozero::ConstBytes>(6); }
17345   bool has_statsd_metadata() const { return at<7>().valid(); }
17346   ::protozero::ConstBytes statsd_metadata() const { return at<7>().as_bytes(); }
17347   bool has_write_into_file() const { return at<8>().valid(); }
17348   bool write_into_file() const { return at<8>().as_bool(); }
17349   bool has_output_path() const { return at<29>().valid(); }
17350   ::protozero::ConstChars output_path() const { return at<29>().as_string(); }
17351   bool has_file_write_period_ms() const { return at<9>().valid(); }
17352   uint32_t file_write_period_ms() const { return at<9>().as_uint32(); }
17353   bool has_max_file_size_bytes() const { return at<10>().valid(); }
17354   uint64_t max_file_size_bytes() const { return at<10>().as_uint64(); }
17355   bool has_guardrail_overrides() const { return at<11>().valid(); }
17356   ::protozero::ConstBytes guardrail_overrides() const { return at<11>().as_bytes(); }
17357   bool has_deferred_start() const { return at<12>().valid(); }
17358   bool deferred_start() const { return at<12>().as_bool(); }
17359   bool has_flush_period_ms() const { return at<13>().valid(); }
17360   uint32_t flush_period_ms() const { return at<13>().as_uint32(); }
17361   bool has_flush_timeout_ms() const { return at<14>().valid(); }
17362   uint32_t flush_timeout_ms() const { return at<14>().as_uint32(); }
17363   bool has_data_source_stop_timeout_ms() const { return at<23>().valid(); }
17364   uint32_t data_source_stop_timeout_ms() const { return at<23>().as_uint32(); }
17365   bool has_notify_traceur() const { return at<16>().valid(); }
17366   bool notify_traceur() const { return at<16>().as_bool(); }
17367   bool has_trigger_config() const { return at<17>().valid(); }
17368   ::protozero::ConstBytes trigger_config() const { return at<17>().as_bytes(); }
17369   bool has_activate_triggers() const { return at<18>().valid(); }
17370   ::protozero::RepeatedFieldIterator<::protozero::ConstChars> activate_triggers() const { return GetRepeated<::protozero::ConstChars>(18); }
17371   bool has_incremental_state_config() const { return at<21>().valid(); }
17372   ::protozero::ConstBytes incremental_state_config() const { return at<21>().as_bytes(); }
17373   bool has_allow_user_build_tracing() const { return at<19>().valid(); }
17374   bool allow_user_build_tracing() const { return at<19>().as_bool(); }
17375   bool has_unique_session_name() const { return at<22>().valid(); }
17376   ::protozero::ConstChars unique_session_name() const { return at<22>().as_string(); }
17377   bool has_compression_type() const { return at<24>().valid(); }
17378   int32_t compression_type() const { return at<24>().as_int32(); }
17379   bool has_incident_report_config() const { return at<25>().valid(); }
17380   ::protozero::ConstBytes incident_report_config() const { return at<25>().as_bytes(); }
17381   bool has_trace_uuid_msb() const { return at<27>().valid(); }
17382   int64_t trace_uuid_msb() const { return at<27>().as_int64(); }
17383   bool has_trace_uuid_lsb() const { return at<28>().valid(); }
17384   int64_t trace_uuid_lsb() const { return at<28>().as_int64(); }
17385 };
17386 
17387 class TraceConfig : public ::protozero::Message {
17388  public:
17389   using Decoder = TraceConfig_Decoder;
17390   enum : int32_t {
17391     kBuffersFieldNumber = 1,
17392     kDataSourcesFieldNumber = 2,
17393     kBuiltinDataSourcesFieldNumber = 20,
17394     kDurationMsFieldNumber = 3,
17395     kEnableExtraGuardrailsFieldNumber = 4,
17396     kLockdownModeFieldNumber = 5,
17397     kProducersFieldNumber = 6,
17398     kStatsdMetadataFieldNumber = 7,
17399     kWriteIntoFileFieldNumber = 8,
17400     kOutputPathFieldNumber = 29,
17401     kFileWritePeriodMsFieldNumber = 9,
17402     kMaxFileSizeBytesFieldNumber = 10,
17403     kGuardrailOverridesFieldNumber = 11,
17404     kDeferredStartFieldNumber = 12,
17405     kFlushPeriodMsFieldNumber = 13,
17406     kFlushTimeoutMsFieldNumber = 14,
17407     kDataSourceStopTimeoutMsFieldNumber = 23,
17408     kNotifyTraceurFieldNumber = 16,
17409     kTriggerConfigFieldNumber = 17,
17410     kActivateTriggersFieldNumber = 18,
17411     kIncrementalStateConfigFieldNumber = 21,
17412     kAllowUserBuildTracingFieldNumber = 19,
17413     kUniqueSessionNameFieldNumber = 22,
17414     kCompressionTypeFieldNumber = 24,
17415     kIncidentReportConfigFieldNumber = 25,
17416     kTraceUuidMsbFieldNumber = 27,
17417     kTraceUuidLsbFieldNumber = 28,
17418   };
17419   using BufferConfig = ::perfetto::protos::pbzero::TraceConfig_BufferConfig;
17420   using DataSource = ::perfetto::protos::pbzero::TraceConfig_DataSource;
17421   using BuiltinDataSource = ::perfetto::protos::pbzero::TraceConfig_BuiltinDataSource;
17422   using ProducerConfig = ::perfetto::protos::pbzero::TraceConfig_ProducerConfig;
17423   using StatsdMetadata = ::perfetto::protos::pbzero::TraceConfig_StatsdMetadata;
17424   using GuardrailOverrides = ::perfetto::protos::pbzero::TraceConfig_GuardrailOverrides;
17425   using TriggerConfig = ::perfetto::protos::pbzero::TraceConfig_TriggerConfig;
17426   using IncrementalStateConfig = ::perfetto::protos::pbzero::TraceConfig_IncrementalStateConfig;
17427   using IncidentReportConfig = ::perfetto::protos::pbzero::TraceConfig_IncidentReportConfig;
17428   using LockdownModeOperation = ::perfetto::protos::pbzero::TraceConfig_LockdownModeOperation;
17429   using CompressionType = ::perfetto::protos::pbzero::TraceConfig_CompressionType;
17430   static const LockdownModeOperation LOCKDOWN_UNCHANGED = TraceConfig_LockdownModeOperation_LOCKDOWN_UNCHANGED;
17431   static const LockdownModeOperation LOCKDOWN_CLEAR = TraceConfig_LockdownModeOperation_LOCKDOWN_CLEAR;
17432   static const LockdownModeOperation LOCKDOWN_SET = TraceConfig_LockdownModeOperation_LOCKDOWN_SET;
17433   static const CompressionType COMPRESSION_TYPE_UNSPECIFIED = TraceConfig_CompressionType_COMPRESSION_TYPE_UNSPECIFIED;
17434   static const CompressionType COMPRESSION_TYPE_DEFLATE = TraceConfig_CompressionType_COMPRESSION_TYPE_DEFLATE;
17435   template <typename T = TraceConfig_BufferConfig> T* add_buffers() {
17436     return BeginNestedMessage<T>(1);
17437   }
17438 
17439   template <typename T = TraceConfig_DataSource> T* add_data_sources() {
17440     return BeginNestedMessage<T>(2);
17441   }
17442 
17443   template <typename T = TraceConfig_BuiltinDataSource> T* set_builtin_data_sources() {
17444     return BeginNestedMessage<T>(20);
17445   }
17446 
17447   void set_duration_ms(uint32_t value) {
17448     AppendVarInt(3, value);
17449   }
17450   void set_enable_extra_guardrails(bool value) {
17451     AppendTinyVarInt(4, value);
17452   }
17453   void set_lockdown_mode(::perfetto::protos::pbzero::TraceConfig_LockdownModeOperation value) {
17454     AppendTinyVarInt(5, value);
17455   }
17456   template <typename T = TraceConfig_ProducerConfig> T* add_producers() {
17457     return BeginNestedMessage<T>(6);
17458   }
17459 
17460   template <typename T = TraceConfig_StatsdMetadata> T* set_statsd_metadata() {
17461     return BeginNestedMessage<T>(7);
17462   }
17463 
17464   void set_write_into_file(bool value) {
17465     AppendTinyVarInt(8, value);
17466   }
17467   void set_output_path(const std::string& value) {
17468     AppendBytes(29, value.data(), value.size());
17469   }
17470   void set_output_path(const char* data, size_t size) {
17471     AppendBytes(29, data, size);
17472   }
17473   void set_file_write_period_ms(uint32_t value) {
17474     AppendVarInt(9, value);
17475   }
17476   void set_max_file_size_bytes(uint64_t value) {
17477     AppendVarInt(10, value);
17478   }
17479   template <typename T = TraceConfig_GuardrailOverrides> T* set_guardrail_overrides() {
17480     return BeginNestedMessage<T>(11);
17481   }
17482 
17483   void set_deferred_start(bool value) {
17484     AppendTinyVarInt(12, value);
17485   }
17486   void set_flush_period_ms(uint32_t value) {
17487     AppendVarInt(13, value);
17488   }
17489   void set_flush_timeout_ms(uint32_t value) {
17490     AppendVarInt(14, value);
17491   }
17492   void set_data_source_stop_timeout_ms(uint32_t value) {
17493     AppendVarInt(23, value);
17494   }
17495   void set_notify_traceur(bool value) {
17496     AppendTinyVarInt(16, value);
17497   }
17498   template <typename T = TraceConfig_TriggerConfig> T* set_trigger_config() {
17499     return BeginNestedMessage<T>(17);
17500   }
17501 
17502   void add_activate_triggers(const std::string& value) {
17503     AppendBytes(18, value.data(), value.size());
17504   }
17505   void add_activate_triggers(const char* data, size_t size) {
17506     AppendBytes(18, data, size);
17507   }
17508   template <typename T = TraceConfig_IncrementalStateConfig> T* set_incremental_state_config() {
17509     return BeginNestedMessage<T>(21);
17510   }
17511 
17512   void set_allow_user_build_tracing(bool value) {
17513     AppendTinyVarInt(19, value);
17514   }
17515   void set_unique_session_name(const std::string& value) {
17516     AppendBytes(22, value.data(), value.size());
17517   }
17518   void set_unique_session_name(const char* data, size_t size) {
17519     AppendBytes(22, data, size);
17520   }
17521   void set_compression_type(::perfetto::protos::pbzero::TraceConfig_CompressionType value) {
17522     AppendTinyVarInt(24, value);
17523   }
17524   template <typename T = TraceConfig_IncidentReportConfig> T* set_incident_report_config() {
17525     return BeginNestedMessage<T>(25);
17526   }
17527 
17528   void set_trace_uuid_msb(int64_t value) {
17529     AppendVarInt(27, value);
17530   }
17531   void set_trace_uuid_lsb(int64_t value) {
17532     AppendVarInt(28, value);
17533   }
17534 };
17535 
17536 class TraceConfig_IncidentReportConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
17537  public:
17538   TraceConfig_IncidentReportConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
17539   explicit TraceConfig_IncidentReportConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
17540   explicit TraceConfig_IncidentReportConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
17541   bool has_destination_package() const { return at<1>().valid(); }
17542   ::protozero::ConstChars destination_package() const { return at<1>().as_string(); }
17543   bool has_destination_class() const { return at<2>().valid(); }
17544   ::protozero::ConstChars destination_class() const { return at<2>().as_string(); }
17545   bool has_privacy_level() const { return at<3>().valid(); }
17546   int32_t privacy_level() const { return at<3>().as_int32(); }
17547   bool has_skip_dropbox() const { return at<4>().valid(); }
17548   bool skip_dropbox() const { return at<4>().as_bool(); }
17549 };
17550 
17551 class TraceConfig_IncidentReportConfig : public ::protozero::Message {
17552  public:
17553   using Decoder = TraceConfig_IncidentReportConfig_Decoder;
17554   enum : int32_t {
17555     kDestinationPackageFieldNumber = 1,
17556     kDestinationClassFieldNumber = 2,
17557     kPrivacyLevelFieldNumber = 3,
17558     kSkipDropboxFieldNumber = 4,
17559   };
17560   void set_destination_package(const std::string& value) {
17561     AppendBytes(1, value.data(), value.size());
17562   }
17563   void set_destination_package(const char* data, size_t size) {
17564     AppendBytes(1, data, size);
17565   }
17566   void set_destination_class(const std::string& value) {
17567     AppendBytes(2, value.data(), value.size());
17568   }
17569   void set_destination_class(const char* data, size_t size) {
17570     AppendBytes(2, data, size);
17571   }
17572   void set_privacy_level(int32_t value) {
17573     AppendVarInt(3, value);
17574   }
17575   void set_skip_dropbox(bool value) {
17576     AppendTinyVarInt(4, value);
17577   }
17578 };
17579 
17580 class TraceConfig_IncrementalStateConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
17581  public:
17582   TraceConfig_IncrementalStateConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
17583   explicit TraceConfig_IncrementalStateConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
17584   explicit TraceConfig_IncrementalStateConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
17585   bool has_clear_period_ms() const { return at<1>().valid(); }
17586   uint32_t clear_period_ms() const { return at<1>().as_uint32(); }
17587 };
17588 
17589 class TraceConfig_IncrementalStateConfig : public ::protozero::Message {
17590  public:
17591   using Decoder = TraceConfig_IncrementalStateConfig_Decoder;
17592   enum : int32_t {
17593     kClearPeriodMsFieldNumber = 1,
17594   };
17595   void set_clear_period_ms(uint32_t value) {
17596     AppendVarInt(1, value);
17597   }
17598 };
17599 
17600 class TraceConfig_TriggerConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
17601  public:
17602   TraceConfig_TriggerConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
17603   explicit TraceConfig_TriggerConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
17604   explicit TraceConfig_TriggerConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
17605   bool has_trigger_mode() const { return at<1>().valid(); }
17606   int32_t trigger_mode() const { return at<1>().as_int32(); }
17607   bool has_triggers() const { return at<2>().valid(); }
17608   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> triggers() const { return GetRepeated<::protozero::ConstBytes>(2); }
17609   bool has_trigger_timeout_ms() const { return at<3>().valid(); }
17610   uint32_t trigger_timeout_ms() const { return at<3>().as_uint32(); }
17611 };
17612 
17613 class TraceConfig_TriggerConfig : public ::protozero::Message {
17614  public:
17615   using Decoder = TraceConfig_TriggerConfig_Decoder;
17616   enum : int32_t {
17617     kTriggerModeFieldNumber = 1,
17618     kTriggersFieldNumber = 2,
17619     kTriggerTimeoutMsFieldNumber = 3,
17620   };
17621   using Trigger = ::perfetto::protos::pbzero::TraceConfig_TriggerConfig_Trigger;
17622   using TriggerMode = ::perfetto::protos::pbzero::TraceConfig_TriggerConfig_TriggerMode;
17623   static const TriggerMode UNSPECIFIED = TraceConfig_TriggerConfig_TriggerMode_UNSPECIFIED;
17624   static const TriggerMode START_TRACING = TraceConfig_TriggerConfig_TriggerMode_START_TRACING;
17625   static const TriggerMode STOP_TRACING = TraceConfig_TriggerConfig_TriggerMode_STOP_TRACING;
17626   void set_trigger_mode(::perfetto::protos::pbzero::TraceConfig_TriggerConfig_TriggerMode value) {
17627     AppendTinyVarInt(1, value);
17628   }
17629   template <typename T = TraceConfig_TriggerConfig_Trigger> T* add_triggers() {
17630     return BeginNestedMessage<T>(2);
17631   }
17632 
17633   void set_trigger_timeout_ms(uint32_t value) {
17634     AppendVarInt(3, value);
17635   }
17636 };
17637 
17638 class TraceConfig_TriggerConfig_Trigger_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
17639  public:
17640   TraceConfig_TriggerConfig_Trigger_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
17641   explicit TraceConfig_TriggerConfig_Trigger_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
17642   explicit TraceConfig_TriggerConfig_Trigger_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
17643   bool has_name() const { return at<1>().valid(); }
17644   ::protozero::ConstChars name() const { return at<1>().as_string(); }
17645   bool has_producer_name_regex() const { return at<2>().valid(); }
17646   ::protozero::ConstChars producer_name_regex() const { return at<2>().as_string(); }
17647   bool has_stop_delay_ms() const { return at<3>().valid(); }
17648   uint32_t stop_delay_ms() const { return at<3>().as_uint32(); }
17649 };
17650 
17651 class TraceConfig_TriggerConfig_Trigger : public ::protozero::Message {
17652  public:
17653   using Decoder = TraceConfig_TriggerConfig_Trigger_Decoder;
17654   enum : int32_t {
17655     kNameFieldNumber = 1,
17656     kProducerNameRegexFieldNumber = 2,
17657     kStopDelayMsFieldNumber = 3,
17658   };
17659   void set_name(const std::string& value) {
17660     AppendBytes(1, value.data(), value.size());
17661   }
17662   void set_name(const char* data, size_t size) {
17663     AppendBytes(1, data, size);
17664   }
17665   void set_producer_name_regex(const std::string& value) {
17666     AppendBytes(2, value.data(), value.size());
17667   }
17668   void set_producer_name_regex(const char* data, size_t size) {
17669     AppendBytes(2, data, size);
17670   }
17671   void set_stop_delay_ms(uint32_t value) {
17672     AppendVarInt(3, value);
17673   }
17674 };
17675 
17676 class TraceConfig_GuardrailOverrides_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
17677  public:
17678   TraceConfig_GuardrailOverrides_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
17679   explicit TraceConfig_GuardrailOverrides_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
17680   explicit TraceConfig_GuardrailOverrides_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
17681   bool has_max_upload_per_day_bytes() const { return at<1>().valid(); }
17682   uint64_t max_upload_per_day_bytes() const { return at<1>().as_uint64(); }
17683 };
17684 
17685 class TraceConfig_GuardrailOverrides : public ::protozero::Message {
17686  public:
17687   using Decoder = TraceConfig_GuardrailOverrides_Decoder;
17688   enum : int32_t {
17689     kMaxUploadPerDayBytesFieldNumber = 1,
17690   };
17691   void set_max_upload_per_day_bytes(uint64_t value) {
17692     AppendVarInt(1, value);
17693   }
17694 };
17695 
17696 class TraceConfig_StatsdMetadata_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
17697  public:
17698   TraceConfig_StatsdMetadata_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
17699   explicit TraceConfig_StatsdMetadata_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
17700   explicit TraceConfig_StatsdMetadata_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
17701   bool has_triggering_alert_id() const { return at<1>().valid(); }
17702   int64_t triggering_alert_id() const { return at<1>().as_int64(); }
17703   bool has_triggering_config_uid() const { return at<2>().valid(); }
17704   int32_t triggering_config_uid() const { return at<2>().as_int32(); }
17705   bool has_triggering_config_id() const { return at<3>().valid(); }
17706   int64_t triggering_config_id() const { return at<3>().as_int64(); }
17707   bool has_triggering_subscription_id() const { return at<4>().valid(); }
17708   int64_t triggering_subscription_id() const { return at<4>().as_int64(); }
17709 };
17710 
17711 class TraceConfig_StatsdMetadata : public ::protozero::Message {
17712  public:
17713   using Decoder = TraceConfig_StatsdMetadata_Decoder;
17714   enum : int32_t {
17715     kTriggeringAlertIdFieldNumber = 1,
17716     kTriggeringConfigUidFieldNumber = 2,
17717     kTriggeringConfigIdFieldNumber = 3,
17718     kTriggeringSubscriptionIdFieldNumber = 4,
17719   };
17720   void set_triggering_alert_id(int64_t value) {
17721     AppendVarInt(1, value);
17722   }
17723   void set_triggering_config_uid(int32_t value) {
17724     AppendVarInt(2, value);
17725   }
17726   void set_triggering_config_id(int64_t value) {
17727     AppendVarInt(3, value);
17728   }
17729   void set_triggering_subscription_id(int64_t value) {
17730     AppendVarInt(4, value);
17731   }
17732 };
17733 
17734 class TraceConfig_ProducerConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
17735  public:
17736   TraceConfig_ProducerConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
17737   explicit TraceConfig_ProducerConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
17738   explicit TraceConfig_ProducerConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
17739   bool has_producer_name() const { return at<1>().valid(); }
17740   ::protozero::ConstChars producer_name() const { return at<1>().as_string(); }
17741   bool has_shm_size_kb() const { return at<2>().valid(); }
17742   uint32_t shm_size_kb() const { return at<2>().as_uint32(); }
17743   bool has_page_size_kb() const { return at<3>().valid(); }
17744   uint32_t page_size_kb() const { return at<3>().as_uint32(); }
17745 };
17746 
17747 class TraceConfig_ProducerConfig : public ::protozero::Message {
17748  public:
17749   using Decoder = TraceConfig_ProducerConfig_Decoder;
17750   enum : int32_t {
17751     kProducerNameFieldNumber = 1,
17752     kShmSizeKbFieldNumber = 2,
17753     kPageSizeKbFieldNumber = 3,
17754   };
17755   void set_producer_name(const std::string& value) {
17756     AppendBytes(1, value.data(), value.size());
17757   }
17758   void set_producer_name(const char* data, size_t size) {
17759     AppendBytes(1, data, size);
17760   }
17761   void set_shm_size_kb(uint32_t value) {
17762     AppendVarInt(2, value);
17763   }
17764   void set_page_size_kb(uint32_t value) {
17765     AppendVarInt(3, value);
17766   }
17767 };
17768 
17769 class TraceConfig_BuiltinDataSource_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
17770  public:
17771   TraceConfig_BuiltinDataSource_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
17772   explicit TraceConfig_BuiltinDataSource_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
17773   explicit TraceConfig_BuiltinDataSource_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
17774   bool has_disable_clock_snapshotting() const { return at<1>().valid(); }
17775   bool disable_clock_snapshotting() const { return at<1>().as_bool(); }
17776   bool has_disable_trace_config() const { return at<2>().valid(); }
17777   bool disable_trace_config() const { return at<2>().as_bool(); }
17778   bool has_disable_system_info() const { return at<3>().valid(); }
17779   bool disable_system_info() const { return at<3>().as_bool(); }
17780   bool has_disable_service_events() const { return at<4>().valid(); }
17781   bool disable_service_events() const { return at<4>().as_bool(); }
17782   bool has_primary_trace_clock() const { return at<5>().valid(); }
17783   int32_t primary_trace_clock() const { return at<5>().as_int32(); }
17784   bool has_snapshot_interval_ms() const { return at<6>().valid(); }
17785   uint32_t snapshot_interval_ms() const { return at<6>().as_uint32(); }
17786 };
17787 
17788 class TraceConfig_BuiltinDataSource : public ::protozero::Message {
17789  public:
17790   using Decoder = TraceConfig_BuiltinDataSource_Decoder;
17791   enum : int32_t {
17792     kDisableClockSnapshottingFieldNumber = 1,
17793     kDisableTraceConfigFieldNumber = 2,
17794     kDisableSystemInfoFieldNumber = 3,
17795     kDisableServiceEventsFieldNumber = 4,
17796     kPrimaryTraceClockFieldNumber = 5,
17797     kSnapshotIntervalMsFieldNumber = 6,
17798   };
17799   void set_disable_clock_snapshotting(bool value) {
17800     AppendTinyVarInt(1, value);
17801   }
17802   void set_disable_trace_config(bool value) {
17803     AppendTinyVarInt(2, value);
17804   }
17805   void set_disable_system_info(bool value) {
17806     AppendTinyVarInt(3, value);
17807   }
17808   void set_disable_service_events(bool value) {
17809     AppendTinyVarInt(4, value);
17810   }
17811   void set_primary_trace_clock(::perfetto::protos::pbzero::BuiltinClock value) {
17812     AppendTinyVarInt(5, value);
17813   }
17814   void set_snapshot_interval_ms(uint32_t value) {
17815     AppendVarInt(6, value);
17816   }
17817 };
17818 
17819 class TraceConfig_DataSource_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
17820  public:
17821   TraceConfig_DataSource_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
17822   explicit TraceConfig_DataSource_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
17823   explicit TraceConfig_DataSource_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
17824   bool has_config() const { return at<1>().valid(); }
17825   ::protozero::ConstBytes config() const { return at<1>().as_bytes(); }
17826   bool has_producer_name_filter() const { return at<2>().valid(); }
17827   ::protozero::RepeatedFieldIterator<::protozero::ConstChars> producer_name_filter() const { return GetRepeated<::protozero::ConstChars>(2); }
17828   bool has_producer_name_regex_filter() const { return at<3>().valid(); }
17829   ::protozero::RepeatedFieldIterator<::protozero::ConstChars> producer_name_regex_filter() const { return GetRepeated<::protozero::ConstChars>(3); }
17830 };
17831 
17832 class TraceConfig_DataSource : public ::protozero::Message {
17833  public:
17834   using Decoder = TraceConfig_DataSource_Decoder;
17835   enum : int32_t {
17836     kConfigFieldNumber = 1,
17837     kProducerNameFilterFieldNumber = 2,
17838     kProducerNameRegexFilterFieldNumber = 3,
17839   };
17840   template <typename T = DataSourceConfig> T* set_config() {
17841     return BeginNestedMessage<T>(1);
17842   }
17843 
17844   void add_producer_name_filter(const std::string& value) {
17845     AppendBytes(2, value.data(), value.size());
17846   }
17847   void add_producer_name_filter(const char* data, size_t size) {
17848     AppendBytes(2, data, size);
17849   }
17850   void add_producer_name_regex_filter(const std::string& value) {
17851     AppendBytes(3, value.data(), value.size());
17852   }
17853   void add_producer_name_regex_filter(const char* data, size_t size) {
17854     AppendBytes(3, data, size);
17855   }
17856 };
17857 
17858 class TraceConfig_BufferConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
17859  public:
17860   TraceConfig_BufferConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
17861   explicit TraceConfig_BufferConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
17862   explicit TraceConfig_BufferConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
17863   bool has_size_kb() const { return at<1>().valid(); }
17864   uint32_t size_kb() const { return at<1>().as_uint32(); }
17865   bool has_fill_policy() const { return at<4>().valid(); }
17866   int32_t fill_policy() const { return at<4>().as_int32(); }
17867 };
17868 
17869 class TraceConfig_BufferConfig : public ::protozero::Message {
17870  public:
17871   using Decoder = TraceConfig_BufferConfig_Decoder;
17872   enum : int32_t {
17873     kSizeKbFieldNumber = 1,
17874     kFillPolicyFieldNumber = 4,
17875   };
17876   using FillPolicy = ::perfetto::protos::pbzero::TraceConfig_BufferConfig_FillPolicy;
17877   static const FillPolicy UNSPECIFIED = TraceConfig_BufferConfig_FillPolicy_UNSPECIFIED;
17878   static const FillPolicy RING_BUFFER = TraceConfig_BufferConfig_FillPolicy_RING_BUFFER;
17879   static const FillPolicy DISCARD = TraceConfig_BufferConfig_FillPolicy_DISCARD;
17880   void set_size_kb(uint32_t value) {
17881     AppendVarInt(1, value);
17882   }
17883   void set_fill_policy(::perfetto::protos::pbzero::TraceConfig_BufferConfig_FillPolicy value) {
17884     AppendTinyVarInt(4, value);
17885   }
17886 };
17887 
17888 } // Namespace.
17889 } // Namespace.
17890 } // Namespace.
17891 #endif  // Include guard.
17892 // gen_amalgamated begin header: gen/protos/perfetto/trace/clock_snapshot.pbzero.h
17893 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
17894 
17895 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_CLOCK_SNAPSHOT_PROTO_H_
17896 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_CLOCK_SNAPSHOT_PROTO_H_
17897 
17898 #include <stddef.h>
17899 #include <stdint.h>
17900 
17901 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
17902 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
17903 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
17904 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
17905 
17906 namespace perfetto {
17907 namespace protos {
17908 namespace pbzero {
17909 
17910 class ClockSnapshot_Clock;
17911 enum BuiltinClock : int32_t;
17912 
17913 enum ClockSnapshot_Clock_BuiltinClocks : int32_t {
17914   ClockSnapshot_Clock_BuiltinClocks_UNKNOWN = 0,
17915   ClockSnapshot_Clock_BuiltinClocks_REALTIME = 1,
17916   ClockSnapshot_Clock_BuiltinClocks_REALTIME_COARSE = 2,
17917   ClockSnapshot_Clock_BuiltinClocks_MONOTONIC = 3,
17918   ClockSnapshot_Clock_BuiltinClocks_MONOTONIC_COARSE = 4,
17919   ClockSnapshot_Clock_BuiltinClocks_MONOTONIC_RAW = 5,
17920   ClockSnapshot_Clock_BuiltinClocks_BOOTTIME = 6,
17921   ClockSnapshot_Clock_BuiltinClocks_BUILTIN_CLOCK_MAX_ID = 63,
17922 };
17923 
17924 const ClockSnapshot_Clock_BuiltinClocks ClockSnapshot_Clock_BuiltinClocks_MIN = ClockSnapshot_Clock_BuiltinClocks_UNKNOWN;
17925 const ClockSnapshot_Clock_BuiltinClocks ClockSnapshot_Clock_BuiltinClocks_MAX = ClockSnapshot_Clock_BuiltinClocks_BUILTIN_CLOCK_MAX_ID;
17926 
17927 class ClockSnapshot_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
17928  public:
17929   ClockSnapshot_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
17930   explicit ClockSnapshot_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
17931   explicit ClockSnapshot_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
17932   bool has_clocks() const { return at<1>().valid(); }
17933   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> clocks() const { return GetRepeated<::protozero::ConstBytes>(1); }
17934   bool has_primary_trace_clock() const { return at<2>().valid(); }
17935   int32_t primary_trace_clock() const { return at<2>().as_int32(); }
17936 };
17937 
17938 class ClockSnapshot : public ::protozero::Message {
17939  public:
17940   using Decoder = ClockSnapshot_Decoder;
17941   enum : int32_t {
17942     kClocksFieldNumber = 1,
17943     kPrimaryTraceClockFieldNumber = 2,
17944   };
17945   using Clock = ::perfetto::protos::pbzero::ClockSnapshot_Clock;
17946   template <typename T = ClockSnapshot_Clock> T* add_clocks() {
17947     return BeginNestedMessage<T>(1);
17948   }
17949 
17950   void set_primary_trace_clock(::perfetto::protos::pbzero::BuiltinClock value) {
17951     AppendTinyVarInt(2, value);
17952   }
17953 };
17954 
17955 class ClockSnapshot_Clock_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
17956  public:
17957   ClockSnapshot_Clock_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
17958   explicit ClockSnapshot_Clock_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
17959   explicit ClockSnapshot_Clock_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
17960   bool has_clock_id() const { return at<1>().valid(); }
17961   uint32_t clock_id() const { return at<1>().as_uint32(); }
17962   bool has_timestamp() const { return at<2>().valid(); }
17963   uint64_t timestamp() const { return at<2>().as_uint64(); }
17964   bool has_is_incremental() const { return at<3>().valid(); }
17965   bool is_incremental() const { return at<3>().as_bool(); }
17966   bool has_unit_multiplier_ns() const { return at<4>().valid(); }
17967   uint64_t unit_multiplier_ns() const { return at<4>().as_uint64(); }
17968 };
17969 
17970 class ClockSnapshot_Clock : public ::protozero::Message {
17971  public:
17972   using Decoder = ClockSnapshot_Clock_Decoder;
17973   enum : int32_t {
17974     kClockIdFieldNumber = 1,
17975     kTimestampFieldNumber = 2,
17976     kIsIncrementalFieldNumber = 3,
17977     kUnitMultiplierNsFieldNumber = 4,
17978   };
17979   using BuiltinClocks = ::perfetto::protos::pbzero::ClockSnapshot_Clock_BuiltinClocks;
17980   static const BuiltinClocks UNKNOWN = ClockSnapshot_Clock_BuiltinClocks_UNKNOWN;
17981   static const BuiltinClocks REALTIME = ClockSnapshot_Clock_BuiltinClocks_REALTIME;
17982   static const BuiltinClocks REALTIME_COARSE = ClockSnapshot_Clock_BuiltinClocks_REALTIME_COARSE;
17983   static const BuiltinClocks MONOTONIC = ClockSnapshot_Clock_BuiltinClocks_MONOTONIC;
17984   static const BuiltinClocks MONOTONIC_COARSE = ClockSnapshot_Clock_BuiltinClocks_MONOTONIC_COARSE;
17985   static const BuiltinClocks MONOTONIC_RAW = ClockSnapshot_Clock_BuiltinClocks_MONOTONIC_RAW;
17986   static const BuiltinClocks BOOTTIME = ClockSnapshot_Clock_BuiltinClocks_BOOTTIME;
17987   static const BuiltinClocks BUILTIN_CLOCK_MAX_ID = ClockSnapshot_Clock_BuiltinClocks_BUILTIN_CLOCK_MAX_ID;
17988   void set_clock_id(uint32_t value) {
17989     AppendVarInt(1, value);
17990   }
17991   void set_timestamp(uint64_t value) {
17992     AppendVarInt(2, value);
17993   }
17994   void set_is_incremental(bool value) {
17995     AppendTinyVarInt(3, value);
17996   }
17997   void set_unit_multiplier_ns(uint64_t value) {
17998     AppendVarInt(4, value);
17999   }
18000 };
18001 
18002 } // Namespace.
18003 } // Namespace.
18004 } // Namespace.
18005 #endif  // Include guard.
18006 // gen_amalgamated begin header: gen/protos/perfetto/trace/trigger.pbzero.h
18007 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
18008 
18009 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRIGGER_PROTO_H_
18010 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRIGGER_PROTO_H_
18011 
18012 #include <stddef.h>
18013 #include <stdint.h>
18014 
18015 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
18016 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
18017 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
18018 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
18019 
18020 namespace perfetto {
18021 namespace protos {
18022 namespace pbzero {
18023 
18024 
18025 class Trigger_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
18026  public:
18027   Trigger_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
18028   explicit Trigger_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
18029   explicit Trigger_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
18030   bool has_trigger_name() const { return at<1>().valid(); }
18031   ::protozero::ConstChars trigger_name() const { return at<1>().as_string(); }
18032   bool has_producer_name() const { return at<2>().valid(); }
18033   ::protozero::ConstChars producer_name() const { return at<2>().as_string(); }
18034   bool has_trusted_producer_uid() const { return at<3>().valid(); }
18035   int32_t trusted_producer_uid() const { return at<3>().as_int32(); }
18036 };
18037 
18038 class Trigger : public ::protozero::Message {
18039  public:
18040   using Decoder = Trigger_Decoder;
18041   enum : int32_t {
18042     kTriggerNameFieldNumber = 1,
18043     kProducerNameFieldNumber = 2,
18044     kTrustedProducerUidFieldNumber = 3,
18045   };
18046   void set_trigger_name(const std::string& value) {
18047     AppendBytes(1, value.data(), value.size());
18048   }
18049   void set_trigger_name(const char* data, size_t size) {
18050     AppendBytes(1, data, size);
18051   }
18052   void set_producer_name(const std::string& value) {
18053     AppendBytes(2, value.data(), value.size());
18054   }
18055   void set_producer_name(const char* data, size_t size) {
18056     AppendBytes(2, data, size);
18057   }
18058   void set_trusted_producer_uid(int32_t value) {
18059     AppendVarInt(3, value);
18060   }
18061 };
18062 
18063 } // Namespace.
18064 } // Namespace.
18065 } // Namespace.
18066 #endif  // Include guard.
18067 // gen_amalgamated begin header: gen/protos/perfetto/trace/system_info.pbzero.h
18068 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
18069 
18070 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_SYSTEM_INFO_PROTO_H_
18071 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_SYSTEM_INFO_PROTO_H_
18072 
18073 #include <stddef.h>
18074 #include <stdint.h>
18075 
18076 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
18077 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
18078 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
18079 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
18080 
18081 namespace perfetto {
18082 namespace protos {
18083 namespace pbzero {
18084 
18085 class Utsname;
18086 
18087 class SystemInfo_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
18088  public:
18089   SystemInfo_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
18090   explicit SystemInfo_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
18091   explicit SystemInfo_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
18092   bool has_utsname() const { return at<1>().valid(); }
18093   ::protozero::ConstBytes utsname() const { return at<1>().as_bytes(); }
18094   bool has_android_build_fingerprint() const { return at<2>().valid(); }
18095   ::protozero::ConstChars android_build_fingerprint() const { return at<2>().as_string(); }
18096   bool has_hz() const { return at<3>().valid(); }
18097   int64_t hz() const { return at<3>().as_int64(); }
18098 };
18099 
18100 class SystemInfo : public ::protozero::Message {
18101  public:
18102   using Decoder = SystemInfo_Decoder;
18103   enum : int32_t {
18104     kUtsnameFieldNumber = 1,
18105     kAndroidBuildFingerprintFieldNumber = 2,
18106     kHzFieldNumber = 3,
18107   };
18108   template <typename T = Utsname> T* set_utsname() {
18109     return BeginNestedMessage<T>(1);
18110   }
18111 
18112   void set_android_build_fingerprint(const std::string& value) {
18113     AppendBytes(2, value.data(), value.size());
18114   }
18115   void set_android_build_fingerprint(const char* data, size_t size) {
18116     AppendBytes(2, data, size);
18117   }
18118   void set_hz(int64_t value) {
18119     AppendVarInt(3, value);
18120   }
18121 };
18122 
18123 class Utsname_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
18124  public:
18125   Utsname_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
18126   explicit Utsname_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
18127   explicit Utsname_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
18128   bool has_sysname() const { return at<1>().valid(); }
18129   ::protozero::ConstChars sysname() const { return at<1>().as_string(); }
18130   bool has_version() const { return at<2>().valid(); }
18131   ::protozero::ConstChars version() const { return at<2>().as_string(); }
18132   bool has_release() const { return at<3>().valid(); }
18133   ::protozero::ConstChars release() const { return at<3>().as_string(); }
18134   bool has_machine() const { return at<4>().valid(); }
18135   ::protozero::ConstChars machine() const { return at<4>().as_string(); }
18136 };
18137 
18138 class Utsname : public ::protozero::Message {
18139  public:
18140   using Decoder = Utsname_Decoder;
18141   enum : int32_t {
18142     kSysnameFieldNumber = 1,
18143     kVersionFieldNumber = 2,
18144     kReleaseFieldNumber = 3,
18145     kMachineFieldNumber = 4,
18146   };
18147   void set_sysname(const std::string& value) {
18148     AppendBytes(1, value.data(), value.size());
18149   }
18150   void set_sysname(const char* data, size_t size) {
18151     AppendBytes(1, data, size);
18152   }
18153   void set_version(const std::string& value) {
18154     AppendBytes(2, value.data(), value.size());
18155   }
18156   void set_version(const char* data, size_t size) {
18157     AppendBytes(2, data, size);
18158   }
18159   void set_release(const std::string& value) {
18160     AppendBytes(3, value.data(), value.size());
18161   }
18162   void set_release(const char* data, size_t size) {
18163     AppendBytes(3, data, size);
18164   }
18165   void set_machine(const std::string& value) {
18166     AppendBytes(4, value.data(), value.size());
18167   }
18168   void set_machine(const char* data, size_t size) {
18169     AppendBytes(4, data, size);
18170   }
18171 };
18172 
18173 } // Namespace.
18174 } // Namespace.
18175 } // Namespace.
18176 #endif  // Include guard.
18177 // gen_amalgamated begin header: gen/protos/perfetto/trace/android/android_log.pbzero.h
18178 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
18179 
18180 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_ANDROID_ANDROID_LOG_PROTO_H_
18181 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_ANDROID_ANDROID_LOG_PROTO_H_
18182 
18183 #include <stddef.h>
18184 #include <stdint.h>
18185 
18186 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
18187 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
18188 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
18189 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
18190 
18191 namespace perfetto {
18192 namespace protos {
18193 namespace pbzero {
18194 
18195 class AndroidLogPacket_LogEvent;
18196 class AndroidLogPacket_LogEvent_Arg;
18197 class AndroidLogPacket_Stats;
18198 enum AndroidLogId : int32_t;
18199 enum AndroidLogPriority : int32_t;
18200 
18201 class AndroidLogPacket_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
18202  public:
18203   AndroidLogPacket_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
18204   explicit AndroidLogPacket_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
18205   explicit AndroidLogPacket_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
18206   bool has_events() const { return at<1>().valid(); }
18207   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> events() const { return GetRepeated<::protozero::ConstBytes>(1); }
18208   bool has_stats() const { return at<2>().valid(); }
18209   ::protozero::ConstBytes stats() const { return at<2>().as_bytes(); }
18210 };
18211 
18212 class AndroidLogPacket : public ::protozero::Message {
18213  public:
18214   using Decoder = AndroidLogPacket_Decoder;
18215   enum : int32_t {
18216     kEventsFieldNumber = 1,
18217     kStatsFieldNumber = 2,
18218   };
18219   using LogEvent = ::perfetto::protos::pbzero::AndroidLogPacket_LogEvent;
18220   using Stats = ::perfetto::protos::pbzero::AndroidLogPacket_Stats;
18221   template <typename T = AndroidLogPacket_LogEvent> T* add_events() {
18222     return BeginNestedMessage<T>(1);
18223   }
18224 
18225   template <typename T = AndroidLogPacket_Stats> T* set_stats() {
18226     return BeginNestedMessage<T>(2);
18227   }
18228 
18229 };
18230 
18231 class AndroidLogPacket_Stats_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
18232  public:
18233   AndroidLogPacket_Stats_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
18234   explicit AndroidLogPacket_Stats_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
18235   explicit AndroidLogPacket_Stats_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
18236   bool has_num_total() const { return at<1>().valid(); }
18237   uint64_t num_total() const { return at<1>().as_uint64(); }
18238   bool has_num_failed() const { return at<2>().valid(); }
18239   uint64_t num_failed() const { return at<2>().as_uint64(); }
18240   bool has_num_skipped() const { return at<3>().valid(); }
18241   uint64_t num_skipped() const { return at<3>().as_uint64(); }
18242 };
18243 
18244 class AndroidLogPacket_Stats : public ::protozero::Message {
18245  public:
18246   using Decoder = AndroidLogPacket_Stats_Decoder;
18247   enum : int32_t {
18248     kNumTotalFieldNumber = 1,
18249     kNumFailedFieldNumber = 2,
18250     kNumSkippedFieldNumber = 3,
18251   };
18252   void set_num_total(uint64_t value) {
18253     AppendVarInt(1, value);
18254   }
18255   void set_num_failed(uint64_t value) {
18256     AppendVarInt(2, value);
18257   }
18258   void set_num_skipped(uint64_t value) {
18259     AppendVarInt(3, value);
18260   }
18261 };
18262 
18263 class AndroidLogPacket_LogEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/9, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
18264  public:
18265   AndroidLogPacket_LogEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
18266   explicit AndroidLogPacket_LogEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
18267   explicit AndroidLogPacket_LogEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
18268   bool has_log_id() const { return at<1>().valid(); }
18269   int32_t log_id() const { return at<1>().as_int32(); }
18270   bool has_pid() const { return at<2>().valid(); }
18271   int32_t pid() const { return at<2>().as_int32(); }
18272   bool has_tid() const { return at<3>().valid(); }
18273   int32_t tid() const { return at<3>().as_int32(); }
18274   bool has_uid() const { return at<4>().valid(); }
18275   int32_t uid() const { return at<4>().as_int32(); }
18276   bool has_timestamp() const { return at<5>().valid(); }
18277   uint64_t timestamp() const { return at<5>().as_uint64(); }
18278   bool has_tag() const { return at<6>().valid(); }
18279   ::protozero::ConstChars tag() const { return at<6>().as_string(); }
18280   bool has_prio() const { return at<7>().valid(); }
18281   int32_t prio() const { return at<7>().as_int32(); }
18282   bool has_message() const { return at<8>().valid(); }
18283   ::protozero::ConstChars message() const { return at<8>().as_string(); }
18284   bool has_args() const { return at<9>().valid(); }
18285   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> args() const { return GetRepeated<::protozero::ConstBytes>(9); }
18286 };
18287 
18288 class AndroidLogPacket_LogEvent : public ::protozero::Message {
18289  public:
18290   using Decoder = AndroidLogPacket_LogEvent_Decoder;
18291   enum : int32_t {
18292     kLogIdFieldNumber = 1,
18293     kPidFieldNumber = 2,
18294     kTidFieldNumber = 3,
18295     kUidFieldNumber = 4,
18296     kTimestampFieldNumber = 5,
18297     kTagFieldNumber = 6,
18298     kPrioFieldNumber = 7,
18299     kMessageFieldNumber = 8,
18300     kArgsFieldNumber = 9,
18301   };
18302   using Arg = ::perfetto::protos::pbzero::AndroidLogPacket_LogEvent_Arg;
18303   void set_log_id(::perfetto::protos::pbzero::AndroidLogId value) {
18304     AppendTinyVarInt(1, value);
18305   }
18306   void set_pid(int32_t value) {
18307     AppendVarInt(2, value);
18308   }
18309   void set_tid(int32_t value) {
18310     AppendVarInt(3, value);
18311   }
18312   void set_uid(int32_t value) {
18313     AppendVarInt(4, value);
18314   }
18315   void set_timestamp(uint64_t value) {
18316     AppendVarInt(5, value);
18317   }
18318   void set_tag(const std::string& value) {
18319     AppendBytes(6, value.data(), value.size());
18320   }
18321   void set_tag(const char* data, size_t size) {
18322     AppendBytes(6, data, size);
18323   }
18324   void set_prio(::perfetto::protos::pbzero::AndroidLogPriority value) {
18325     AppendTinyVarInt(7, value);
18326   }
18327   void set_message(const std::string& value) {
18328     AppendBytes(8, value.data(), value.size());
18329   }
18330   void set_message(const char* data, size_t size) {
18331     AppendBytes(8, data, size);
18332   }
18333   template <typename T = AndroidLogPacket_LogEvent_Arg> T* add_args() {
18334     return BeginNestedMessage<T>(9);
18335   }
18336 
18337 };
18338 
18339 class AndroidLogPacket_LogEvent_Arg_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
18340  public:
18341   AndroidLogPacket_LogEvent_Arg_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
18342   explicit AndroidLogPacket_LogEvent_Arg_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
18343   explicit AndroidLogPacket_LogEvent_Arg_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
18344   bool has_name() const { return at<1>().valid(); }
18345   ::protozero::ConstChars name() const { return at<1>().as_string(); }
18346   bool has_int_value() const { return at<2>().valid(); }
18347   int64_t int_value() const { return at<2>().as_int64(); }
18348   bool has_float_value() const { return at<3>().valid(); }
18349   float float_value() const { return at<3>().as_float(); }
18350   bool has_string_value() const { return at<4>().valid(); }
18351   ::protozero::ConstChars string_value() const { return at<4>().as_string(); }
18352 };
18353 
18354 class AndroidLogPacket_LogEvent_Arg : public ::protozero::Message {
18355  public:
18356   using Decoder = AndroidLogPacket_LogEvent_Arg_Decoder;
18357   enum : int32_t {
18358     kNameFieldNumber = 1,
18359     kIntValueFieldNumber = 2,
18360     kFloatValueFieldNumber = 3,
18361     kStringValueFieldNumber = 4,
18362   };
18363   void set_name(const std::string& value) {
18364     AppendBytes(1, value.data(), value.size());
18365   }
18366   void set_name(const char* data, size_t size) {
18367     AppendBytes(1, data, size);
18368   }
18369   void set_int_value(int64_t value) {
18370     AppendVarInt(2, value);
18371   }
18372   void set_float_value(float value) {
18373     AppendFixed(3, value);
18374   }
18375   void set_string_value(const std::string& value) {
18376     AppendBytes(4, value.data(), value.size());
18377   }
18378   void set_string_value(const char* data, size_t size) {
18379     AppendBytes(4, data, size);
18380   }
18381 };
18382 
18383 } // Namespace.
18384 } // Namespace.
18385 } // Namespace.
18386 #endif  // Include guard.
18387 // gen_amalgamated begin header: gen/protos/perfetto/trace/android/gpu_mem_event.pbzero.h
18388 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
18389 
18390 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_ANDROID_GPU_MEM_EVENT_PROTO_H_
18391 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_ANDROID_GPU_MEM_EVENT_PROTO_H_
18392 
18393 #include <stddef.h>
18394 #include <stdint.h>
18395 
18396 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
18397 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
18398 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
18399 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
18400 
18401 namespace perfetto {
18402 namespace protos {
18403 namespace pbzero {
18404 
18405 
18406 class GpuMemTotalEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
18407  public:
18408   GpuMemTotalEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
18409   explicit GpuMemTotalEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
18410   explicit GpuMemTotalEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
18411   bool has_gpu_id() const { return at<1>().valid(); }
18412   uint32_t gpu_id() const { return at<1>().as_uint32(); }
18413   bool has_pid() const { return at<2>().valid(); }
18414   uint32_t pid() const { return at<2>().as_uint32(); }
18415   bool has_size() const { return at<3>().valid(); }
18416   uint64_t size() const { return at<3>().as_uint64(); }
18417 };
18418 
18419 class GpuMemTotalEvent : public ::protozero::Message {
18420  public:
18421   using Decoder = GpuMemTotalEvent_Decoder;
18422   enum : int32_t {
18423     kGpuIdFieldNumber = 1,
18424     kPidFieldNumber = 2,
18425     kSizeFieldNumber = 3,
18426   };
18427   void set_gpu_id(uint32_t value) {
18428     AppendVarInt(1, value);
18429   }
18430   void set_pid(uint32_t value) {
18431     AppendVarInt(2, value);
18432   }
18433   void set_size(uint64_t value) {
18434     AppendVarInt(3, value);
18435   }
18436 };
18437 
18438 } // Namespace.
18439 } // Namespace.
18440 } // Namespace.
18441 #endif  // Include guard.
18442 // gen_amalgamated begin header: gen/protos/perfetto/trace/android/graphics_frame_event.pbzero.h
18443 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
18444 
18445 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_ANDROID_GRAPHICS_FRAME_EVENT_PROTO_H_
18446 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_ANDROID_GRAPHICS_FRAME_EVENT_PROTO_H_
18447 
18448 #include <stddef.h>
18449 #include <stdint.h>
18450 
18451 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
18452 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
18453 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
18454 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
18455 
18456 namespace perfetto {
18457 namespace protos {
18458 namespace pbzero {
18459 
18460 class GraphicsFrameEvent_BufferEvent;
18461 enum GraphicsFrameEvent_BufferEventType : int32_t;
18462 
18463 enum GraphicsFrameEvent_BufferEventType : int32_t {
18464   GraphicsFrameEvent_BufferEventType_UNSPECIFIED = 0,
18465   GraphicsFrameEvent_BufferEventType_DEQUEUE = 1,
18466   GraphicsFrameEvent_BufferEventType_QUEUE = 2,
18467   GraphicsFrameEvent_BufferEventType_POST = 3,
18468   GraphicsFrameEvent_BufferEventType_ACQUIRE_FENCE = 4,
18469   GraphicsFrameEvent_BufferEventType_LATCH = 5,
18470   GraphicsFrameEvent_BufferEventType_HWC_COMPOSITION_QUEUED = 6,
18471   GraphicsFrameEvent_BufferEventType_FALLBACK_COMPOSITION = 7,
18472   GraphicsFrameEvent_BufferEventType_PRESENT_FENCE = 8,
18473   GraphicsFrameEvent_BufferEventType_RELEASE_FENCE = 9,
18474   GraphicsFrameEvent_BufferEventType_MODIFY = 10,
18475   GraphicsFrameEvent_BufferEventType_DETACH = 11,
18476   GraphicsFrameEvent_BufferEventType_ATTACH = 12,
18477   GraphicsFrameEvent_BufferEventType_CANCEL = 13,
18478 };
18479 
18480 const GraphicsFrameEvent_BufferEventType GraphicsFrameEvent_BufferEventType_MIN = GraphicsFrameEvent_BufferEventType_UNSPECIFIED;
18481 const GraphicsFrameEvent_BufferEventType GraphicsFrameEvent_BufferEventType_MAX = GraphicsFrameEvent_BufferEventType_CANCEL;
18482 
18483 class GraphicsFrameEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
18484  public:
18485   GraphicsFrameEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
18486   explicit GraphicsFrameEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
18487   explicit GraphicsFrameEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
18488   bool has_buffer_event() const { return at<1>().valid(); }
18489   ::protozero::ConstBytes buffer_event() const { return at<1>().as_bytes(); }
18490 };
18491 
18492 class GraphicsFrameEvent : public ::protozero::Message {
18493  public:
18494   using Decoder = GraphicsFrameEvent_Decoder;
18495   enum : int32_t {
18496     kBufferEventFieldNumber = 1,
18497   };
18498   using BufferEvent = ::perfetto::protos::pbzero::GraphicsFrameEvent_BufferEvent;
18499   using BufferEventType = ::perfetto::protos::pbzero::GraphicsFrameEvent_BufferEventType;
18500   static const BufferEventType UNSPECIFIED = GraphicsFrameEvent_BufferEventType_UNSPECIFIED;
18501   static const BufferEventType DEQUEUE = GraphicsFrameEvent_BufferEventType_DEQUEUE;
18502   static const BufferEventType QUEUE = GraphicsFrameEvent_BufferEventType_QUEUE;
18503   static const BufferEventType POST = GraphicsFrameEvent_BufferEventType_POST;
18504   static const BufferEventType ACQUIRE_FENCE = GraphicsFrameEvent_BufferEventType_ACQUIRE_FENCE;
18505   static const BufferEventType LATCH = GraphicsFrameEvent_BufferEventType_LATCH;
18506   static const BufferEventType HWC_COMPOSITION_QUEUED = GraphicsFrameEvent_BufferEventType_HWC_COMPOSITION_QUEUED;
18507   static const BufferEventType FALLBACK_COMPOSITION = GraphicsFrameEvent_BufferEventType_FALLBACK_COMPOSITION;
18508   static const BufferEventType PRESENT_FENCE = GraphicsFrameEvent_BufferEventType_PRESENT_FENCE;
18509   static const BufferEventType RELEASE_FENCE = GraphicsFrameEvent_BufferEventType_RELEASE_FENCE;
18510   static const BufferEventType MODIFY = GraphicsFrameEvent_BufferEventType_MODIFY;
18511   static const BufferEventType DETACH = GraphicsFrameEvent_BufferEventType_DETACH;
18512   static const BufferEventType ATTACH = GraphicsFrameEvent_BufferEventType_ATTACH;
18513   static const BufferEventType CANCEL = GraphicsFrameEvent_BufferEventType_CANCEL;
18514   template <typename T = GraphicsFrameEvent_BufferEvent> T* set_buffer_event() {
18515     return BeginNestedMessage<T>(1);
18516   }
18517 
18518 };
18519 
18520 class GraphicsFrameEvent_BufferEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
18521  public:
18522   GraphicsFrameEvent_BufferEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
18523   explicit GraphicsFrameEvent_BufferEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
18524   explicit GraphicsFrameEvent_BufferEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
18525   bool has_frame_number() const { return at<1>().valid(); }
18526   uint32_t frame_number() const { return at<1>().as_uint32(); }
18527   bool has_type() const { return at<2>().valid(); }
18528   int32_t type() const { return at<2>().as_int32(); }
18529   bool has_layer_name() const { return at<3>().valid(); }
18530   ::protozero::ConstChars layer_name() const { return at<3>().as_string(); }
18531   bool has_duration_ns() const { return at<4>().valid(); }
18532   uint64_t duration_ns() const { return at<4>().as_uint64(); }
18533   bool has_buffer_id() const { return at<5>().valid(); }
18534   uint32_t buffer_id() const { return at<5>().as_uint32(); }
18535 };
18536 
18537 class GraphicsFrameEvent_BufferEvent : public ::protozero::Message {
18538  public:
18539   using Decoder = GraphicsFrameEvent_BufferEvent_Decoder;
18540   enum : int32_t {
18541     kFrameNumberFieldNumber = 1,
18542     kTypeFieldNumber = 2,
18543     kLayerNameFieldNumber = 3,
18544     kDurationNsFieldNumber = 4,
18545     kBufferIdFieldNumber = 5,
18546   };
18547   void set_frame_number(uint32_t value) {
18548     AppendVarInt(1, value);
18549   }
18550   void set_type(::perfetto::protos::pbzero::GraphicsFrameEvent_BufferEventType value) {
18551     AppendTinyVarInt(2, value);
18552   }
18553   void set_layer_name(const std::string& value) {
18554     AppendBytes(3, value.data(), value.size());
18555   }
18556   void set_layer_name(const char* data, size_t size) {
18557     AppendBytes(3, data, size);
18558   }
18559   void set_duration_ns(uint64_t value) {
18560     AppendVarInt(4, value);
18561   }
18562   void set_buffer_id(uint32_t value) {
18563     AppendVarInt(5, value);
18564   }
18565 };
18566 
18567 } // Namespace.
18568 } // Namespace.
18569 } // Namespace.
18570 #endif  // Include guard.
18571 // gen_amalgamated begin header: gen/protos/perfetto/trace/android/initial_display_state.pbzero.h
18572 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
18573 
18574 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_ANDROID_INITIAL_DISPLAY_STATE_PROTO_H_
18575 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_ANDROID_INITIAL_DISPLAY_STATE_PROTO_H_
18576 
18577 #include <stddef.h>
18578 #include <stdint.h>
18579 
18580 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
18581 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
18582 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
18583 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
18584 
18585 namespace perfetto {
18586 namespace protos {
18587 namespace pbzero {
18588 
18589 
18590 class InitialDisplayState_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
18591  public:
18592   InitialDisplayState_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
18593   explicit InitialDisplayState_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
18594   explicit InitialDisplayState_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
18595   bool has_display_state() const { return at<1>().valid(); }
18596   int32_t display_state() const { return at<1>().as_int32(); }
18597   bool has_brightness() const { return at<2>().valid(); }
18598   double brightness() const { return at<2>().as_double(); }
18599 };
18600 
18601 class InitialDisplayState : public ::protozero::Message {
18602  public:
18603   using Decoder = InitialDisplayState_Decoder;
18604   enum : int32_t {
18605     kDisplayStateFieldNumber = 1,
18606     kBrightnessFieldNumber = 2,
18607   };
18608   void set_display_state(int32_t value) {
18609     AppendVarInt(1, value);
18610   }
18611   void set_brightness(double value) {
18612     AppendFixed(2, value);
18613   }
18614 };
18615 
18616 } // Namespace.
18617 } // Namespace.
18618 } // Namespace.
18619 #endif  // Include guard.
18620 // gen_amalgamated begin header: gen/protos/perfetto/trace/android/packages_list.pbzero.h
18621 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
18622 
18623 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_ANDROID_PACKAGES_LIST_PROTO_H_
18624 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_ANDROID_PACKAGES_LIST_PROTO_H_
18625 
18626 #include <stddef.h>
18627 #include <stdint.h>
18628 
18629 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
18630 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
18631 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
18632 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
18633 
18634 namespace perfetto {
18635 namespace protos {
18636 namespace pbzero {
18637 
18638 class PackagesList_PackageInfo;
18639 
18640 class PackagesList_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
18641  public:
18642   PackagesList_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
18643   explicit PackagesList_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
18644   explicit PackagesList_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
18645   bool has_packages() const { return at<1>().valid(); }
18646   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> packages() const { return GetRepeated<::protozero::ConstBytes>(1); }
18647   bool has_parse_error() const { return at<2>().valid(); }
18648   bool parse_error() const { return at<2>().as_bool(); }
18649   bool has_read_error() const { return at<3>().valid(); }
18650   bool read_error() const { return at<3>().as_bool(); }
18651 };
18652 
18653 class PackagesList : public ::protozero::Message {
18654  public:
18655   using Decoder = PackagesList_Decoder;
18656   enum : int32_t {
18657     kPackagesFieldNumber = 1,
18658     kParseErrorFieldNumber = 2,
18659     kReadErrorFieldNumber = 3,
18660   };
18661   using PackageInfo = ::perfetto::protos::pbzero::PackagesList_PackageInfo;
18662   template <typename T = PackagesList_PackageInfo> T* add_packages() {
18663     return BeginNestedMessage<T>(1);
18664   }
18665 
18666   void set_parse_error(bool value) {
18667     AppendTinyVarInt(2, value);
18668   }
18669   void set_read_error(bool value) {
18670     AppendTinyVarInt(3, value);
18671   }
18672 };
18673 
18674 class PackagesList_PackageInfo_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
18675  public:
18676   PackagesList_PackageInfo_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
18677   explicit PackagesList_PackageInfo_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
18678   explicit PackagesList_PackageInfo_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
18679   bool has_name() const { return at<1>().valid(); }
18680   ::protozero::ConstChars name() const { return at<1>().as_string(); }
18681   bool has_uid() const { return at<2>().valid(); }
18682   uint64_t uid() const { return at<2>().as_uint64(); }
18683   bool has_debuggable() const { return at<3>().valid(); }
18684   bool debuggable() const { return at<3>().as_bool(); }
18685   bool has_profileable_from_shell() const { return at<4>().valid(); }
18686   bool profileable_from_shell() const { return at<4>().as_bool(); }
18687   bool has_version_code() const { return at<5>().valid(); }
18688   int64_t version_code() const { return at<5>().as_int64(); }
18689 };
18690 
18691 class PackagesList_PackageInfo : public ::protozero::Message {
18692  public:
18693   using Decoder = PackagesList_PackageInfo_Decoder;
18694   enum : int32_t {
18695     kNameFieldNumber = 1,
18696     kUidFieldNumber = 2,
18697     kDebuggableFieldNumber = 3,
18698     kProfileableFromShellFieldNumber = 4,
18699     kVersionCodeFieldNumber = 5,
18700   };
18701   void set_name(const std::string& value) {
18702     AppendBytes(1, value.data(), value.size());
18703   }
18704   void set_name(const char* data, size_t size) {
18705     AppendBytes(1, data, size);
18706   }
18707   void set_uid(uint64_t value) {
18708     AppendVarInt(2, value);
18709   }
18710   void set_debuggable(bool value) {
18711     AppendTinyVarInt(3, value);
18712   }
18713   void set_profileable_from_shell(bool value) {
18714     AppendTinyVarInt(4, value);
18715   }
18716   void set_version_code(int64_t value) {
18717     AppendVarInt(5, value);
18718   }
18719 };
18720 
18721 } // Namespace.
18722 } // Namespace.
18723 } // Namespace.
18724 #endif  // Include guard.
18725 // gen_amalgamated begin header: gen/protos/perfetto/trace/chrome/chrome_benchmark_metadata.pbzero.h
18726 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
18727 
18728 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_CHROME_CHROME_BENCHMARK_METADATA_PROTO_H_
18729 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_CHROME_CHROME_BENCHMARK_METADATA_PROTO_H_
18730 
18731 #include <stddef.h>
18732 #include <stdint.h>
18733 
18734 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
18735 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
18736 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
18737 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
18738 
18739 namespace perfetto {
18740 namespace protos {
18741 namespace pbzero {
18742 
18743 
18744 class ChromeBenchmarkMetadata_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/9, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
18745  public:
18746   ChromeBenchmarkMetadata_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
18747   explicit ChromeBenchmarkMetadata_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
18748   explicit ChromeBenchmarkMetadata_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
18749   bool has_benchmark_start_time_us() const { return at<1>().valid(); }
18750   int64_t benchmark_start_time_us() const { return at<1>().as_int64(); }
18751   bool has_story_run_time_us() const { return at<2>().valid(); }
18752   int64_t story_run_time_us() const { return at<2>().as_int64(); }
18753   bool has_benchmark_name() const { return at<3>().valid(); }
18754   ::protozero::ConstChars benchmark_name() const { return at<3>().as_string(); }
18755   bool has_benchmark_description() const { return at<4>().valid(); }
18756   ::protozero::ConstChars benchmark_description() const { return at<4>().as_string(); }
18757   bool has_label() const { return at<5>().valid(); }
18758   ::protozero::ConstChars label() const { return at<5>().as_string(); }
18759   bool has_story_name() const { return at<6>().valid(); }
18760   ::protozero::ConstChars story_name() const { return at<6>().as_string(); }
18761   bool has_story_tags() const { return at<7>().valid(); }
18762   ::protozero::RepeatedFieldIterator<::protozero::ConstChars> story_tags() const { return GetRepeated<::protozero::ConstChars>(7); }
18763   bool has_story_run_index() const { return at<8>().valid(); }
18764   int32_t story_run_index() const { return at<8>().as_int32(); }
18765   bool has_had_failures() const { return at<9>().valid(); }
18766   bool had_failures() const { return at<9>().as_bool(); }
18767 };
18768 
18769 class ChromeBenchmarkMetadata : public ::protozero::Message {
18770  public:
18771   using Decoder = ChromeBenchmarkMetadata_Decoder;
18772   enum : int32_t {
18773     kBenchmarkStartTimeUsFieldNumber = 1,
18774     kStoryRunTimeUsFieldNumber = 2,
18775     kBenchmarkNameFieldNumber = 3,
18776     kBenchmarkDescriptionFieldNumber = 4,
18777     kLabelFieldNumber = 5,
18778     kStoryNameFieldNumber = 6,
18779     kStoryTagsFieldNumber = 7,
18780     kStoryRunIndexFieldNumber = 8,
18781     kHadFailuresFieldNumber = 9,
18782   };
18783   void set_benchmark_start_time_us(int64_t value) {
18784     AppendVarInt(1, value);
18785   }
18786   void set_story_run_time_us(int64_t value) {
18787     AppendVarInt(2, value);
18788   }
18789   void set_benchmark_name(const std::string& value) {
18790     AppendBytes(3, value.data(), value.size());
18791   }
18792   void set_benchmark_name(const char* data, size_t size) {
18793     AppendBytes(3, data, size);
18794   }
18795   void set_benchmark_description(const std::string& value) {
18796     AppendBytes(4, value.data(), value.size());
18797   }
18798   void set_benchmark_description(const char* data, size_t size) {
18799     AppendBytes(4, data, size);
18800   }
18801   void set_label(const std::string& value) {
18802     AppendBytes(5, value.data(), value.size());
18803   }
18804   void set_label(const char* data, size_t size) {
18805     AppendBytes(5, data, size);
18806   }
18807   void set_story_name(const std::string& value) {
18808     AppendBytes(6, value.data(), value.size());
18809   }
18810   void set_story_name(const char* data, size_t size) {
18811     AppendBytes(6, data, size);
18812   }
18813   void add_story_tags(const std::string& value) {
18814     AppendBytes(7, value.data(), value.size());
18815   }
18816   void add_story_tags(const char* data, size_t size) {
18817     AppendBytes(7, data, size);
18818   }
18819   void set_story_run_index(int32_t value) {
18820     AppendVarInt(8, value);
18821   }
18822   void set_had_failures(bool value) {
18823     AppendTinyVarInt(9, value);
18824   }
18825 };
18826 
18827 } // Namespace.
18828 } // Namespace.
18829 } // Namespace.
18830 #endif  // Include guard.
18831 // gen_amalgamated begin header: gen/protos/perfetto/trace/chrome/chrome_metadata.pbzero.h
18832 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
18833 
18834 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_CHROME_CHROME_METADATA_PROTO_H_
18835 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_CHROME_CHROME_METADATA_PROTO_H_
18836 
18837 #include <stddef.h>
18838 #include <stdint.h>
18839 
18840 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
18841 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
18842 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
18843 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
18844 
18845 namespace perfetto {
18846 namespace protos {
18847 namespace pbzero {
18848 
18849 class BackgroundTracingMetadata;
18850 class BackgroundTracingMetadata_TriggerRule;
18851 class BackgroundTracingMetadata_TriggerRule_HistogramRule;
18852 class BackgroundTracingMetadata_TriggerRule_NamedRule;
18853 enum BackgroundTracingMetadata_TriggerRule_NamedRule_EventType : int32_t;
18854 enum BackgroundTracingMetadata_TriggerRule_TriggerType : int32_t;
18855 
18856 enum BackgroundTracingMetadata_TriggerRule_TriggerType : int32_t {
18857   BackgroundTracingMetadata_TriggerRule_TriggerType_TRIGGER_UNSPECIFIED = 0,
18858   BackgroundTracingMetadata_TriggerRule_TriggerType_MONITOR_AND_DUMP_WHEN_SPECIFIC_HISTOGRAM_AND_VALUE = 1,
18859   BackgroundTracingMetadata_TriggerRule_TriggerType_MONITOR_AND_DUMP_WHEN_TRIGGER_NAMED = 2,
18860 };
18861 
18862 const BackgroundTracingMetadata_TriggerRule_TriggerType BackgroundTracingMetadata_TriggerRule_TriggerType_MIN = BackgroundTracingMetadata_TriggerRule_TriggerType_TRIGGER_UNSPECIFIED;
18863 const BackgroundTracingMetadata_TriggerRule_TriggerType BackgroundTracingMetadata_TriggerRule_TriggerType_MAX = BackgroundTracingMetadata_TriggerRule_TriggerType_MONITOR_AND_DUMP_WHEN_TRIGGER_NAMED;
18864 
18865 enum BackgroundTracingMetadata_TriggerRule_NamedRule_EventType : int32_t {
18866   BackgroundTracingMetadata_TriggerRule_NamedRule_EventType_UNSPECIFIED = 0,
18867   BackgroundTracingMetadata_TriggerRule_NamedRule_EventType_SESSION_RESTORE = 1,
18868   BackgroundTracingMetadata_TriggerRule_NamedRule_EventType_NAVIGATION = 2,
18869   BackgroundTracingMetadata_TriggerRule_NamedRule_EventType_STARTUP = 3,
18870   BackgroundTracingMetadata_TriggerRule_NamedRule_EventType_REACHED_CODE = 4,
18871   BackgroundTracingMetadata_TriggerRule_NamedRule_EventType_TEST_RULE = 1000,
18872 };
18873 
18874 const BackgroundTracingMetadata_TriggerRule_NamedRule_EventType BackgroundTracingMetadata_TriggerRule_NamedRule_EventType_MIN = BackgroundTracingMetadata_TriggerRule_NamedRule_EventType_UNSPECIFIED;
18875 const BackgroundTracingMetadata_TriggerRule_NamedRule_EventType BackgroundTracingMetadata_TriggerRule_NamedRule_EventType_MAX = BackgroundTracingMetadata_TriggerRule_NamedRule_EventType_TEST_RULE;
18876 
18877 class BackgroundTracingMetadata_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
18878  public:
18879   BackgroundTracingMetadata_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
18880   explicit BackgroundTracingMetadata_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
18881   explicit BackgroundTracingMetadata_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
18882   bool has_triggered_rule() const { return at<1>().valid(); }
18883   ::protozero::ConstBytes triggered_rule() const { return at<1>().as_bytes(); }
18884   bool has_active_rules() const { return at<2>().valid(); }
18885   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> active_rules() const { return GetRepeated<::protozero::ConstBytes>(2); }
18886 };
18887 
18888 class BackgroundTracingMetadata : public ::protozero::Message {
18889  public:
18890   using Decoder = BackgroundTracingMetadata_Decoder;
18891   enum : int32_t {
18892     kTriggeredRuleFieldNumber = 1,
18893     kActiveRulesFieldNumber = 2,
18894   };
18895   using TriggerRule = ::perfetto::protos::pbzero::BackgroundTracingMetadata_TriggerRule;
18896   template <typename T = BackgroundTracingMetadata_TriggerRule> T* set_triggered_rule() {
18897     return BeginNestedMessage<T>(1);
18898   }
18899 
18900   template <typename T = BackgroundTracingMetadata_TriggerRule> T* add_active_rules() {
18901     return BeginNestedMessage<T>(2);
18902   }
18903 
18904 };
18905 
18906 class BackgroundTracingMetadata_TriggerRule_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
18907  public:
18908   BackgroundTracingMetadata_TriggerRule_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
18909   explicit BackgroundTracingMetadata_TriggerRule_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
18910   explicit BackgroundTracingMetadata_TriggerRule_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
18911   bool has_trigger_type() const { return at<1>().valid(); }
18912   int32_t trigger_type() const { return at<1>().as_int32(); }
18913   bool has_histogram_rule() const { return at<2>().valid(); }
18914   ::protozero::ConstBytes histogram_rule() const { return at<2>().as_bytes(); }
18915   bool has_named_rule() const { return at<3>().valid(); }
18916   ::protozero::ConstBytes named_rule() const { return at<3>().as_bytes(); }
18917 };
18918 
18919 class BackgroundTracingMetadata_TriggerRule : public ::protozero::Message {
18920  public:
18921   using Decoder = BackgroundTracingMetadata_TriggerRule_Decoder;
18922   enum : int32_t {
18923     kTriggerTypeFieldNumber = 1,
18924     kHistogramRuleFieldNumber = 2,
18925     kNamedRuleFieldNumber = 3,
18926   };
18927   using HistogramRule = ::perfetto::protos::pbzero::BackgroundTracingMetadata_TriggerRule_HistogramRule;
18928   using NamedRule = ::perfetto::protos::pbzero::BackgroundTracingMetadata_TriggerRule_NamedRule;
18929   using TriggerType = ::perfetto::protos::pbzero::BackgroundTracingMetadata_TriggerRule_TriggerType;
18930   static const TriggerType TRIGGER_UNSPECIFIED = BackgroundTracingMetadata_TriggerRule_TriggerType_TRIGGER_UNSPECIFIED;
18931   static const TriggerType MONITOR_AND_DUMP_WHEN_SPECIFIC_HISTOGRAM_AND_VALUE = BackgroundTracingMetadata_TriggerRule_TriggerType_MONITOR_AND_DUMP_WHEN_SPECIFIC_HISTOGRAM_AND_VALUE;
18932   static const TriggerType MONITOR_AND_DUMP_WHEN_TRIGGER_NAMED = BackgroundTracingMetadata_TriggerRule_TriggerType_MONITOR_AND_DUMP_WHEN_TRIGGER_NAMED;
18933   void set_trigger_type(::perfetto::protos::pbzero::BackgroundTracingMetadata_TriggerRule_TriggerType value) {
18934     AppendTinyVarInt(1, value);
18935   }
18936   template <typename T = BackgroundTracingMetadata_TriggerRule_HistogramRule> T* set_histogram_rule() {
18937     return BeginNestedMessage<T>(2);
18938   }
18939 
18940   template <typename T = BackgroundTracingMetadata_TriggerRule_NamedRule> T* set_named_rule() {
18941     return BeginNestedMessage<T>(3);
18942   }
18943 
18944 };
18945 
18946 class BackgroundTracingMetadata_TriggerRule_NamedRule_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
18947  public:
18948   BackgroundTracingMetadata_TriggerRule_NamedRule_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
18949   explicit BackgroundTracingMetadata_TriggerRule_NamedRule_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
18950   explicit BackgroundTracingMetadata_TriggerRule_NamedRule_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
18951   bool has_event_type() const { return at<1>().valid(); }
18952   int32_t event_type() const { return at<1>().as_int32(); }
18953 };
18954 
18955 class BackgroundTracingMetadata_TriggerRule_NamedRule : public ::protozero::Message {
18956  public:
18957   using Decoder = BackgroundTracingMetadata_TriggerRule_NamedRule_Decoder;
18958   enum : int32_t {
18959     kEventTypeFieldNumber = 1,
18960   };
18961   using EventType = ::perfetto::protos::pbzero::BackgroundTracingMetadata_TriggerRule_NamedRule_EventType;
18962   static const EventType UNSPECIFIED = BackgroundTracingMetadata_TriggerRule_NamedRule_EventType_UNSPECIFIED;
18963   static const EventType SESSION_RESTORE = BackgroundTracingMetadata_TriggerRule_NamedRule_EventType_SESSION_RESTORE;
18964   static const EventType NAVIGATION = BackgroundTracingMetadata_TriggerRule_NamedRule_EventType_NAVIGATION;
18965   static const EventType STARTUP = BackgroundTracingMetadata_TriggerRule_NamedRule_EventType_STARTUP;
18966   static const EventType REACHED_CODE = BackgroundTracingMetadata_TriggerRule_NamedRule_EventType_REACHED_CODE;
18967   static const EventType TEST_RULE = BackgroundTracingMetadata_TriggerRule_NamedRule_EventType_TEST_RULE;
18968   void set_event_type(::perfetto::protos::pbzero::BackgroundTracingMetadata_TriggerRule_NamedRule_EventType value) {
18969     AppendVarInt(1, value);
18970   }
18971 };
18972 
18973 class BackgroundTracingMetadata_TriggerRule_HistogramRule_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
18974  public:
18975   BackgroundTracingMetadata_TriggerRule_HistogramRule_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
18976   explicit BackgroundTracingMetadata_TriggerRule_HistogramRule_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
18977   explicit BackgroundTracingMetadata_TriggerRule_HistogramRule_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
18978   bool has_histogram_name_hash() const { return at<1>().valid(); }
18979   uint64_t histogram_name_hash() const { return at<1>().as_uint64(); }
18980   bool has_histogram_min_trigger() const { return at<2>().valid(); }
18981   int64_t histogram_min_trigger() const { return at<2>().as_int64(); }
18982   bool has_histogram_max_trigger() const { return at<3>().valid(); }
18983   int64_t histogram_max_trigger() const { return at<3>().as_int64(); }
18984 };
18985 
18986 class BackgroundTracingMetadata_TriggerRule_HistogramRule : public ::protozero::Message {
18987  public:
18988   using Decoder = BackgroundTracingMetadata_TriggerRule_HistogramRule_Decoder;
18989   enum : int32_t {
18990     kHistogramNameHashFieldNumber = 1,
18991     kHistogramMinTriggerFieldNumber = 2,
18992     kHistogramMaxTriggerFieldNumber = 3,
18993   };
18994   void set_histogram_name_hash(uint64_t value) {
18995     AppendFixed(1, value);
18996   }
18997   void set_histogram_min_trigger(int64_t value) {
18998     AppendVarInt(2, value);
18999   }
19000   void set_histogram_max_trigger(int64_t value) {
19001     AppendVarInt(3, value);
19002   }
19003 };
19004 
19005 class ChromeMetadataPacket_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
19006  public:
19007   ChromeMetadataPacket_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
19008   explicit ChromeMetadataPacket_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
19009   explicit ChromeMetadataPacket_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
19010   bool has_background_tracing_metadata() const { return at<1>().valid(); }
19011   ::protozero::ConstBytes background_tracing_metadata() const { return at<1>().as_bytes(); }
19012   bool has_chrome_version_code() const { return at<2>().valid(); }
19013   int32_t chrome_version_code() const { return at<2>().as_int32(); }
19014 };
19015 
19016 class ChromeMetadataPacket : public ::protozero::Message {
19017  public:
19018   using Decoder = ChromeMetadataPacket_Decoder;
19019   enum : int32_t {
19020     kBackgroundTracingMetadataFieldNumber = 1,
19021     kChromeVersionCodeFieldNumber = 2,
19022   };
19023   template <typename T = BackgroundTracingMetadata> T* set_background_tracing_metadata() {
19024     return BeginNestedMessage<T>(1);
19025   }
19026 
19027   void set_chrome_version_code(int32_t value) {
19028     AppendVarInt(2, value);
19029   }
19030 };
19031 
19032 } // Namespace.
19033 } // Namespace.
19034 } // Namespace.
19035 #endif  // Include guard.
19036 // gen_amalgamated begin header: gen/protos/perfetto/trace/chrome/chrome_trace_event.pbzero.h
19037 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
19038 
19039 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_CHROME_CHROME_TRACE_EVENT_PROTO_H_
19040 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_CHROME_CHROME_TRACE_EVENT_PROTO_H_
19041 
19042 #include <stddef.h>
19043 #include <stdint.h>
19044 
19045 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
19046 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
19047 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
19048 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
19049 
19050 namespace perfetto {
19051 namespace protos {
19052 namespace pbzero {
19053 
19054 class ChromeLegacyJsonTrace;
19055 class ChromeMetadata;
19056 class ChromeStringTableEntry;
19057 class ChromeTraceEvent;
19058 class ChromeTraceEvent_Arg;
19059 class ChromeTracedValue;
19060 enum ChromeLegacyJsonTrace_TraceType : int32_t;
19061 enum ChromeTracedValue_NestedType : int32_t;
19062 
19063 enum ChromeLegacyJsonTrace_TraceType : int32_t {
19064   ChromeLegacyJsonTrace_TraceType_USER_TRACE = 0,
19065   ChromeLegacyJsonTrace_TraceType_SYSTEM_TRACE = 1,
19066 };
19067 
19068 const ChromeLegacyJsonTrace_TraceType ChromeLegacyJsonTrace_TraceType_MIN = ChromeLegacyJsonTrace_TraceType_USER_TRACE;
19069 const ChromeLegacyJsonTrace_TraceType ChromeLegacyJsonTrace_TraceType_MAX = ChromeLegacyJsonTrace_TraceType_SYSTEM_TRACE;
19070 
19071 enum ChromeTracedValue_NestedType : int32_t {
19072   ChromeTracedValue_NestedType_DICT = 0,
19073   ChromeTracedValue_NestedType_ARRAY = 1,
19074 };
19075 
19076 const ChromeTracedValue_NestedType ChromeTracedValue_NestedType_MIN = ChromeTracedValue_NestedType_DICT;
19077 const ChromeTracedValue_NestedType ChromeTracedValue_NestedType_MAX = ChromeTracedValue_NestedType_ARRAY;
19078 
19079 class ChromeEventBundle_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
19080  public:
19081   ChromeEventBundle_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
19082   explicit ChromeEventBundle_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
19083   explicit ChromeEventBundle_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
19084   bool has_trace_events() const { return at<1>().valid(); }
19085   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> trace_events() const { return GetRepeated<::protozero::ConstBytes>(1); }
19086   bool has_metadata() const { return at<2>().valid(); }
19087   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> metadata() const { return GetRepeated<::protozero::ConstBytes>(2); }
19088   bool has_legacy_ftrace_output() const { return at<4>().valid(); }
19089   ::protozero::RepeatedFieldIterator<::protozero::ConstChars> legacy_ftrace_output() const { return GetRepeated<::protozero::ConstChars>(4); }
19090   bool has_legacy_json_trace() const { return at<5>().valid(); }
19091   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> legacy_json_trace() const { return GetRepeated<::protozero::ConstBytes>(5); }
19092   bool has_string_table() const { return at<3>().valid(); }
19093   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> string_table() const { return GetRepeated<::protozero::ConstBytes>(3); }
19094 };
19095 
19096 class ChromeEventBundle : public ::protozero::Message {
19097  public:
19098   using Decoder = ChromeEventBundle_Decoder;
19099   enum : int32_t {
19100     kTraceEventsFieldNumber = 1,
19101     kMetadataFieldNumber = 2,
19102     kLegacyFtraceOutputFieldNumber = 4,
19103     kLegacyJsonTraceFieldNumber = 5,
19104     kStringTableFieldNumber = 3,
19105   };
19106   template <typename T = ChromeTraceEvent> T* add_trace_events() {
19107     return BeginNestedMessage<T>(1);
19108   }
19109 
19110   template <typename T = ChromeMetadata> T* add_metadata() {
19111     return BeginNestedMessage<T>(2);
19112   }
19113 
19114   void add_legacy_ftrace_output(const std::string& value) {
19115     AppendBytes(4, value.data(), value.size());
19116   }
19117   void add_legacy_ftrace_output(const char* data, size_t size) {
19118     AppendBytes(4, data, size);
19119   }
19120   template <typename T = ChromeLegacyJsonTrace> T* add_legacy_json_trace() {
19121     return BeginNestedMessage<T>(5);
19122   }
19123 
19124   template <typename T = ChromeStringTableEntry> T* add_string_table() {
19125     return BeginNestedMessage<T>(3);
19126   }
19127 
19128 };
19129 
19130 class ChromeLegacyJsonTrace_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
19131  public:
19132   ChromeLegacyJsonTrace_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
19133   explicit ChromeLegacyJsonTrace_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
19134   explicit ChromeLegacyJsonTrace_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
19135   bool has_type() const { return at<1>().valid(); }
19136   int32_t type() const { return at<1>().as_int32(); }
19137   bool has_data() const { return at<2>().valid(); }
19138   ::protozero::ConstChars data() const { return at<2>().as_string(); }
19139 };
19140 
19141 class ChromeLegacyJsonTrace : public ::protozero::Message {
19142  public:
19143   using Decoder = ChromeLegacyJsonTrace_Decoder;
19144   enum : int32_t {
19145     kTypeFieldNumber = 1,
19146     kDataFieldNumber = 2,
19147   };
19148   using TraceType = ::perfetto::protos::pbzero::ChromeLegacyJsonTrace_TraceType;
19149   static const TraceType USER_TRACE = ChromeLegacyJsonTrace_TraceType_USER_TRACE;
19150   static const TraceType SYSTEM_TRACE = ChromeLegacyJsonTrace_TraceType_SYSTEM_TRACE;
19151   void set_type(::perfetto::protos::pbzero::ChromeLegacyJsonTrace_TraceType value) {
19152     AppendTinyVarInt(1, value);
19153   }
19154   void set_data(const std::string& value) {
19155     AppendBytes(2, value.data(), value.size());
19156   }
19157   void set_data(const char* data, size_t size) {
19158     AppendBytes(2, data, size);
19159   }
19160 };
19161 
19162 class ChromeMetadata_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
19163  public:
19164   ChromeMetadata_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
19165   explicit ChromeMetadata_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
19166   explicit ChromeMetadata_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
19167   bool has_name() const { return at<1>().valid(); }
19168   ::protozero::ConstChars name() const { return at<1>().as_string(); }
19169   bool has_string_value() const { return at<2>().valid(); }
19170   ::protozero::ConstChars string_value() const { return at<2>().as_string(); }
19171   bool has_bool_value() const { return at<3>().valid(); }
19172   bool bool_value() const { return at<3>().as_bool(); }
19173   bool has_int_value() const { return at<4>().valid(); }
19174   int64_t int_value() const { return at<4>().as_int64(); }
19175   bool has_json_value() const { return at<5>().valid(); }
19176   ::protozero::ConstChars json_value() const { return at<5>().as_string(); }
19177 };
19178 
19179 class ChromeMetadata : public ::protozero::Message {
19180  public:
19181   using Decoder = ChromeMetadata_Decoder;
19182   enum : int32_t {
19183     kNameFieldNumber = 1,
19184     kStringValueFieldNumber = 2,
19185     kBoolValueFieldNumber = 3,
19186     kIntValueFieldNumber = 4,
19187     kJsonValueFieldNumber = 5,
19188   };
19189   void set_name(const std::string& value) {
19190     AppendBytes(1, value.data(), value.size());
19191   }
19192   void set_name(const char* data, size_t size) {
19193     AppendBytes(1, data, size);
19194   }
19195   void set_string_value(const std::string& value) {
19196     AppendBytes(2, value.data(), value.size());
19197   }
19198   void set_string_value(const char* data, size_t size) {
19199     AppendBytes(2, data, size);
19200   }
19201   void set_bool_value(bool value) {
19202     AppendTinyVarInt(3, value);
19203   }
19204   void set_int_value(int64_t value) {
19205     AppendVarInt(4, value);
19206   }
19207   void set_json_value(const std::string& value) {
19208     AppendBytes(5, value.data(), value.size());
19209   }
19210   void set_json_value(const char* data, size_t size) {
19211     AppendBytes(5, data, size);
19212   }
19213 };
19214 
19215 class ChromeTraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/16, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
19216  public:
19217   ChromeTraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
19218   explicit ChromeTraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
19219   explicit ChromeTraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
19220   bool has_name() const { return at<1>().valid(); }
19221   ::protozero::ConstChars name() const { return at<1>().as_string(); }
19222   bool has_timestamp() const { return at<2>().valid(); }
19223   int64_t timestamp() const { return at<2>().as_int64(); }
19224   bool has_phase() const { return at<3>().valid(); }
19225   int32_t phase() const { return at<3>().as_int32(); }
19226   bool has_thread_id() const { return at<4>().valid(); }
19227   int32_t thread_id() const { return at<4>().as_int32(); }
19228   bool has_duration() const { return at<5>().valid(); }
19229   int64_t duration() const { return at<5>().as_int64(); }
19230   bool has_thread_duration() const { return at<6>().valid(); }
19231   int64_t thread_duration() const { return at<6>().as_int64(); }
19232   bool has_scope() const { return at<7>().valid(); }
19233   ::protozero::ConstChars scope() const { return at<7>().as_string(); }
19234   bool has_id() const { return at<8>().valid(); }
19235   uint64_t id() const { return at<8>().as_uint64(); }
19236   bool has_flags() const { return at<9>().valid(); }
19237   uint32_t flags() const { return at<9>().as_uint32(); }
19238   bool has_category_group_name() const { return at<10>().valid(); }
19239   ::protozero::ConstChars category_group_name() const { return at<10>().as_string(); }
19240   bool has_process_id() const { return at<11>().valid(); }
19241   int32_t process_id() const { return at<11>().as_int32(); }
19242   bool has_thread_timestamp() const { return at<12>().valid(); }
19243   int64_t thread_timestamp() const { return at<12>().as_int64(); }
19244   bool has_bind_id() const { return at<13>().valid(); }
19245   uint64_t bind_id() const { return at<13>().as_uint64(); }
19246   bool has_args() const { return at<14>().valid(); }
19247   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> args() const { return GetRepeated<::protozero::ConstBytes>(14); }
19248   bool has_name_index() const { return at<15>().valid(); }
19249   uint32_t name_index() const { return at<15>().as_uint32(); }
19250   bool has_category_group_name_index() const { return at<16>().valid(); }
19251   uint32_t category_group_name_index() const { return at<16>().as_uint32(); }
19252 };
19253 
19254 class ChromeTraceEvent : public ::protozero::Message {
19255  public:
19256   using Decoder = ChromeTraceEvent_Decoder;
19257   enum : int32_t {
19258     kNameFieldNumber = 1,
19259     kTimestampFieldNumber = 2,
19260     kPhaseFieldNumber = 3,
19261     kThreadIdFieldNumber = 4,
19262     kDurationFieldNumber = 5,
19263     kThreadDurationFieldNumber = 6,
19264     kScopeFieldNumber = 7,
19265     kIdFieldNumber = 8,
19266     kFlagsFieldNumber = 9,
19267     kCategoryGroupNameFieldNumber = 10,
19268     kProcessIdFieldNumber = 11,
19269     kThreadTimestampFieldNumber = 12,
19270     kBindIdFieldNumber = 13,
19271     kArgsFieldNumber = 14,
19272     kNameIndexFieldNumber = 15,
19273     kCategoryGroupNameIndexFieldNumber = 16,
19274   };
19275   using Arg = ::perfetto::protos::pbzero::ChromeTraceEvent_Arg;
19276   void set_name(const std::string& value) {
19277     AppendBytes(1, value.data(), value.size());
19278   }
19279   void set_name(const char* data, size_t size) {
19280     AppendBytes(1, data, size);
19281   }
19282   void set_timestamp(int64_t value) {
19283     AppendVarInt(2, value);
19284   }
19285   void set_phase(int32_t value) {
19286     AppendVarInt(3, value);
19287   }
19288   void set_thread_id(int32_t value) {
19289     AppendVarInt(4, value);
19290   }
19291   void set_duration(int64_t value) {
19292     AppendVarInt(5, value);
19293   }
19294   void set_thread_duration(int64_t value) {
19295     AppendVarInt(6, value);
19296   }
19297   void set_scope(const std::string& value) {
19298     AppendBytes(7, value.data(), value.size());
19299   }
19300   void set_scope(const char* data, size_t size) {
19301     AppendBytes(7, data, size);
19302   }
19303   void set_id(uint64_t value) {
19304     AppendVarInt(8, value);
19305   }
19306   void set_flags(uint32_t value) {
19307     AppendVarInt(9, value);
19308   }
19309   void set_category_group_name(const std::string& value) {
19310     AppendBytes(10, value.data(), value.size());
19311   }
19312   void set_category_group_name(const char* data, size_t size) {
19313     AppendBytes(10, data, size);
19314   }
19315   void set_process_id(int32_t value) {
19316     AppendVarInt(11, value);
19317   }
19318   void set_thread_timestamp(int64_t value) {
19319     AppendVarInt(12, value);
19320   }
19321   void set_bind_id(uint64_t value) {
19322     AppendVarInt(13, value);
19323   }
19324   template <typename T = ChromeTraceEvent_Arg> T* add_args() {
19325     return BeginNestedMessage<T>(14);
19326   }
19327 
19328   void set_name_index(uint32_t value) {
19329     AppendVarInt(15, value);
19330   }
19331   void set_category_group_name_index(uint32_t value) {
19332     AppendVarInt(16, value);
19333   }
19334 };
19335 
19336 class ChromeTraceEvent_Arg_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/10, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
19337  public:
19338   ChromeTraceEvent_Arg_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
19339   explicit ChromeTraceEvent_Arg_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
19340   explicit ChromeTraceEvent_Arg_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
19341   bool has_name() const { return at<1>().valid(); }
19342   ::protozero::ConstChars name() const { return at<1>().as_string(); }
19343   bool has_bool_value() const { return at<2>().valid(); }
19344   bool bool_value() const { return at<2>().as_bool(); }
19345   bool has_uint_value() const { return at<3>().valid(); }
19346   uint64_t uint_value() const { return at<3>().as_uint64(); }
19347   bool has_int_value() const { return at<4>().valid(); }
19348   int64_t int_value() const { return at<4>().as_int64(); }
19349   bool has_double_value() const { return at<5>().valid(); }
19350   double double_value() const { return at<5>().as_double(); }
19351   bool has_string_value() const { return at<6>().valid(); }
19352   ::protozero::ConstChars string_value() const { return at<6>().as_string(); }
19353   bool has_pointer_value() const { return at<7>().valid(); }
19354   uint64_t pointer_value() const { return at<7>().as_uint64(); }
19355   bool has_json_value() const { return at<8>().valid(); }
19356   ::protozero::ConstChars json_value() const { return at<8>().as_string(); }
19357   bool has_traced_value() const { return at<10>().valid(); }
19358   ::protozero::ConstBytes traced_value() const { return at<10>().as_bytes(); }
19359   bool has_name_index() const { return at<9>().valid(); }
19360   uint32_t name_index() const { return at<9>().as_uint32(); }
19361 };
19362 
19363 class ChromeTraceEvent_Arg : public ::protozero::Message {
19364  public:
19365   using Decoder = ChromeTraceEvent_Arg_Decoder;
19366   enum : int32_t {
19367     kNameFieldNumber = 1,
19368     kBoolValueFieldNumber = 2,
19369     kUintValueFieldNumber = 3,
19370     kIntValueFieldNumber = 4,
19371     kDoubleValueFieldNumber = 5,
19372     kStringValueFieldNumber = 6,
19373     kPointerValueFieldNumber = 7,
19374     kJsonValueFieldNumber = 8,
19375     kTracedValueFieldNumber = 10,
19376     kNameIndexFieldNumber = 9,
19377   };
19378   void set_name(const std::string& value) {
19379     AppendBytes(1, value.data(), value.size());
19380   }
19381   void set_name(const char* data, size_t size) {
19382     AppendBytes(1, data, size);
19383   }
19384   void set_bool_value(bool value) {
19385     AppendTinyVarInt(2, value);
19386   }
19387   void set_uint_value(uint64_t value) {
19388     AppendVarInt(3, value);
19389   }
19390   void set_int_value(int64_t value) {
19391     AppendVarInt(4, value);
19392   }
19393   void set_double_value(double value) {
19394     AppendFixed(5, value);
19395   }
19396   void set_string_value(const std::string& value) {
19397     AppendBytes(6, value.data(), value.size());
19398   }
19399   void set_string_value(const char* data, size_t size) {
19400     AppendBytes(6, data, size);
19401   }
19402   void set_pointer_value(uint64_t value) {
19403     AppendVarInt(7, value);
19404   }
19405   void set_json_value(const std::string& value) {
19406     AppendBytes(8, value.data(), value.size());
19407   }
19408   void set_json_value(const char* data, size_t size) {
19409     AppendBytes(8, data, size);
19410   }
19411   template <typename T = ChromeTracedValue> T* set_traced_value() {
19412     return BeginNestedMessage<T>(10);
19413   }
19414 
19415   void set_name_index(uint32_t value) {
19416     AppendVarInt(9, value);
19417   }
19418 };
19419 
19420 class ChromeStringTableEntry_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
19421  public:
19422   ChromeStringTableEntry_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
19423   explicit ChromeStringTableEntry_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
19424   explicit ChromeStringTableEntry_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
19425   bool has_value() const { return at<1>().valid(); }
19426   ::protozero::ConstChars value() const { return at<1>().as_string(); }
19427   bool has_index() const { return at<2>().valid(); }
19428   int32_t index() const { return at<2>().as_int32(); }
19429 };
19430 
19431 class ChromeStringTableEntry : public ::protozero::Message {
19432  public:
19433   using Decoder = ChromeStringTableEntry_Decoder;
19434   enum : int32_t {
19435     kValueFieldNumber = 1,
19436     kIndexFieldNumber = 2,
19437   };
19438   void set_value(const std::string& value) {
19439     AppendBytes(1, value.data(), value.size());
19440   }
19441   void set_value(const char* data, size_t size) {
19442     AppendBytes(1, data, size);
19443   }
19444   void set_index(int32_t value) {
19445     AppendVarInt(2, value);
19446   }
19447 };
19448 
19449 class ChromeTracedValue_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
19450  public:
19451   ChromeTracedValue_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
19452   explicit ChromeTracedValue_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
19453   explicit ChromeTracedValue_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
19454   bool has_nested_type() const { return at<1>().valid(); }
19455   int32_t nested_type() const { return at<1>().as_int32(); }
19456   bool has_dict_keys() const { return at<2>().valid(); }
19457   ::protozero::RepeatedFieldIterator<::protozero::ConstChars> dict_keys() const { return GetRepeated<::protozero::ConstChars>(2); }
19458   bool has_dict_values() const { return at<3>().valid(); }
19459   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> dict_values() const { return GetRepeated<::protozero::ConstBytes>(3); }
19460   bool has_array_values() const { return at<4>().valid(); }
19461   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> array_values() const { return GetRepeated<::protozero::ConstBytes>(4); }
19462   bool has_int_value() const { return at<5>().valid(); }
19463   int32_t int_value() const { return at<5>().as_int32(); }
19464   bool has_double_value() const { return at<6>().valid(); }
19465   double double_value() const { return at<6>().as_double(); }
19466   bool has_bool_value() const { return at<7>().valid(); }
19467   bool bool_value() const { return at<7>().as_bool(); }
19468   bool has_string_value() const { return at<8>().valid(); }
19469   ::protozero::ConstChars string_value() const { return at<8>().as_string(); }
19470 };
19471 
19472 class ChromeTracedValue : public ::protozero::Message {
19473  public:
19474   using Decoder = ChromeTracedValue_Decoder;
19475   enum : int32_t {
19476     kNestedTypeFieldNumber = 1,
19477     kDictKeysFieldNumber = 2,
19478     kDictValuesFieldNumber = 3,
19479     kArrayValuesFieldNumber = 4,
19480     kIntValueFieldNumber = 5,
19481     kDoubleValueFieldNumber = 6,
19482     kBoolValueFieldNumber = 7,
19483     kStringValueFieldNumber = 8,
19484   };
19485   using NestedType = ::perfetto::protos::pbzero::ChromeTracedValue_NestedType;
19486   static const NestedType DICT = ChromeTracedValue_NestedType_DICT;
19487   static const NestedType ARRAY = ChromeTracedValue_NestedType_ARRAY;
19488   void set_nested_type(::perfetto::protos::pbzero::ChromeTracedValue_NestedType value) {
19489     AppendTinyVarInt(1, value);
19490   }
19491   void add_dict_keys(const std::string& value) {
19492     AppendBytes(2, value.data(), value.size());
19493   }
19494   void add_dict_keys(const char* data, size_t size) {
19495     AppendBytes(2, data, size);
19496   }
19497   template <typename T = ChromeTracedValue> T* add_dict_values() {
19498     return BeginNestedMessage<T>(3);
19499   }
19500 
19501   template <typename T = ChromeTracedValue> T* add_array_values() {
19502     return BeginNestedMessage<T>(4);
19503   }
19504 
19505   void set_int_value(int32_t value) {
19506     AppendVarInt(5, value);
19507   }
19508   void set_double_value(double value) {
19509     AppendFixed(6, value);
19510   }
19511   void set_bool_value(bool value) {
19512     AppendTinyVarInt(7, value);
19513   }
19514   void set_string_value(const std::string& value) {
19515     AppendBytes(8, value.data(), value.size());
19516   }
19517   void set_string_value(const char* data, size_t size) {
19518     AppendBytes(8, data, size);
19519   }
19520 };
19521 
19522 } // Namespace.
19523 } // Namespace.
19524 } // Namespace.
19525 #endif  // Include guard.
19526 // gen_amalgamated begin header: gen/protos/perfetto/trace/filesystem/inode_file_map.pbzero.h
19527 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
19528 
19529 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FILESYSTEM_INODE_FILE_MAP_PROTO_H_
19530 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FILESYSTEM_INODE_FILE_MAP_PROTO_H_
19531 
19532 #include <stddef.h>
19533 #include <stdint.h>
19534 
19535 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
19536 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
19537 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
19538 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
19539 
19540 namespace perfetto {
19541 namespace protos {
19542 namespace pbzero {
19543 
19544 class InodeFileMap_Entry;
19545 enum InodeFileMap_Entry_Type : int32_t;
19546 
19547 enum InodeFileMap_Entry_Type : int32_t {
19548   InodeFileMap_Entry_Type_UNKNOWN = 0,
19549   InodeFileMap_Entry_Type_FILE = 1,
19550   InodeFileMap_Entry_Type_DIRECTORY = 2,
19551 };
19552 
19553 const InodeFileMap_Entry_Type InodeFileMap_Entry_Type_MIN = InodeFileMap_Entry_Type_UNKNOWN;
19554 const InodeFileMap_Entry_Type InodeFileMap_Entry_Type_MAX = InodeFileMap_Entry_Type_DIRECTORY;
19555 
19556 class InodeFileMap_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
19557  public:
19558   InodeFileMap_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
19559   explicit InodeFileMap_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
19560   explicit InodeFileMap_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
19561   bool has_block_device_id() const { return at<1>().valid(); }
19562   uint64_t block_device_id() const { return at<1>().as_uint64(); }
19563   bool has_mount_points() const { return at<2>().valid(); }
19564   ::protozero::RepeatedFieldIterator<::protozero::ConstChars> mount_points() const { return GetRepeated<::protozero::ConstChars>(2); }
19565   bool has_entries() const { return at<3>().valid(); }
19566   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> entries() const { return GetRepeated<::protozero::ConstBytes>(3); }
19567 };
19568 
19569 class InodeFileMap : public ::protozero::Message {
19570  public:
19571   using Decoder = InodeFileMap_Decoder;
19572   enum : int32_t {
19573     kBlockDeviceIdFieldNumber = 1,
19574     kMountPointsFieldNumber = 2,
19575     kEntriesFieldNumber = 3,
19576   };
19577   using Entry = ::perfetto::protos::pbzero::InodeFileMap_Entry;
19578   void set_block_device_id(uint64_t value) {
19579     AppendVarInt(1, value);
19580   }
19581   void add_mount_points(const std::string& value) {
19582     AppendBytes(2, value.data(), value.size());
19583   }
19584   void add_mount_points(const char* data, size_t size) {
19585     AppendBytes(2, data, size);
19586   }
19587   template <typename T = InodeFileMap_Entry> T* add_entries() {
19588     return BeginNestedMessage<T>(3);
19589   }
19590 
19591 };
19592 
19593 class InodeFileMap_Entry_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
19594  public:
19595   InodeFileMap_Entry_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
19596   explicit InodeFileMap_Entry_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
19597   explicit InodeFileMap_Entry_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
19598   bool has_inode_number() const { return at<1>().valid(); }
19599   uint64_t inode_number() const { return at<1>().as_uint64(); }
19600   bool has_paths() const { return at<2>().valid(); }
19601   ::protozero::RepeatedFieldIterator<::protozero::ConstChars> paths() const { return GetRepeated<::protozero::ConstChars>(2); }
19602   bool has_type() const { return at<3>().valid(); }
19603   int32_t type() const { return at<3>().as_int32(); }
19604 };
19605 
19606 class InodeFileMap_Entry : public ::protozero::Message {
19607  public:
19608   using Decoder = InodeFileMap_Entry_Decoder;
19609   enum : int32_t {
19610     kInodeNumberFieldNumber = 1,
19611     kPathsFieldNumber = 2,
19612     kTypeFieldNumber = 3,
19613   };
19614   using Type = ::perfetto::protos::pbzero::InodeFileMap_Entry_Type;
19615   static const Type UNKNOWN = InodeFileMap_Entry_Type_UNKNOWN;
19616   static const Type FILE = InodeFileMap_Entry_Type_FILE;
19617   static const Type DIRECTORY = InodeFileMap_Entry_Type_DIRECTORY;
19618   void set_inode_number(uint64_t value) {
19619     AppendVarInt(1, value);
19620   }
19621   void add_paths(const std::string& value) {
19622     AppendBytes(2, value.data(), value.size());
19623   }
19624   void add_paths(const char* data, size_t size) {
19625     AppendBytes(2, data, size);
19626   }
19627   void set_type(::perfetto::protos::pbzero::InodeFileMap_Entry_Type value) {
19628     AppendTinyVarInt(3, value);
19629   }
19630 };
19631 
19632 } // Namespace.
19633 } // Namespace.
19634 } // Namespace.
19635 #endif  // Include guard.
19636 // gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/ftrace_event.pbzero.h
19637 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
19638 
19639 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_FTRACE_EVENT_PROTO_H_
19640 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_FTRACE_EVENT_PROTO_H_
19641 
19642 #include <stddef.h>
19643 #include <stdint.h>
19644 
19645 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
19646 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
19647 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
19648 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
19649 
19650 namespace perfetto {
19651 namespace protos {
19652 namespace pbzero {
19653 
19654 class AllocPagesIommuEndFtraceEvent;
19655 class AllocPagesIommuFailFtraceEvent;
19656 class AllocPagesIommuStartFtraceEvent;
19657 class AllocPagesSysEndFtraceEvent;
19658 class AllocPagesSysFailFtraceEvent;
19659 class AllocPagesSysStartFtraceEvent;
19660 class BinderLockFtraceEvent;
19661 class BinderLockedFtraceEvent;
19662 class BinderSetPriorityFtraceEvent;
19663 class BinderTransactionAllocBufFtraceEvent;
19664 class BinderTransactionFtraceEvent;
19665 class BinderTransactionReceivedFtraceEvent;
19666 class BinderUnlockFtraceEvent;
19667 class BlockBioBackmergeFtraceEvent;
19668 class BlockBioBounceFtraceEvent;
19669 class BlockBioCompleteFtraceEvent;
19670 class BlockBioFrontmergeFtraceEvent;
19671 class BlockBioQueueFtraceEvent;
19672 class BlockBioRemapFtraceEvent;
19673 class BlockDirtyBufferFtraceEvent;
19674 class BlockGetrqFtraceEvent;
19675 class BlockPlugFtraceEvent;
19676 class BlockRqAbortFtraceEvent;
19677 class BlockRqCompleteFtraceEvent;
19678 class BlockRqInsertFtraceEvent;
19679 class BlockRqIssueFtraceEvent;
19680 class BlockRqRemapFtraceEvent;
19681 class BlockRqRequeueFtraceEvent;
19682 class BlockSleeprqFtraceEvent;
19683 class BlockSplitFtraceEvent;
19684 class BlockTouchBufferFtraceEvent;
19685 class BlockUnplugFtraceEvent;
19686 class CdevUpdateFtraceEvent;
19687 class CgroupAttachTaskFtraceEvent;
19688 class CgroupDestroyRootFtraceEvent;
19689 class CgroupMkdirFtraceEvent;
19690 class CgroupReleaseFtraceEvent;
19691 class CgroupRemountFtraceEvent;
19692 class CgroupRenameFtraceEvent;
19693 class CgroupRmdirFtraceEvent;
19694 class CgroupSetupRootFtraceEvent;
19695 class CgroupTransferTasksFtraceEvent;
19696 class ClkDisableFtraceEvent;
19697 class ClkEnableFtraceEvent;
19698 class ClkSetRateFtraceEvent;
19699 class ClockDisableFtraceEvent;
19700 class ClockEnableFtraceEvent;
19701 class ClockSetRateFtraceEvent;
19702 class CpuFrequencyFtraceEvent;
19703 class CpuFrequencyLimitsFtraceEvent;
19704 class CpuIdleFtraceEvent;
19705 class CpuhpEnterFtraceEvent;
19706 class CpuhpExitFtraceEvent;
19707 class CpuhpLatencyFtraceEvent;
19708 class CpuhpMultiEnterFtraceEvent;
19709 class DmaAllocContiguousRetryFtraceEvent;
19710 class Ext4AllocDaBlocksFtraceEvent;
19711 class Ext4AllocateBlocksFtraceEvent;
19712 class Ext4AllocateInodeFtraceEvent;
19713 class Ext4BeginOrderedTruncateFtraceEvent;
19714 class Ext4CollapseRangeFtraceEvent;
19715 class Ext4DaReleaseSpaceFtraceEvent;
19716 class Ext4DaReserveSpaceFtraceEvent;
19717 class Ext4DaUpdateReserveSpaceFtraceEvent;
19718 class Ext4DaWriteBeginFtraceEvent;
19719 class Ext4DaWriteEndFtraceEvent;
19720 class Ext4DaWritePagesExtentFtraceEvent;
19721 class Ext4DaWritePagesFtraceEvent;
19722 class Ext4DirectIOEnterFtraceEvent;
19723 class Ext4DirectIOExitFtraceEvent;
19724 class Ext4DiscardBlocksFtraceEvent;
19725 class Ext4DiscardPreallocationsFtraceEvent;
19726 class Ext4DropInodeFtraceEvent;
19727 class Ext4EsCacheExtentFtraceEvent;
19728 class Ext4EsFindDelayedExtentRangeEnterFtraceEvent;
19729 class Ext4EsFindDelayedExtentRangeExitFtraceEvent;
19730 class Ext4EsInsertExtentFtraceEvent;
19731 class Ext4EsLookupExtentEnterFtraceEvent;
19732 class Ext4EsLookupExtentExitFtraceEvent;
19733 class Ext4EsRemoveExtentFtraceEvent;
19734 class Ext4EsShrinkCountFtraceEvent;
19735 class Ext4EsShrinkFtraceEvent;
19736 class Ext4EsShrinkScanEnterFtraceEvent;
19737 class Ext4EsShrinkScanExitFtraceEvent;
19738 class Ext4EvictInodeFtraceEvent;
19739 class Ext4ExtConvertToInitializedEnterFtraceEvent;
19740 class Ext4ExtConvertToInitializedFastpathFtraceEvent;
19741 class Ext4ExtHandleUnwrittenExtentsFtraceEvent;
19742 class Ext4ExtInCacheFtraceEvent;
19743 class Ext4ExtLoadExtentFtraceEvent;
19744 class Ext4ExtMapBlocksEnterFtraceEvent;
19745 class Ext4ExtMapBlocksExitFtraceEvent;
19746 class Ext4ExtPutInCacheFtraceEvent;
19747 class Ext4ExtRemoveSpaceDoneFtraceEvent;
19748 class Ext4ExtRemoveSpaceFtraceEvent;
19749 class Ext4ExtRmIdxFtraceEvent;
19750 class Ext4ExtRmLeafFtraceEvent;
19751 class Ext4ExtShowExtentFtraceEvent;
19752 class Ext4FallocateEnterFtraceEvent;
19753 class Ext4FallocateExitFtraceEvent;
19754 class Ext4FindDelallocRangeFtraceEvent;
19755 class Ext4ForgetFtraceEvent;
19756 class Ext4FreeBlocksFtraceEvent;
19757 class Ext4FreeInodeFtraceEvent;
19758 class Ext4GetImpliedClusterAllocExitFtraceEvent;
19759 class Ext4GetReservedClusterAllocFtraceEvent;
19760 class Ext4IndMapBlocksEnterFtraceEvent;
19761 class Ext4IndMapBlocksExitFtraceEvent;
19762 class Ext4InsertRangeFtraceEvent;
19763 class Ext4InvalidatepageFtraceEvent;
19764 class Ext4JournalStartFtraceEvent;
19765 class Ext4JournalStartReservedFtraceEvent;
19766 class Ext4JournalledInvalidatepageFtraceEvent;
19767 class Ext4JournalledWriteEndFtraceEvent;
19768 class Ext4LoadInodeBitmapFtraceEvent;
19769 class Ext4LoadInodeFtraceEvent;
19770 class Ext4MarkInodeDirtyFtraceEvent;
19771 class Ext4MbBitmapLoadFtraceEvent;
19772 class Ext4MbBuddyBitmapLoadFtraceEvent;
19773 class Ext4MbDiscardPreallocationsFtraceEvent;
19774 class Ext4MbNewGroupPaFtraceEvent;
19775 class Ext4MbNewInodePaFtraceEvent;
19776 class Ext4MbReleaseGroupPaFtraceEvent;
19777 class Ext4MbReleaseInodePaFtraceEvent;
19778 class Ext4MballocAllocFtraceEvent;
19779 class Ext4MballocDiscardFtraceEvent;
19780 class Ext4MballocFreeFtraceEvent;
19781 class Ext4MballocPreallocFtraceEvent;
19782 class Ext4OtherInodeUpdateTimeFtraceEvent;
19783 class Ext4PunchHoleFtraceEvent;
19784 class Ext4ReadBlockBitmapLoadFtraceEvent;
19785 class Ext4ReadpageFtraceEvent;
19786 class Ext4ReleasepageFtraceEvent;
19787 class Ext4RemoveBlocksFtraceEvent;
19788 class Ext4RequestBlocksFtraceEvent;
19789 class Ext4RequestInodeFtraceEvent;
19790 class Ext4SyncFileEnterFtraceEvent;
19791 class Ext4SyncFileExitFtraceEvent;
19792 class Ext4SyncFsFtraceEvent;
19793 class Ext4TrimAllFreeFtraceEvent;
19794 class Ext4TrimExtentFtraceEvent;
19795 class Ext4TruncateEnterFtraceEvent;
19796 class Ext4TruncateExitFtraceEvent;
19797 class Ext4UnlinkEnterFtraceEvent;
19798 class Ext4UnlinkExitFtraceEvent;
19799 class Ext4WriteBeginFtraceEvent;
19800 class Ext4WriteEndFtraceEvent;
19801 class Ext4WritepageFtraceEvent;
19802 class Ext4WritepagesFtraceEvent;
19803 class Ext4WritepagesResultFtraceEvent;
19804 class Ext4ZeroRangeFtraceEvent;
19805 class F2fsDoSubmitBioFtraceEvent;
19806 class F2fsEvictInodeFtraceEvent;
19807 class F2fsFallocateFtraceEvent;
19808 class F2fsGetDataBlockFtraceEvent;
19809 class F2fsGetVictimFtraceEvent;
19810 class F2fsIgetExitFtraceEvent;
19811 class F2fsIgetFtraceEvent;
19812 class F2fsNewInodeFtraceEvent;
19813 class F2fsReadpageFtraceEvent;
19814 class F2fsReserveNewBlockFtraceEvent;
19815 class F2fsSetPageDirtyFtraceEvent;
19816 class F2fsSubmitWritePageFtraceEvent;
19817 class F2fsSyncFileEnterFtraceEvent;
19818 class F2fsSyncFileExitFtraceEvent;
19819 class F2fsSyncFsFtraceEvent;
19820 class F2fsTruncateBlocksEnterFtraceEvent;
19821 class F2fsTruncateBlocksExitFtraceEvent;
19822 class F2fsTruncateDataBlocksRangeFtraceEvent;
19823 class F2fsTruncateFtraceEvent;
19824 class F2fsTruncateInodeBlocksEnterFtraceEvent;
19825 class F2fsTruncateInodeBlocksExitFtraceEvent;
19826 class F2fsTruncateNodeFtraceEvent;
19827 class F2fsTruncateNodesEnterFtraceEvent;
19828 class F2fsTruncateNodesExitFtraceEvent;
19829 class F2fsTruncatePartialNodesFtraceEvent;
19830 class F2fsUnlinkEnterFtraceEvent;
19831 class F2fsUnlinkExitFtraceEvent;
19832 class F2fsVmPageMkwriteFtraceEvent;
19833 class F2fsWriteBeginFtraceEvent;
19834 class F2fsWriteCheckpointFtraceEvent;
19835 class F2fsWriteEndFtraceEvent;
19836 class FenceDestroyFtraceEvent;
19837 class FenceEnableSignalFtraceEvent;
19838 class FenceInitFtraceEvent;
19839 class FenceSignaledFtraceEvent;
19840 class GenericFtraceEvent;
19841 class GpuFrequencyFtraceEvent;
19842 class GpuMemTotalFtraceEvent;
19843 class I2cReadFtraceEvent;
19844 class I2cReplyFtraceEvent;
19845 class I2cResultFtraceEvent;
19846 class I2cWriteFtraceEvent;
19847 class IommuMapRangeFtraceEvent;
19848 class IommuSecPtblMapRangeEndFtraceEvent;
19849 class IommuSecPtblMapRangeStartFtraceEvent;
19850 class IonAllocBufferEndFtraceEvent;
19851 class IonAllocBufferFailFtraceEvent;
19852 class IonAllocBufferFallbackFtraceEvent;
19853 class IonAllocBufferStartFtraceEvent;
19854 class IonBufferCreateFtraceEvent;
19855 class IonBufferDestroyFtraceEvent;
19856 class IonCpAllocRetryFtraceEvent;
19857 class IonCpSecureBufferEndFtraceEvent;
19858 class IonCpSecureBufferStartFtraceEvent;
19859 class IonHeapGrowFtraceEvent;
19860 class IonHeapShrinkFtraceEvent;
19861 class IonPrefetchingFtraceEvent;
19862 class IonSecureCmaAddToPoolEndFtraceEvent;
19863 class IonSecureCmaAddToPoolStartFtraceEvent;
19864 class IonSecureCmaAllocateEndFtraceEvent;
19865 class IonSecureCmaAllocateStartFtraceEvent;
19866 class IonSecureCmaShrinkPoolEndFtraceEvent;
19867 class IonSecureCmaShrinkPoolStartFtraceEvent;
19868 class IonStatFtraceEvent;
19869 class IpiEntryFtraceEvent;
19870 class IpiExitFtraceEvent;
19871 class IpiRaiseFtraceEvent;
19872 class IrqHandlerEntryFtraceEvent;
19873 class IrqHandlerExitFtraceEvent;
19874 class KfreeFtraceEvent;
19875 class KmallocFtraceEvent;
19876 class KmallocNodeFtraceEvent;
19877 class KmemCacheAllocFtraceEvent;
19878 class KmemCacheAllocNodeFtraceEvent;
19879 class KmemCacheFreeFtraceEvent;
19880 class LowmemoryKillFtraceEvent;
19881 class MarkVictimFtraceEvent;
19882 class MdpCmdKickoffFtraceEvent;
19883 class MdpCmdPingpongDoneFtraceEvent;
19884 class MdpCmdReadptrDoneFtraceEvent;
19885 class MdpCmdReleaseBwFtraceEvent;
19886 class MdpCmdWaitPingpongFtraceEvent;
19887 class MdpCommitFtraceEvent;
19888 class MdpCompareBwFtraceEvent;
19889 class MdpMisrCrcFtraceEvent;
19890 class MdpMixerUpdateFtraceEvent;
19891 class MdpPerfPrefillCalcFtraceEvent;
19892 class MdpPerfSetOtFtraceEvent;
19893 class MdpPerfSetPanicLutsFtraceEvent;
19894 class MdpPerfSetQosLutsFtraceEvent;
19895 class MdpPerfSetWmLevelsFtraceEvent;
19896 class MdpPerfUpdateBusFtraceEvent;
19897 class MdpSsppChangeFtraceEvent;
19898 class MdpSsppSetFtraceEvent;
19899 class MdpTraceCounterFtraceEvent;
19900 class MdpVideoUnderrunDoneFtraceEvent;
19901 class MigratePagesEndFtraceEvent;
19902 class MigratePagesStartFtraceEvent;
19903 class MigrateRetryFtraceEvent;
19904 class MmCompactionBeginFtraceEvent;
19905 class MmCompactionDeferCompactionFtraceEvent;
19906 class MmCompactionDeferResetFtraceEvent;
19907 class MmCompactionDeferredFtraceEvent;
19908 class MmCompactionEndFtraceEvent;
19909 class MmCompactionFinishedFtraceEvent;
19910 class MmCompactionIsolateFreepagesFtraceEvent;
19911 class MmCompactionIsolateMigratepagesFtraceEvent;
19912 class MmCompactionKcompactdSleepFtraceEvent;
19913 class MmCompactionKcompactdWakeFtraceEvent;
19914 class MmCompactionMigratepagesFtraceEvent;
19915 class MmCompactionSuitableFtraceEvent;
19916 class MmCompactionTryToCompactPagesFtraceEvent;
19917 class MmCompactionWakeupKcompactdFtraceEvent;
19918 class MmEventRecordFtraceEvent;
19919 class MmFilemapAddToPageCacheFtraceEvent;
19920 class MmFilemapDeleteFromPageCacheFtraceEvent;
19921 class MmPageAllocExtfragFtraceEvent;
19922 class MmPageAllocFtraceEvent;
19923 class MmPageAllocZoneLockedFtraceEvent;
19924 class MmPageFreeBatchedFtraceEvent;
19925 class MmPageFreeFtraceEvent;
19926 class MmPagePcpuDrainFtraceEvent;
19927 class MmVmscanDirectReclaimBeginFtraceEvent;
19928 class MmVmscanDirectReclaimEndFtraceEvent;
19929 class MmVmscanKswapdSleepFtraceEvent;
19930 class MmVmscanKswapdWakeFtraceEvent;
19931 class OomScoreAdjUpdateFtraceEvent;
19932 class PrintFtraceEvent;
19933 class RegulatorDisableCompleteFtraceEvent;
19934 class RegulatorDisableFtraceEvent;
19935 class RegulatorEnableCompleteFtraceEvent;
19936 class RegulatorEnableDelayFtraceEvent;
19937 class RegulatorEnableFtraceEvent;
19938 class RegulatorSetVoltageCompleteFtraceEvent;
19939 class RegulatorSetVoltageFtraceEvent;
19940 class RotatorBwAoAsContextFtraceEvent;
19941 class RssStatFtraceEvent;
19942 class SchedBlockedReasonFtraceEvent;
19943 class SchedCpuHotplugFtraceEvent;
19944 class SchedProcessExecFtraceEvent;
19945 class SchedProcessExitFtraceEvent;
19946 class SchedProcessForkFtraceEvent;
19947 class SchedProcessFreeFtraceEvent;
19948 class SchedProcessHangFtraceEvent;
19949 class SchedProcessWaitFtraceEvent;
19950 class SchedSwitchFtraceEvent;
19951 class SchedWakeupFtraceEvent;
19952 class SchedWakeupNewFtraceEvent;
19953 class SchedWakingFtraceEvent;
19954 class ScmCallEndFtraceEvent;
19955 class ScmCallStartFtraceEvent;
19956 class SdeTracingMarkWriteFtraceEvent;
19957 class SignalDeliverFtraceEvent;
19958 class SignalGenerateFtraceEvent;
19959 class SmbusReadFtraceEvent;
19960 class SmbusReplyFtraceEvent;
19961 class SmbusResultFtraceEvent;
19962 class SmbusWriteFtraceEvent;
19963 class SoftirqEntryFtraceEvent;
19964 class SoftirqExitFtraceEvent;
19965 class SoftirqRaiseFtraceEvent;
19966 class SuspendResumeFtraceEvent;
19967 class SyncPtFtraceEvent;
19968 class SyncTimelineFtraceEvent;
19969 class SyncWaitFtraceEvent;
19970 class SysEnterFtraceEvent;
19971 class SysExitFtraceEvent;
19972 class TaskNewtaskFtraceEvent;
19973 class TaskRenameFtraceEvent;
19974 class ThermalTemperatureFtraceEvent;
19975 class TracingMarkWriteFtraceEvent;
19976 class WorkqueueActivateWorkFtraceEvent;
19977 class WorkqueueExecuteEndFtraceEvent;
19978 class WorkqueueExecuteStartFtraceEvent;
19979 class WorkqueueQueueWorkFtraceEvent;
19980 class ZeroFtraceEvent;
19981 
19982 class FtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/346, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
19983  public:
19984   FtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
19985   explicit FtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
19986   explicit FtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
19987   bool has_timestamp() const { return at<1>().valid(); }
19988   uint64_t timestamp() const { return at<1>().as_uint64(); }
19989   bool has_pid() const { return at<2>().valid(); }
19990   uint32_t pid() const { return at<2>().as_uint32(); }
19991   bool has_print() const { return at<3>().valid(); }
19992   ::protozero::ConstBytes print() const { return at<3>().as_bytes(); }
19993   bool has_sched_switch() const { return at<4>().valid(); }
19994   ::protozero::ConstBytes sched_switch() const { return at<4>().as_bytes(); }
19995   bool has_cpu_frequency() const { return at<11>().valid(); }
19996   ::protozero::ConstBytes cpu_frequency() const { return at<11>().as_bytes(); }
19997   bool has_cpu_frequency_limits() const { return at<12>().valid(); }
19998   ::protozero::ConstBytes cpu_frequency_limits() const { return at<12>().as_bytes(); }
19999   bool has_cpu_idle() const { return at<13>().valid(); }
20000   ::protozero::ConstBytes cpu_idle() const { return at<13>().as_bytes(); }
20001   bool has_clock_enable() const { return at<14>().valid(); }
20002   ::protozero::ConstBytes clock_enable() const { return at<14>().as_bytes(); }
20003   bool has_clock_disable() const { return at<15>().valid(); }
20004   ::protozero::ConstBytes clock_disable() const { return at<15>().as_bytes(); }
20005   bool has_clock_set_rate() const { return at<16>().valid(); }
20006   ::protozero::ConstBytes clock_set_rate() const { return at<16>().as_bytes(); }
20007   bool has_sched_wakeup() const { return at<17>().valid(); }
20008   ::protozero::ConstBytes sched_wakeup() const { return at<17>().as_bytes(); }
20009   bool has_sched_blocked_reason() const { return at<18>().valid(); }
20010   ::protozero::ConstBytes sched_blocked_reason() const { return at<18>().as_bytes(); }
20011   bool has_sched_cpu_hotplug() const { return at<19>().valid(); }
20012   ::protozero::ConstBytes sched_cpu_hotplug() const { return at<19>().as_bytes(); }
20013   bool has_sched_waking() const { return at<20>().valid(); }
20014   ::protozero::ConstBytes sched_waking() const { return at<20>().as_bytes(); }
20015   bool has_ipi_entry() const { return at<21>().valid(); }
20016   ::protozero::ConstBytes ipi_entry() const { return at<21>().as_bytes(); }
20017   bool has_ipi_exit() const { return at<22>().valid(); }
20018   ::protozero::ConstBytes ipi_exit() const { return at<22>().as_bytes(); }
20019   bool has_ipi_raise() const { return at<23>().valid(); }
20020   ::protozero::ConstBytes ipi_raise() const { return at<23>().as_bytes(); }
20021   bool has_softirq_entry() const { return at<24>().valid(); }
20022   ::protozero::ConstBytes softirq_entry() const { return at<24>().as_bytes(); }
20023   bool has_softirq_exit() const { return at<25>().valid(); }
20024   ::protozero::ConstBytes softirq_exit() const { return at<25>().as_bytes(); }
20025   bool has_softirq_raise() const { return at<26>().valid(); }
20026   ::protozero::ConstBytes softirq_raise() const { return at<26>().as_bytes(); }
20027   bool has_i2c_read() const { return at<27>().valid(); }
20028   ::protozero::ConstBytes i2c_read() const { return at<27>().as_bytes(); }
20029   bool has_i2c_write() const { return at<28>().valid(); }
20030   ::protozero::ConstBytes i2c_write() const { return at<28>().as_bytes(); }
20031   bool has_i2c_result() const { return at<29>().valid(); }
20032   ::protozero::ConstBytes i2c_result() const { return at<29>().as_bytes(); }
20033   bool has_i2c_reply() const { return at<30>().valid(); }
20034   ::protozero::ConstBytes i2c_reply() const { return at<30>().as_bytes(); }
20035   bool has_smbus_read() const { return at<31>().valid(); }
20036   ::protozero::ConstBytes smbus_read() const { return at<31>().as_bytes(); }
20037   bool has_smbus_write() const { return at<32>().valid(); }
20038   ::protozero::ConstBytes smbus_write() const { return at<32>().as_bytes(); }
20039   bool has_smbus_result() const { return at<33>().valid(); }
20040   ::protozero::ConstBytes smbus_result() const { return at<33>().as_bytes(); }
20041   bool has_smbus_reply() const { return at<34>().valid(); }
20042   ::protozero::ConstBytes smbus_reply() const { return at<34>().as_bytes(); }
20043   bool has_lowmemory_kill() const { return at<35>().valid(); }
20044   ::protozero::ConstBytes lowmemory_kill() const { return at<35>().as_bytes(); }
20045   bool has_irq_handler_entry() const { return at<36>().valid(); }
20046   ::protozero::ConstBytes irq_handler_entry() const { return at<36>().as_bytes(); }
20047   bool has_irq_handler_exit() const { return at<37>().valid(); }
20048   ::protozero::ConstBytes irq_handler_exit() const { return at<37>().as_bytes(); }
20049   bool has_sync_pt() const { return at<38>().valid(); }
20050   ::protozero::ConstBytes sync_pt() const { return at<38>().as_bytes(); }
20051   bool has_sync_timeline() const { return at<39>().valid(); }
20052   ::protozero::ConstBytes sync_timeline() const { return at<39>().as_bytes(); }
20053   bool has_sync_wait() const { return at<40>().valid(); }
20054   ::protozero::ConstBytes sync_wait() const { return at<40>().as_bytes(); }
20055   bool has_ext4_da_write_begin() const { return at<41>().valid(); }
20056   ::protozero::ConstBytes ext4_da_write_begin() const { return at<41>().as_bytes(); }
20057   bool has_ext4_da_write_end() const { return at<42>().valid(); }
20058   ::protozero::ConstBytes ext4_da_write_end() const { return at<42>().as_bytes(); }
20059   bool has_ext4_sync_file_enter() const { return at<43>().valid(); }
20060   ::protozero::ConstBytes ext4_sync_file_enter() const { return at<43>().as_bytes(); }
20061   bool has_ext4_sync_file_exit() const { return at<44>().valid(); }
20062   ::protozero::ConstBytes ext4_sync_file_exit() const { return at<44>().as_bytes(); }
20063   bool has_block_rq_issue() const { return at<45>().valid(); }
20064   ::protozero::ConstBytes block_rq_issue() const { return at<45>().as_bytes(); }
20065   bool has_mm_vmscan_direct_reclaim_begin() const { return at<46>().valid(); }
20066   ::protozero::ConstBytes mm_vmscan_direct_reclaim_begin() const { return at<46>().as_bytes(); }
20067   bool has_mm_vmscan_direct_reclaim_end() const { return at<47>().valid(); }
20068   ::protozero::ConstBytes mm_vmscan_direct_reclaim_end() const { return at<47>().as_bytes(); }
20069   bool has_mm_vmscan_kswapd_wake() const { return at<48>().valid(); }
20070   ::protozero::ConstBytes mm_vmscan_kswapd_wake() const { return at<48>().as_bytes(); }
20071   bool has_mm_vmscan_kswapd_sleep() const { return at<49>().valid(); }
20072   ::protozero::ConstBytes mm_vmscan_kswapd_sleep() const { return at<49>().as_bytes(); }
20073   bool has_binder_transaction() const { return at<50>().valid(); }
20074   ::protozero::ConstBytes binder_transaction() const { return at<50>().as_bytes(); }
20075   bool has_binder_transaction_received() const { return at<51>().valid(); }
20076   ::protozero::ConstBytes binder_transaction_received() const { return at<51>().as_bytes(); }
20077   bool has_binder_set_priority() const { return at<52>().valid(); }
20078   ::protozero::ConstBytes binder_set_priority() const { return at<52>().as_bytes(); }
20079   bool has_binder_lock() const { return at<53>().valid(); }
20080   ::protozero::ConstBytes binder_lock() const { return at<53>().as_bytes(); }
20081   bool has_binder_locked() const { return at<54>().valid(); }
20082   ::protozero::ConstBytes binder_locked() const { return at<54>().as_bytes(); }
20083   bool has_binder_unlock() const { return at<55>().valid(); }
20084   ::protozero::ConstBytes binder_unlock() const { return at<55>().as_bytes(); }
20085   bool has_workqueue_activate_work() const { return at<56>().valid(); }
20086   ::protozero::ConstBytes workqueue_activate_work() const { return at<56>().as_bytes(); }
20087   bool has_workqueue_execute_end() const { return at<57>().valid(); }
20088   ::protozero::ConstBytes workqueue_execute_end() const { return at<57>().as_bytes(); }
20089   bool has_workqueue_execute_start() const { return at<58>().valid(); }
20090   ::protozero::ConstBytes workqueue_execute_start() const { return at<58>().as_bytes(); }
20091   bool has_workqueue_queue_work() const { return at<59>().valid(); }
20092   ::protozero::ConstBytes workqueue_queue_work() const { return at<59>().as_bytes(); }
20093   bool has_regulator_disable() const { return at<60>().valid(); }
20094   ::protozero::ConstBytes regulator_disable() const { return at<60>().as_bytes(); }
20095   bool has_regulator_disable_complete() const { return at<61>().valid(); }
20096   ::protozero::ConstBytes regulator_disable_complete() const { return at<61>().as_bytes(); }
20097   bool has_regulator_enable() const { return at<62>().valid(); }
20098   ::protozero::ConstBytes regulator_enable() const { return at<62>().as_bytes(); }
20099   bool has_regulator_enable_complete() const { return at<63>().valid(); }
20100   ::protozero::ConstBytes regulator_enable_complete() const { return at<63>().as_bytes(); }
20101   bool has_regulator_enable_delay() const { return at<64>().valid(); }
20102   ::protozero::ConstBytes regulator_enable_delay() const { return at<64>().as_bytes(); }
20103   bool has_regulator_set_voltage() const { return at<65>().valid(); }
20104   ::protozero::ConstBytes regulator_set_voltage() const { return at<65>().as_bytes(); }
20105   bool has_regulator_set_voltage_complete() const { return at<66>().valid(); }
20106   ::protozero::ConstBytes regulator_set_voltage_complete() const { return at<66>().as_bytes(); }
20107   bool has_cgroup_attach_task() const { return at<67>().valid(); }
20108   ::protozero::ConstBytes cgroup_attach_task() const { return at<67>().as_bytes(); }
20109   bool has_cgroup_mkdir() const { return at<68>().valid(); }
20110   ::protozero::ConstBytes cgroup_mkdir() const { return at<68>().as_bytes(); }
20111   bool has_cgroup_remount() const { return at<69>().valid(); }
20112   ::protozero::ConstBytes cgroup_remount() const { return at<69>().as_bytes(); }
20113   bool has_cgroup_rmdir() const { return at<70>().valid(); }
20114   ::protozero::ConstBytes cgroup_rmdir() const { return at<70>().as_bytes(); }
20115   bool has_cgroup_transfer_tasks() const { return at<71>().valid(); }
20116   ::protozero::ConstBytes cgroup_transfer_tasks() const { return at<71>().as_bytes(); }
20117   bool has_cgroup_destroy_root() const { return at<72>().valid(); }
20118   ::protozero::ConstBytes cgroup_destroy_root() const { return at<72>().as_bytes(); }
20119   bool has_cgroup_release() const { return at<73>().valid(); }
20120   ::protozero::ConstBytes cgroup_release() const { return at<73>().as_bytes(); }
20121   bool has_cgroup_rename() const { return at<74>().valid(); }
20122   ::protozero::ConstBytes cgroup_rename() const { return at<74>().as_bytes(); }
20123   bool has_cgroup_setup_root() const { return at<75>().valid(); }
20124   ::protozero::ConstBytes cgroup_setup_root() const { return at<75>().as_bytes(); }
20125   bool has_mdp_cmd_kickoff() const { return at<76>().valid(); }
20126   ::protozero::ConstBytes mdp_cmd_kickoff() const { return at<76>().as_bytes(); }
20127   bool has_mdp_commit() const { return at<77>().valid(); }
20128   ::protozero::ConstBytes mdp_commit() const { return at<77>().as_bytes(); }
20129   bool has_mdp_perf_set_ot() const { return at<78>().valid(); }
20130   ::protozero::ConstBytes mdp_perf_set_ot() const { return at<78>().as_bytes(); }
20131   bool has_mdp_sspp_change() const { return at<79>().valid(); }
20132   ::protozero::ConstBytes mdp_sspp_change() const { return at<79>().as_bytes(); }
20133   bool has_tracing_mark_write() const { return at<80>().valid(); }
20134   ::protozero::ConstBytes tracing_mark_write() const { return at<80>().as_bytes(); }
20135   bool has_mdp_cmd_pingpong_done() const { return at<81>().valid(); }
20136   ::protozero::ConstBytes mdp_cmd_pingpong_done() const { return at<81>().as_bytes(); }
20137   bool has_mdp_compare_bw() const { return at<82>().valid(); }
20138   ::protozero::ConstBytes mdp_compare_bw() const { return at<82>().as_bytes(); }
20139   bool has_mdp_perf_set_panic_luts() const { return at<83>().valid(); }
20140   ::protozero::ConstBytes mdp_perf_set_panic_luts() const { return at<83>().as_bytes(); }
20141   bool has_mdp_sspp_set() const { return at<84>().valid(); }
20142   ::protozero::ConstBytes mdp_sspp_set() const { return at<84>().as_bytes(); }
20143   bool has_mdp_cmd_readptr_done() const { return at<85>().valid(); }
20144   ::protozero::ConstBytes mdp_cmd_readptr_done() const { return at<85>().as_bytes(); }
20145   bool has_mdp_misr_crc() const { return at<86>().valid(); }
20146   ::protozero::ConstBytes mdp_misr_crc() const { return at<86>().as_bytes(); }
20147   bool has_mdp_perf_set_qos_luts() const { return at<87>().valid(); }
20148   ::protozero::ConstBytes mdp_perf_set_qos_luts() const { return at<87>().as_bytes(); }
20149   bool has_mdp_trace_counter() const { return at<88>().valid(); }
20150   ::protozero::ConstBytes mdp_trace_counter() const { return at<88>().as_bytes(); }
20151   bool has_mdp_cmd_release_bw() const { return at<89>().valid(); }
20152   ::protozero::ConstBytes mdp_cmd_release_bw() const { return at<89>().as_bytes(); }
20153   bool has_mdp_mixer_update() const { return at<90>().valid(); }
20154   ::protozero::ConstBytes mdp_mixer_update() const { return at<90>().as_bytes(); }
20155   bool has_mdp_perf_set_wm_levels() const { return at<91>().valid(); }
20156   ::protozero::ConstBytes mdp_perf_set_wm_levels() const { return at<91>().as_bytes(); }
20157   bool has_mdp_video_underrun_done() const { return at<92>().valid(); }
20158   ::protozero::ConstBytes mdp_video_underrun_done() const { return at<92>().as_bytes(); }
20159   bool has_mdp_cmd_wait_pingpong() const { return at<93>().valid(); }
20160   ::protozero::ConstBytes mdp_cmd_wait_pingpong() const { return at<93>().as_bytes(); }
20161   bool has_mdp_perf_prefill_calc() const { return at<94>().valid(); }
20162   ::protozero::ConstBytes mdp_perf_prefill_calc() const { return at<94>().as_bytes(); }
20163   bool has_mdp_perf_update_bus() const { return at<95>().valid(); }
20164   ::protozero::ConstBytes mdp_perf_update_bus() const { return at<95>().as_bytes(); }
20165   bool has_rotator_bw_ao_as_context() const { return at<96>().valid(); }
20166   ::protozero::ConstBytes rotator_bw_ao_as_context() const { return at<96>().as_bytes(); }
20167   bool has_mm_filemap_add_to_page_cache() const { return at<97>().valid(); }
20168   ::protozero::ConstBytes mm_filemap_add_to_page_cache() const { return at<97>().as_bytes(); }
20169   bool has_mm_filemap_delete_from_page_cache() const { return at<98>().valid(); }
20170   ::protozero::ConstBytes mm_filemap_delete_from_page_cache() const { return at<98>().as_bytes(); }
20171   bool has_mm_compaction_begin() const { return at<99>().valid(); }
20172   ::protozero::ConstBytes mm_compaction_begin() const { return at<99>().as_bytes(); }
20173   bool has_mm_compaction_defer_compaction() const { return at<100>().valid(); }
20174   ::protozero::ConstBytes mm_compaction_defer_compaction() const { return at<100>().as_bytes(); }
20175   bool has_mm_compaction_deferred() const { return at<101>().valid(); }
20176   ::protozero::ConstBytes mm_compaction_deferred() const { return at<101>().as_bytes(); }
20177   bool has_mm_compaction_defer_reset() const { return at<102>().valid(); }
20178   ::protozero::ConstBytes mm_compaction_defer_reset() const { return at<102>().as_bytes(); }
20179   bool has_mm_compaction_end() const { return at<103>().valid(); }
20180   ::protozero::ConstBytes mm_compaction_end() const { return at<103>().as_bytes(); }
20181   bool has_mm_compaction_finished() const { return at<104>().valid(); }
20182   ::protozero::ConstBytes mm_compaction_finished() const { return at<104>().as_bytes(); }
20183   bool has_mm_compaction_isolate_freepages() const { return at<105>().valid(); }
20184   ::protozero::ConstBytes mm_compaction_isolate_freepages() const { return at<105>().as_bytes(); }
20185   bool has_mm_compaction_isolate_migratepages() const { return at<106>().valid(); }
20186   ::protozero::ConstBytes mm_compaction_isolate_migratepages() const { return at<106>().as_bytes(); }
20187   bool has_mm_compaction_kcompactd_sleep() const { return at<107>().valid(); }
20188   ::protozero::ConstBytes mm_compaction_kcompactd_sleep() const { return at<107>().as_bytes(); }
20189   bool has_mm_compaction_kcompactd_wake() const { return at<108>().valid(); }
20190   ::protozero::ConstBytes mm_compaction_kcompactd_wake() const { return at<108>().as_bytes(); }
20191   bool has_mm_compaction_migratepages() const { return at<109>().valid(); }
20192   ::protozero::ConstBytes mm_compaction_migratepages() const { return at<109>().as_bytes(); }
20193   bool has_mm_compaction_suitable() const { return at<110>().valid(); }
20194   ::protozero::ConstBytes mm_compaction_suitable() const { return at<110>().as_bytes(); }
20195   bool has_mm_compaction_try_to_compact_pages() const { return at<111>().valid(); }
20196   ::protozero::ConstBytes mm_compaction_try_to_compact_pages() const { return at<111>().as_bytes(); }
20197   bool has_mm_compaction_wakeup_kcompactd() const { return at<112>().valid(); }
20198   ::protozero::ConstBytes mm_compaction_wakeup_kcompactd() const { return at<112>().as_bytes(); }
20199   bool has_suspend_resume() const { return at<113>().valid(); }
20200   ::protozero::ConstBytes suspend_resume() const { return at<113>().as_bytes(); }
20201   bool has_sched_wakeup_new() const { return at<114>().valid(); }
20202   ::protozero::ConstBytes sched_wakeup_new() const { return at<114>().as_bytes(); }
20203   bool has_block_bio_backmerge() const { return at<115>().valid(); }
20204   ::protozero::ConstBytes block_bio_backmerge() const { return at<115>().as_bytes(); }
20205   bool has_block_bio_bounce() const { return at<116>().valid(); }
20206   ::protozero::ConstBytes block_bio_bounce() const { return at<116>().as_bytes(); }
20207   bool has_block_bio_complete() const { return at<117>().valid(); }
20208   ::protozero::ConstBytes block_bio_complete() const { return at<117>().as_bytes(); }
20209   bool has_block_bio_frontmerge() const { return at<118>().valid(); }
20210   ::protozero::ConstBytes block_bio_frontmerge() const { return at<118>().as_bytes(); }
20211   bool has_block_bio_queue() const { return at<119>().valid(); }
20212   ::protozero::ConstBytes block_bio_queue() const { return at<119>().as_bytes(); }
20213   bool has_block_bio_remap() const { return at<120>().valid(); }
20214   ::protozero::ConstBytes block_bio_remap() const { return at<120>().as_bytes(); }
20215   bool has_block_dirty_buffer() const { return at<121>().valid(); }
20216   ::protozero::ConstBytes block_dirty_buffer() const { return at<121>().as_bytes(); }
20217   bool has_block_getrq() const { return at<122>().valid(); }
20218   ::protozero::ConstBytes block_getrq() const { return at<122>().as_bytes(); }
20219   bool has_block_plug() const { return at<123>().valid(); }
20220   ::protozero::ConstBytes block_plug() const { return at<123>().as_bytes(); }
20221   bool has_block_rq_abort() const { return at<124>().valid(); }
20222   ::protozero::ConstBytes block_rq_abort() const { return at<124>().as_bytes(); }
20223   bool has_block_rq_complete() const { return at<125>().valid(); }
20224   ::protozero::ConstBytes block_rq_complete() const { return at<125>().as_bytes(); }
20225   bool has_block_rq_insert() const { return at<126>().valid(); }
20226   ::protozero::ConstBytes block_rq_insert() const { return at<126>().as_bytes(); }
20227   bool has_block_rq_remap() const { return at<128>().valid(); }
20228   ::protozero::ConstBytes block_rq_remap() const { return at<128>().as_bytes(); }
20229   bool has_block_rq_requeue() const { return at<129>().valid(); }
20230   ::protozero::ConstBytes block_rq_requeue() const { return at<129>().as_bytes(); }
20231   bool has_block_sleeprq() const { return at<130>().valid(); }
20232   ::protozero::ConstBytes block_sleeprq() const { return at<130>().as_bytes(); }
20233   bool has_block_split() const { return at<131>().valid(); }
20234   ::protozero::ConstBytes block_split() const { return at<131>().as_bytes(); }
20235   bool has_block_touch_buffer() const { return at<132>().valid(); }
20236   ::protozero::ConstBytes block_touch_buffer() const { return at<132>().as_bytes(); }
20237   bool has_block_unplug() const { return at<133>().valid(); }
20238   ::protozero::ConstBytes block_unplug() const { return at<133>().as_bytes(); }
20239   bool has_ext4_alloc_da_blocks() const { return at<134>().valid(); }
20240   ::protozero::ConstBytes ext4_alloc_da_blocks() const { return at<134>().as_bytes(); }
20241   bool has_ext4_allocate_blocks() const { return at<135>().valid(); }
20242   ::protozero::ConstBytes ext4_allocate_blocks() const { return at<135>().as_bytes(); }
20243   bool has_ext4_allocate_inode() const { return at<136>().valid(); }
20244   ::protozero::ConstBytes ext4_allocate_inode() const { return at<136>().as_bytes(); }
20245   bool has_ext4_begin_ordered_truncate() const { return at<137>().valid(); }
20246   ::protozero::ConstBytes ext4_begin_ordered_truncate() const { return at<137>().as_bytes(); }
20247   bool has_ext4_collapse_range() const { return at<138>().valid(); }
20248   ::protozero::ConstBytes ext4_collapse_range() const { return at<138>().as_bytes(); }
20249   bool has_ext4_da_release_space() const { return at<139>().valid(); }
20250   ::protozero::ConstBytes ext4_da_release_space() const { return at<139>().as_bytes(); }
20251   bool has_ext4_da_reserve_space() const { return at<140>().valid(); }
20252   ::protozero::ConstBytes ext4_da_reserve_space() const { return at<140>().as_bytes(); }
20253   bool has_ext4_da_update_reserve_space() const { return at<141>().valid(); }
20254   ::protozero::ConstBytes ext4_da_update_reserve_space() const { return at<141>().as_bytes(); }
20255   bool has_ext4_da_write_pages() const { return at<142>().valid(); }
20256   ::protozero::ConstBytes ext4_da_write_pages() const { return at<142>().as_bytes(); }
20257   bool has_ext4_da_write_pages_extent() const { return at<143>().valid(); }
20258   ::protozero::ConstBytes ext4_da_write_pages_extent() const { return at<143>().as_bytes(); }
20259   bool has_ext4_direct_io_enter() const { return at<144>().valid(); }
20260   ::protozero::ConstBytes ext4_direct_io_enter() const { return at<144>().as_bytes(); }
20261   bool has_ext4_direct_io_exit() const { return at<145>().valid(); }
20262   ::protozero::ConstBytes ext4_direct_io_exit() const { return at<145>().as_bytes(); }
20263   bool has_ext4_discard_blocks() const { return at<146>().valid(); }
20264   ::protozero::ConstBytes ext4_discard_blocks() const { return at<146>().as_bytes(); }
20265   bool has_ext4_discard_preallocations() const { return at<147>().valid(); }
20266   ::protozero::ConstBytes ext4_discard_preallocations() const { return at<147>().as_bytes(); }
20267   bool has_ext4_drop_inode() const { return at<148>().valid(); }
20268   ::protozero::ConstBytes ext4_drop_inode() const { return at<148>().as_bytes(); }
20269   bool has_ext4_es_cache_extent() const { return at<149>().valid(); }
20270   ::protozero::ConstBytes ext4_es_cache_extent() const { return at<149>().as_bytes(); }
20271   bool has_ext4_es_find_delayed_extent_range_enter() const { return at<150>().valid(); }
20272   ::protozero::ConstBytes ext4_es_find_delayed_extent_range_enter() const { return at<150>().as_bytes(); }
20273   bool has_ext4_es_find_delayed_extent_range_exit() const { return at<151>().valid(); }
20274   ::protozero::ConstBytes ext4_es_find_delayed_extent_range_exit() const { return at<151>().as_bytes(); }
20275   bool has_ext4_es_insert_extent() const { return at<152>().valid(); }
20276   ::protozero::ConstBytes ext4_es_insert_extent() const { return at<152>().as_bytes(); }
20277   bool has_ext4_es_lookup_extent_enter() const { return at<153>().valid(); }
20278   ::protozero::ConstBytes ext4_es_lookup_extent_enter() const { return at<153>().as_bytes(); }
20279   bool has_ext4_es_lookup_extent_exit() const { return at<154>().valid(); }
20280   ::protozero::ConstBytes ext4_es_lookup_extent_exit() const { return at<154>().as_bytes(); }
20281   bool has_ext4_es_remove_extent() const { return at<155>().valid(); }
20282   ::protozero::ConstBytes ext4_es_remove_extent() const { return at<155>().as_bytes(); }
20283   bool has_ext4_es_shrink() const { return at<156>().valid(); }
20284   ::protozero::ConstBytes ext4_es_shrink() const { return at<156>().as_bytes(); }
20285   bool has_ext4_es_shrink_count() const { return at<157>().valid(); }
20286   ::protozero::ConstBytes ext4_es_shrink_count() const { return at<157>().as_bytes(); }
20287   bool has_ext4_es_shrink_scan_enter() const { return at<158>().valid(); }
20288   ::protozero::ConstBytes ext4_es_shrink_scan_enter() const { return at<158>().as_bytes(); }
20289   bool has_ext4_es_shrink_scan_exit() const { return at<159>().valid(); }
20290   ::protozero::ConstBytes ext4_es_shrink_scan_exit() const { return at<159>().as_bytes(); }
20291   bool has_ext4_evict_inode() const { return at<160>().valid(); }
20292   ::protozero::ConstBytes ext4_evict_inode() const { return at<160>().as_bytes(); }
20293   bool has_ext4_ext_convert_to_initialized_enter() const { return at<161>().valid(); }
20294   ::protozero::ConstBytes ext4_ext_convert_to_initialized_enter() const { return at<161>().as_bytes(); }
20295   bool has_ext4_ext_convert_to_initialized_fastpath() const { return at<162>().valid(); }
20296   ::protozero::ConstBytes ext4_ext_convert_to_initialized_fastpath() const { return at<162>().as_bytes(); }
20297   bool has_ext4_ext_handle_unwritten_extents() const { return at<163>().valid(); }
20298   ::protozero::ConstBytes ext4_ext_handle_unwritten_extents() const { return at<163>().as_bytes(); }
20299   bool has_ext4_ext_in_cache() const { return at<164>().valid(); }
20300   ::protozero::ConstBytes ext4_ext_in_cache() const { return at<164>().as_bytes(); }
20301   bool has_ext4_ext_load_extent() const { return at<165>().valid(); }
20302   ::protozero::ConstBytes ext4_ext_load_extent() const { return at<165>().as_bytes(); }
20303   bool has_ext4_ext_map_blocks_enter() const { return at<166>().valid(); }
20304   ::protozero::ConstBytes ext4_ext_map_blocks_enter() const { return at<166>().as_bytes(); }
20305   bool has_ext4_ext_map_blocks_exit() const { return at<167>().valid(); }
20306   ::protozero::ConstBytes ext4_ext_map_blocks_exit() const { return at<167>().as_bytes(); }
20307   bool has_ext4_ext_put_in_cache() const { return at<168>().valid(); }
20308   ::protozero::ConstBytes ext4_ext_put_in_cache() const { return at<168>().as_bytes(); }
20309   bool has_ext4_ext_remove_space() const { return at<169>().valid(); }
20310   ::protozero::ConstBytes ext4_ext_remove_space() const { return at<169>().as_bytes(); }
20311   bool has_ext4_ext_remove_space_done() const { return at<170>().valid(); }
20312   ::protozero::ConstBytes ext4_ext_remove_space_done() const { return at<170>().as_bytes(); }
20313   bool has_ext4_ext_rm_idx() const { return at<171>().valid(); }
20314   ::protozero::ConstBytes ext4_ext_rm_idx() const { return at<171>().as_bytes(); }
20315   bool has_ext4_ext_rm_leaf() const { return at<172>().valid(); }
20316   ::protozero::ConstBytes ext4_ext_rm_leaf() const { return at<172>().as_bytes(); }
20317   bool has_ext4_ext_show_extent() const { return at<173>().valid(); }
20318   ::protozero::ConstBytes ext4_ext_show_extent() const { return at<173>().as_bytes(); }
20319   bool has_ext4_fallocate_enter() const { return at<174>().valid(); }
20320   ::protozero::ConstBytes ext4_fallocate_enter() const { return at<174>().as_bytes(); }
20321   bool has_ext4_fallocate_exit() const { return at<175>().valid(); }
20322   ::protozero::ConstBytes ext4_fallocate_exit() const { return at<175>().as_bytes(); }
20323   bool has_ext4_find_delalloc_range() const { return at<176>().valid(); }
20324   ::protozero::ConstBytes ext4_find_delalloc_range() const { return at<176>().as_bytes(); }
20325   bool has_ext4_forget() const { return at<177>().valid(); }
20326   ::protozero::ConstBytes ext4_forget() const { return at<177>().as_bytes(); }
20327   bool has_ext4_free_blocks() const { return at<178>().valid(); }
20328   ::protozero::ConstBytes ext4_free_blocks() const { return at<178>().as_bytes(); }
20329   bool has_ext4_free_inode() const { return at<179>().valid(); }
20330   ::protozero::ConstBytes ext4_free_inode() const { return at<179>().as_bytes(); }
20331   bool has_ext4_get_implied_cluster_alloc_exit() const { return at<180>().valid(); }
20332   ::protozero::ConstBytes ext4_get_implied_cluster_alloc_exit() const { return at<180>().as_bytes(); }
20333   bool has_ext4_get_reserved_cluster_alloc() const { return at<181>().valid(); }
20334   ::protozero::ConstBytes ext4_get_reserved_cluster_alloc() const { return at<181>().as_bytes(); }
20335   bool has_ext4_ind_map_blocks_enter() const { return at<182>().valid(); }
20336   ::protozero::ConstBytes ext4_ind_map_blocks_enter() const { return at<182>().as_bytes(); }
20337   bool has_ext4_ind_map_blocks_exit() const { return at<183>().valid(); }
20338   ::protozero::ConstBytes ext4_ind_map_blocks_exit() const { return at<183>().as_bytes(); }
20339   bool has_ext4_insert_range() const { return at<184>().valid(); }
20340   ::protozero::ConstBytes ext4_insert_range() const { return at<184>().as_bytes(); }
20341   bool has_ext4_invalidatepage() const { return at<185>().valid(); }
20342   ::protozero::ConstBytes ext4_invalidatepage() const { return at<185>().as_bytes(); }
20343   bool has_ext4_journal_start() const { return at<186>().valid(); }
20344   ::protozero::ConstBytes ext4_journal_start() const { return at<186>().as_bytes(); }
20345   bool has_ext4_journal_start_reserved() const { return at<187>().valid(); }
20346   ::protozero::ConstBytes ext4_journal_start_reserved() const { return at<187>().as_bytes(); }
20347   bool has_ext4_journalled_invalidatepage() const { return at<188>().valid(); }
20348   ::protozero::ConstBytes ext4_journalled_invalidatepage() const { return at<188>().as_bytes(); }
20349   bool has_ext4_journalled_write_end() const { return at<189>().valid(); }
20350   ::protozero::ConstBytes ext4_journalled_write_end() const { return at<189>().as_bytes(); }
20351   bool has_ext4_load_inode() const { return at<190>().valid(); }
20352   ::protozero::ConstBytes ext4_load_inode() const { return at<190>().as_bytes(); }
20353   bool has_ext4_load_inode_bitmap() const { return at<191>().valid(); }
20354   ::protozero::ConstBytes ext4_load_inode_bitmap() const { return at<191>().as_bytes(); }
20355   bool has_ext4_mark_inode_dirty() const { return at<192>().valid(); }
20356   ::protozero::ConstBytes ext4_mark_inode_dirty() const { return at<192>().as_bytes(); }
20357   bool has_ext4_mb_bitmap_load() const { return at<193>().valid(); }
20358   ::protozero::ConstBytes ext4_mb_bitmap_load() const { return at<193>().as_bytes(); }
20359   bool has_ext4_mb_buddy_bitmap_load() const { return at<194>().valid(); }
20360   ::protozero::ConstBytes ext4_mb_buddy_bitmap_load() const { return at<194>().as_bytes(); }
20361   bool has_ext4_mb_discard_preallocations() const { return at<195>().valid(); }
20362   ::protozero::ConstBytes ext4_mb_discard_preallocations() const { return at<195>().as_bytes(); }
20363   bool has_ext4_mb_new_group_pa() const { return at<196>().valid(); }
20364   ::protozero::ConstBytes ext4_mb_new_group_pa() const { return at<196>().as_bytes(); }
20365   bool has_ext4_mb_new_inode_pa() const { return at<197>().valid(); }
20366   ::protozero::ConstBytes ext4_mb_new_inode_pa() const { return at<197>().as_bytes(); }
20367   bool has_ext4_mb_release_group_pa() const { return at<198>().valid(); }
20368   ::protozero::ConstBytes ext4_mb_release_group_pa() const { return at<198>().as_bytes(); }
20369   bool has_ext4_mb_release_inode_pa() const { return at<199>().valid(); }
20370   ::protozero::ConstBytes ext4_mb_release_inode_pa() const { return at<199>().as_bytes(); }
20371   bool has_ext4_mballoc_alloc() const { return at<200>().valid(); }
20372   ::protozero::ConstBytes ext4_mballoc_alloc() const { return at<200>().as_bytes(); }
20373   bool has_ext4_mballoc_discard() const { return at<201>().valid(); }
20374   ::protozero::ConstBytes ext4_mballoc_discard() const { return at<201>().as_bytes(); }
20375   bool has_ext4_mballoc_free() const { return at<202>().valid(); }
20376   ::protozero::ConstBytes ext4_mballoc_free() const { return at<202>().as_bytes(); }
20377   bool has_ext4_mballoc_prealloc() const { return at<203>().valid(); }
20378   ::protozero::ConstBytes ext4_mballoc_prealloc() const { return at<203>().as_bytes(); }
20379   bool has_ext4_other_inode_update_time() const { return at<204>().valid(); }
20380   ::protozero::ConstBytes ext4_other_inode_update_time() const { return at<204>().as_bytes(); }
20381   bool has_ext4_punch_hole() const { return at<205>().valid(); }
20382   ::protozero::ConstBytes ext4_punch_hole() const { return at<205>().as_bytes(); }
20383   bool has_ext4_read_block_bitmap_load() const { return at<206>().valid(); }
20384   ::protozero::ConstBytes ext4_read_block_bitmap_load() const { return at<206>().as_bytes(); }
20385   bool has_ext4_readpage() const { return at<207>().valid(); }
20386   ::protozero::ConstBytes ext4_readpage() const { return at<207>().as_bytes(); }
20387   bool has_ext4_releasepage() const { return at<208>().valid(); }
20388   ::protozero::ConstBytes ext4_releasepage() const { return at<208>().as_bytes(); }
20389   bool has_ext4_remove_blocks() const { return at<209>().valid(); }
20390   ::protozero::ConstBytes ext4_remove_blocks() const { return at<209>().as_bytes(); }
20391   bool has_ext4_request_blocks() const { return at<210>().valid(); }
20392   ::protozero::ConstBytes ext4_request_blocks() const { return at<210>().as_bytes(); }
20393   bool has_ext4_request_inode() const { return at<211>().valid(); }
20394   ::protozero::ConstBytes ext4_request_inode() const { return at<211>().as_bytes(); }
20395   bool has_ext4_sync_fs() const { return at<212>().valid(); }
20396   ::protozero::ConstBytes ext4_sync_fs() const { return at<212>().as_bytes(); }
20397   bool has_ext4_trim_all_free() const { return at<213>().valid(); }
20398   ::protozero::ConstBytes ext4_trim_all_free() const { return at<213>().as_bytes(); }
20399   bool has_ext4_trim_extent() const { return at<214>().valid(); }
20400   ::protozero::ConstBytes ext4_trim_extent() const { return at<214>().as_bytes(); }
20401   bool has_ext4_truncate_enter() const { return at<215>().valid(); }
20402   ::protozero::ConstBytes ext4_truncate_enter() const { return at<215>().as_bytes(); }
20403   bool has_ext4_truncate_exit() const { return at<216>().valid(); }
20404   ::protozero::ConstBytes ext4_truncate_exit() const { return at<216>().as_bytes(); }
20405   bool has_ext4_unlink_enter() const { return at<217>().valid(); }
20406   ::protozero::ConstBytes ext4_unlink_enter() const { return at<217>().as_bytes(); }
20407   bool has_ext4_unlink_exit() const { return at<218>().valid(); }
20408   ::protozero::ConstBytes ext4_unlink_exit() const { return at<218>().as_bytes(); }
20409   bool has_ext4_write_begin() const { return at<219>().valid(); }
20410   ::protozero::ConstBytes ext4_write_begin() const { return at<219>().as_bytes(); }
20411   bool has_ext4_write_end() const { return at<230>().valid(); }
20412   ::protozero::ConstBytes ext4_write_end() const { return at<230>().as_bytes(); }
20413   bool has_ext4_writepage() const { return at<231>().valid(); }
20414   ::protozero::ConstBytes ext4_writepage() const { return at<231>().as_bytes(); }
20415   bool has_ext4_writepages() const { return at<232>().valid(); }
20416   ::protozero::ConstBytes ext4_writepages() const { return at<232>().as_bytes(); }
20417   bool has_ext4_writepages_result() const { return at<233>().valid(); }
20418   ::protozero::ConstBytes ext4_writepages_result() const { return at<233>().as_bytes(); }
20419   bool has_ext4_zero_range() const { return at<234>().valid(); }
20420   ::protozero::ConstBytes ext4_zero_range() const { return at<234>().as_bytes(); }
20421   bool has_task_newtask() const { return at<235>().valid(); }
20422   ::protozero::ConstBytes task_newtask() const { return at<235>().as_bytes(); }
20423   bool has_task_rename() const { return at<236>().valid(); }
20424   ::protozero::ConstBytes task_rename() const { return at<236>().as_bytes(); }
20425   bool has_sched_process_exec() const { return at<237>().valid(); }
20426   ::protozero::ConstBytes sched_process_exec() const { return at<237>().as_bytes(); }
20427   bool has_sched_process_exit() const { return at<238>().valid(); }
20428   ::protozero::ConstBytes sched_process_exit() const { return at<238>().as_bytes(); }
20429   bool has_sched_process_fork() const { return at<239>().valid(); }
20430   ::protozero::ConstBytes sched_process_fork() const { return at<239>().as_bytes(); }
20431   bool has_sched_process_free() const { return at<240>().valid(); }
20432   ::protozero::ConstBytes sched_process_free() const { return at<240>().as_bytes(); }
20433   bool has_sched_process_hang() const { return at<241>().valid(); }
20434   ::protozero::ConstBytes sched_process_hang() const { return at<241>().as_bytes(); }
20435   bool has_sched_process_wait() const { return at<242>().valid(); }
20436   ::protozero::ConstBytes sched_process_wait() const { return at<242>().as_bytes(); }
20437   bool has_f2fs_do_submit_bio() const { return at<243>().valid(); }
20438   ::protozero::ConstBytes f2fs_do_submit_bio() const { return at<243>().as_bytes(); }
20439   bool has_f2fs_evict_inode() const { return at<244>().valid(); }
20440   ::protozero::ConstBytes f2fs_evict_inode() const { return at<244>().as_bytes(); }
20441   bool has_f2fs_fallocate() const { return at<245>().valid(); }
20442   ::protozero::ConstBytes f2fs_fallocate() const { return at<245>().as_bytes(); }
20443   bool has_f2fs_get_data_block() const { return at<246>().valid(); }
20444   ::protozero::ConstBytes f2fs_get_data_block() const { return at<246>().as_bytes(); }
20445   bool has_f2fs_get_victim() const { return at<247>().valid(); }
20446   ::protozero::ConstBytes f2fs_get_victim() const { return at<247>().as_bytes(); }
20447   bool has_f2fs_iget() const { return at<248>().valid(); }
20448   ::protozero::ConstBytes f2fs_iget() const { return at<248>().as_bytes(); }
20449   bool has_f2fs_iget_exit() const { return at<249>().valid(); }
20450   ::protozero::ConstBytes f2fs_iget_exit() const { return at<249>().as_bytes(); }
20451   bool has_f2fs_new_inode() const { return at<250>().valid(); }
20452   ::protozero::ConstBytes f2fs_new_inode() const { return at<250>().as_bytes(); }
20453   bool has_f2fs_readpage() const { return at<251>().valid(); }
20454   ::protozero::ConstBytes f2fs_readpage() const { return at<251>().as_bytes(); }
20455   bool has_f2fs_reserve_new_block() const { return at<252>().valid(); }
20456   ::protozero::ConstBytes f2fs_reserve_new_block() const { return at<252>().as_bytes(); }
20457   bool has_f2fs_set_page_dirty() const { return at<253>().valid(); }
20458   ::protozero::ConstBytes f2fs_set_page_dirty() const { return at<253>().as_bytes(); }
20459   bool has_f2fs_submit_write_page() const { return at<254>().valid(); }
20460   ::protozero::ConstBytes f2fs_submit_write_page() const { return at<254>().as_bytes(); }
20461   bool has_f2fs_sync_file_enter() const { return at<255>().valid(); }
20462   ::protozero::ConstBytes f2fs_sync_file_enter() const { return at<255>().as_bytes(); }
20463   bool has_f2fs_sync_file_exit() const { return at<256>().valid(); }
20464   ::protozero::ConstBytes f2fs_sync_file_exit() const { return at<256>().as_bytes(); }
20465   bool has_f2fs_sync_fs() const { return at<257>().valid(); }
20466   ::protozero::ConstBytes f2fs_sync_fs() const { return at<257>().as_bytes(); }
20467   bool has_f2fs_truncate() const { return at<258>().valid(); }
20468   ::protozero::ConstBytes f2fs_truncate() const { return at<258>().as_bytes(); }
20469   bool has_f2fs_truncate_blocks_enter() const { return at<259>().valid(); }
20470   ::protozero::ConstBytes f2fs_truncate_blocks_enter() const { return at<259>().as_bytes(); }
20471   bool has_f2fs_truncate_blocks_exit() const { return at<260>().valid(); }
20472   ::protozero::ConstBytes f2fs_truncate_blocks_exit() const { return at<260>().as_bytes(); }
20473   bool has_f2fs_truncate_data_blocks_range() const { return at<261>().valid(); }
20474   ::protozero::ConstBytes f2fs_truncate_data_blocks_range() const { return at<261>().as_bytes(); }
20475   bool has_f2fs_truncate_inode_blocks_enter() const { return at<262>().valid(); }
20476   ::protozero::ConstBytes f2fs_truncate_inode_blocks_enter() const { return at<262>().as_bytes(); }
20477   bool has_f2fs_truncate_inode_blocks_exit() const { return at<263>().valid(); }
20478   ::protozero::ConstBytes f2fs_truncate_inode_blocks_exit() const { return at<263>().as_bytes(); }
20479   bool has_f2fs_truncate_node() const { return at<264>().valid(); }
20480   ::protozero::ConstBytes f2fs_truncate_node() const { return at<264>().as_bytes(); }
20481   bool has_f2fs_truncate_nodes_enter() const { return at<265>().valid(); }
20482   ::protozero::ConstBytes f2fs_truncate_nodes_enter() const { return at<265>().as_bytes(); }
20483   bool has_f2fs_truncate_nodes_exit() const { return at<266>().valid(); }
20484   ::protozero::ConstBytes f2fs_truncate_nodes_exit() const { return at<266>().as_bytes(); }
20485   bool has_f2fs_truncate_partial_nodes() const { return at<267>().valid(); }
20486   ::protozero::ConstBytes f2fs_truncate_partial_nodes() const { return at<267>().as_bytes(); }
20487   bool has_f2fs_unlink_enter() const { return at<268>().valid(); }
20488   ::protozero::ConstBytes f2fs_unlink_enter() const { return at<268>().as_bytes(); }
20489   bool has_f2fs_unlink_exit() const { return at<269>().valid(); }
20490   ::protozero::ConstBytes f2fs_unlink_exit() const { return at<269>().as_bytes(); }
20491   bool has_f2fs_vm_page_mkwrite() const { return at<270>().valid(); }
20492   ::protozero::ConstBytes f2fs_vm_page_mkwrite() const { return at<270>().as_bytes(); }
20493   bool has_f2fs_write_begin() const { return at<271>().valid(); }
20494   ::protozero::ConstBytes f2fs_write_begin() const { return at<271>().as_bytes(); }
20495   bool has_f2fs_write_checkpoint() const { return at<272>().valid(); }
20496   ::protozero::ConstBytes f2fs_write_checkpoint() const { return at<272>().as_bytes(); }
20497   bool has_f2fs_write_end() const { return at<273>().valid(); }
20498   ::protozero::ConstBytes f2fs_write_end() const { return at<273>().as_bytes(); }
20499   bool has_alloc_pages_iommu_end() const { return at<274>().valid(); }
20500   ::protozero::ConstBytes alloc_pages_iommu_end() const { return at<274>().as_bytes(); }
20501   bool has_alloc_pages_iommu_fail() const { return at<275>().valid(); }
20502   ::protozero::ConstBytes alloc_pages_iommu_fail() const { return at<275>().as_bytes(); }
20503   bool has_alloc_pages_iommu_start() const { return at<276>().valid(); }
20504   ::protozero::ConstBytes alloc_pages_iommu_start() const { return at<276>().as_bytes(); }
20505   bool has_alloc_pages_sys_end() const { return at<277>().valid(); }
20506   ::protozero::ConstBytes alloc_pages_sys_end() const { return at<277>().as_bytes(); }
20507   bool has_alloc_pages_sys_fail() const { return at<278>().valid(); }
20508   ::protozero::ConstBytes alloc_pages_sys_fail() const { return at<278>().as_bytes(); }
20509   bool has_alloc_pages_sys_start() const { return at<279>().valid(); }
20510   ::protozero::ConstBytes alloc_pages_sys_start() const { return at<279>().as_bytes(); }
20511   bool has_dma_alloc_contiguous_retry() const { return at<280>().valid(); }
20512   ::protozero::ConstBytes dma_alloc_contiguous_retry() const { return at<280>().as_bytes(); }
20513   bool has_iommu_map_range() const { return at<281>().valid(); }
20514   ::protozero::ConstBytes iommu_map_range() const { return at<281>().as_bytes(); }
20515   bool has_iommu_sec_ptbl_map_range_end() const { return at<282>().valid(); }
20516   ::protozero::ConstBytes iommu_sec_ptbl_map_range_end() const { return at<282>().as_bytes(); }
20517   bool has_iommu_sec_ptbl_map_range_start() const { return at<283>().valid(); }
20518   ::protozero::ConstBytes iommu_sec_ptbl_map_range_start() const { return at<283>().as_bytes(); }
20519   bool has_ion_alloc_buffer_end() const { return at<284>().valid(); }
20520   ::protozero::ConstBytes ion_alloc_buffer_end() const { return at<284>().as_bytes(); }
20521   bool has_ion_alloc_buffer_fail() const { return at<285>().valid(); }
20522   ::protozero::ConstBytes ion_alloc_buffer_fail() const { return at<285>().as_bytes(); }
20523   bool has_ion_alloc_buffer_fallback() const { return at<286>().valid(); }
20524   ::protozero::ConstBytes ion_alloc_buffer_fallback() const { return at<286>().as_bytes(); }
20525   bool has_ion_alloc_buffer_start() const { return at<287>().valid(); }
20526   ::protozero::ConstBytes ion_alloc_buffer_start() const { return at<287>().as_bytes(); }
20527   bool has_ion_cp_alloc_retry() const { return at<288>().valid(); }
20528   ::protozero::ConstBytes ion_cp_alloc_retry() const { return at<288>().as_bytes(); }
20529   bool has_ion_cp_secure_buffer_end() const { return at<289>().valid(); }
20530   ::protozero::ConstBytes ion_cp_secure_buffer_end() const { return at<289>().as_bytes(); }
20531   bool has_ion_cp_secure_buffer_start() const { return at<290>().valid(); }
20532   ::protozero::ConstBytes ion_cp_secure_buffer_start() const { return at<290>().as_bytes(); }
20533   bool has_ion_prefetching() const { return at<291>().valid(); }
20534   ::protozero::ConstBytes ion_prefetching() const { return at<291>().as_bytes(); }
20535   bool has_ion_secure_cma_add_to_pool_end() const { return at<292>().valid(); }
20536   ::protozero::ConstBytes ion_secure_cma_add_to_pool_end() const { return at<292>().as_bytes(); }
20537   bool has_ion_secure_cma_add_to_pool_start() const { return at<293>().valid(); }
20538   ::protozero::ConstBytes ion_secure_cma_add_to_pool_start() const { return at<293>().as_bytes(); }
20539   bool has_ion_secure_cma_allocate_end() const { return at<294>().valid(); }
20540   ::protozero::ConstBytes ion_secure_cma_allocate_end() const { return at<294>().as_bytes(); }
20541   bool has_ion_secure_cma_allocate_start() const { return at<295>().valid(); }
20542   ::protozero::ConstBytes ion_secure_cma_allocate_start() const { return at<295>().as_bytes(); }
20543   bool has_ion_secure_cma_shrink_pool_end() const { return at<296>().valid(); }
20544   ::protozero::ConstBytes ion_secure_cma_shrink_pool_end() const { return at<296>().as_bytes(); }
20545   bool has_ion_secure_cma_shrink_pool_start() const { return at<297>().valid(); }
20546   ::protozero::ConstBytes ion_secure_cma_shrink_pool_start() const { return at<297>().as_bytes(); }
20547   bool has_kfree() const { return at<298>().valid(); }
20548   ::protozero::ConstBytes kfree() const { return at<298>().as_bytes(); }
20549   bool has_kmalloc() const { return at<299>().valid(); }
20550   ::protozero::ConstBytes kmalloc() const { return at<299>().as_bytes(); }
20551   bool has_kmalloc_node() const { return at<300>().valid(); }
20552   ::protozero::ConstBytes kmalloc_node() const { return at<300>().as_bytes(); }
20553   bool has_kmem_cache_alloc() const { return at<301>().valid(); }
20554   ::protozero::ConstBytes kmem_cache_alloc() const { return at<301>().as_bytes(); }
20555   bool has_kmem_cache_alloc_node() const { return at<302>().valid(); }
20556   ::protozero::ConstBytes kmem_cache_alloc_node() const { return at<302>().as_bytes(); }
20557   bool has_kmem_cache_free() const { return at<303>().valid(); }
20558   ::protozero::ConstBytes kmem_cache_free() const { return at<303>().as_bytes(); }
20559   bool has_migrate_pages_end() const { return at<304>().valid(); }
20560   ::protozero::ConstBytes migrate_pages_end() const { return at<304>().as_bytes(); }
20561   bool has_migrate_pages_start() const { return at<305>().valid(); }
20562   ::protozero::ConstBytes migrate_pages_start() const { return at<305>().as_bytes(); }
20563   bool has_migrate_retry() const { return at<306>().valid(); }
20564   ::protozero::ConstBytes migrate_retry() const { return at<306>().as_bytes(); }
20565   bool has_mm_page_alloc() const { return at<307>().valid(); }
20566   ::protozero::ConstBytes mm_page_alloc() const { return at<307>().as_bytes(); }
20567   bool has_mm_page_alloc_extfrag() const { return at<308>().valid(); }
20568   ::protozero::ConstBytes mm_page_alloc_extfrag() const { return at<308>().as_bytes(); }
20569   bool has_mm_page_alloc_zone_locked() const { return at<309>().valid(); }
20570   ::protozero::ConstBytes mm_page_alloc_zone_locked() const { return at<309>().as_bytes(); }
20571   bool has_mm_page_free() const { return at<310>().valid(); }
20572   ::protozero::ConstBytes mm_page_free() const { return at<310>().as_bytes(); }
20573   bool has_mm_page_free_batched() const { return at<311>().valid(); }
20574   ::protozero::ConstBytes mm_page_free_batched() const { return at<311>().as_bytes(); }
20575   bool has_mm_page_pcpu_drain() const { return at<312>().valid(); }
20576   ::protozero::ConstBytes mm_page_pcpu_drain() const { return at<312>().as_bytes(); }
20577   bool has_rss_stat() const { return at<313>().valid(); }
20578   ::protozero::ConstBytes rss_stat() const { return at<313>().as_bytes(); }
20579   bool has_ion_heap_shrink() const { return at<314>().valid(); }
20580   ::protozero::ConstBytes ion_heap_shrink() const { return at<314>().as_bytes(); }
20581   bool has_ion_heap_grow() const { return at<315>().valid(); }
20582   ::protozero::ConstBytes ion_heap_grow() const { return at<315>().as_bytes(); }
20583   bool has_fence_init() const { return at<316>().valid(); }
20584   ::protozero::ConstBytes fence_init() const { return at<316>().as_bytes(); }
20585   bool has_fence_destroy() const { return at<317>().valid(); }
20586   ::protozero::ConstBytes fence_destroy() const { return at<317>().as_bytes(); }
20587   bool has_fence_enable_signal() const { return at<318>().valid(); }
20588   ::protozero::ConstBytes fence_enable_signal() const { return at<318>().as_bytes(); }
20589   bool has_fence_signaled() const { return at<319>().valid(); }
20590   ::protozero::ConstBytes fence_signaled() const { return at<319>().as_bytes(); }
20591   bool has_clk_enable() const { return at<320>().valid(); }
20592   ::protozero::ConstBytes clk_enable() const { return at<320>().as_bytes(); }
20593   bool has_clk_disable() const { return at<321>().valid(); }
20594   ::protozero::ConstBytes clk_disable() const { return at<321>().as_bytes(); }
20595   bool has_clk_set_rate() const { return at<322>().valid(); }
20596   ::protozero::ConstBytes clk_set_rate() const { return at<322>().as_bytes(); }
20597   bool has_binder_transaction_alloc_buf() const { return at<323>().valid(); }
20598   ::protozero::ConstBytes binder_transaction_alloc_buf() const { return at<323>().as_bytes(); }
20599   bool has_signal_deliver() const { return at<324>().valid(); }
20600   ::protozero::ConstBytes signal_deliver() const { return at<324>().as_bytes(); }
20601   bool has_signal_generate() const { return at<325>().valid(); }
20602   ::protozero::ConstBytes signal_generate() const { return at<325>().as_bytes(); }
20603   bool has_oom_score_adj_update() const { return at<326>().valid(); }
20604   ::protozero::ConstBytes oom_score_adj_update() const { return at<326>().as_bytes(); }
20605   bool has_generic() const { return at<327>().valid(); }
20606   ::protozero::ConstBytes generic() const { return at<327>().as_bytes(); }
20607   bool has_mm_event_record() const { return at<328>().valid(); }
20608   ::protozero::ConstBytes mm_event_record() const { return at<328>().as_bytes(); }
20609   bool has_sys_enter() const { return at<329>().valid(); }
20610   ::protozero::ConstBytes sys_enter() const { return at<329>().as_bytes(); }
20611   bool has_sys_exit() const { return at<330>().valid(); }
20612   ::protozero::ConstBytes sys_exit() const { return at<330>().as_bytes(); }
20613   bool has_zero() const { return at<331>().valid(); }
20614   ::protozero::ConstBytes zero() const { return at<331>().as_bytes(); }
20615   bool has_gpu_frequency() const { return at<332>().valid(); }
20616   ::protozero::ConstBytes gpu_frequency() const { return at<332>().as_bytes(); }
20617   bool has_sde_tracing_mark_write() const { return at<333>().valid(); }
20618   ::protozero::ConstBytes sde_tracing_mark_write() const { return at<333>().as_bytes(); }
20619   bool has_mark_victim() const { return at<334>().valid(); }
20620   ::protozero::ConstBytes mark_victim() const { return at<334>().as_bytes(); }
20621   bool has_ion_stat() const { return at<335>().valid(); }
20622   ::protozero::ConstBytes ion_stat() const { return at<335>().as_bytes(); }
20623   bool has_ion_buffer_create() const { return at<336>().valid(); }
20624   ::protozero::ConstBytes ion_buffer_create() const { return at<336>().as_bytes(); }
20625   bool has_ion_buffer_destroy() const { return at<337>().valid(); }
20626   ::protozero::ConstBytes ion_buffer_destroy() const { return at<337>().as_bytes(); }
20627   bool has_scm_call_start() const { return at<338>().valid(); }
20628   ::protozero::ConstBytes scm_call_start() const { return at<338>().as_bytes(); }
20629   bool has_scm_call_end() const { return at<339>().valid(); }
20630   ::protozero::ConstBytes scm_call_end() const { return at<339>().as_bytes(); }
20631   bool has_gpu_mem_total() const { return at<340>().valid(); }
20632   ::protozero::ConstBytes gpu_mem_total() const { return at<340>().as_bytes(); }
20633   bool has_thermal_temperature() const { return at<341>().valid(); }
20634   ::protozero::ConstBytes thermal_temperature() const { return at<341>().as_bytes(); }
20635   bool has_cdev_update() const { return at<342>().valid(); }
20636   ::protozero::ConstBytes cdev_update() const { return at<342>().as_bytes(); }
20637   bool has_cpuhp_exit() const { return at<343>().valid(); }
20638   ::protozero::ConstBytes cpuhp_exit() const { return at<343>().as_bytes(); }
20639   bool has_cpuhp_multi_enter() const { return at<344>().valid(); }
20640   ::protozero::ConstBytes cpuhp_multi_enter() const { return at<344>().as_bytes(); }
20641   bool has_cpuhp_enter() const { return at<345>().valid(); }
20642   ::protozero::ConstBytes cpuhp_enter() const { return at<345>().as_bytes(); }
20643   bool has_cpuhp_latency() const { return at<346>().valid(); }
20644   ::protozero::ConstBytes cpuhp_latency() const { return at<346>().as_bytes(); }
20645 };
20646 
20647 class FtraceEvent : public ::protozero::Message {
20648  public:
20649   using Decoder = FtraceEvent_Decoder;
20650   enum : int32_t {
20651     kTimestampFieldNumber = 1,
20652     kPidFieldNumber = 2,
20653     kPrintFieldNumber = 3,
20654     kSchedSwitchFieldNumber = 4,
20655     kCpuFrequencyFieldNumber = 11,
20656     kCpuFrequencyLimitsFieldNumber = 12,
20657     kCpuIdleFieldNumber = 13,
20658     kClockEnableFieldNumber = 14,
20659     kClockDisableFieldNumber = 15,
20660     kClockSetRateFieldNumber = 16,
20661     kSchedWakeupFieldNumber = 17,
20662     kSchedBlockedReasonFieldNumber = 18,
20663     kSchedCpuHotplugFieldNumber = 19,
20664     kSchedWakingFieldNumber = 20,
20665     kIpiEntryFieldNumber = 21,
20666     kIpiExitFieldNumber = 22,
20667     kIpiRaiseFieldNumber = 23,
20668     kSoftirqEntryFieldNumber = 24,
20669     kSoftirqExitFieldNumber = 25,
20670     kSoftirqRaiseFieldNumber = 26,
20671     kI2cReadFieldNumber = 27,
20672     kI2cWriteFieldNumber = 28,
20673     kI2cResultFieldNumber = 29,
20674     kI2cReplyFieldNumber = 30,
20675     kSmbusReadFieldNumber = 31,
20676     kSmbusWriteFieldNumber = 32,
20677     kSmbusResultFieldNumber = 33,
20678     kSmbusReplyFieldNumber = 34,
20679     kLowmemoryKillFieldNumber = 35,
20680     kIrqHandlerEntryFieldNumber = 36,
20681     kIrqHandlerExitFieldNumber = 37,
20682     kSyncPtFieldNumber = 38,
20683     kSyncTimelineFieldNumber = 39,
20684     kSyncWaitFieldNumber = 40,
20685     kExt4DaWriteBeginFieldNumber = 41,
20686     kExt4DaWriteEndFieldNumber = 42,
20687     kExt4SyncFileEnterFieldNumber = 43,
20688     kExt4SyncFileExitFieldNumber = 44,
20689     kBlockRqIssueFieldNumber = 45,
20690     kMmVmscanDirectReclaimBeginFieldNumber = 46,
20691     kMmVmscanDirectReclaimEndFieldNumber = 47,
20692     kMmVmscanKswapdWakeFieldNumber = 48,
20693     kMmVmscanKswapdSleepFieldNumber = 49,
20694     kBinderTransactionFieldNumber = 50,
20695     kBinderTransactionReceivedFieldNumber = 51,
20696     kBinderSetPriorityFieldNumber = 52,
20697     kBinderLockFieldNumber = 53,
20698     kBinderLockedFieldNumber = 54,
20699     kBinderUnlockFieldNumber = 55,
20700     kWorkqueueActivateWorkFieldNumber = 56,
20701     kWorkqueueExecuteEndFieldNumber = 57,
20702     kWorkqueueExecuteStartFieldNumber = 58,
20703     kWorkqueueQueueWorkFieldNumber = 59,
20704     kRegulatorDisableFieldNumber = 60,
20705     kRegulatorDisableCompleteFieldNumber = 61,
20706     kRegulatorEnableFieldNumber = 62,
20707     kRegulatorEnableCompleteFieldNumber = 63,
20708     kRegulatorEnableDelayFieldNumber = 64,
20709     kRegulatorSetVoltageFieldNumber = 65,
20710     kRegulatorSetVoltageCompleteFieldNumber = 66,
20711     kCgroupAttachTaskFieldNumber = 67,
20712     kCgroupMkdirFieldNumber = 68,
20713     kCgroupRemountFieldNumber = 69,
20714     kCgroupRmdirFieldNumber = 70,
20715     kCgroupTransferTasksFieldNumber = 71,
20716     kCgroupDestroyRootFieldNumber = 72,
20717     kCgroupReleaseFieldNumber = 73,
20718     kCgroupRenameFieldNumber = 74,
20719     kCgroupSetupRootFieldNumber = 75,
20720     kMdpCmdKickoffFieldNumber = 76,
20721     kMdpCommitFieldNumber = 77,
20722     kMdpPerfSetOtFieldNumber = 78,
20723     kMdpSsppChangeFieldNumber = 79,
20724     kTracingMarkWriteFieldNumber = 80,
20725     kMdpCmdPingpongDoneFieldNumber = 81,
20726     kMdpCompareBwFieldNumber = 82,
20727     kMdpPerfSetPanicLutsFieldNumber = 83,
20728     kMdpSsppSetFieldNumber = 84,
20729     kMdpCmdReadptrDoneFieldNumber = 85,
20730     kMdpMisrCrcFieldNumber = 86,
20731     kMdpPerfSetQosLutsFieldNumber = 87,
20732     kMdpTraceCounterFieldNumber = 88,
20733     kMdpCmdReleaseBwFieldNumber = 89,
20734     kMdpMixerUpdateFieldNumber = 90,
20735     kMdpPerfSetWmLevelsFieldNumber = 91,
20736     kMdpVideoUnderrunDoneFieldNumber = 92,
20737     kMdpCmdWaitPingpongFieldNumber = 93,
20738     kMdpPerfPrefillCalcFieldNumber = 94,
20739     kMdpPerfUpdateBusFieldNumber = 95,
20740     kRotatorBwAoAsContextFieldNumber = 96,
20741     kMmFilemapAddToPageCacheFieldNumber = 97,
20742     kMmFilemapDeleteFromPageCacheFieldNumber = 98,
20743     kMmCompactionBeginFieldNumber = 99,
20744     kMmCompactionDeferCompactionFieldNumber = 100,
20745     kMmCompactionDeferredFieldNumber = 101,
20746     kMmCompactionDeferResetFieldNumber = 102,
20747     kMmCompactionEndFieldNumber = 103,
20748     kMmCompactionFinishedFieldNumber = 104,
20749     kMmCompactionIsolateFreepagesFieldNumber = 105,
20750     kMmCompactionIsolateMigratepagesFieldNumber = 106,
20751     kMmCompactionKcompactdSleepFieldNumber = 107,
20752     kMmCompactionKcompactdWakeFieldNumber = 108,
20753     kMmCompactionMigratepagesFieldNumber = 109,
20754     kMmCompactionSuitableFieldNumber = 110,
20755     kMmCompactionTryToCompactPagesFieldNumber = 111,
20756     kMmCompactionWakeupKcompactdFieldNumber = 112,
20757     kSuspendResumeFieldNumber = 113,
20758     kSchedWakeupNewFieldNumber = 114,
20759     kBlockBioBackmergeFieldNumber = 115,
20760     kBlockBioBounceFieldNumber = 116,
20761     kBlockBioCompleteFieldNumber = 117,
20762     kBlockBioFrontmergeFieldNumber = 118,
20763     kBlockBioQueueFieldNumber = 119,
20764     kBlockBioRemapFieldNumber = 120,
20765     kBlockDirtyBufferFieldNumber = 121,
20766     kBlockGetrqFieldNumber = 122,
20767     kBlockPlugFieldNumber = 123,
20768     kBlockRqAbortFieldNumber = 124,
20769     kBlockRqCompleteFieldNumber = 125,
20770     kBlockRqInsertFieldNumber = 126,
20771     kBlockRqRemapFieldNumber = 128,
20772     kBlockRqRequeueFieldNumber = 129,
20773     kBlockSleeprqFieldNumber = 130,
20774     kBlockSplitFieldNumber = 131,
20775     kBlockTouchBufferFieldNumber = 132,
20776     kBlockUnplugFieldNumber = 133,
20777     kExt4AllocDaBlocksFieldNumber = 134,
20778     kExt4AllocateBlocksFieldNumber = 135,
20779     kExt4AllocateInodeFieldNumber = 136,
20780     kExt4BeginOrderedTruncateFieldNumber = 137,
20781     kExt4CollapseRangeFieldNumber = 138,
20782     kExt4DaReleaseSpaceFieldNumber = 139,
20783     kExt4DaReserveSpaceFieldNumber = 140,
20784     kExt4DaUpdateReserveSpaceFieldNumber = 141,
20785     kExt4DaWritePagesFieldNumber = 142,
20786     kExt4DaWritePagesExtentFieldNumber = 143,
20787     kExt4DirectIOEnterFieldNumber = 144,
20788     kExt4DirectIOExitFieldNumber = 145,
20789     kExt4DiscardBlocksFieldNumber = 146,
20790     kExt4DiscardPreallocationsFieldNumber = 147,
20791     kExt4DropInodeFieldNumber = 148,
20792     kExt4EsCacheExtentFieldNumber = 149,
20793     kExt4EsFindDelayedExtentRangeEnterFieldNumber = 150,
20794     kExt4EsFindDelayedExtentRangeExitFieldNumber = 151,
20795     kExt4EsInsertExtentFieldNumber = 152,
20796     kExt4EsLookupExtentEnterFieldNumber = 153,
20797     kExt4EsLookupExtentExitFieldNumber = 154,
20798     kExt4EsRemoveExtentFieldNumber = 155,
20799     kExt4EsShrinkFieldNumber = 156,
20800     kExt4EsShrinkCountFieldNumber = 157,
20801     kExt4EsShrinkScanEnterFieldNumber = 158,
20802     kExt4EsShrinkScanExitFieldNumber = 159,
20803     kExt4EvictInodeFieldNumber = 160,
20804     kExt4ExtConvertToInitializedEnterFieldNumber = 161,
20805     kExt4ExtConvertToInitializedFastpathFieldNumber = 162,
20806     kExt4ExtHandleUnwrittenExtentsFieldNumber = 163,
20807     kExt4ExtInCacheFieldNumber = 164,
20808     kExt4ExtLoadExtentFieldNumber = 165,
20809     kExt4ExtMapBlocksEnterFieldNumber = 166,
20810     kExt4ExtMapBlocksExitFieldNumber = 167,
20811     kExt4ExtPutInCacheFieldNumber = 168,
20812     kExt4ExtRemoveSpaceFieldNumber = 169,
20813     kExt4ExtRemoveSpaceDoneFieldNumber = 170,
20814     kExt4ExtRmIdxFieldNumber = 171,
20815     kExt4ExtRmLeafFieldNumber = 172,
20816     kExt4ExtShowExtentFieldNumber = 173,
20817     kExt4FallocateEnterFieldNumber = 174,
20818     kExt4FallocateExitFieldNumber = 175,
20819     kExt4FindDelallocRangeFieldNumber = 176,
20820     kExt4ForgetFieldNumber = 177,
20821     kExt4FreeBlocksFieldNumber = 178,
20822     kExt4FreeInodeFieldNumber = 179,
20823     kExt4GetImpliedClusterAllocExitFieldNumber = 180,
20824     kExt4GetReservedClusterAllocFieldNumber = 181,
20825     kExt4IndMapBlocksEnterFieldNumber = 182,
20826     kExt4IndMapBlocksExitFieldNumber = 183,
20827     kExt4InsertRangeFieldNumber = 184,
20828     kExt4InvalidatepageFieldNumber = 185,
20829     kExt4JournalStartFieldNumber = 186,
20830     kExt4JournalStartReservedFieldNumber = 187,
20831     kExt4JournalledInvalidatepageFieldNumber = 188,
20832     kExt4JournalledWriteEndFieldNumber = 189,
20833     kExt4LoadInodeFieldNumber = 190,
20834     kExt4LoadInodeBitmapFieldNumber = 191,
20835     kExt4MarkInodeDirtyFieldNumber = 192,
20836     kExt4MbBitmapLoadFieldNumber = 193,
20837     kExt4MbBuddyBitmapLoadFieldNumber = 194,
20838     kExt4MbDiscardPreallocationsFieldNumber = 195,
20839     kExt4MbNewGroupPaFieldNumber = 196,
20840     kExt4MbNewInodePaFieldNumber = 197,
20841     kExt4MbReleaseGroupPaFieldNumber = 198,
20842     kExt4MbReleaseInodePaFieldNumber = 199,
20843     kExt4MballocAllocFieldNumber = 200,
20844     kExt4MballocDiscardFieldNumber = 201,
20845     kExt4MballocFreeFieldNumber = 202,
20846     kExt4MballocPreallocFieldNumber = 203,
20847     kExt4OtherInodeUpdateTimeFieldNumber = 204,
20848     kExt4PunchHoleFieldNumber = 205,
20849     kExt4ReadBlockBitmapLoadFieldNumber = 206,
20850     kExt4ReadpageFieldNumber = 207,
20851     kExt4ReleasepageFieldNumber = 208,
20852     kExt4RemoveBlocksFieldNumber = 209,
20853     kExt4RequestBlocksFieldNumber = 210,
20854     kExt4RequestInodeFieldNumber = 211,
20855     kExt4SyncFsFieldNumber = 212,
20856     kExt4TrimAllFreeFieldNumber = 213,
20857     kExt4TrimExtentFieldNumber = 214,
20858     kExt4TruncateEnterFieldNumber = 215,
20859     kExt4TruncateExitFieldNumber = 216,
20860     kExt4UnlinkEnterFieldNumber = 217,
20861     kExt4UnlinkExitFieldNumber = 218,
20862     kExt4WriteBeginFieldNumber = 219,
20863     kExt4WriteEndFieldNumber = 230,
20864     kExt4WritepageFieldNumber = 231,
20865     kExt4WritepagesFieldNumber = 232,
20866     kExt4WritepagesResultFieldNumber = 233,
20867     kExt4ZeroRangeFieldNumber = 234,
20868     kTaskNewtaskFieldNumber = 235,
20869     kTaskRenameFieldNumber = 236,
20870     kSchedProcessExecFieldNumber = 237,
20871     kSchedProcessExitFieldNumber = 238,
20872     kSchedProcessForkFieldNumber = 239,
20873     kSchedProcessFreeFieldNumber = 240,
20874     kSchedProcessHangFieldNumber = 241,
20875     kSchedProcessWaitFieldNumber = 242,
20876     kF2fsDoSubmitBioFieldNumber = 243,
20877     kF2fsEvictInodeFieldNumber = 244,
20878     kF2fsFallocateFieldNumber = 245,
20879     kF2fsGetDataBlockFieldNumber = 246,
20880     kF2fsGetVictimFieldNumber = 247,
20881     kF2fsIgetFieldNumber = 248,
20882     kF2fsIgetExitFieldNumber = 249,
20883     kF2fsNewInodeFieldNumber = 250,
20884     kF2fsReadpageFieldNumber = 251,
20885     kF2fsReserveNewBlockFieldNumber = 252,
20886     kF2fsSetPageDirtyFieldNumber = 253,
20887     kF2fsSubmitWritePageFieldNumber = 254,
20888     kF2fsSyncFileEnterFieldNumber = 255,
20889     kF2fsSyncFileExitFieldNumber = 256,
20890     kF2fsSyncFsFieldNumber = 257,
20891     kF2fsTruncateFieldNumber = 258,
20892     kF2fsTruncateBlocksEnterFieldNumber = 259,
20893     kF2fsTruncateBlocksExitFieldNumber = 260,
20894     kF2fsTruncateDataBlocksRangeFieldNumber = 261,
20895     kF2fsTruncateInodeBlocksEnterFieldNumber = 262,
20896     kF2fsTruncateInodeBlocksExitFieldNumber = 263,
20897     kF2fsTruncateNodeFieldNumber = 264,
20898     kF2fsTruncateNodesEnterFieldNumber = 265,
20899     kF2fsTruncateNodesExitFieldNumber = 266,
20900     kF2fsTruncatePartialNodesFieldNumber = 267,
20901     kF2fsUnlinkEnterFieldNumber = 268,
20902     kF2fsUnlinkExitFieldNumber = 269,
20903     kF2fsVmPageMkwriteFieldNumber = 270,
20904     kF2fsWriteBeginFieldNumber = 271,
20905     kF2fsWriteCheckpointFieldNumber = 272,
20906     kF2fsWriteEndFieldNumber = 273,
20907     kAllocPagesIommuEndFieldNumber = 274,
20908     kAllocPagesIommuFailFieldNumber = 275,
20909     kAllocPagesIommuStartFieldNumber = 276,
20910     kAllocPagesSysEndFieldNumber = 277,
20911     kAllocPagesSysFailFieldNumber = 278,
20912     kAllocPagesSysStartFieldNumber = 279,
20913     kDmaAllocContiguousRetryFieldNumber = 280,
20914     kIommuMapRangeFieldNumber = 281,
20915     kIommuSecPtblMapRangeEndFieldNumber = 282,
20916     kIommuSecPtblMapRangeStartFieldNumber = 283,
20917     kIonAllocBufferEndFieldNumber = 284,
20918     kIonAllocBufferFailFieldNumber = 285,
20919     kIonAllocBufferFallbackFieldNumber = 286,
20920     kIonAllocBufferStartFieldNumber = 287,
20921     kIonCpAllocRetryFieldNumber = 288,
20922     kIonCpSecureBufferEndFieldNumber = 289,
20923     kIonCpSecureBufferStartFieldNumber = 290,
20924     kIonPrefetchingFieldNumber = 291,
20925     kIonSecureCmaAddToPoolEndFieldNumber = 292,
20926     kIonSecureCmaAddToPoolStartFieldNumber = 293,
20927     kIonSecureCmaAllocateEndFieldNumber = 294,
20928     kIonSecureCmaAllocateStartFieldNumber = 295,
20929     kIonSecureCmaShrinkPoolEndFieldNumber = 296,
20930     kIonSecureCmaShrinkPoolStartFieldNumber = 297,
20931     kKfreeFieldNumber = 298,
20932     kKmallocFieldNumber = 299,
20933     kKmallocNodeFieldNumber = 300,
20934     kKmemCacheAllocFieldNumber = 301,
20935     kKmemCacheAllocNodeFieldNumber = 302,
20936     kKmemCacheFreeFieldNumber = 303,
20937     kMigratePagesEndFieldNumber = 304,
20938     kMigratePagesStartFieldNumber = 305,
20939     kMigrateRetryFieldNumber = 306,
20940     kMmPageAllocFieldNumber = 307,
20941     kMmPageAllocExtfragFieldNumber = 308,
20942     kMmPageAllocZoneLockedFieldNumber = 309,
20943     kMmPageFreeFieldNumber = 310,
20944     kMmPageFreeBatchedFieldNumber = 311,
20945     kMmPagePcpuDrainFieldNumber = 312,
20946     kRssStatFieldNumber = 313,
20947     kIonHeapShrinkFieldNumber = 314,
20948     kIonHeapGrowFieldNumber = 315,
20949     kFenceInitFieldNumber = 316,
20950     kFenceDestroyFieldNumber = 317,
20951     kFenceEnableSignalFieldNumber = 318,
20952     kFenceSignaledFieldNumber = 319,
20953     kClkEnableFieldNumber = 320,
20954     kClkDisableFieldNumber = 321,
20955     kClkSetRateFieldNumber = 322,
20956     kBinderTransactionAllocBufFieldNumber = 323,
20957     kSignalDeliverFieldNumber = 324,
20958     kSignalGenerateFieldNumber = 325,
20959     kOomScoreAdjUpdateFieldNumber = 326,
20960     kGenericFieldNumber = 327,
20961     kMmEventRecordFieldNumber = 328,
20962     kSysEnterFieldNumber = 329,
20963     kSysExitFieldNumber = 330,
20964     kZeroFieldNumber = 331,
20965     kGpuFrequencyFieldNumber = 332,
20966     kSdeTracingMarkWriteFieldNumber = 333,
20967     kMarkVictimFieldNumber = 334,
20968     kIonStatFieldNumber = 335,
20969     kIonBufferCreateFieldNumber = 336,
20970     kIonBufferDestroyFieldNumber = 337,
20971     kScmCallStartFieldNumber = 338,
20972     kScmCallEndFieldNumber = 339,
20973     kGpuMemTotalFieldNumber = 340,
20974     kThermalTemperatureFieldNumber = 341,
20975     kCdevUpdateFieldNumber = 342,
20976     kCpuhpExitFieldNumber = 343,
20977     kCpuhpMultiEnterFieldNumber = 344,
20978     kCpuhpEnterFieldNumber = 345,
20979     kCpuhpLatencyFieldNumber = 346,
20980   };
20981   void set_timestamp(uint64_t value) {
20982     AppendVarInt(1, value);
20983   }
20984   void set_pid(uint32_t value) {
20985     AppendVarInt(2, value);
20986   }
20987   template <typename T = PrintFtraceEvent> T* set_print() {
20988     return BeginNestedMessage<T>(3);
20989   }
20990 
20991   template <typename T = SchedSwitchFtraceEvent> T* set_sched_switch() {
20992     return BeginNestedMessage<T>(4);
20993   }
20994 
20995   template <typename T = CpuFrequencyFtraceEvent> T* set_cpu_frequency() {
20996     return BeginNestedMessage<T>(11);
20997   }
20998 
20999   template <typename T = CpuFrequencyLimitsFtraceEvent> T* set_cpu_frequency_limits() {
21000     return BeginNestedMessage<T>(12);
21001   }
21002 
21003   template <typename T = CpuIdleFtraceEvent> T* set_cpu_idle() {
21004     return BeginNestedMessage<T>(13);
21005   }
21006 
21007   template <typename T = ClockEnableFtraceEvent> T* set_clock_enable() {
21008     return BeginNestedMessage<T>(14);
21009   }
21010 
21011   template <typename T = ClockDisableFtraceEvent> T* set_clock_disable() {
21012     return BeginNestedMessage<T>(15);
21013   }
21014 
21015   template <typename T = ClockSetRateFtraceEvent> T* set_clock_set_rate() {
21016     return BeginNestedMessage<T>(16);
21017   }
21018 
21019   template <typename T = SchedWakeupFtraceEvent> T* set_sched_wakeup() {
21020     return BeginNestedMessage<T>(17);
21021   }
21022 
21023   template <typename T = SchedBlockedReasonFtraceEvent> T* set_sched_blocked_reason() {
21024     return BeginNestedMessage<T>(18);
21025   }
21026 
21027   template <typename T = SchedCpuHotplugFtraceEvent> T* set_sched_cpu_hotplug() {
21028     return BeginNestedMessage<T>(19);
21029   }
21030 
21031   template <typename T = SchedWakingFtraceEvent> T* set_sched_waking() {
21032     return BeginNestedMessage<T>(20);
21033   }
21034 
21035   template <typename T = IpiEntryFtraceEvent> T* set_ipi_entry() {
21036     return BeginNestedMessage<T>(21);
21037   }
21038 
21039   template <typename T = IpiExitFtraceEvent> T* set_ipi_exit() {
21040     return BeginNestedMessage<T>(22);
21041   }
21042 
21043   template <typename T = IpiRaiseFtraceEvent> T* set_ipi_raise() {
21044     return BeginNestedMessage<T>(23);
21045   }
21046 
21047   template <typename T = SoftirqEntryFtraceEvent> T* set_softirq_entry() {
21048     return BeginNestedMessage<T>(24);
21049   }
21050 
21051   template <typename T = SoftirqExitFtraceEvent> T* set_softirq_exit() {
21052     return BeginNestedMessage<T>(25);
21053   }
21054 
21055   template <typename T = SoftirqRaiseFtraceEvent> T* set_softirq_raise() {
21056     return BeginNestedMessage<T>(26);
21057   }
21058 
21059   template <typename T = I2cReadFtraceEvent> T* set_i2c_read() {
21060     return BeginNestedMessage<T>(27);
21061   }
21062 
21063   template <typename T = I2cWriteFtraceEvent> T* set_i2c_write() {
21064     return BeginNestedMessage<T>(28);
21065   }
21066 
21067   template <typename T = I2cResultFtraceEvent> T* set_i2c_result() {
21068     return BeginNestedMessage<T>(29);
21069   }
21070 
21071   template <typename T = I2cReplyFtraceEvent> T* set_i2c_reply() {
21072     return BeginNestedMessage<T>(30);
21073   }
21074 
21075   template <typename T = SmbusReadFtraceEvent> T* set_smbus_read() {
21076     return BeginNestedMessage<T>(31);
21077   }
21078 
21079   template <typename T = SmbusWriteFtraceEvent> T* set_smbus_write() {
21080     return BeginNestedMessage<T>(32);
21081   }
21082 
21083   template <typename T = SmbusResultFtraceEvent> T* set_smbus_result() {
21084     return BeginNestedMessage<T>(33);
21085   }
21086 
21087   template <typename T = SmbusReplyFtraceEvent> T* set_smbus_reply() {
21088     return BeginNestedMessage<T>(34);
21089   }
21090 
21091   template <typename T = LowmemoryKillFtraceEvent> T* set_lowmemory_kill() {
21092     return BeginNestedMessage<T>(35);
21093   }
21094 
21095   template <typename T = IrqHandlerEntryFtraceEvent> T* set_irq_handler_entry() {
21096     return BeginNestedMessage<T>(36);
21097   }
21098 
21099   template <typename T = IrqHandlerExitFtraceEvent> T* set_irq_handler_exit() {
21100     return BeginNestedMessage<T>(37);
21101   }
21102 
21103   template <typename T = SyncPtFtraceEvent> T* set_sync_pt() {
21104     return BeginNestedMessage<T>(38);
21105   }
21106 
21107   template <typename T = SyncTimelineFtraceEvent> T* set_sync_timeline() {
21108     return BeginNestedMessage<T>(39);
21109   }
21110 
21111   template <typename T = SyncWaitFtraceEvent> T* set_sync_wait() {
21112     return BeginNestedMessage<T>(40);
21113   }
21114 
21115   template <typename T = Ext4DaWriteBeginFtraceEvent> T* set_ext4_da_write_begin() {
21116     return BeginNestedMessage<T>(41);
21117   }
21118 
21119   template <typename T = Ext4DaWriteEndFtraceEvent> T* set_ext4_da_write_end() {
21120     return BeginNestedMessage<T>(42);
21121   }
21122 
21123   template <typename T = Ext4SyncFileEnterFtraceEvent> T* set_ext4_sync_file_enter() {
21124     return BeginNestedMessage<T>(43);
21125   }
21126 
21127   template <typename T = Ext4SyncFileExitFtraceEvent> T* set_ext4_sync_file_exit() {
21128     return BeginNestedMessage<T>(44);
21129   }
21130 
21131   template <typename T = BlockRqIssueFtraceEvent> T* set_block_rq_issue() {
21132     return BeginNestedMessage<T>(45);
21133   }
21134 
21135   template <typename T = MmVmscanDirectReclaimBeginFtraceEvent> T* set_mm_vmscan_direct_reclaim_begin() {
21136     return BeginNestedMessage<T>(46);
21137   }
21138 
21139   template <typename T = MmVmscanDirectReclaimEndFtraceEvent> T* set_mm_vmscan_direct_reclaim_end() {
21140     return BeginNestedMessage<T>(47);
21141   }
21142 
21143   template <typename T = MmVmscanKswapdWakeFtraceEvent> T* set_mm_vmscan_kswapd_wake() {
21144     return BeginNestedMessage<T>(48);
21145   }
21146 
21147   template <typename T = MmVmscanKswapdSleepFtraceEvent> T* set_mm_vmscan_kswapd_sleep() {
21148     return BeginNestedMessage<T>(49);
21149   }
21150 
21151   template <typename T = BinderTransactionFtraceEvent> T* set_binder_transaction() {
21152     return BeginNestedMessage<T>(50);
21153   }
21154 
21155   template <typename T = BinderTransactionReceivedFtraceEvent> T* set_binder_transaction_received() {
21156     return BeginNestedMessage<T>(51);
21157   }
21158 
21159   template <typename T = BinderSetPriorityFtraceEvent> T* set_binder_set_priority() {
21160     return BeginNestedMessage<T>(52);
21161   }
21162 
21163   template <typename T = BinderLockFtraceEvent> T* set_binder_lock() {
21164     return BeginNestedMessage<T>(53);
21165   }
21166 
21167   template <typename T = BinderLockedFtraceEvent> T* set_binder_locked() {
21168     return BeginNestedMessage<T>(54);
21169   }
21170 
21171   template <typename T = BinderUnlockFtraceEvent> T* set_binder_unlock() {
21172     return BeginNestedMessage<T>(55);
21173   }
21174 
21175   template <typename T = WorkqueueActivateWorkFtraceEvent> T* set_workqueue_activate_work() {
21176     return BeginNestedMessage<T>(56);
21177   }
21178 
21179   template <typename T = WorkqueueExecuteEndFtraceEvent> T* set_workqueue_execute_end() {
21180     return BeginNestedMessage<T>(57);
21181   }
21182 
21183   template <typename T = WorkqueueExecuteStartFtraceEvent> T* set_workqueue_execute_start() {
21184     return BeginNestedMessage<T>(58);
21185   }
21186 
21187   template <typename T = WorkqueueQueueWorkFtraceEvent> T* set_workqueue_queue_work() {
21188     return BeginNestedMessage<T>(59);
21189   }
21190 
21191   template <typename T = RegulatorDisableFtraceEvent> T* set_regulator_disable() {
21192     return BeginNestedMessage<T>(60);
21193   }
21194 
21195   template <typename T = RegulatorDisableCompleteFtraceEvent> T* set_regulator_disable_complete() {
21196     return BeginNestedMessage<T>(61);
21197   }
21198 
21199   template <typename T = RegulatorEnableFtraceEvent> T* set_regulator_enable() {
21200     return BeginNestedMessage<T>(62);
21201   }
21202 
21203   template <typename T = RegulatorEnableCompleteFtraceEvent> T* set_regulator_enable_complete() {
21204     return BeginNestedMessage<T>(63);
21205   }
21206 
21207   template <typename T = RegulatorEnableDelayFtraceEvent> T* set_regulator_enable_delay() {
21208     return BeginNestedMessage<T>(64);
21209   }
21210 
21211   template <typename T = RegulatorSetVoltageFtraceEvent> T* set_regulator_set_voltage() {
21212     return BeginNestedMessage<T>(65);
21213   }
21214 
21215   template <typename T = RegulatorSetVoltageCompleteFtraceEvent> T* set_regulator_set_voltage_complete() {
21216     return BeginNestedMessage<T>(66);
21217   }
21218 
21219   template <typename T = CgroupAttachTaskFtraceEvent> T* set_cgroup_attach_task() {
21220     return BeginNestedMessage<T>(67);
21221   }
21222 
21223   template <typename T = CgroupMkdirFtraceEvent> T* set_cgroup_mkdir() {
21224     return BeginNestedMessage<T>(68);
21225   }
21226 
21227   template <typename T = CgroupRemountFtraceEvent> T* set_cgroup_remount() {
21228     return BeginNestedMessage<T>(69);
21229   }
21230 
21231   template <typename T = CgroupRmdirFtraceEvent> T* set_cgroup_rmdir() {
21232     return BeginNestedMessage<T>(70);
21233   }
21234 
21235   template <typename T = CgroupTransferTasksFtraceEvent> T* set_cgroup_transfer_tasks() {
21236     return BeginNestedMessage<T>(71);
21237   }
21238 
21239   template <typename T = CgroupDestroyRootFtraceEvent> T* set_cgroup_destroy_root() {
21240     return BeginNestedMessage<T>(72);
21241   }
21242 
21243   template <typename T = CgroupReleaseFtraceEvent> T* set_cgroup_release() {
21244     return BeginNestedMessage<T>(73);
21245   }
21246 
21247   template <typename T = CgroupRenameFtraceEvent> T* set_cgroup_rename() {
21248     return BeginNestedMessage<T>(74);
21249   }
21250 
21251   template <typename T = CgroupSetupRootFtraceEvent> T* set_cgroup_setup_root() {
21252     return BeginNestedMessage<T>(75);
21253   }
21254 
21255   template <typename T = MdpCmdKickoffFtraceEvent> T* set_mdp_cmd_kickoff() {
21256     return BeginNestedMessage<T>(76);
21257   }
21258 
21259   template <typename T = MdpCommitFtraceEvent> T* set_mdp_commit() {
21260     return BeginNestedMessage<T>(77);
21261   }
21262 
21263   template <typename T = MdpPerfSetOtFtraceEvent> T* set_mdp_perf_set_ot() {
21264     return BeginNestedMessage<T>(78);
21265   }
21266 
21267   template <typename T = MdpSsppChangeFtraceEvent> T* set_mdp_sspp_change() {
21268     return BeginNestedMessage<T>(79);
21269   }
21270 
21271   template <typename T = TracingMarkWriteFtraceEvent> T* set_tracing_mark_write() {
21272     return BeginNestedMessage<T>(80);
21273   }
21274 
21275   template <typename T = MdpCmdPingpongDoneFtraceEvent> T* set_mdp_cmd_pingpong_done() {
21276     return BeginNestedMessage<T>(81);
21277   }
21278 
21279   template <typename T = MdpCompareBwFtraceEvent> T* set_mdp_compare_bw() {
21280     return BeginNestedMessage<T>(82);
21281   }
21282 
21283   template <typename T = MdpPerfSetPanicLutsFtraceEvent> T* set_mdp_perf_set_panic_luts() {
21284     return BeginNestedMessage<T>(83);
21285   }
21286 
21287   template <typename T = MdpSsppSetFtraceEvent> T* set_mdp_sspp_set() {
21288     return BeginNestedMessage<T>(84);
21289   }
21290 
21291   template <typename T = MdpCmdReadptrDoneFtraceEvent> T* set_mdp_cmd_readptr_done() {
21292     return BeginNestedMessage<T>(85);
21293   }
21294 
21295   template <typename T = MdpMisrCrcFtraceEvent> T* set_mdp_misr_crc() {
21296     return BeginNestedMessage<T>(86);
21297   }
21298 
21299   template <typename T = MdpPerfSetQosLutsFtraceEvent> T* set_mdp_perf_set_qos_luts() {
21300     return BeginNestedMessage<T>(87);
21301   }
21302 
21303   template <typename T = MdpTraceCounterFtraceEvent> T* set_mdp_trace_counter() {
21304     return BeginNestedMessage<T>(88);
21305   }
21306 
21307   template <typename T = MdpCmdReleaseBwFtraceEvent> T* set_mdp_cmd_release_bw() {
21308     return BeginNestedMessage<T>(89);
21309   }
21310 
21311   template <typename T = MdpMixerUpdateFtraceEvent> T* set_mdp_mixer_update() {
21312     return BeginNestedMessage<T>(90);
21313   }
21314 
21315   template <typename T = MdpPerfSetWmLevelsFtraceEvent> T* set_mdp_perf_set_wm_levels() {
21316     return BeginNestedMessage<T>(91);
21317   }
21318 
21319   template <typename T = MdpVideoUnderrunDoneFtraceEvent> T* set_mdp_video_underrun_done() {
21320     return BeginNestedMessage<T>(92);
21321   }
21322 
21323   template <typename T = MdpCmdWaitPingpongFtraceEvent> T* set_mdp_cmd_wait_pingpong() {
21324     return BeginNestedMessage<T>(93);
21325   }
21326 
21327   template <typename T = MdpPerfPrefillCalcFtraceEvent> T* set_mdp_perf_prefill_calc() {
21328     return BeginNestedMessage<T>(94);
21329   }
21330 
21331   template <typename T = MdpPerfUpdateBusFtraceEvent> T* set_mdp_perf_update_bus() {
21332     return BeginNestedMessage<T>(95);
21333   }
21334 
21335   template <typename T = RotatorBwAoAsContextFtraceEvent> T* set_rotator_bw_ao_as_context() {
21336     return BeginNestedMessage<T>(96);
21337   }
21338 
21339   template <typename T = MmFilemapAddToPageCacheFtraceEvent> T* set_mm_filemap_add_to_page_cache() {
21340     return BeginNestedMessage<T>(97);
21341   }
21342 
21343   template <typename T = MmFilemapDeleteFromPageCacheFtraceEvent> T* set_mm_filemap_delete_from_page_cache() {
21344     return BeginNestedMessage<T>(98);
21345   }
21346 
21347   template <typename T = MmCompactionBeginFtraceEvent> T* set_mm_compaction_begin() {
21348     return BeginNestedMessage<T>(99);
21349   }
21350 
21351   template <typename T = MmCompactionDeferCompactionFtraceEvent> T* set_mm_compaction_defer_compaction() {
21352     return BeginNestedMessage<T>(100);
21353   }
21354 
21355   template <typename T = MmCompactionDeferredFtraceEvent> T* set_mm_compaction_deferred() {
21356     return BeginNestedMessage<T>(101);
21357   }
21358 
21359   template <typename T = MmCompactionDeferResetFtraceEvent> T* set_mm_compaction_defer_reset() {
21360     return BeginNestedMessage<T>(102);
21361   }
21362 
21363   template <typename T = MmCompactionEndFtraceEvent> T* set_mm_compaction_end() {
21364     return BeginNestedMessage<T>(103);
21365   }
21366 
21367   template <typename T = MmCompactionFinishedFtraceEvent> T* set_mm_compaction_finished() {
21368     return BeginNestedMessage<T>(104);
21369   }
21370 
21371   template <typename T = MmCompactionIsolateFreepagesFtraceEvent> T* set_mm_compaction_isolate_freepages() {
21372     return BeginNestedMessage<T>(105);
21373   }
21374 
21375   template <typename T = MmCompactionIsolateMigratepagesFtraceEvent> T* set_mm_compaction_isolate_migratepages() {
21376     return BeginNestedMessage<T>(106);
21377   }
21378 
21379   template <typename T = MmCompactionKcompactdSleepFtraceEvent> T* set_mm_compaction_kcompactd_sleep() {
21380     return BeginNestedMessage<T>(107);
21381   }
21382 
21383   template <typename T = MmCompactionKcompactdWakeFtraceEvent> T* set_mm_compaction_kcompactd_wake() {
21384     return BeginNestedMessage<T>(108);
21385   }
21386 
21387   template <typename T = MmCompactionMigratepagesFtraceEvent> T* set_mm_compaction_migratepages() {
21388     return BeginNestedMessage<T>(109);
21389   }
21390 
21391   template <typename T = MmCompactionSuitableFtraceEvent> T* set_mm_compaction_suitable() {
21392     return BeginNestedMessage<T>(110);
21393   }
21394 
21395   template <typename T = MmCompactionTryToCompactPagesFtraceEvent> T* set_mm_compaction_try_to_compact_pages() {
21396     return BeginNestedMessage<T>(111);
21397   }
21398 
21399   template <typename T = MmCompactionWakeupKcompactdFtraceEvent> T* set_mm_compaction_wakeup_kcompactd() {
21400     return BeginNestedMessage<T>(112);
21401   }
21402 
21403   template <typename T = SuspendResumeFtraceEvent> T* set_suspend_resume() {
21404     return BeginNestedMessage<T>(113);
21405   }
21406 
21407   template <typename T = SchedWakeupNewFtraceEvent> T* set_sched_wakeup_new() {
21408     return BeginNestedMessage<T>(114);
21409   }
21410 
21411   template <typename T = BlockBioBackmergeFtraceEvent> T* set_block_bio_backmerge() {
21412     return BeginNestedMessage<T>(115);
21413   }
21414 
21415   template <typename T = BlockBioBounceFtraceEvent> T* set_block_bio_bounce() {
21416     return BeginNestedMessage<T>(116);
21417   }
21418 
21419   template <typename T = BlockBioCompleteFtraceEvent> T* set_block_bio_complete() {
21420     return BeginNestedMessage<T>(117);
21421   }
21422 
21423   template <typename T = BlockBioFrontmergeFtraceEvent> T* set_block_bio_frontmerge() {
21424     return BeginNestedMessage<T>(118);
21425   }
21426 
21427   template <typename T = BlockBioQueueFtraceEvent> T* set_block_bio_queue() {
21428     return BeginNestedMessage<T>(119);
21429   }
21430 
21431   template <typename T = BlockBioRemapFtraceEvent> T* set_block_bio_remap() {
21432     return BeginNestedMessage<T>(120);
21433   }
21434 
21435   template <typename T = BlockDirtyBufferFtraceEvent> T* set_block_dirty_buffer() {
21436     return BeginNestedMessage<T>(121);
21437   }
21438 
21439   template <typename T = BlockGetrqFtraceEvent> T* set_block_getrq() {
21440     return BeginNestedMessage<T>(122);
21441   }
21442 
21443   template <typename T = BlockPlugFtraceEvent> T* set_block_plug() {
21444     return BeginNestedMessage<T>(123);
21445   }
21446 
21447   template <typename T = BlockRqAbortFtraceEvent> T* set_block_rq_abort() {
21448     return BeginNestedMessage<T>(124);
21449   }
21450 
21451   template <typename T = BlockRqCompleteFtraceEvent> T* set_block_rq_complete() {
21452     return BeginNestedMessage<T>(125);
21453   }
21454 
21455   template <typename T = BlockRqInsertFtraceEvent> T* set_block_rq_insert() {
21456     return BeginNestedMessage<T>(126);
21457   }
21458 
21459   template <typename T = BlockRqRemapFtraceEvent> T* set_block_rq_remap() {
21460     return BeginNestedMessage<T>(128);
21461   }
21462 
21463   template <typename T = BlockRqRequeueFtraceEvent> T* set_block_rq_requeue() {
21464     return BeginNestedMessage<T>(129);
21465   }
21466 
21467   template <typename T = BlockSleeprqFtraceEvent> T* set_block_sleeprq() {
21468     return BeginNestedMessage<T>(130);
21469   }
21470 
21471   template <typename T = BlockSplitFtraceEvent> T* set_block_split() {
21472     return BeginNestedMessage<T>(131);
21473   }
21474 
21475   template <typename T = BlockTouchBufferFtraceEvent> T* set_block_touch_buffer() {
21476     return BeginNestedMessage<T>(132);
21477   }
21478 
21479   template <typename T = BlockUnplugFtraceEvent> T* set_block_unplug() {
21480     return BeginNestedMessage<T>(133);
21481   }
21482 
21483   template <typename T = Ext4AllocDaBlocksFtraceEvent> T* set_ext4_alloc_da_blocks() {
21484     return BeginNestedMessage<T>(134);
21485   }
21486 
21487   template <typename T = Ext4AllocateBlocksFtraceEvent> T* set_ext4_allocate_blocks() {
21488     return BeginNestedMessage<T>(135);
21489   }
21490 
21491   template <typename T = Ext4AllocateInodeFtraceEvent> T* set_ext4_allocate_inode() {
21492     return BeginNestedMessage<T>(136);
21493   }
21494 
21495   template <typename T = Ext4BeginOrderedTruncateFtraceEvent> T* set_ext4_begin_ordered_truncate() {
21496     return BeginNestedMessage<T>(137);
21497   }
21498 
21499   template <typename T = Ext4CollapseRangeFtraceEvent> T* set_ext4_collapse_range() {
21500     return BeginNestedMessage<T>(138);
21501   }
21502 
21503   template <typename T = Ext4DaReleaseSpaceFtraceEvent> T* set_ext4_da_release_space() {
21504     return BeginNestedMessage<T>(139);
21505   }
21506 
21507   template <typename T = Ext4DaReserveSpaceFtraceEvent> T* set_ext4_da_reserve_space() {
21508     return BeginNestedMessage<T>(140);
21509   }
21510 
21511   template <typename T = Ext4DaUpdateReserveSpaceFtraceEvent> T* set_ext4_da_update_reserve_space() {
21512     return BeginNestedMessage<T>(141);
21513   }
21514 
21515   template <typename T = Ext4DaWritePagesFtraceEvent> T* set_ext4_da_write_pages() {
21516     return BeginNestedMessage<T>(142);
21517   }
21518 
21519   template <typename T = Ext4DaWritePagesExtentFtraceEvent> T* set_ext4_da_write_pages_extent() {
21520     return BeginNestedMessage<T>(143);
21521   }
21522 
21523   template <typename T = Ext4DirectIOEnterFtraceEvent> T* set_ext4_direct_io_enter() {
21524     return BeginNestedMessage<T>(144);
21525   }
21526 
21527   template <typename T = Ext4DirectIOExitFtraceEvent> T* set_ext4_direct_io_exit() {
21528     return BeginNestedMessage<T>(145);
21529   }
21530 
21531   template <typename T = Ext4DiscardBlocksFtraceEvent> T* set_ext4_discard_blocks() {
21532     return BeginNestedMessage<T>(146);
21533   }
21534 
21535   template <typename T = Ext4DiscardPreallocationsFtraceEvent> T* set_ext4_discard_preallocations() {
21536     return BeginNestedMessage<T>(147);
21537   }
21538 
21539   template <typename T = Ext4DropInodeFtraceEvent> T* set_ext4_drop_inode() {
21540     return BeginNestedMessage<T>(148);
21541   }
21542 
21543   template <typename T = Ext4EsCacheExtentFtraceEvent> T* set_ext4_es_cache_extent() {
21544     return BeginNestedMessage<T>(149);
21545   }
21546 
21547   template <typename T = Ext4EsFindDelayedExtentRangeEnterFtraceEvent> T* set_ext4_es_find_delayed_extent_range_enter() {
21548     return BeginNestedMessage<T>(150);
21549   }
21550 
21551   template <typename T = Ext4EsFindDelayedExtentRangeExitFtraceEvent> T* set_ext4_es_find_delayed_extent_range_exit() {
21552     return BeginNestedMessage<T>(151);
21553   }
21554 
21555   template <typename T = Ext4EsInsertExtentFtraceEvent> T* set_ext4_es_insert_extent() {
21556     return BeginNestedMessage<T>(152);
21557   }
21558 
21559   template <typename T = Ext4EsLookupExtentEnterFtraceEvent> T* set_ext4_es_lookup_extent_enter() {
21560     return BeginNestedMessage<T>(153);
21561   }
21562 
21563   template <typename T = Ext4EsLookupExtentExitFtraceEvent> T* set_ext4_es_lookup_extent_exit() {
21564     return BeginNestedMessage<T>(154);
21565   }
21566 
21567   template <typename T = Ext4EsRemoveExtentFtraceEvent> T* set_ext4_es_remove_extent() {
21568     return BeginNestedMessage<T>(155);
21569   }
21570 
21571   template <typename T = Ext4EsShrinkFtraceEvent> T* set_ext4_es_shrink() {
21572     return BeginNestedMessage<T>(156);
21573   }
21574 
21575   template <typename T = Ext4EsShrinkCountFtraceEvent> T* set_ext4_es_shrink_count() {
21576     return BeginNestedMessage<T>(157);
21577   }
21578 
21579   template <typename T = Ext4EsShrinkScanEnterFtraceEvent> T* set_ext4_es_shrink_scan_enter() {
21580     return BeginNestedMessage<T>(158);
21581   }
21582 
21583   template <typename T = Ext4EsShrinkScanExitFtraceEvent> T* set_ext4_es_shrink_scan_exit() {
21584     return BeginNestedMessage<T>(159);
21585   }
21586 
21587   template <typename T = Ext4EvictInodeFtraceEvent> T* set_ext4_evict_inode() {
21588     return BeginNestedMessage<T>(160);
21589   }
21590 
21591   template <typename T = Ext4ExtConvertToInitializedEnterFtraceEvent> T* set_ext4_ext_convert_to_initialized_enter() {
21592     return BeginNestedMessage<T>(161);
21593   }
21594 
21595   template <typename T = Ext4ExtConvertToInitializedFastpathFtraceEvent> T* set_ext4_ext_convert_to_initialized_fastpath() {
21596     return BeginNestedMessage<T>(162);
21597   }
21598 
21599   template <typename T = Ext4ExtHandleUnwrittenExtentsFtraceEvent> T* set_ext4_ext_handle_unwritten_extents() {
21600     return BeginNestedMessage<T>(163);
21601   }
21602 
21603   template <typename T = Ext4ExtInCacheFtraceEvent> T* set_ext4_ext_in_cache() {
21604     return BeginNestedMessage<T>(164);
21605   }
21606 
21607   template <typename T = Ext4ExtLoadExtentFtraceEvent> T* set_ext4_ext_load_extent() {
21608     return BeginNestedMessage<T>(165);
21609   }
21610 
21611   template <typename T = Ext4ExtMapBlocksEnterFtraceEvent> T* set_ext4_ext_map_blocks_enter() {
21612     return BeginNestedMessage<T>(166);
21613   }
21614 
21615   template <typename T = Ext4ExtMapBlocksExitFtraceEvent> T* set_ext4_ext_map_blocks_exit() {
21616     return BeginNestedMessage<T>(167);
21617   }
21618 
21619   template <typename T = Ext4ExtPutInCacheFtraceEvent> T* set_ext4_ext_put_in_cache() {
21620     return BeginNestedMessage<T>(168);
21621   }
21622 
21623   template <typename T = Ext4ExtRemoveSpaceFtraceEvent> T* set_ext4_ext_remove_space() {
21624     return BeginNestedMessage<T>(169);
21625   }
21626 
21627   template <typename T = Ext4ExtRemoveSpaceDoneFtraceEvent> T* set_ext4_ext_remove_space_done() {
21628     return BeginNestedMessage<T>(170);
21629   }
21630 
21631   template <typename T = Ext4ExtRmIdxFtraceEvent> T* set_ext4_ext_rm_idx() {
21632     return BeginNestedMessage<T>(171);
21633   }
21634 
21635   template <typename T = Ext4ExtRmLeafFtraceEvent> T* set_ext4_ext_rm_leaf() {
21636     return BeginNestedMessage<T>(172);
21637   }
21638 
21639   template <typename T = Ext4ExtShowExtentFtraceEvent> T* set_ext4_ext_show_extent() {
21640     return BeginNestedMessage<T>(173);
21641   }
21642 
21643   template <typename T = Ext4FallocateEnterFtraceEvent> T* set_ext4_fallocate_enter() {
21644     return BeginNestedMessage<T>(174);
21645   }
21646 
21647   template <typename T = Ext4FallocateExitFtraceEvent> T* set_ext4_fallocate_exit() {
21648     return BeginNestedMessage<T>(175);
21649   }
21650 
21651   template <typename T = Ext4FindDelallocRangeFtraceEvent> T* set_ext4_find_delalloc_range() {
21652     return BeginNestedMessage<T>(176);
21653   }
21654 
21655   template <typename T = Ext4ForgetFtraceEvent> T* set_ext4_forget() {
21656     return BeginNestedMessage<T>(177);
21657   }
21658 
21659   template <typename T = Ext4FreeBlocksFtraceEvent> T* set_ext4_free_blocks() {
21660     return BeginNestedMessage<T>(178);
21661   }
21662 
21663   template <typename T = Ext4FreeInodeFtraceEvent> T* set_ext4_free_inode() {
21664     return BeginNestedMessage<T>(179);
21665   }
21666 
21667   template <typename T = Ext4GetImpliedClusterAllocExitFtraceEvent> T* set_ext4_get_implied_cluster_alloc_exit() {
21668     return BeginNestedMessage<T>(180);
21669   }
21670 
21671   template <typename T = Ext4GetReservedClusterAllocFtraceEvent> T* set_ext4_get_reserved_cluster_alloc() {
21672     return BeginNestedMessage<T>(181);
21673   }
21674 
21675   template <typename T = Ext4IndMapBlocksEnterFtraceEvent> T* set_ext4_ind_map_blocks_enter() {
21676     return BeginNestedMessage<T>(182);
21677   }
21678 
21679   template <typename T = Ext4IndMapBlocksExitFtraceEvent> T* set_ext4_ind_map_blocks_exit() {
21680     return BeginNestedMessage<T>(183);
21681   }
21682 
21683   template <typename T = Ext4InsertRangeFtraceEvent> T* set_ext4_insert_range() {
21684     return BeginNestedMessage<T>(184);
21685   }
21686 
21687   template <typename T = Ext4InvalidatepageFtraceEvent> T* set_ext4_invalidatepage() {
21688     return BeginNestedMessage<T>(185);
21689   }
21690 
21691   template <typename T = Ext4JournalStartFtraceEvent> T* set_ext4_journal_start() {
21692     return BeginNestedMessage<T>(186);
21693   }
21694 
21695   template <typename T = Ext4JournalStartReservedFtraceEvent> T* set_ext4_journal_start_reserved() {
21696     return BeginNestedMessage<T>(187);
21697   }
21698 
21699   template <typename T = Ext4JournalledInvalidatepageFtraceEvent> T* set_ext4_journalled_invalidatepage() {
21700     return BeginNestedMessage<T>(188);
21701   }
21702 
21703   template <typename T = Ext4JournalledWriteEndFtraceEvent> T* set_ext4_journalled_write_end() {
21704     return BeginNestedMessage<T>(189);
21705   }
21706 
21707   template <typename T = Ext4LoadInodeFtraceEvent> T* set_ext4_load_inode() {
21708     return BeginNestedMessage<T>(190);
21709   }
21710 
21711   template <typename T = Ext4LoadInodeBitmapFtraceEvent> T* set_ext4_load_inode_bitmap() {
21712     return BeginNestedMessage<T>(191);
21713   }
21714 
21715   template <typename T = Ext4MarkInodeDirtyFtraceEvent> T* set_ext4_mark_inode_dirty() {
21716     return BeginNestedMessage<T>(192);
21717   }
21718 
21719   template <typename T = Ext4MbBitmapLoadFtraceEvent> T* set_ext4_mb_bitmap_load() {
21720     return BeginNestedMessage<T>(193);
21721   }
21722 
21723   template <typename T = Ext4MbBuddyBitmapLoadFtraceEvent> T* set_ext4_mb_buddy_bitmap_load() {
21724     return BeginNestedMessage<T>(194);
21725   }
21726 
21727   template <typename T = Ext4MbDiscardPreallocationsFtraceEvent> T* set_ext4_mb_discard_preallocations() {
21728     return BeginNestedMessage<T>(195);
21729   }
21730 
21731   template <typename T = Ext4MbNewGroupPaFtraceEvent> T* set_ext4_mb_new_group_pa() {
21732     return BeginNestedMessage<T>(196);
21733   }
21734 
21735   template <typename T = Ext4MbNewInodePaFtraceEvent> T* set_ext4_mb_new_inode_pa() {
21736     return BeginNestedMessage<T>(197);
21737   }
21738 
21739   template <typename T = Ext4MbReleaseGroupPaFtraceEvent> T* set_ext4_mb_release_group_pa() {
21740     return BeginNestedMessage<T>(198);
21741   }
21742 
21743   template <typename T = Ext4MbReleaseInodePaFtraceEvent> T* set_ext4_mb_release_inode_pa() {
21744     return BeginNestedMessage<T>(199);
21745   }
21746 
21747   template <typename T = Ext4MballocAllocFtraceEvent> T* set_ext4_mballoc_alloc() {
21748     return BeginNestedMessage<T>(200);
21749   }
21750 
21751   template <typename T = Ext4MballocDiscardFtraceEvent> T* set_ext4_mballoc_discard() {
21752     return BeginNestedMessage<T>(201);
21753   }
21754 
21755   template <typename T = Ext4MballocFreeFtraceEvent> T* set_ext4_mballoc_free() {
21756     return BeginNestedMessage<T>(202);
21757   }
21758 
21759   template <typename T = Ext4MballocPreallocFtraceEvent> T* set_ext4_mballoc_prealloc() {
21760     return BeginNestedMessage<T>(203);
21761   }
21762 
21763   template <typename T = Ext4OtherInodeUpdateTimeFtraceEvent> T* set_ext4_other_inode_update_time() {
21764     return BeginNestedMessage<T>(204);
21765   }
21766 
21767   template <typename T = Ext4PunchHoleFtraceEvent> T* set_ext4_punch_hole() {
21768     return BeginNestedMessage<T>(205);
21769   }
21770 
21771   template <typename T = Ext4ReadBlockBitmapLoadFtraceEvent> T* set_ext4_read_block_bitmap_load() {
21772     return BeginNestedMessage<T>(206);
21773   }
21774 
21775   template <typename T = Ext4ReadpageFtraceEvent> T* set_ext4_readpage() {
21776     return BeginNestedMessage<T>(207);
21777   }
21778 
21779   template <typename T = Ext4ReleasepageFtraceEvent> T* set_ext4_releasepage() {
21780     return BeginNestedMessage<T>(208);
21781   }
21782 
21783   template <typename T = Ext4RemoveBlocksFtraceEvent> T* set_ext4_remove_blocks() {
21784     return BeginNestedMessage<T>(209);
21785   }
21786 
21787   template <typename T = Ext4RequestBlocksFtraceEvent> T* set_ext4_request_blocks() {
21788     return BeginNestedMessage<T>(210);
21789   }
21790 
21791   template <typename T = Ext4RequestInodeFtraceEvent> T* set_ext4_request_inode() {
21792     return BeginNestedMessage<T>(211);
21793   }
21794 
21795   template <typename T = Ext4SyncFsFtraceEvent> T* set_ext4_sync_fs() {
21796     return BeginNestedMessage<T>(212);
21797   }
21798 
21799   template <typename T = Ext4TrimAllFreeFtraceEvent> T* set_ext4_trim_all_free() {
21800     return BeginNestedMessage<T>(213);
21801   }
21802 
21803   template <typename T = Ext4TrimExtentFtraceEvent> T* set_ext4_trim_extent() {
21804     return BeginNestedMessage<T>(214);
21805   }
21806 
21807   template <typename T = Ext4TruncateEnterFtraceEvent> T* set_ext4_truncate_enter() {
21808     return BeginNestedMessage<T>(215);
21809   }
21810 
21811   template <typename T = Ext4TruncateExitFtraceEvent> T* set_ext4_truncate_exit() {
21812     return BeginNestedMessage<T>(216);
21813   }
21814 
21815   template <typename T = Ext4UnlinkEnterFtraceEvent> T* set_ext4_unlink_enter() {
21816     return BeginNestedMessage<T>(217);
21817   }
21818 
21819   template <typename T = Ext4UnlinkExitFtraceEvent> T* set_ext4_unlink_exit() {
21820     return BeginNestedMessage<T>(218);
21821   }
21822 
21823   template <typename T = Ext4WriteBeginFtraceEvent> T* set_ext4_write_begin() {
21824     return BeginNestedMessage<T>(219);
21825   }
21826 
21827   template <typename T = Ext4WriteEndFtraceEvent> T* set_ext4_write_end() {
21828     return BeginNestedMessage<T>(230);
21829   }
21830 
21831   template <typename T = Ext4WritepageFtraceEvent> T* set_ext4_writepage() {
21832     return BeginNestedMessage<T>(231);
21833   }
21834 
21835   template <typename T = Ext4WritepagesFtraceEvent> T* set_ext4_writepages() {
21836     return BeginNestedMessage<T>(232);
21837   }
21838 
21839   template <typename T = Ext4WritepagesResultFtraceEvent> T* set_ext4_writepages_result() {
21840     return BeginNestedMessage<T>(233);
21841   }
21842 
21843   template <typename T = Ext4ZeroRangeFtraceEvent> T* set_ext4_zero_range() {
21844     return BeginNestedMessage<T>(234);
21845   }
21846 
21847   template <typename T = TaskNewtaskFtraceEvent> T* set_task_newtask() {
21848     return BeginNestedMessage<T>(235);
21849   }
21850 
21851   template <typename T = TaskRenameFtraceEvent> T* set_task_rename() {
21852     return BeginNestedMessage<T>(236);
21853   }
21854 
21855   template <typename T = SchedProcessExecFtraceEvent> T* set_sched_process_exec() {
21856     return BeginNestedMessage<T>(237);
21857   }
21858 
21859   template <typename T = SchedProcessExitFtraceEvent> T* set_sched_process_exit() {
21860     return BeginNestedMessage<T>(238);
21861   }
21862 
21863   template <typename T = SchedProcessForkFtraceEvent> T* set_sched_process_fork() {
21864     return BeginNestedMessage<T>(239);
21865   }
21866 
21867   template <typename T = SchedProcessFreeFtraceEvent> T* set_sched_process_free() {
21868     return BeginNestedMessage<T>(240);
21869   }
21870 
21871   template <typename T = SchedProcessHangFtraceEvent> T* set_sched_process_hang() {
21872     return BeginNestedMessage<T>(241);
21873   }
21874 
21875   template <typename T = SchedProcessWaitFtraceEvent> T* set_sched_process_wait() {
21876     return BeginNestedMessage<T>(242);
21877   }
21878 
21879   template <typename T = F2fsDoSubmitBioFtraceEvent> T* set_f2fs_do_submit_bio() {
21880     return BeginNestedMessage<T>(243);
21881   }
21882 
21883   template <typename T = F2fsEvictInodeFtraceEvent> T* set_f2fs_evict_inode() {
21884     return BeginNestedMessage<T>(244);
21885   }
21886 
21887   template <typename T = F2fsFallocateFtraceEvent> T* set_f2fs_fallocate() {
21888     return BeginNestedMessage<T>(245);
21889   }
21890 
21891   template <typename T = F2fsGetDataBlockFtraceEvent> T* set_f2fs_get_data_block() {
21892     return BeginNestedMessage<T>(246);
21893   }
21894 
21895   template <typename T = F2fsGetVictimFtraceEvent> T* set_f2fs_get_victim() {
21896     return BeginNestedMessage<T>(247);
21897   }
21898 
21899   template <typename T = F2fsIgetFtraceEvent> T* set_f2fs_iget() {
21900     return BeginNestedMessage<T>(248);
21901   }
21902 
21903   template <typename T = F2fsIgetExitFtraceEvent> T* set_f2fs_iget_exit() {
21904     return BeginNestedMessage<T>(249);
21905   }
21906 
21907   template <typename T = F2fsNewInodeFtraceEvent> T* set_f2fs_new_inode() {
21908     return BeginNestedMessage<T>(250);
21909   }
21910 
21911   template <typename T = F2fsReadpageFtraceEvent> T* set_f2fs_readpage() {
21912     return BeginNestedMessage<T>(251);
21913   }
21914 
21915   template <typename T = F2fsReserveNewBlockFtraceEvent> T* set_f2fs_reserve_new_block() {
21916     return BeginNestedMessage<T>(252);
21917   }
21918 
21919   template <typename T = F2fsSetPageDirtyFtraceEvent> T* set_f2fs_set_page_dirty() {
21920     return BeginNestedMessage<T>(253);
21921   }
21922 
21923   template <typename T = F2fsSubmitWritePageFtraceEvent> T* set_f2fs_submit_write_page() {
21924     return BeginNestedMessage<T>(254);
21925   }
21926 
21927   template <typename T = F2fsSyncFileEnterFtraceEvent> T* set_f2fs_sync_file_enter() {
21928     return BeginNestedMessage<T>(255);
21929   }
21930 
21931   template <typename T = F2fsSyncFileExitFtraceEvent> T* set_f2fs_sync_file_exit() {
21932     return BeginNestedMessage<T>(256);
21933   }
21934 
21935   template <typename T = F2fsSyncFsFtraceEvent> T* set_f2fs_sync_fs() {
21936     return BeginNestedMessage<T>(257);
21937   }
21938 
21939   template <typename T = F2fsTruncateFtraceEvent> T* set_f2fs_truncate() {
21940     return BeginNestedMessage<T>(258);
21941   }
21942 
21943   template <typename T = F2fsTruncateBlocksEnterFtraceEvent> T* set_f2fs_truncate_blocks_enter() {
21944     return BeginNestedMessage<T>(259);
21945   }
21946 
21947   template <typename T = F2fsTruncateBlocksExitFtraceEvent> T* set_f2fs_truncate_blocks_exit() {
21948     return BeginNestedMessage<T>(260);
21949   }
21950 
21951   template <typename T = F2fsTruncateDataBlocksRangeFtraceEvent> T* set_f2fs_truncate_data_blocks_range() {
21952     return BeginNestedMessage<T>(261);
21953   }
21954 
21955   template <typename T = F2fsTruncateInodeBlocksEnterFtraceEvent> T* set_f2fs_truncate_inode_blocks_enter() {
21956     return BeginNestedMessage<T>(262);
21957   }
21958 
21959   template <typename T = F2fsTruncateInodeBlocksExitFtraceEvent> T* set_f2fs_truncate_inode_blocks_exit() {
21960     return BeginNestedMessage<T>(263);
21961   }
21962 
21963   template <typename T = F2fsTruncateNodeFtraceEvent> T* set_f2fs_truncate_node() {
21964     return BeginNestedMessage<T>(264);
21965   }
21966 
21967   template <typename T = F2fsTruncateNodesEnterFtraceEvent> T* set_f2fs_truncate_nodes_enter() {
21968     return BeginNestedMessage<T>(265);
21969   }
21970 
21971   template <typename T = F2fsTruncateNodesExitFtraceEvent> T* set_f2fs_truncate_nodes_exit() {
21972     return BeginNestedMessage<T>(266);
21973   }
21974 
21975   template <typename T = F2fsTruncatePartialNodesFtraceEvent> T* set_f2fs_truncate_partial_nodes() {
21976     return BeginNestedMessage<T>(267);
21977   }
21978 
21979   template <typename T = F2fsUnlinkEnterFtraceEvent> T* set_f2fs_unlink_enter() {
21980     return BeginNestedMessage<T>(268);
21981   }
21982 
21983   template <typename T = F2fsUnlinkExitFtraceEvent> T* set_f2fs_unlink_exit() {
21984     return BeginNestedMessage<T>(269);
21985   }
21986 
21987   template <typename T = F2fsVmPageMkwriteFtraceEvent> T* set_f2fs_vm_page_mkwrite() {
21988     return BeginNestedMessage<T>(270);
21989   }
21990 
21991   template <typename T = F2fsWriteBeginFtraceEvent> T* set_f2fs_write_begin() {
21992     return BeginNestedMessage<T>(271);
21993   }
21994 
21995   template <typename T = F2fsWriteCheckpointFtraceEvent> T* set_f2fs_write_checkpoint() {
21996     return BeginNestedMessage<T>(272);
21997   }
21998 
21999   template <typename T = F2fsWriteEndFtraceEvent> T* set_f2fs_write_end() {
22000     return BeginNestedMessage<T>(273);
22001   }
22002 
22003   template <typename T = AllocPagesIommuEndFtraceEvent> T* set_alloc_pages_iommu_end() {
22004     return BeginNestedMessage<T>(274);
22005   }
22006 
22007   template <typename T = AllocPagesIommuFailFtraceEvent> T* set_alloc_pages_iommu_fail() {
22008     return BeginNestedMessage<T>(275);
22009   }
22010 
22011   template <typename T = AllocPagesIommuStartFtraceEvent> T* set_alloc_pages_iommu_start() {
22012     return BeginNestedMessage<T>(276);
22013   }
22014 
22015   template <typename T = AllocPagesSysEndFtraceEvent> T* set_alloc_pages_sys_end() {
22016     return BeginNestedMessage<T>(277);
22017   }
22018 
22019   template <typename T = AllocPagesSysFailFtraceEvent> T* set_alloc_pages_sys_fail() {
22020     return BeginNestedMessage<T>(278);
22021   }
22022 
22023   template <typename T = AllocPagesSysStartFtraceEvent> T* set_alloc_pages_sys_start() {
22024     return BeginNestedMessage<T>(279);
22025   }
22026 
22027   template <typename T = DmaAllocContiguousRetryFtraceEvent> T* set_dma_alloc_contiguous_retry() {
22028     return BeginNestedMessage<T>(280);
22029   }
22030 
22031   template <typename T = IommuMapRangeFtraceEvent> T* set_iommu_map_range() {
22032     return BeginNestedMessage<T>(281);
22033   }
22034 
22035   template <typename T = IommuSecPtblMapRangeEndFtraceEvent> T* set_iommu_sec_ptbl_map_range_end() {
22036     return BeginNestedMessage<T>(282);
22037   }
22038 
22039   template <typename T = IommuSecPtblMapRangeStartFtraceEvent> T* set_iommu_sec_ptbl_map_range_start() {
22040     return BeginNestedMessage<T>(283);
22041   }
22042 
22043   template <typename T = IonAllocBufferEndFtraceEvent> T* set_ion_alloc_buffer_end() {
22044     return BeginNestedMessage<T>(284);
22045   }
22046 
22047   template <typename T = IonAllocBufferFailFtraceEvent> T* set_ion_alloc_buffer_fail() {
22048     return BeginNestedMessage<T>(285);
22049   }
22050 
22051   template <typename T = IonAllocBufferFallbackFtraceEvent> T* set_ion_alloc_buffer_fallback() {
22052     return BeginNestedMessage<T>(286);
22053   }
22054 
22055   template <typename T = IonAllocBufferStartFtraceEvent> T* set_ion_alloc_buffer_start() {
22056     return BeginNestedMessage<T>(287);
22057   }
22058 
22059   template <typename T = IonCpAllocRetryFtraceEvent> T* set_ion_cp_alloc_retry() {
22060     return BeginNestedMessage<T>(288);
22061   }
22062 
22063   template <typename T = IonCpSecureBufferEndFtraceEvent> T* set_ion_cp_secure_buffer_end() {
22064     return BeginNestedMessage<T>(289);
22065   }
22066 
22067   template <typename T = IonCpSecureBufferStartFtraceEvent> T* set_ion_cp_secure_buffer_start() {
22068     return BeginNestedMessage<T>(290);
22069   }
22070 
22071   template <typename T = IonPrefetchingFtraceEvent> T* set_ion_prefetching() {
22072     return BeginNestedMessage<T>(291);
22073   }
22074 
22075   template <typename T = IonSecureCmaAddToPoolEndFtraceEvent> T* set_ion_secure_cma_add_to_pool_end() {
22076     return BeginNestedMessage<T>(292);
22077   }
22078 
22079   template <typename T = IonSecureCmaAddToPoolStartFtraceEvent> T* set_ion_secure_cma_add_to_pool_start() {
22080     return BeginNestedMessage<T>(293);
22081   }
22082 
22083   template <typename T = IonSecureCmaAllocateEndFtraceEvent> T* set_ion_secure_cma_allocate_end() {
22084     return BeginNestedMessage<T>(294);
22085   }
22086 
22087   template <typename T = IonSecureCmaAllocateStartFtraceEvent> T* set_ion_secure_cma_allocate_start() {
22088     return BeginNestedMessage<T>(295);
22089   }
22090 
22091   template <typename T = IonSecureCmaShrinkPoolEndFtraceEvent> T* set_ion_secure_cma_shrink_pool_end() {
22092     return BeginNestedMessage<T>(296);
22093   }
22094 
22095   template <typename T = IonSecureCmaShrinkPoolStartFtraceEvent> T* set_ion_secure_cma_shrink_pool_start() {
22096     return BeginNestedMessage<T>(297);
22097   }
22098 
22099   template <typename T = KfreeFtraceEvent> T* set_kfree() {
22100     return BeginNestedMessage<T>(298);
22101   }
22102 
22103   template <typename T = KmallocFtraceEvent> T* set_kmalloc() {
22104     return BeginNestedMessage<T>(299);
22105   }
22106 
22107   template <typename T = KmallocNodeFtraceEvent> T* set_kmalloc_node() {
22108     return BeginNestedMessage<T>(300);
22109   }
22110 
22111   template <typename T = KmemCacheAllocFtraceEvent> T* set_kmem_cache_alloc() {
22112     return BeginNestedMessage<T>(301);
22113   }
22114 
22115   template <typename T = KmemCacheAllocNodeFtraceEvent> T* set_kmem_cache_alloc_node() {
22116     return BeginNestedMessage<T>(302);
22117   }
22118 
22119   template <typename T = KmemCacheFreeFtraceEvent> T* set_kmem_cache_free() {
22120     return BeginNestedMessage<T>(303);
22121   }
22122 
22123   template <typename T = MigratePagesEndFtraceEvent> T* set_migrate_pages_end() {
22124     return BeginNestedMessage<T>(304);
22125   }
22126 
22127   template <typename T = MigratePagesStartFtraceEvent> T* set_migrate_pages_start() {
22128     return BeginNestedMessage<T>(305);
22129   }
22130 
22131   template <typename T = MigrateRetryFtraceEvent> T* set_migrate_retry() {
22132     return BeginNestedMessage<T>(306);
22133   }
22134 
22135   template <typename T = MmPageAllocFtraceEvent> T* set_mm_page_alloc() {
22136     return BeginNestedMessage<T>(307);
22137   }
22138 
22139   template <typename T = MmPageAllocExtfragFtraceEvent> T* set_mm_page_alloc_extfrag() {
22140     return BeginNestedMessage<T>(308);
22141   }
22142 
22143   template <typename T = MmPageAllocZoneLockedFtraceEvent> T* set_mm_page_alloc_zone_locked() {
22144     return BeginNestedMessage<T>(309);
22145   }
22146 
22147   template <typename T = MmPageFreeFtraceEvent> T* set_mm_page_free() {
22148     return BeginNestedMessage<T>(310);
22149   }
22150 
22151   template <typename T = MmPageFreeBatchedFtraceEvent> T* set_mm_page_free_batched() {
22152     return BeginNestedMessage<T>(311);
22153   }
22154 
22155   template <typename T = MmPagePcpuDrainFtraceEvent> T* set_mm_page_pcpu_drain() {
22156     return BeginNestedMessage<T>(312);
22157   }
22158 
22159   template <typename T = RssStatFtraceEvent> T* set_rss_stat() {
22160     return BeginNestedMessage<T>(313);
22161   }
22162 
22163   template <typename T = IonHeapShrinkFtraceEvent> T* set_ion_heap_shrink() {
22164     return BeginNestedMessage<T>(314);
22165   }
22166 
22167   template <typename T = IonHeapGrowFtraceEvent> T* set_ion_heap_grow() {
22168     return BeginNestedMessage<T>(315);
22169   }
22170 
22171   template <typename T = FenceInitFtraceEvent> T* set_fence_init() {
22172     return BeginNestedMessage<T>(316);
22173   }
22174 
22175   template <typename T = FenceDestroyFtraceEvent> T* set_fence_destroy() {
22176     return BeginNestedMessage<T>(317);
22177   }
22178 
22179   template <typename T = FenceEnableSignalFtraceEvent> T* set_fence_enable_signal() {
22180     return BeginNestedMessage<T>(318);
22181   }
22182 
22183   template <typename T = FenceSignaledFtraceEvent> T* set_fence_signaled() {
22184     return BeginNestedMessage<T>(319);
22185   }
22186 
22187   template <typename T = ClkEnableFtraceEvent> T* set_clk_enable() {
22188     return BeginNestedMessage<T>(320);
22189   }
22190 
22191   template <typename T = ClkDisableFtraceEvent> T* set_clk_disable() {
22192     return BeginNestedMessage<T>(321);
22193   }
22194 
22195   template <typename T = ClkSetRateFtraceEvent> T* set_clk_set_rate() {
22196     return BeginNestedMessage<T>(322);
22197   }
22198 
22199   template <typename T = BinderTransactionAllocBufFtraceEvent> T* set_binder_transaction_alloc_buf() {
22200     return BeginNestedMessage<T>(323);
22201   }
22202 
22203   template <typename T = SignalDeliverFtraceEvent> T* set_signal_deliver() {
22204     return BeginNestedMessage<T>(324);
22205   }
22206 
22207   template <typename T = SignalGenerateFtraceEvent> T* set_signal_generate() {
22208     return BeginNestedMessage<T>(325);
22209   }
22210 
22211   template <typename T = OomScoreAdjUpdateFtraceEvent> T* set_oom_score_adj_update() {
22212     return BeginNestedMessage<T>(326);
22213   }
22214 
22215   template <typename T = GenericFtraceEvent> T* set_generic() {
22216     return BeginNestedMessage<T>(327);
22217   }
22218 
22219   template <typename T = MmEventRecordFtraceEvent> T* set_mm_event_record() {
22220     return BeginNestedMessage<T>(328);
22221   }
22222 
22223   template <typename T = SysEnterFtraceEvent> T* set_sys_enter() {
22224     return BeginNestedMessage<T>(329);
22225   }
22226 
22227   template <typename T = SysExitFtraceEvent> T* set_sys_exit() {
22228     return BeginNestedMessage<T>(330);
22229   }
22230 
22231   template <typename T = ZeroFtraceEvent> T* set_zero() {
22232     return BeginNestedMessage<T>(331);
22233   }
22234 
22235   template <typename T = GpuFrequencyFtraceEvent> T* set_gpu_frequency() {
22236     return BeginNestedMessage<T>(332);
22237   }
22238 
22239   template <typename T = SdeTracingMarkWriteFtraceEvent> T* set_sde_tracing_mark_write() {
22240     return BeginNestedMessage<T>(333);
22241   }
22242 
22243   template <typename T = MarkVictimFtraceEvent> T* set_mark_victim() {
22244     return BeginNestedMessage<T>(334);
22245   }
22246 
22247   template <typename T = IonStatFtraceEvent> T* set_ion_stat() {
22248     return BeginNestedMessage<T>(335);
22249   }
22250 
22251   template <typename T = IonBufferCreateFtraceEvent> T* set_ion_buffer_create() {
22252     return BeginNestedMessage<T>(336);
22253   }
22254 
22255   template <typename T = IonBufferDestroyFtraceEvent> T* set_ion_buffer_destroy() {
22256     return BeginNestedMessage<T>(337);
22257   }
22258 
22259   template <typename T = ScmCallStartFtraceEvent> T* set_scm_call_start() {
22260     return BeginNestedMessage<T>(338);
22261   }
22262 
22263   template <typename T = ScmCallEndFtraceEvent> T* set_scm_call_end() {
22264     return BeginNestedMessage<T>(339);
22265   }
22266 
22267   template <typename T = GpuMemTotalFtraceEvent> T* set_gpu_mem_total() {
22268     return BeginNestedMessage<T>(340);
22269   }
22270 
22271   template <typename T = ThermalTemperatureFtraceEvent> T* set_thermal_temperature() {
22272     return BeginNestedMessage<T>(341);
22273   }
22274 
22275   template <typename T = CdevUpdateFtraceEvent> T* set_cdev_update() {
22276     return BeginNestedMessage<T>(342);
22277   }
22278 
22279   template <typename T = CpuhpExitFtraceEvent> T* set_cpuhp_exit() {
22280     return BeginNestedMessage<T>(343);
22281   }
22282 
22283   template <typename T = CpuhpMultiEnterFtraceEvent> T* set_cpuhp_multi_enter() {
22284     return BeginNestedMessage<T>(344);
22285   }
22286 
22287   template <typename T = CpuhpEnterFtraceEvent> T* set_cpuhp_enter() {
22288     return BeginNestedMessage<T>(345);
22289   }
22290 
22291   template <typename T = CpuhpLatencyFtraceEvent> T* set_cpuhp_latency() {
22292     return BeginNestedMessage<T>(346);
22293   }
22294 
22295 };
22296 
22297 } // Namespace.
22298 } // Namespace.
22299 } // Namespace.
22300 #endif  // Include guard.
22301 // gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/ftrace_event_bundle.pbzero.h
22302 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
22303 
22304 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_FTRACE_EVENT_BUNDLE_PROTO_H_
22305 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_FTRACE_EVENT_BUNDLE_PROTO_H_
22306 
22307 #include <stddef.h>
22308 #include <stdint.h>
22309 
22310 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
22311 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
22312 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
22313 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
22314 
22315 namespace perfetto {
22316 namespace protos {
22317 namespace pbzero {
22318 
22319 class FtraceEvent;
22320 class FtraceEventBundle_CompactSched;
22321 
22322 class FtraceEventBundle_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
22323  public:
22324   FtraceEventBundle_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
22325   explicit FtraceEventBundle_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
22326   explicit FtraceEventBundle_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
22327   bool has_cpu() const { return at<1>().valid(); }
22328   uint32_t cpu() const { return at<1>().as_uint32(); }
22329   bool has_event() const { return at<2>().valid(); }
22330   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> event() const { return GetRepeated<::protozero::ConstBytes>(2); }
22331   bool has_lost_events() const { return at<3>().valid(); }
22332   bool lost_events() const { return at<3>().as_bool(); }
22333   bool has_compact_sched() const { return at<4>().valid(); }
22334   ::protozero::ConstBytes compact_sched() const { return at<4>().as_bytes(); }
22335 };
22336 
22337 class FtraceEventBundle : public ::protozero::Message {
22338  public:
22339   using Decoder = FtraceEventBundle_Decoder;
22340   enum : int32_t {
22341     kCpuFieldNumber = 1,
22342     kEventFieldNumber = 2,
22343     kLostEventsFieldNumber = 3,
22344     kCompactSchedFieldNumber = 4,
22345   };
22346   using CompactSched = ::perfetto::protos::pbzero::FtraceEventBundle_CompactSched;
22347   void set_cpu(uint32_t value) {
22348     AppendVarInt(1, value);
22349   }
22350   template <typename T = FtraceEvent> T* add_event() {
22351     return BeginNestedMessage<T>(2);
22352   }
22353 
22354   void set_lost_events(bool value) {
22355     AppendTinyVarInt(3, value);
22356   }
22357   template <typename T = FtraceEventBundle_CompactSched> T* set_compact_sched() {
22358     return BeginNestedMessage<T>(4);
22359   }
22360 
22361 };
22362 
22363 class FtraceEventBundle_CompactSched_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/11, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
22364  public:
22365   FtraceEventBundle_CompactSched_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
22366   explicit FtraceEventBundle_CompactSched_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
22367   explicit FtraceEventBundle_CompactSched_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
22368   bool has_intern_table() const { return at<5>().valid(); }
22369   ::protozero::RepeatedFieldIterator<::protozero::ConstChars> intern_table() const { return GetRepeated<::protozero::ConstChars>(5); }
22370   bool has_switch_timestamp() const { return at<1>().valid(); }
22371   ::protozero::PackedRepeatedFieldIterator<::protozero::proto_utils::ProtoWireType::kVarInt, uint64_t> switch_timestamp(bool* parse_error_ptr) const { return GetPackedRepeated<::protozero::proto_utils::ProtoWireType::kVarInt, uint64_t>(1, parse_error_ptr); }
22372   bool has_switch_prev_state() const { return at<2>().valid(); }
22373   ::protozero::PackedRepeatedFieldIterator<::protozero::proto_utils::ProtoWireType::kVarInt, int64_t> switch_prev_state(bool* parse_error_ptr) const { return GetPackedRepeated<::protozero::proto_utils::ProtoWireType::kVarInt, int64_t>(2, parse_error_ptr); }
22374   bool has_switch_next_pid() const { return at<3>().valid(); }
22375   ::protozero::PackedRepeatedFieldIterator<::protozero::proto_utils::ProtoWireType::kVarInt, int32_t> switch_next_pid(bool* parse_error_ptr) const { return GetPackedRepeated<::protozero::proto_utils::ProtoWireType::kVarInt, int32_t>(3, parse_error_ptr); }
22376   bool has_switch_next_prio() const { return at<4>().valid(); }
22377   ::protozero::PackedRepeatedFieldIterator<::protozero::proto_utils::ProtoWireType::kVarInt, int32_t> switch_next_prio(bool* parse_error_ptr) const { return GetPackedRepeated<::protozero::proto_utils::ProtoWireType::kVarInt, int32_t>(4, parse_error_ptr); }
22378   bool has_switch_next_comm_index() const { return at<6>().valid(); }
22379   ::protozero::PackedRepeatedFieldIterator<::protozero::proto_utils::ProtoWireType::kVarInt, uint32_t> switch_next_comm_index(bool* parse_error_ptr) const { return GetPackedRepeated<::protozero::proto_utils::ProtoWireType::kVarInt, uint32_t>(6, parse_error_ptr); }
22380   bool has_waking_timestamp() const { return at<7>().valid(); }
22381   ::protozero::PackedRepeatedFieldIterator<::protozero::proto_utils::ProtoWireType::kVarInt, uint64_t> waking_timestamp(bool* parse_error_ptr) const { return GetPackedRepeated<::protozero::proto_utils::ProtoWireType::kVarInt, uint64_t>(7, parse_error_ptr); }
22382   bool has_waking_pid() const { return at<8>().valid(); }
22383   ::protozero::PackedRepeatedFieldIterator<::protozero::proto_utils::ProtoWireType::kVarInt, int32_t> waking_pid(bool* parse_error_ptr) const { return GetPackedRepeated<::protozero::proto_utils::ProtoWireType::kVarInt, int32_t>(8, parse_error_ptr); }
22384   bool has_waking_target_cpu() const { return at<9>().valid(); }
22385   ::protozero::PackedRepeatedFieldIterator<::protozero::proto_utils::ProtoWireType::kVarInt, int32_t> waking_target_cpu(bool* parse_error_ptr) const { return GetPackedRepeated<::protozero::proto_utils::ProtoWireType::kVarInt, int32_t>(9, parse_error_ptr); }
22386   bool has_waking_prio() const { return at<10>().valid(); }
22387   ::protozero::PackedRepeatedFieldIterator<::protozero::proto_utils::ProtoWireType::kVarInt, int32_t> waking_prio(bool* parse_error_ptr) const { return GetPackedRepeated<::protozero::proto_utils::ProtoWireType::kVarInt, int32_t>(10, parse_error_ptr); }
22388   bool has_waking_comm_index() const { return at<11>().valid(); }
22389   ::protozero::PackedRepeatedFieldIterator<::protozero::proto_utils::ProtoWireType::kVarInt, uint32_t> waking_comm_index(bool* parse_error_ptr) const { return GetPackedRepeated<::protozero::proto_utils::ProtoWireType::kVarInt, uint32_t>(11, parse_error_ptr); }
22390 };
22391 
22392 class FtraceEventBundle_CompactSched : public ::protozero::Message {
22393  public:
22394   using Decoder = FtraceEventBundle_CompactSched_Decoder;
22395   enum : int32_t {
22396     kInternTableFieldNumber = 5,
22397     kSwitchTimestampFieldNumber = 1,
22398     kSwitchPrevStateFieldNumber = 2,
22399     kSwitchNextPidFieldNumber = 3,
22400     kSwitchNextPrioFieldNumber = 4,
22401     kSwitchNextCommIndexFieldNumber = 6,
22402     kWakingTimestampFieldNumber = 7,
22403     kWakingPidFieldNumber = 8,
22404     kWakingTargetCpuFieldNumber = 9,
22405     kWakingPrioFieldNumber = 10,
22406     kWakingCommIndexFieldNumber = 11,
22407   };
22408   void add_intern_table(const std::string& value) {
22409     AppendBytes(5, value.data(), value.size());
22410   }
22411   void add_intern_table(const char* data, size_t size) {
22412     AppendBytes(5, data, size);
22413   }
22414   void set_switch_timestamp(const ::protozero::PackedVarInt& packed_buffer) {
22415     AppendBytes(1, packed_buffer.data(), packed_buffer.size());
22416   }
22417   void set_switch_prev_state(const ::protozero::PackedVarInt& packed_buffer) {
22418     AppendBytes(2, packed_buffer.data(), packed_buffer.size());
22419   }
22420   void set_switch_next_pid(const ::protozero::PackedVarInt& packed_buffer) {
22421     AppendBytes(3, packed_buffer.data(), packed_buffer.size());
22422   }
22423   void set_switch_next_prio(const ::protozero::PackedVarInt& packed_buffer) {
22424     AppendBytes(4, packed_buffer.data(), packed_buffer.size());
22425   }
22426   void set_switch_next_comm_index(const ::protozero::PackedVarInt& packed_buffer) {
22427     AppendBytes(6, packed_buffer.data(), packed_buffer.size());
22428   }
22429   void set_waking_timestamp(const ::protozero::PackedVarInt& packed_buffer) {
22430     AppendBytes(7, packed_buffer.data(), packed_buffer.size());
22431   }
22432   void set_waking_pid(const ::protozero::PackedVarInt& packed_buffer) {
22433     AppendBytes(8, packed_buffer.data(), packed_buffer.size());
22434   }
22435   void set_waking_target_cpu(const ::protozero::PackedVarInt& packed_buffer) {
22436     AppendBytes(9, packed_buffer.data(), packed_buffer.size());
22437   }
22438   void set_waking_prio(const ::protozero::PackedVarInt& packed_buffer) {
22439     AppendBytes(10, packed_buffer.data(), packed_buffer.size());
22440   }
22441   void set_waking_comm_index(const ::protozero::PackedVarInt& packed_buffer) {
22442     AppendBytes(11, packed_buffer.data(), packed_buffer.size());
22443   }
22444 };
22445 
22446 } // Namespace.
22447 } // Namespace.
22448 } // Namespace.
22449 #endif  // Include guard.
22450 // gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/ftrace_stats.pbzero.h
22451 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
22452 
22453 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_FTRACE_STATS_PROTO_H_
22454 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_FTRACE_STATS_PROTO_H_
22455 
22456 #include <stddef.h>
22457 #include <stdint.h>
22458 
22459 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
22460 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
22461 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
22462 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
22463 
22464 namespace perfetto {
22465 namespace protos {
22466 namespace pbzero {
22467 
22468 class FtraceCpuStats;
22469 enum FtraceStats_Phase : int32_t;
22470 
22471 enum FtraceStats_Phase : int32_t {
22472   FtraceStats_Phase_UNSPECIFIED = 0,
22473   FtraceStats_Phase_START_OF_TRACE = 1,
22474   FtraceStats_Phase_END_OF_TRACE = 2,
22475 };
22476 
22477 const FtraceStats_Phase FtraceStats_Phase_MIN = FtraceStats_Phase_UNSPECIFIED;
22478 const FtraceStats_Phase FtraceStats_Phase_MAX = FtraceStats_Phase_END_OF_TRACE;
22479 
22480 class FtraceStats_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
22481  public:
22482   FtraceStats_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
22483   explicit FtraceStats_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
22484   explicit FtraceStats_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
22485   bool has_phase() const { return at<1>().valid(); }
22486   int32_t phase() const { return at<1>().as_int32(); }
22487   bool has_cpu_stats() const { return at<2>().valid(); }
22488   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> cpu_stats() const { return GetRepeated<::protozero::ConstBytes>(2); }
22489 };
22490 
22491 class FtraceStats : public ::protozero::Message {
22492  public:
22493   using Decoder = FtraceStats_Decoder;
22494   enum : int32_t {
22495     kPhaseFieldNumber = 1,
22496     kCpuStatsFieldNumber = 2,
22497   };
22498   using Phase = ::perfetto::protos::pbzero::FtraceStats_Phase;
22499   static const Phase UNSPECIFIED = FtraceStats_Phase_UNSPECIFIED;
22500   static const Phase START_OF_TRACE = FtraceStats_Phase_START_OF_TRACE;
22501   static const Phase END_OF_TRACE = FtraceStats_Phase_END_OF_TRACE;
22502   void set_phase(::perfetto::protos::pbzero::FtraceStats_Phase value) {
22503     AppendTinyVarInt(1, value);
22504   }
22505   template <typename T = FtraceCpuStats> T* add_cpu_stats() {
22506     return BeginNestedMessage<T>(2);
22507   }
22508 
22509 };
22510 
22511 class FtraceCpuStats_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/9, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
22512  public:
22513   FtraceCpuStats_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
22514   explicit FtraceCpuStats_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
22515   explicit FtraceCpuStats_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
22516   bool has_cpu() const { return at<1>().valid(); }
22517   uint64_t cpu() const { return at<1>().as_uint64(); }
22518   bool has_entries() const { return at<2>().valid(); }
22519   uint64_t entries() const { return at<2>().as_uint64(); }
22520   bool has_overrun() const { return at<3>().valid(); }
22521   uint64_t overrun() const { return at<3>().as_uint64(); }
22522   bool has_commit_overrun() const { return at<4>().valid(); }
22523   uint64_t commit_overrun() const { return at<4>().as_uint64(); }
22524   bool has_bytes_read() const { return at<5>().valid(); }
22525   uint64_t bytes_read() const { return at<5>().as_uint64(); }
22526   bool has_oldest_event_ts() const { return at<6>().valid(); }
22527   double oldest_event_ts() const { return at<6>().as_double(); }
22528   bool has_now_ts() const { return at<7>().valid(); }
22529   double now_ts() const { return at<7>().as_double(); }
22530   bool has_dropped_events() const { return at<8>().valid(); }
22531   uint64_t dropped_events() const { return at<8>().as_uint64(); }
22532   bool has_read_events() const { return at<9>().valid(); }
22533   uint64_t read_events() const { return at<9>().as_uint64(); }
22534 };
22535 
22536 class FtraceCpuStats : public ::protozero::Message {
22537  public:
22538   using Decoder = FtraceCpuStats_Decoder;
22539   enum : int32_t {
22540     kCpuFieldNumber = 1,
22541     kEntriesFieldNumber = 2,
22542     kOverrunFieldNumber = 3,
22543     kCommitOverrunFieldNumber = 4,
22544     kBytesReadFieldNumber = 5,
22545     kOldestEventTsFieldNumber = 6,
22546     kNowTsFieldNumber = 7,
22547     kDroppedEventsFieldNumber = 8,
22548     kReadEventsFieldNumber = 9,
22549   };
22550   void set_cpu(uint64_t value) {
22551     AppendVarInt(1, value);
22552   }
22553   void set_entries(uint64_t value) {
22554     AppendVarInt(2, value);
22555   }
22556   void set_overrun(uint64_t value) {
22557     AppendVarInt(3, value);
22558   }
22559   void set_commit_overrun(uint64_t value) {
22560     AppendVarInt(4, value);
22561   }
22562   void set_bytes_read(uint64_t value) {
22563     AppendVarInt(5, value);
22564   }
22565   void set_oldest_event_ts(double value) {
22566     AppendFixed(6, value);
22567   }
22568   void set_now_ts(double value) {
22569     AppendFixed(7, value);
22570   }
22571   void set_dropped_events(uint64_t value) {
22572     AppendVarInt(8, value);
22573   }
22574   void set_read_events(uint64_t value) {
22575     AppendVarInt(9, value);
22576   }
22577 };
22578 
22579 } // Namespace.
22580 } // Namespace.
22581 } // Namespace.
22582 #endif  // Include guard.
22583 // gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/test_bundle_wrapper.pbzero.h
22584 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
22585 
22586 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_TEST_BUNDLE_WRAPPER_PROTO_H_
22587 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_TEST_BUNDLE_WRAPPER_PROTO_H_
22588 
22589 #include <stddef.h>
22590 #include <stdint.h>
22591 
22592 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
22593 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
22594 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
22595 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
22596 
22597 namespace perfetto {
22598 namespace protos {
22599 namespace pbzero {
22600 
22601 class FtraceEventBundle;
22602 
22603 class TestBundleWrapper_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
22604  public:
22605   TestBundleWrapper_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
22606   explicit TestBundleWrapper_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
22607   explicit TestBundleWrapper_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
22608   bool has_before() const { return at<1>().valid(); }
22609   ::protozero::ConstChars before() const { return at<1>().as_string(); }
22610   bool has_bundle() const { return at<2>().valid(); }
22611   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> bundle() const { return GetRepeated<::protozero::ConstBytes>(2); }
22612   bool has_after() const { return at<3>().valid(); }
22613   ::protozero::ConstChars after() const { return at<3>().as_string(); }
22614 };
22615 
22616 class TestBundleWrapper : public ::protozero::Message {
22617  public:
22618   using Decoder = TestBundleWrapper_Decoder;
22619   enum : int32_t {
22620     kBeforeFieldNumber = 1,
22621     kBundleFieldNumber = 2,
22622     kAfterFieldNumber = 3,
22623   };
22624   void set_before(const std::string& value) {
22625     AppendBytes(1, value.data(), value.size());
22626   }
22627   void set_before(const char* data, size_t size) {
22628     AppendBytes(1, data, size);
22629   }
22630   template <typename T = FtraceEventBundle> T* add_bundle() {
22631     return BeginNestedMessage<T>(2);
22632   }
22633 
22634   void set_after(const std::string& value) {
22635     AppendBytes(3, value.data(), value.size());
22636   }
22637   void set_after(const char* data, size_t size) {
22638     AppendBytes(3, data, size);
22639   }
22640 };
22641 
22642 } // Namespace.
22643 } // Namespace.
22644 } // Namespace.
22645 #endif  // Include guard.
22646 // gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/generic.pbzero.h
22647 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
22648 
22649 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_GENERIC_PROTO_H_
22650 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_GENERIC_PROTO_H_
22651 
22652 #include <stddef.h>
22653 #include <stdint.h>
22654 
22655 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
22656 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
22657 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
22658 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
22659 
22660 namespace perfetto {
22661 namespace protos {
22662 namespace pbzero {
22663 
22664 class GenericFtraceEvent_Field;
22665 
22666 class GenericFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
22667  public:
22668   GenericFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
22669   explicit GenericFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
22670   explicit GenericFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
22671   bool has_event_name() const { return at<1>().valid(); }
22672   ::protozero::ConstChars event_name() const { return at<1>().as_string(); }
22673   bool has_field() const { return at<2>().valid(); }
22674   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> field() const { return GetRepeated<::protozero::ConstBytes>(2); }
22675 };
22676 
22677 class GenericFtraceEvent : public ::protozero::Message {
22678  public:
22679   using Decoder = GenericFtraceEvent_Decoder;
22680   enum : int32_t {
22681     kEventNameFieldNumber = 1,
22682     kFieldFieldNumber = 2,
22683   };
22684   using Field = ::perfetto::protos::pbzero::GenericFtraceEvent_Field;
22685   void set_event_name(const std::string& value) {
22686     AppendBytes(1, value.data(), value.size());
22687   }
22688   void set_event_name(const char* data, size_t size) {
22689     AppendBytes(1, data, size);
22690   }
22691   template <typename T = GenericFtraceEvent_Field> T* add_field() {
22692     return BeginNestedMessage<T>(2);
22693   }
22694 
22695 };
22696 
22697 class GenericFtraceEvent_Field_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
22698  public:
22699   GenericFtraceEvent_Field_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
22700   explicit GenericFtraceEvent_Field_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
22701   explicit GenericFtraceEvent_Field_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
22702   bool has_name() const { return at<1>().valid(); }
22703   ::protozero::ConstChars name() const { return at<1>().as_string(); }
22704   bool has_str_value() const { return at<3>().valid(); }
22705   ::protozero::ConstChars str_value() const { return at<3>().as_string(); }
22706   bool has_int_value() const { return at<4>().valid(); }
22707   int64_t int_value() const { return at<4>().as_int64(); }
22708   bool has_uint_value() const { return at<5>().valid(); }
22709   uint64_t uint_value() const { return at<5>().as_uint64(); }
22710 };
22711 
22712 class GenericFtraceEvent_Field : public ::protozero::Message {
22713  public:
22714   using Decoder = GenericFtraceEvent_Field_Decoder;
22715   enum : int32_t {
22716     kNameFieldNumber = 1,
22717     kStrValueFieldNumber = 3,
22718     kIntValueFieldNumber = 4,
22719     kUintValueFieldNumber = 5,
22720   };
22721   void set_name(const std::string& value) {
22722     AppendBytes(1, value.data(), value.size());
22723   }
22724   void set_name(const char* data, size_t size) {
22725     AppendBytes(1, data, size);
22726   }
22727   void set_str_value(const std::string& value) {
22728     AppendBytes(3, value.data(), value.size());
22729   }
22730   void set_str_value(const char* data, size_t size) {
22731     AppendBytes(3, data, size);
22732   }
22733   void set_int_value(int64_t value) {
22734     AppendVarInt(4, value);
22735   }
22736   void set_uint_value(uint64_t value) {
22737     AppendVarInt(5, value);
22738   }
22739 };
22740 
22741 } // Namespace.
22742 } // Namespace.
22743 } // Namespace.
22744 #endif  // Include guard.
22745 // gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/binder.pbzero.h
22746 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
22747 
22748 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_BINDER_PROTO_H_
22749 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_BINDER_PROTO_H_
22750 
22751 #include <stddef.h>
22752 #include <stdint.h>
22753 
22754 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
22755 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
22756 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
22757 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
22758 
22759 namespace perfetto {
22760 namespace protos {
22761 namespace pbzero {
22762 
22763 
22764 class BinderTransactionAllocBufFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
22765  public:
22766   BinderTransactionAllocBufFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
22767   explicit BinderTransactionAllocBufFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
22768   explicit BinderTransactionAllocBufFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
22769   bool has_data_size() const { return at<1>().valid(); }
22770   uint64_t data_size() const { return at<1>().as_uint64(); }
22771   bool has_debug_id() const { return at<2>().valid(); }
22772   int32_t debug_id() const { return at<2>().as_int32(); }
22773   bool has_offsets_size() const { return at<3>().valid(); }
22774   uint64_t offsets_size() const { return at<3>().as_uint64(); }
22775 };
22776 
22777 class BinderTransactionAllocBufFtraceEvent : public ::protozero::Message {
22778  public:
22779   using Decoder = BinderTransactionAllocBufFtraceEvent_Decoder;
22780   enum : int32_t {
22781     kDataSizeFieldNumber = 1,
22782     kDebugIdFieldNumber = 2,
22783     kOffsetsSizeFieldNumber = 3,
22784   };
22785   void set_data_size(uint64_t value) {
22786     AppendVarInt(1, value);
22787   }
22788   void set_debug_id(int32_t value) {
22789     AppendVarInt(2, value);
22790   }
22791   void set_offsets_size(uint64_t value) {
22792     AppendVarInt(3, value);
22793   }
22794 };
22795 
22796 class BinderUnlockFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
22797  public:
22798   BinderUnlockFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
22799   explicit BinderUnlockFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
22800   explicit BinderUnlockFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
22801   bool has_tag() const { return at<1>().valid(); }
22802   ::protozero::ConstChars tag() const { return at<1>().as_string(); }
22803 };
22804 
22805 class BinderUnlockFtraceEvent : public ::protozero::Message {
22806  public:
22807   using Decoder = BinderUnlockFtraceEvent_Decoder;
22808   enum : int32_t {
22809     kTagFieldNumber = 1,
22810   };
22811   void set_tag(const std::string& value) {
22812     AppendBytes(1, value.data(), value.size());
22813   }
22814   void set_tag(const char* data, size_t size) {
22815     AppendBytes(1, data, size);
22816   }
22817 };
22818 
22819 class BinderLockedFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
22820  public:
22821   BinderLockedFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
22822   explicit BinderLockedFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
22823   explicit BinderLockedFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
22824   bool has_tag() const { return at<1>().valid(); }
22825   ::protozero::ConstChars tag() const { return at<1>().as_string(); }
22826 };
22827 
22828 class BinderLockedFtraceEvent : public ::protozero::Message {
22829  public:
22830   using Decoder = BinderLockedFtraceEvent_Decoder;
22831   enum : int32_t {
22832     kTagFieldNumber = 1,
22833   };
22834   void set_tag(const std::string& value) {
22835     AppendBytes(1, value.data(), value.size());
22836   }
22837   void set_tag(const char* data, size_t size) {
22838     AppendBytes(1, data, size);
22839   }
22840 };
22841 
22842 class BinderLockFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
22843  public:
22844   BinderLockFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
22845   explicit BinderLockFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
22846   explicit BinderLockFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
22847   bool has_tag() const { return at<1>().valid(); }
22848   ::protozero::ConstChars tag() const { return at<1>().as_string(); }
22849 };
22850 
22851 class BinderLockFtraceEvent : public ::protozero::Message {
22852  public:
22853   using Decoder = BinderLockFtraceEvent_Decoder;
22854   enum : int32_t {
22855     kTagFieldNumber = 1,
22856   };
22857   void set_tag(const std::string& value) {
22858     AppendBytes(1, value.data(), value.size());
22859   }
22860   void set_tag(const char* data, size_t size) {
22861     AppendBytes(1, data, size);
22862   }
22863 };
22864 
22865 class BinderSetPriorityFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
22866  public:
22867   BinderSetPriorityFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
22868   explicit BinderSetPriorityFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
22869   explicit BinderSetPriorityFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
22870   bool has_proc() const { return at<1>().valid(); }
22871   int32_t proc() const { return at<1>().as_int32(); }
22872   bool has_thread() const { return at<2>().valid(); }
22873   int32_t thread() const { return at<2>().as_int32(); }
22874   bool has_old_prio() const { return at<3>().valid(); }
22875   uint32_t old_prio() const { return at<3>().as_uint32(); }
22876   bool has_new_prio() const { return at<4>().valid(); }
22877   uint32_t new_prio() const { return at<4>().as_uint32(); }
22878   bool has_desired_prio() const { return at<5>().valid(); }
22879   uint32_t desired_prio() const { return at<5>().as_uint32(); }
22880 };
22881 
22882 class BinderSetPriorityFtraceEvent : public ::protozero::Message {
22883  public:
22884   using Decoder = BinderSetPriorityFtraceEvent_Decoder;
22885   enum : int32_t {
22886     kProcFieldNumber = 1,
22887     kThreadFieldNumber = 2,
22888     kOldPrioFieldNumber = 3,
22889     kNewPrioFieldNumber = 4,
22890     kDesiredPrioFieldNumber = 5,
22891   };
22892   void set_proc(int32_t value) {
22893     AppendVarInt(1, value);
22894   }
22895   void set_thread(int32_t value) {
22896     AppendVarInt(2, value);
22897   }
22898   void set_old_prio(uint32_t value) {
22899     AppendVarInt(3, value);
22900   }
22901   void set_new_prio(uint32_t value) {
22902     AppendVarInt(4, value);
22903   }
22904   void set_desired_prio(uint32_t value) {
22905     AppendVarInt(5, value);
22906   }
22907 };
22908 
22909 class BinderTransactionReceivedFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
22910  public:
22911   BinderTransactionReceivedFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
22912   explicit BinderTransactionReceivedFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
22913   explicit BinderTransactionReceivedFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
22914   bool has_debug_id() const { return at<1>().valid(); }
22915   int32_t debug_id() const { return at<1>().as_int32(); }
22916 };
22917 
22918 class BinderTransactionReceivedFtraceEvent : public ::protozero::Message {
22919  public:
22920   using Decoder = BinderTransactionReceivedFtraceEvent_Decoder;
22921   enum : int32_t {
22922     kDebugIdFieldNumber = 1,
22923   };
22924   void set_debug_id(int32_t value) {
22925     AppendVarInt(1, value);
22926   }
22927 };
22928 
22929 class BinderTransactionFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
22930  public:
22931   BinderTransactionFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
22932   explicit BinderTransactionFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
22933   explicit BinderTransactionFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
22934   bool has_debug_id() const { return at<1>().valid(); }
22935   int32_t debug_id() const { return at<1>().as_int32(); }
22936   bool has_target_node() const { return at<2>().valid(); }
22937   int32_t target_node() const { return at<2>().as_int32(); }
22938   bool has_to_proc() const { return at<3>().valid(); }
22939   int32_t to_proc() const { return at<3>().as_int32(); }
22940   bool has_to_thread() const { return at<4>().valid(); }
22941   int32_t to_thread() const { return at<4>().as_int32(); }
22942   bool has_reply() const { return at<5>().valid(); }
22943   int32_t reply() const { return at<5>().as_int32(); }
22944   bool has_code() const { return at<6>().valid(); }
22945   uint32_t code() const { return at<6>().as_uint32(); }
22946   bool has_flags() const { return at<7>().valid(); }
22947   uint32_t flags() const { return at<7>().as_uint32(); }
22948 };
22949 
22950 class BinderTransactionFtraceEvent : public ::protozero::Message {
22951  public:
22952   using Decoder = BinderTransactionFtraceEvent_Decoder;
22953   enum : int32_t {
22954     kDebugIdFieldNumber = 1,
22955     kTargetNodeFieldNumber = 2,
22956     kToProcFieldNumber = 3,
22957     kToThreadFieldNumber = 4,
22958     kReplyFieldNumber = 5,
22959     kCodeFieldNumber = 6,
22960     kFlagsFieldNumber = 7,
22961   };
22962   void set_debug_id(int32_t value) {
22963     AppendVarInt(1, value);
22964   }
22965   void set_target_node(int32_t value) {
22966     AppendVarInt(2, value);
22967   }
22968   void set_to_proc(int32_t value) {
22969     AppendVarInt(3, value);
22970   }
22971   void set_to_thread(int32_t value) {
22972     AppendVarInt(4, value);
22973   }
22974   void set_reply(int32_t value) {
22975     AppendVarInt(5, value);
22976   }
22977   void set_code(uint32_t value) {
22978     AppendVarInt(6, value);
22979   }
22980   void set_flags(uint32_t value) {
22981     AppendVarInt(7, value);
22982   }
22983 };
22984 
22985 } // Namespace.
22986 } // Namespace.
22987 } // Namespace.
22988 #endif  // Include guard.
22989 // gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/block.pbzero.h
22990 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
22991 
22992 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_BLOCK_PROTO_H_
22993 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_BLOCK_PROTO_H_
22994 
22995 #include <stddef.h>
22996 #include <stdint.h>
22997 
22998 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
22999 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
23000 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
23001 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
23002 
23003 namespace perfetto {
23004 namespace protos {
23005 namespace pbzero {
23006 
23007 
23008 class BlockUnplugFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
23009  public:
23010   BlockUnplugFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
23011   explicit BlockUnplugFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
23012   explicit BlockUnplugFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
23013   bool has_nr_rq() const { return at<1>().valid(); }
23014   int32_t nr_rq() const { return at<1>().as_int32(); }
23015   bool has_comm() const { return at<2>().valid(); }
23016   ::protozero::ConstChars comm() const { return at<2>().as_string(); }
23017 };
23018 
23019 class BlockUnplugFtraceEvent : public ::protozero::Message {
23020  public:
23021   using Decoder = BlockUnplugFtraceEvent_Decoder;
23022   enum : int32_t {
23023     kNrRqFieldNumber = 1,
23024     kCommFieldNumber = 2,
23025   };
23026   void set_nr_rq(int32_t value) {
23027     AppendVarInt(1, value);
23028   }
23029   void set_comm(const std::string& value) {
23030     AppendBytes(2, value.data(), value.size());
23031   }
23032   void set_comm(const char* data, size_t size) {
23033     AppendBytes(2, data, size);
23034   }
23035 };
23036 
23037 class BlockTouchBufferFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
23038  public:
23039   BlockTouchBufferFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
23040   explicit BlockTouchBufferFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
23041   explicit BlockTouchBufferFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
23042   bool has_dev() const { return at<1>().valid(); }
23043   uint64_t dev() const { return at<1>().as_uint64(); }
23044   bool has_sector() const { return at<2>().valid(); }
23045   uint64_t sector() const { return at<2>().as_uint64(); }
23046   bool has_size() const { return at<3>().valid(); }
23047   uint64_t size() const { return at<3>().as_uint64(); }
23048 };
23049 
23050 class BlockTouchBufferFtraceEvent : public ::protozero::Message {
23051  public:
23052   using Decoder = BlockTouchBufferFtraceEvent_Decoder;
23053   enum : int32_t {
23054     kDevFieldNumber = 1,
23055     kSectorFieldNumber = 2,
23056     kSizeFieldNumber = 3,
23057   };
23058   void set_dev(uint64_t value) {
23059     AppendVarInt(1, value);
23060   }
23061   void set_sector(uint64_t value) {
23062     AppendVarInt(2, value);
23063   }
23064   void set_size(uint64_t value) {
23065     AppendVarInt(3, value);
23066   }
23067 };
23068 
23069 class BlockSplitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
23070  public:
23071   BlockSplitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
23072   explicit BlockSplitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
23073   explicit BlockSplitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
23074   bool has_dev() const { return at<1>().valid(); }
23075   uint64_t dev() const { return at<1>().as_uint64(); }
23076   bool has_sector() const { return at<2>().valid(); }
23077   uint64_t sector() const { return at<2>().as_uint64(); }
23078   bool has_new_sector() const { return at<3>().valid(); }
23079   uint64_t new_sector() const { return at<3>().as_uint64(); }
23080   bool has_rwbs() const { return at<4>().valid(); }
23081   ::protozero::ConstChars rwbs() const { return at<4>().as_string(); }
23082   bool has_comm() const { return at<5>().valid(); }
23083   ::protozero::ConstChars comm() const { return at<5>().as_string(); }
23084 };
23085 
23086 class BlockSplitFtraceEvent : public ::protozero::Message {
23087  public:
23088   using Decoder = BlockSplitFtraceEvent_Decoder;
23089   enum : int32_t {
23090     kDevFieldNumber = 1,
23091     kSectorFieldNumber = 2,
23092     kNewSectorFieldNumber = 3,
23093     kRwbsFieldNumber = 4,
23094     kCommFieldNumber = 5,
23095   };
23096   void set_dev(uint64_t value) {
23097     AppendVarInt(1, value);
23098   }
23099   void set_sector(uint64_t value) {
23100     AppendVarInt(2, value);
23101   }
23102   void set_new_sector(uint64_t value) {
23103     AppendVarInt(3, value);
23104   }
23105   void set_rwbs(const std::string& value) {
23106     AppendBytes(4, value.data(), value.size());
23107   }
23108   void set_rwbs(const char* data, size_t size) {
23109     AppendBytes(4, data, size);
23110   }
23111   void set_comm(const std::string& value) {
23112     AppendBytes(5, value.data(), value.size());
23113   }
23114   void set_comm(const char* data, size_t size) {
23115     AppendBytes(5, data, size);
23116   }
23117 };
23118 
23119 class BlockSleeprqFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
23120  public:
23121   BlockSleeprqFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
23122   explicit BlockSleeprqFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
23123   explicit BlockSleeprqFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
23124   bool has_dev() const { return at<1>().valid(); }
23125   uint64_t dev() const { return at<1>().as_uint64(); }
23126   bool has_sector() const { return at<2>().valid(); }
23127   uint64_t sector() const { return at<2>().as_uint64(); }
23128   bool has_nr_sector() const { return at<3>().valid(); }
23129   uint32_t nr_sector() const { return at<3>().as_uint32(); }
23130   bool has_rwbs() const { return at<4>().valid(); }
23131   ::protozero::ConstChars rwbs() const { return at<4>().as_string(); }
23132   bool has_comm() const { return at<5>().valid(); }
23133   ::protozero::ConstChars comm() const { return at<5>().as_string(); }
23134 };
23135 
23136 class BlockSleeprqFtraceEvent : public ::protozero::Message {
23137  public:
23138   using Decoder = BlockSleeprqFtraceEvent_Decoder;
23139   enum : int32_t {
23140     kDevFieldNumber = 1,
23141     kSectorFieldNumber = 2,
23142     kNrSectorFieldNumber = 3,
23143     kRwbsFieldNumber = 4,
23144     kCommFieldNumber = 5,
23145   };
23146   void set_dev(uint64_t value) {
23147     AppendVarInt(1, value);
23148   }
23149   void set_sector(uint64_t value) {
23150     AppendVarInt(2, value);
23151   }
23152   void set_nr_sector(uint32_t value) {
23153     AppendVarInt(3, value);
23154   }
23155   void set_rwbs(const std::string& value) {
23156     AppendBytes(4, value.data(), value.size());
23157   }
23158   void set_rwbs(const char* data, size_t size) {
23159     AppendBytes(4, data, size);
23160   }
23161   void set_comm(const std::string& value) {
23162     AppendBytes(5, value.data(), value.size());
23163   }
23164   void set_comm(const char* data, size_t size) {
23165     AppendBytes(5, data, size);
23166   }
23167 };
23168 
23169 class BlockRqRequeueFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
23170  public:
23171   BlockRqRequeueFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
23172   explicit BlockRqRequeueFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
23173   explicit BlockRqRequeueFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
23174   bool has_dev() const { return at<1>().valid(); }
23175   uint64_t dev() const { return at<1>().as_uint64(); }
23176   bool has_sector() const { return at<2>().valid(); }
23177   uint64_t sector() const { return at<2>().as_uint64(); }
23178   bool has_nr_sector() const { return at<3>().valid(); }
23179   uint32_t nr_sector() const { return at<3>().as_uint32(); }
23180   bool has_errors() const { return at<4>().valid(); }
23181   int32_t errors() const { return at<4>().as_int32(); }
23182   bool has_rwbs() const { return at<5>().valid(); }
23183   ::protozero::ConstChars rwbs() const { return at<5>().as_string(); }
23184   bool has_cmd() const { return at<6>().valid(); }
23185   ::protozero::ConstChars cmd() const { return at<6>().as_string(); }
23186 };
23187 
23188 class BlockRqRequeueFtraceEvent : public ::protozero::Message {
23189  public:
23190   using Decoder = BlockRqRequeueFtraceEvent_Decoder;
23191   enum : int32_t {
23192     kDevFieldNumber = 1,
23193     kSectorFieldNumber = 2,
23194     kNrSectorFieldNumber = 3,
23195     kErrorsFieldNumber = 4,
23196     kRwbsFieldNumber = 5,
23197     kCmdFieldNumber = 6,
23198   };
23199   void set_dev(uint64_t value) {
23200     AppendVarInt(1, value);
23201   }
23202   void set_sector(uint64_t value) {
23203     AppendVarInt(2, value);
23204   }
23205   void set_nr_sector(uint32_t value) {
23206     AppendVarInt(3, value);
23207   }
23208   void set_errors(int32_t value) {
23209     AppendVarInt(4, value);
23210   }
23211   void set_rwbs(const std::string& value) {
23212     AppendBytes(5, value.data(), value.size());
23213   }
23214   void set_rwbs(const char* data, size_t size) {
23215     AppendBytes(5, data, size);
23216   }
23217   void set_cmd(const std::string& value) {
23218     AppendBytes(6, value.data(), value.size());
23219   }
23220   void set_cmd(const char* data, size_t size) {
23221     AppendBytes(6, data, size);
23222   }
23223 };
23224 
23225 class BlockRqRemapFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
23226  public:
23227   BlockRqRemapFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
23228   explicit BlockRqRemapFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
23229   explicit BlockRqRemapFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
23230   bool has_dev() const { return at<1>().valid(); }
23231   uint64_t dev() const { return at<1>().as_uint64(); }
23232   bool has_sector() const { return at<2>().valid(); }
23233   uint64_t sector() const { return at<2>().as_uint64(); }
23234   bool has_nr_sector() const { return at<3>().valid(); }
23235   uint32_t nr_sector() const { return at<3>().as_uint32(); }
23236   bool has_old_dev() const { return at<4>().valid(); }
23237   uint64_t old_dev() const { return at<4>().as_uint64(); }
23238   bool has_old_sector() const { return at<5>().valid(); }
23239   uint64_t old_sector() const { return at<5>().as_uint64(); }
23240   bool has_nr_bios() const { return at<6>().valid(); }
23241   uint32_t nr_bios() const { return at<6>().as_uint32(); }
23242   bool has_rwbs() const { return at<7>().valid(); }
23243   ::protozero::ConstChars rwbs() const { return at<7>().as_string(); }
23244 };
23245 
23246 class BlockRqRemapFtraceEvent : public ::protozero::Message {
23247  public:
23248   using Decoder = BlockRqRemapFtraceEvent_Decoder;
23249   enum : int32_t {
23250     kDevFieldNumber = 1,
23251     kSectorFieldNumber = 2,
23252     kNrSectorFieldNumber = 3,
23253     kOldDevFieldNumber = 4,
23254     kOldSectorFieldNumber = 5,
23255     kNrBiosFieldNumber = 6,
23256     kRwbsFieldNumber = 7,
23257   };
23258   void set_dev(uint64_t value) {
23259     AppendVarInt(1, value);
23260   }
23261   void set_sector(uint64_t value) {
23262     AppendVarInt(2, value);
23263   }
23264   void set_nr_sector(uint32_t value) {
23265     AppendVarInt(3, value);
23266   }
23267   void set_old_dev(uint64_t value) {
23268     AppendVarInt(4, value);
23269   }
23270   void set_old_sector(uint64_t value) {
23271     AppendVarInt(5, value);
23272   }
23273   void set_nr_bios(uint32_t value) {
23274     AppendVarInt(6, value);
23275   }
23276   void set_rwbs(const std::string& value) {
23277     AppendBytes(7, value.data(), value.size());
23278   }
23279   void set_rwbs(const char* data, size_t size) {
23280     AppendBytes(7, data, size);
23281   }
23282 };
23283 
23284 class BlockRqInsertFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
23285  public:
23286   BlockRqInsertFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
23287   explicit BlockRqInsertFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
23288   explicit BlockRqInsertFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
23289   bool has_dev() const { return at<1>().valid(); }
23290   uint64_t dev() const { return at<1>().as_uint64(); }
23291   bool has_sector() const { return at<2>().valid(); }
23292   uint64_t sector() const { return at<2>().as_uint64(); }
23293   bool has_nr_sector() const { return at<3>().valid(); }
23294   uint32_t nr_sector() const { return at<3>().as_uint32(); }
23295   bool has_bytes() const { return at<4>().valid(); }
23296   uint32_t bytes() const { return at<4>().as_uint32(); }
23297   bool has_rwbs() const { return at<5>().valid(); }
23298   ::protozero::ConstChars rwbs() const { return at<5>().as_string(); }
23299   bool has_comm() const { return at<6>().valid(); }
23300   ::protozero::ConstChars comm() const { return at<6>().as_string(); }
23301   bool has_cmd() const { return at<7>().valid(); }
23302   ::protozero::ConstChars cmd() const { return at<7>().as_string(); }
23303 };
23304 
23305 class BlockRqInsertFtraceEvent : public ::protozero::Message {
23306  public:
23307   using Decoder = BlockRqInsertFtraceEvent_Decoder;
23308   enum : int32_t {
23309     kDevFieldNumber = 1,
23310     kSectorFieldNumber = 2,
23311     kNrSectorFieldNumber = 3,
23312     kBytesFieldNumber = 4,
23313     kRwbsFieldNumber = 5,
23314     kCommFieldNumber = 6,
23315     kCmdFieldNumber = 7,
23316   };
23317   void set_dev(uint64_t value) {
23318     AppendVarInt(1, value);
23319   }
23320   void set_sector(uint64_t value) {
23321     AppendVarInt(2, value);
23322   }
23323   void set_nr_sector(uint32_t value) {
23324     AppendVarInt(3, value);
23325   }
23326   void set_bytes(uint32_t value) {
23327     AppendVarInt(4, value);
23328   }
23329   void set_rwbs(const std::string& value) {
23330     AppendBytes(5, value.data(), value.size());
23331   }
23332   void set_rwbs(const char* data, size_t size) {
23333     AppendBytes(5, data, size);
23334   }
23335   void set_comm(const std::string& value) {
23336     AppendBytes(6, value.data(), value.size());
23337   }
23338   void set_comm(const char* data, size_t size) {
23339     AppendBytes(6, data, size);
23340   }
23341   void set_cmd(const std::string& value) {
23342     AppendBytes(7, value.data(), value.size());
23343   }
23344   void set_cmd(const char* data, size_t size) {
23345     AppendBytes(7, data, size);
23346   }
23347 };
23348 
23349 class BlockRqCompleteFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
23350  public:
23351   BlockRqCompleteFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
23352   explicit BlockRqCompleteFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
23353   explicit BlockRqCompleteFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
23354   bool has_dev() const { return at<1>().valid(); }
23355   uint64_t dev() const { return at<1>().as_uint64(); }
23356   bool has_sector() const { return at<2>().valid(); }
23357   uint64_t sector() const { return at<2>().as_uint64(); }
23358   bool has_nr_sector() const { return at<3>().valid(); }
23359   uint32_t nr_sector() const { return at<3>().as_uint32(); }
23360   bool has_errors() const { return at<4>().valid(); }
23361   int32_t errors() const { return at<4>().as_int32(); }
23362   bool has_rwbs() const { return at<5>().valid(); }
23363   ::protozero::ConstChars rwbs() const { return at<5>().as_string(); }
23364   bool has_cmd() const { return at<6>().valid(); }
23365   ::protozero::ConstChars cmd() const { return at<6>().as_string(); }
23366 };
23367 
23368 class BlockRqCompleteFtraceEvent : public ::protozero::Message {
23369  public:
23370   using Decoder = BlockRqCompleteFtraceEvent_Decoder;
23371   enum : int32_t {
23372     kDevFieldNumber = 1,
23373     kSectorFieldNumber = 2,
23374     kNrSectorFieldNumber = 3,
23375     kErrorsFieldNumber = 4,
23376     kRwbsFieldNumber = 5,
23377     kCmdFieldNumber = 6,
23378   };
23379   void set_dev(uint64_t value) {
23380     AppendVarInt(1, value);
23381   }
23382   void set_sector(uint64_t value) {
23383     AppendVarInt(2, value);
23384   }
23385   void set_nr_sector(uint32_t value) {
23386     AppendVarInt(3, value);
23387   }
23388   void set_errors(int32_t value) {
23389     AppendVarInt(4, value);
23390   }
23391   void set_rwbs(const std::string& value) {
23392     AppendBytes(5, value.data(), value.size());
23393   }
23394   void set_rwbs(const char* data, size_t size) {
23395     AppendBytes(5, data, size);
23396   }
23397   void set_cmd(const std::string& value) {
23398     AppendBytes(6, value.data(), value.size());
23399   }
23400   void set_cmd(const char* data, size_t size) {
23401     AppendBytes(6, data, size);
23402   }
23403 };
23404 
23405 class BlockRqAbortFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
23406  public:
23407   BlockRqAbortFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
23408   explicit BlockRqAbortFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
23409   explicit BlockRqAbortFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
23410   bool has_dev() const { return at<1>().valid(); }
23411   uint64_t dev() const { return at<1>().as_uint64(); }
23412   bool has_sector() const { return at<2>().valid(); }
23413   uint64_t sector() const { return at<2>().as_uint64(); }
23414   bool has_nr_sector() const { return at<3>().valid(); }
23415   uint32_t nr_sector() const { return at<3>().as_uint32(); }
23416   bool has_errors() const { return at<4>().valid(); }
23417   int32_t errors() const { return at<4>().as_int32(); }
23418   bool has_rwbs() const { return at<5>().valid(); }
23419   ::protozero::ConstChars rwbs() const { return at<5>().as_string(); }
23420   bool has_cmd() const { return at<6>().valid(); }
23421   ::protozero::ConstChars cmd() const { return at<6>().as_string(); }
23422 };
23423 
23424 class BlockRqAbortFtraceEvent : public ::protozero::Message {
23425  public:
23426   using Decoder = BlockRqAbortFtraceEvent_Decoder;
23427   enum : int32_t {
23428     kDevFieldNumber = 1,
23429     kSectorFieldNumber = 2,
23430     kNrSectorFieldNumber = 3,
23431     kErrorsFieldNumber = 4,
23432     kRwbsFieldNumber = 5,
23433     kCmdFieldNumber = 6,
23434   };
23435   void set_dev(uint64_t value) {
23436     AppendVarInt(1, value);
23437   }
23438   void set_sector(uint64_t value) {
23439     AppendVarInt(2, value);
23440   }
23441   void set_nr_sector(uint32_t value) {
23442     AppendVarInt(3, value);
23443   }
23444   void set_errors(int32_t value) {
23445     AppendVarInt(4, value);
23446   }
23447   void set_rwbs(const std::string& value) {
23448     AppendBytes(5, value.data(), value.size());
23449   }
23450   void set_rwbs(const char* data, size_t size) {
23451     AppendBytes(5, data, size);
23452   }
23453   void set_cmd(const std::string& value) {
23454     AppendBytes(6, value.data(), value.size());
23455   }
23456   void set_cmd(const char* data, size_t size) {
23457     AppendBytes(6, data, size);
23458   }
23459 };
23460 
23461 class BlockPlugFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
23462  public:
23463   BlockPlugFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
23464   explicit BlockPlugFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
23465   explicit BlockPlugFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
23466   bool has_comm() const { return at<1>().valid(); }
23467   ::protozero::ConstChars comm() const { return at<1>().as_string(); }
23468 };
23469 
23470 class BlockPlugFtraceEvent : public ::protozero::Message {
23471  public:
23472   using Decoder = BlockPlugFtraceEvent_Decoder;
23473   enum : int32_t {
23474     kCommFieldNumber = 1,
23475   };
23476   void set_comm(const std::string& value) {
23477     AppendBytes(1, value.data(), value.size());
23478   }
23479   void set_comm(const char* data, size_t size) {
23480     AppendBytes(1, data, size);
23481   }
23482 };
23483 
23484 class BlockGetrqFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
23485  public:
23486   BlockGetrqFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
23487   explicit BlockGetrqFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
23488   explicit BlockGetrqFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
23489   bool has_dev() const { return at<1>().valid(); }
23490   uint64_t dev() const { return at<1>().as_uint64(); }
23491   bool has_sector() const { return at<2>().valid(); }
23492   uint64_t sector() const { return at<2>().as_uint64(); }
23493   bool has_nr_sector() const { return at<3>().valid(); }
23494   uint32_t nr_sector() const { return at<3>().as_uint32(); }
23495   bool has_rwbs() const { return at<4>().valid(); }
23496   ::protozero::ConstChars rwbs() const { return at<4>().as_string(); }
23497   bool has_comm() const { return at<5>().valid(); }
23498   ::protozero::ConstChars comm() const { return at<5>().as_string(); }
23499 };
23500 
23501 class BlockGetrqFtraceEvent : public ::protozero::Message {
23502  public:
23503   using Decoder = BlockGetrqFtraceEvent_Decoder;
23504   enum : int32_t {
23505     kDevFieldNumber = 1,
23506     kSectorFieldNumber = 2,
23507     kNrSectorFieldNumber = 3,
23508     kRwbsFieldNumber = 4,
23509     kCommFieldNumber = 5,
23510   };
23511   void set_dev(uint64_t value) {
23512     AppendVarInt(1, value);
23513   }
23514   void set_sector(uint64_t value) {
23515     AppendVarInt(2, value);
23516   }
23517   void set_nr_sector(uint32_t value) {
23518     AppendVarInt(3, value);
23519   }
23520   void set_rwbs(const std::string& value) {
23521     AppendBytes(4, value.data(), value.size());
23522   }
23523   void set_rwbs(const char* data, size_t size) {
23524     AppendBytes(4, data, size);
23525   }
23526   void set_comm(const std::string& value) {
23527     AppendBytes(5, value.data(), value.size());
23528   }
23529   void set_comm(const char* data, size_t size) {
23530     AppendBytes(5, data, size);
23531   }
23532 };
23533 
23534 class BlockDirtyBufferFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
23535  public:
23536   BlockDirtyBufferFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
23537   explicit BlockDirtyBufferFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
23538   explicit BlockDirtyBufferFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
23539   bool has_dev() const { return at<1>().valid(); }
23540   uint64_t dev() const { return at<1>().as_uint64(); }
23541   bool has_sector() const { return at<2>().valid(); }
23542   uint64_t sector() const { return at<2>().as_uint64(); }
23543   bool has_size() const { return at<3>().valid(); }
23544   uint64_t size() const { return at<3>().as_uint64(); }
23545 };
23546 
23547 class BlockDirtyBufferFtraceEvent : public ::protozero::Message {
23548  public:
23549   using Decoder = BlockDirtyBufferFtraceEvent_Decoder;
23550   enum : int32_t {
23551     kDevFieldNumber = 1,
23552     kSectorFieldNumber = 2,
23553     kSizeFieldNumber = 3,
23554   };
23555   void set_dev(uint64_t value) {
23556     AppendVarInt(1, value);
23557   }
23558   void set_sector(uint64_t value) {
23559     AppendVarInt(2, value);
23560   }
23561   void set_size(uint64_t value) {
23562     AppendVarInt(3, value);
23563   }
23564 };
23565 
23566 class BlockBioRemapFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
23567  public:
23568   BlockBioRemapFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
23569   explicit BlockBioRemapFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
23570   explicit BlockBioRemapFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
23571   bool has_dev() const { return at<1>().valid(); }
23572   uint64_t dev() const { return at<1>().as_uint64(); }
23573   bool has_sector() const { return at<2>().valid(); }
23574   uint64_t sector() const { return at<2>().as_uint64(); }
23575   bool has_nr_sector() const { return at<3>().valid(); }
23576   uint32_t nr_sector() const { return at<3>().as_uint32(); }
23577   bool has_old_dev() const { return at<4>().valid(); }
23578   uint64_t old_dev() const { return at<4>().as_uint64(); }
23579   bool has_old_sector() const { return at<5>().valid(); }
23580   uint64_t old_sector() const { return at<5>().as_uint64(); }
23581   bool has_rwbs() const { return at<6>().valid(); }
23582   ::protozero::ConstChars rwbs() const { return at<6>().as_string(); }
23583 };
23584 
23585 class BlockBioRemapFtraceEvent : public ::protozero::Message {
23586  public:
23587   using Decoder = BlockBioRemapFtraceEvent_Decoder;
23588   enum : int32_t {
23589     kDevFieldNumber = 1,
23590     kSectorFieldNumber = 2,
23591     kNrSectorFieldNumber = 3,
23592     kOldDevFieldNumber = 4,
23593     kOldSectorFieldNumber = 5,
23594     kRwbsFieldNumber = 6,
23595   };
23596   void set_dev(uint64_t value) {
23597     AppendVarInt(1, value);
23598   }
23599   void set_sector(uint64_t value) {
23600     AppendVarInt(2, value);
23601   }
23602   void set_nr_sector(uint32_t value) {
23603     AppendVarInt(3, value);
23604   }
23605   void set_old_dev(uint64_t value) {
23606     AppendVarInt(4, value);
23607   }
23608   void set_old_sector(uint64_t value) {
23609     AppendVarInt(5, value);
23610   }
23611   void set_rwbs(const std::string& value) {
23612     AppendBytes(6, value.data(), value.size());
23613   }
23614   void set_rwbs(const char* data, size_t size) {
23615     AppendBytes(6, data, size);
23616   }
23617 };
23618 
23619 class BlockBioQueueFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
23620  public:
23621   BlockBioQueueFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
23622   explicit BlockBioQueueFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
23623   explicit BlockBioQueueFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
23624   bool has_dev() const { return at<1>().valid(); }
23625   uint64_t dev() const { return at<1>().as_uint64(); }
23626   bool has_sector() const { return at<2>().valid(); }
23627   uint64_t sector() const { return at<2>().as_uint64(); }
23628   bool has_nr_sector() const { return at<3>().valid(); }
23629   uint32_t nr_sector() const { return at<3>().as_uint32(); }
23630   bool has_rwbs() const { return at<4>().valid(); }
23631   ::protozero::ConstChars rwbs() const { return at<4>().as_string(); }
23632   bool has_comm() const { return at<5>().valid(); }
23633   ::protozero::ConstChars comm() const { return at<5>().as_string(); }
23634 };
23635 
23636 class BlockBioQueueFtraceEvent : public ::protozero::Message {
23637  public:
23638   using Decoder = BlockBioQueueFtraceEvent_Decoder;
23639   enum : int32_t {
23640     kDevFieldNumber = 1,
23641     kSectorFieldNumber = 2,
23642     kNrSectorFieldNumber = 3,
23643     kRwbsFieldNumber = 4,
23644     kCommFieldNumber = 5,
23645   };
23646   void set_dev(uint64_t value) {
23647     AppendVarInt(1, value);
23648   }
23649   void set_sector(uint64_t value) {
23650     AppendVarInt(2, value);
23651   }
23652   void set_nr_sector(uint32_t value) {
23653     AppendVarInt(3, value);
23654   }
23655   void set_rwbs(const std::string& value) {
23656     AppendBytes(4, value.data(), value.size());
23657   }
23658   void set_rwbs(const char* data, size_t size) {
23659     AppendBytes(4, data, size);
23660   }
23661   void set_comm(const std::string& value) {
23662     AppendBytes(5, value.data(), value.size());
23663   }
23664   void set_comm(const char* data, size_t size) {
23665     AppendBytes(5, data, size);
23666   }
23667 };
23668 
23669 class BlockBioFrontmergeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
23670  public:
23671   BlockBioFrontmergeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
23672   explicit BlockBioFrontmergeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
23673   explicit BlockBioFrontmergeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
23674   bool has_dev() const { return at<1>().valid(); }
23675   uint64_t dev() const { return at<1>().as_uint64(); }
23676   bool has_sector() const { return at<2>().valid(); }
23677   uint64_t sector() const { return at<2>().as_uint64(); }
23678   bool has_nr_sector() const { return at<3>().valid(); }
23679   uint32_t nr_sector() const { return at<3>().as_uint32(); }
23680   bool has_rwbs() const { return at<4>().valid(); }
23681   ::protozero::ConstChars rwbs() const { return at<4>().as_string(); }
23682   bool has_comm() const { return at<5>().valid(); }
23683   ::protozero::ConstChars comm() const { return at<5>().as_string(); }
23684 };
23685 
23686 class BlockBioFrontmergeFtraceEvent : public ::protozero::Message {
23687  public:
23688   using Decoder = BlockBioFrontmergeFtraceEvent_Decoder;
23689   enum : int32_t {
23690     kDevFieldNumber = 1,
23691     kSectorFieldNumber = 2,
23692     kNrSectorFieldNumber = 3,
23693     kRwbsFieldNumber = 4,
23694     kCommFieldNumber = 5,
23695   };
23696   void set_dev(uint64_t value) {
23697     AppendVarInt(1, value);
23698   }
23699   void set_sector(uint64_t value) {
23700     AppendVarInt(2, value);
23701   }
23702   void set_nr_sector(uint32_t value) {
23703     AppendVarInt(3, value);
23704   }
23705   void set_rwbs(const std::string& value) {
23706     AppendBytes(4, value.data(), value.size());
23707   }
23708   void set_rwbs(const char* data, size_t size) {
23709     AppendBytes(4, data, size);
23710   }
23711   void set_comm(const std::string& value) {
23712     AppendBytes(5, value.data(), value.size());
23713   }
23714   void set_comm(const char* data, size_t size) {
23715     AppendBytes(5, data, size);
23716   }
23717 };
23718 
23719 class BlockBioCompleteFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
23720  public:
23721   BlockBioCompleteFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
23722   explicit BlockBioCompleteFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
23723   explicit BlockBioCompleteFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
23724   bool has_dev() const { return at<1>().valid(); }
23725   uint64_t dev() const { return at<1>().as_uint64(); }
23726   bool has_sector() const { return at<2>().valid(); }
23727   uint64_t sector() const { return at<2>().as_uint64(); }
23728   bool has_nr_sector() const { return at<3>().valid(); }
23729   uint32_t nr_sector() const { return at<3>().as_uint32(); }
23730   bool has_error() const { return at<4>().valid(); }
23731   int32_t error() const { return at<4>().as_int32(); }
23732   bool has_rwbs() const { return at<5>().valid(); }
23733   ::protozero::ConstChars rwbs() const { return at<5>().as_string(); }
23734 };
23735 
23736 class BlockBioCompleteFtraceEvent : public ::protozero::Message {
23737  public:
23738   using Decoder = BlockBioCompleteFtraceEvent_Decoder;
23739   enum : int32_t {
23740     kDevFieldNumber = 1,
23741     kSectorFieldNumber = 2,
23742     kNrSectorFieldNumber = 3,
23743     kErrorFieldNumber = 4,
23744     kRwbsFieldNumber = 5,
23745   };
23746   void set_dev(uint64_t value) {
23747     AppendVarInt(1, value);
23748   }
23749   void set_sector(uint64_t value) {
23750     AppendVarInt(2, value);
23751   }
23752   void set_nr_sector(uint32_t value) {
23753     AppendVarInt(3, value);
23754   }
23755   void set_error(int32_t value) {
23756     AppendVarInt(4, value);
23757   }
23758   void set_rwbs(const std::string& value) {
23759     AppendBytes(5, value.data(), value.size());
23760   }
23761   void set_rwbs(const char* data, size_t size) {
23762     AppendBytes(5, data, size);
23763   }
23764 };
23765 
23766 class BlockBioBounceFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
23767  public:
23768   BlockBioBounceFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
23769   explicit BlockBioBounceFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
23770   explicit BlockBioBounceFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
23771   bool has_dev() const { return at<1>().valid(); }
23772   uint64_t dev() const { return at<1>().as_uint64(); }
23773   bool has_sector() const { return at<2>().valid(); }
23774   uint64_t sector() const { return at<2>().as_uint64(); }
23775   bool has_nr_sector() const { return at<3>().valid(); }
23776   uint32_t nr_sector() const { return at<3>().as_uint32(); }
23777   bool has_rwbs() const { return at<4>().valid(); }
23778   ::protozero::ConstChars rwbs() const { return at<4>().as_string(); }
23779   bool has_comm() const { return at<5>().valid(); }
23780   ::protozero::ConstChars comm() const { return at<5>().as_string(); }
23781 };
23782 
23783 class BlockBioBounceFtraceEvent : public ::protozero::Message {
23784  public:
23785   using Decoder = BlockBioBounceFtraceEvent_Decoder;
23786   enum : int32_t {
23787     kDevFieldNumber = 1,
23788     kSectorFieldNumber = 2,
23789     kNrSectorFieldNumber = 3,
23790     kRwbsFieldNumber = 4,
23791     kCommFieldNumber = 5,
23792   };
23793   void set_dev(uint64_t value) {
23794     AppendVarInt(1, value);
23795   }
23796   void set_sector(uint64_t value) {
23797     AppendVarInt(2, value);
23798   }
23799   void set_nr_sector(uint32_t value) {
23800     AppendVarInt(3, value);
23801   }
23802   void set_rwbs(const std::string& value) {
23803     AppendBytes(4, value.data(), value.size());
23804   }
23805   void set_rwbs(const char* data, size_t size) {
23806     AppendBytes(4, data, size);
23807   }
23808   void set_comm(const std::string& value) {
23809     AppendBytes(5, value.data(), value.size());
23810   }
23811   void set_comm(const char* data, size_t size) {
23812     AppendBytes(5, data, size);
23813   }
23814 };
23815 
23816 class BlockBioBackmergeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
23817  public:
23818   BlockBioBackmergeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
23819   explicit BlockBioBackmergeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
23820   explicit BlockBioBackmergeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
23821   bool has_dev() const { return at<1>().valid(); }
23822   uint64_t dev() const { return at<1>().as_uint64(); }
23823   bool has_sector() const { return at<2>().valid(); }
23824   uint64_t sector() const { return at<2>().as_uint64(); }
23825   bool has_nr_sector() const { return at<3>().valid(); }
23826   uint32_t nr_sector() const { return at<3>().as_uint32(); }
23827   bool has_rwbs() const { return at<4>().valid(); }
23828   ::protozero::ConstChars rwbs() const { return at<4>().as_string(); }
23829   bool has_comm() const { return at<5>().valid(); }
23830   ::protozero::ConstChars comm() const { return at<5>().as_string(); }
23831 };
23832 
23833 class BlockBioBackmergeFtraceEvent : public ::protozero::Message {
23834  public:
23835   using Decoder = BlockBioBackmergeFtraceEvent_Decoder;
23836   enum : int32_t {
23837     kDevFieldNumber = 1,
23838     kSectorFieldNumber = 2,
23839     kNrSectorFieldNumber = 3,
23840     kRwbsFieldNumber = 4,
23841     kCommFieldNumber = 5,
23842   };
23843   void set_dev(uint64_t value) {
23844     AppendVarInt(1, value);
23845   }
23846   void set_sector(uint64_t value) {
23847     AppendVarInt(2, value);
23848   }
23849   void set_nr_sector(uint32_t value) {
23850     AppendVarInt(3, value);
23851   }
23852   void set_rwbs(const std::string& value) {
23853     AppendBytes(4, value.data(), value.size());
23854   }
23855   void set_rwbs(const char* data, size_t size) {
23856     AppendBytes(4, data, size);
23857   }
23858   void set_comm(const std::string& value) {
23859     AppendBytes(5, value.data(), value.size());
23860   }
23861   void set_comm(const char* data, size_t size) {
23862     AppendBytes(5, data, size);
23863   }
23864 };
23865 
23866 class BlockRqIssueFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
23867  public:
23868   BlockRqIssueFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
23869   explicit BlockRqIssueFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
23870   explicit BlockRqIssueFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
23871   bool has_dev() const { return at<1>().valid(); }
23872   uint64_t dev() const { return at<1>().as_uint64(); }
23873   bool has_sector() const { return at<2>().valid(); }
23874   uint64_t sector() const { return at<2>().as_uint64(); }
23875   bool has_nr_sector() const { return at<3>().valid(); }
23876   uint32_t nr_sector() const { return at<3>().as_uint32(); }
23877   bool has_bytes() const { return at<4>().valid(); }
23878   uint32_t bytes() const { return at<4>().as_uint32(); }
23879   bool has_rwbs() const { return at<5>().valid(); }
23880   ::protozero::ConstChars rwbs() const { return at<5>().as_string(); }
23881   bool has_comm() const { return at<6>().valid(); }
23882   ::protozero::ConstChars comm() const { return at<6>().as_string(); }
23883   bool has_cmd() const { return at<7>().valid(); }
23884   ::protozero::ConstChars cmd() const { return at<7>().as_string(); }
23885 };
23886 
23887 class BlockRqIssueFtraceEvent : public ::protozero::Message {
23888  public:
23889   using Decoder = BlockRqIssueFtraceEvent_Decoder;
23890   enum : int32_t {
23891     kDevFieldNumber = 1,
23892     kSectorFieldNumber = 2,
23893     kNrSectorFieldNumber = 3,
23894     kBytesFieldNumber = 4,
23895     kRwbsFieldNumber = 5,
23896     kCommFieldNumber = 6,
23897     kCmdFieldNumber = 7,
23898   };
23899   void set_dev(uint64_t value) {
23900     AppendVarInt(1, value);
23901   }
23902   void set_sector(uint64_t value) {
23903     AppendVarInt(2, value);
23904   }
23905   void set_nr_sector(uint32_t value) {
23906     AppendVarInt(3, value);
23907   }
23908   void set_bytes(uint32_t value) {
23909     AppendVarInt(4, value);
23910   }
23911   void set_rwbs(const std::string& value) {
23912     AppendBytes(5, value.data(), value.size());
23913   }
23914   void set_rwbs(const char* data, size_t size) {
23915     AppendBytes(5, data, size);
23916   }
23917   void set_comm(const std::string& value) {
23918     AppendBytes(6, value.data(), value.size());
23919   }
23920   void set_comm(const char* data, size_t size) {
23921     AppendBytes(6, data, size);
23922   }
23923   void set_cmd(const std::string& value) {
23924     AppendBytes(7, value.data(), value.size());
23925   }
23926   void set_cmd(const char* data, size_t size) {
23927     AppendBytes(7, data, size);
23928   }
23929 };
23930 
23931 } // Namespace.
23932 } // Namespace.
23933 } // Namespace.
23934 #endif  // Include guard.
23935 // gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/cgroup.pbzero.h
23936 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
23937 
23938 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_CGROUP_PROTO_H_
23939 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_CGROUP_PROTO_H_
23940 
23941 #include <stddef.h>
23942 #include <stdint.h>
23943 
23944 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
23945 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
23946 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
23947 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
23948 
23949 namespace perfetto {
23950 namespace protos {
23951 namespace pbzero {
23952 
23953 
23954 class CgroupSetupRootFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
23955  public:
23956   CgroupSetupRootFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
23957   explicit CgroupSetupRootFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
23958   explicit CgroupSetupRootFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
23959   bool has_root() const { return at<1>().valid(); }
23960   int32_t root() const { return at<1>().as_int32(); }
23961   bool has_ss_mask() const { return at<2>().valid(); }
23962   uint32_t ss_mask() const { return at<2>().as_uint32(); }
23963   bool has_name() const { return at<3>().valid(); }
23964   ::protozero::ConstChars name() const { return at<3>().as_string(); }
23965 };
23966 
23967 class CgroupSetupRootFtraceEvent : public ::protozero::Message {
23968  public:
23969   using Decoder = CgroupSetupRootFtraceEvent_Decoder;
23970   enum : int32_t {
23971     kRootFieldNumber = 1,
23972     kSsMaskFieldNumber = 2,
23973     kNameFieldNumber = 3,
23974   };
23975   void set_root(int32_t value) {
23976     AppendVarInt(1, value);
23977   }
23978   void set_ss_mask(uint32_t value) {
23979     AppendVarInt(2, value);
23980   }
23981   void set_name(const std::string& value) {
23982     AppendBytes(3, value.data(), value.size());
23983   }
23984   void set_name(const char* data, size_t size) {
23985     AppendBytes(3, data, size);
23986   }
23987 };
23988 
23989 class CgroupRenameFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
23990  public:
23991   CgroupRenameFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
23992   explicit CgroupRenameFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
23993   explicit CgroupRenameFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
23994   bool has_root() const { return at<1>().valid(); }
23995   int32_t root() const { return at<1>().as_int32(); }
23996   bool has_id() const { return at<2>().valid(); }
23997   int32_t id() const { return at<2>().as_int32(); }
23998   bool has_cname() const { return at<3>().valid(); }
23999   ::protozero::ConstChars cname() const { return at<3>().as_string(); }
24000 };
24001 
24002 class CgroupRenameFtraceEvent : public ::protozero::Message {
24003  public:
24004   using Decoder = CgroupRenameFtraceEvent_Decoder;
24005   enum : int32_t {
24006     kRootFieldNumber = 1,
24007     kIdFieldNumber = 2,
24008     kCnameFieldNumber = 3,
24009   };
24010   void set_root(int32_t value) {
24011     AppendVarInt(1, value);
24012   }
24013   void set_id(int32_t value) {
24014     AppendVarInt(2, value);
24015   }
24016   void set_cname(const std::string& value) {
24017     AppendBytes(3, value.data(), value.size());
24018   }
24019   void set_cname(const char* data, size_t size) {
24020     AppendBytes(3, data, size);
24021   }
24022 };
24023 
24024 class CgroupReleaseFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
24025  public:
24026   CgroupReleaseFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
24027   explicit CgroupReleaseFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
24028   explicit CgroupReleaseFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
24029   bool has_root() const { return at<1>().valid(); }
24030   int32_t root() const { return at<1>().as_int32(); }
24031   bool has_id() const { return at<2>().valid(); }
24032   int32_t id() const { return at<2>().as_int32(); }
24033   bool has_cname() const { return at<3>().valid(); }
24034   ::protozero::ConstChars cname() const { return at<3>().as_string(); }
24035 };
24036 
24037 class CgroupReleaseFtraceEvent : public ::protozero::Message {
24038  public:
24039   using Decoder = CgroupReleaseFtraceEvent_Decoder;
24040   enum : int32_t {
24041     kRootFieldNumber = 1,
24042     kIdFieldNumber = 2,
24043     kCnameFieldNumber = 3,
24044   };
24045   void set_root(int32_t value) {
24046     AppendVarInt(1, value);
24047   }
24048   void set_id(int32_t value) {
24049     AppendVarInt(2, value);
24050   }
24051   void set_cname(const std::string& value) {
24052     AppendBytes(3, value.data(), value.size());
24053   }
24054   void set_cname(const char* data, size_t size) {
24055     AppendBytes(3, data, size);
24056   }
24057 };
24058 
24059 class CgroupDestroyRootFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
24060  public:
24061   CgroupDestroyRootFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
24062   explicit CgroupDestroyRootFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
24063   explicit CgroupDestroyRootFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
24064   bool has_root() const { return at<1>().valid(); }
24065   int32_t root() const { return at<1>().as_int32(); }
24066   bool has_ss_mask() const { return at<2>().valid(); }
24067   uint32_t ss_mask() const { return at<2>().as_uint32(); }
24068   bool has_name() const { return at<3>().valid(); }
24069   ::protozero::ConstChars name() const { return at<3>().as_string(); }
24070 };
24071 
24072 class CgroupDestroyRootFtraceEvent : public ::protozero::Message {
24073  public:
24074   using Decoder = CgroupDestroyRootFtraceEvent_Decoder;
24075   enum : int32_t {
24076     kRootFieldNumber = 1,
24077     kSsMaskFieldNumber = 2,
24078     kNameFieldNumber = 3,
24079   };
24080   void set_root(int32_t value) {
24081     AppendVarInt(1, value);
24082   }
24083   void set_ss_mask(uint32_t value) {
24084     AppendVarInt(2, value);
24085   }
24086   void set_name(const std::string& value) {
24087     AppendBytes(3, value.data(), value.size());
24088   }
24089   void set_name(const char* data, size_t size) {
24090     AppendBytes(3, data, size);
24091   }
24092 };
24093 
24094 class CgroupTransferTasksFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
24095  public:
24096   CgroupTransferTasksFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
24097   explicit CgroupTransferTasksFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
24098   explicit CgroupTransferTasksFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
24099   bool has_dst_root() const { return at<1>().valid(); }
24100   int32_t dst_root() const { return at<1>().as_int32(); }
24101   bool has_dst_id() const { return at<2>().valid(); }
24102   int32_t dst_id() const { return at<2>().as_int32(); }
24103   bool has_pid() const { return at<3>().valid(); }
24104   int32_t pid() const { return at<3>().as_int32(); }
24105   bool has_comm() const { return at<4>().valid(); }
24106   ::protozero::ConstChars comm() const { return at<4>().as_string(); }
24107   bool has_cname() const { return at<5>().valid(); }
24108   ::protozero::ConstChars cname() const { return at<5>().as_string(); }
24109 };
24110 
24111 class CgroupTransferTasksFtraceEvent : public ::protozero::Message {
24112  public:
24113   using Decoder = CgroupTransferTasksFtraceEvent_Decoder;
24114   enum : int32_t {
24115     kDstRootFieldNumber = 1,
24116     kDstIdFieldNumber = 2,
24117     kPidFieldNumber = 3,
24118     kCommFieldNumber = 4,
24119     kCnameFieldNumber = 5,
24120   };
24121   void set_dst_root(int32_t value) {
24122     AppendVarInt(1, value);
24123   }
24124   void set_dst_id(int32_t value) {
24125     AppendVarInt(2, value);
24126   }
24127   void set_pid(int32_t value) {
24128     AppendVarInt(3, value);
24129   }
24130   void set_comm(const std::string& value) {
24131     AppendBytes(4, value.data(), value.size());
24132   }
24133   void set_comm(const char* data, size_t size) {
24134     AppendBytes(4, data, size);
24135   }
24136   void set_cname(const std::string& value) {
24137     AppendBytes(5, value.data(), value.size());
24138   }
24139   void set_cname(const char* data, size_t size) {
24140     AppendBytes(5, data, size);
24141   }
24142 };
24143 
24144 class CgroupRmdirFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
24145  public:
24146   CgroupRmdirFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
24147   explicit CgroupRmdirFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
24148   explicit CgroupRmdirFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
24149   bool has_root() const { return at<1>().valid(); }
24150   int32_t root() const { return at<1>().as_int32(); }
24151   bool has_id() const { return at<2>().valid(); }
24152   int32_t id() const { return at<2>().as_int32(); }
24153   bool has_cname() const { return at<3>().valid(); }
24154   ::protozero::ConstChars cname() const { return at<3>().as_string(); }
24155 };
24156 
24157 class CgroupRmdirFtraceEvent : public ::protozero::Message {
24158  public:
24159   using Decoder = CgroupRmdirFtraceEvent_Decoder;
24160   enum : int32_t {
24161     kRootFieldNumber = 1,
24162     kIdFieldNumber = 2,
24163     kCnameFieldNumber = 3,
24164   };
24165   void set_root(int32_t value) {
24166     AppendVarInt(1, value);
24167   }
24168   void set_id(int32_t value) {
24169     AppendVarInt(2, value);
24170   }
24171   void set_cname(const std::string& value) {
24172     AppendBytes(3, value.data(), value.size());
24173   }
24174   void set_cname(const char* data, size_t size) {
24175     AppendBytes(3, data, size);
24176   }
24177 };
24178 
24179 class CgroupRemountFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
24180  public:
24181   CgroupRemountFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
24182   explicit CgroupRemountFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
24183   explicit CgroupRemountFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
24184   bool has_root() const { return at<1>().valid(); }
24185   int32_t root() const { return at<1>().as_int32(); }
24186   bool has_ss_mask() const { return at<2>().valid(); }
24187   uint32_t ss_mask() const { return at<2>().as_uint32(); }
24188   bool has_name() const { return at<3>().valid(); }
24189   ::protozero::ConstChars name() const { return at<3>().as_string(); }
24190 };
24191 
24192 class CgroupRemountFtraceEvent : public ::protozero::Message {
24193  public:
24194   using Decoder = CgroupRemountFtraceEvent_Decoder;
24195   enum : int32_t {
24196     kRootFieldNumber = 1,
24197     kSsMaskFieldNumber = 2,
24198     kNameFieldNumber = 3,
24199   };
24200   void set_root(int32_t value) {
24201     AppendVarInt(1, value);
24202   }
24203   void set_ss_mask(uint32_t value) {
24204     AppendVarInt(2, value);
24205   }
24206   void set_name(const std::string& value) {
24207     AppendBytes(3, value.data(), value.size());
24208   }
24209   void set_name(const char* data, size_t size) {
24210     AppendBytes(3, data, size);
24211   }
24212 };
24213 
24214 class CgroupMkdirFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
24215  public:
24216   CgroupMkdirFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
24217   explicit CgroupMkdirFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
24218   explicit CgroupMkdirFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
24219   bool has_root() const { return at<1>().valid(); }
24220   int32_t root() const { return at<1>().as_int32(); }
24221   bool has_id() const { return at<2>().valid(); }
24222   int32_t id() const { return at<2>().as_int32(); }
24223   bool has_cname() const { return at<3>().valid(); }
24224   ::protozero::ConstChars cname() const { return at<3>().as_string(); }
24225 };
24226 
24227 class CgroupMkdirFtraceEvent : public ::protozero::Message {
24228  public:
24229   using Decoder = CgroupMkdirFtraceEvent_Decoder;
24230   enum : int32_t {
24231     kRootFieldNumber = 1,
24232     kIdFieldNumber = 2,
24233     kCnameFieldNumber = 3,
24234   };
24235   void set_root(int32_t value) {
24236     AppendVarInt(1, value);
24237   }
24238   void set_id(int32_t value) {
24239     AppendVarInt(2, value);
24240   }
24241   void set_cname(const std::string& value) {
24242     AppendBytes(3, value.data(), value.size());
24243   }
24244   void set_cname(const char* data, size_t size) {
24245     AppendBytes(3, data, size);
24246   }
24247 };
24248 
24249 class CgroupAttachTaskFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
24250  public:
24251   CgroupAttachTaskFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
24252   explicit CgroupAttachTaskFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
24253   explicit CgroupAttachTaskFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
24254   bool has_dst_root() const { return at<1>().valid(); }
24255   int32_t dst_root() const { return at<1>().as_int32(); }
24256   bool has_dst_id() const { return at<2>().valid(); }
24257   int32_t dst_id() const { return at<2>().as_int32(); }
24258   bool has_pid() const { return at<3>().valid(); }
24259   int32_t pid() const { return at<3>().as_int32(); }
24260   bool has_comm() const { return at<4>().valid(); }
24261   ::protozero::ConstChars comm() const { return at<4>().as_string(); }
24262   bool has_cname() const { return at<5>().valid(); }
24263   ::protozero::ConstChars cname() const { return at<5>().as_string(); }
24264 };
24265 
24266 class CgroupAttachTaskFtraceEvent : public ::protozero::Message {
24267  public:
24268   using Decoder = CgroupAttachTaskFtraceEvent_Decoder;
24269   enum : int32_t {
24270     kDstRootFieldNumber = 1,
24271     kDstIdFieldNumber = 2,
24272     kPidFieldNumber = 3,
24273     kCommFieldNumber = 4,
24274     kCnameFieldNumber = 5,
24275   };
24276   void set_dst_root(int32_t value) {
24277     AppendVarInt(1, value);
24278   }
24279   void set_dst_id(int32_t value) {
24280     AppendVarInt(2, value);
24281   }
24282   void set_pid(int32_t value) {
24283     AppendVarInt(3, value);
24284   }
24285   void set_comm(const std::string& value) {
24286     AppendBytes(4, value.data(), value.size());
24287   }
24288   void set_comm(const char* data, size_t size) {
24289     AppendBytes(4, data, size);
24290   }
24291   void set_cname(const std::string& value) {
24292     AppendBytes(5, value.data(), value.size());
24293   }
24294   void set_cname(const char* data, size_t size) {
24295     AppendBytes(5, data, size);
24296   }
24297 };
24298 
24299 } // Namespace.
24300 } // Namespace.
24301 } // Namespace.
24302 #endif  // Include guard.
24303 // gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/clk.pbzero.h
24304 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
24305 
24306 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_CLK_PROTO_H_
24307 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_CLK_PROTO_H_
24308 
24309 #include <stddef.h>
24310 #include <stdint.h>
24311 
24312 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
24313 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
24314 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
24315 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
24316 
24317 namespace perfetto {
24318 namespace protos {
24319 namespace pbzero {
24320 
24321 
24322 class ClkSetRateFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
24323  public:
24324   ClkSetRateFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
24325   explicit ClkSetRateFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
24326   explicit ClkSetRateFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
24327   bool has_name() const { return at<1>().valid(); }
24328   ::protozero::ConstChars name() const { return at<1>().as_string(); }
24329   bool has_rate() const { return at<2>().valid(); }
24330   uint64_t rate() const { return at<2>().as_uint64(); }
24331 };
24332 
24333 class ClkSetRateFtraceEvent : public ::protozero::Message {
24334  public:
24335   using Decoder = ClkSetRateFtraceEvent_Decoder;
24336   enum : int32_t {
24337     kNameFieldNumber = 1,
24338     kRateFieldNumber = 2,
24339   };
24340   void set_name(const std::string& value) {
24341     AppendBytes(1, value.data(), value.size());
24342   }
24343   void set_name(const char* data, size_t size) {
24344     AppendBytes(1, data, size);
24345   }
24346   void set_rate(uint64_t value) {
24347     AppendVarInt(2, value);
24348   }
24349 };
24350 
24351 class ClkDisableFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
24352  public:
24353   ClkDisableFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
24354   explicit ClkDisableFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
24355   explicit ClkDisableFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
24356   bool has_name() const { return at<1>().valid(); }
24357   ::protozero::ConstChars name() const { return at<1>().as_string(); }
24358 };
24359 
24360 class ClkDisableFtraceEvent : public ::protozero::Message {
24361  public:
24362   using Decoder = ClkDisableFtraceEvent_Decoder;
24363   enum : int32_t {
24364     kNameFieldNumber = 1,
24365   };
24366   void set_name(const std::string& value) {
24367     AppendBytes(1, value.data(), value.size());
24368   }
24369   void set_name(const char* data, size_t size) {
24370     AppendBytes(1, data, size);
24371   }
24372 };
24373 
24374 class ClkEnableFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
24375  public:
24376   ClkEnableFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
24377   explicit ClkEnableFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
24378   explicit ClkEnableFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
24379   bool has_name() const { return at<1>().valid(); }
24380   ::protozero::ConstChars name() const { return at<1>().as_string(); }
24381 };
24382 
24383 class ClkEnableFtraceEvent : public ::protozero::Message {
24384  public:
24385   using Decoder = ClkEnableFtraceEvent_Decoder;
24386   enum : int32_t {
24387     kNameFieldNumber = 1,
24388   };
24389   void set_name(const std::string& value) {
24390     AppendBytes(1, value.data(), value.size());
24391   }
24392   void set_name(const char* data, size_t size) {
24393     AppendBytes(1, data, size);
24394   }
24395 };
24396 
24397 } // Namespace.
24398 } // Namespace.
24399 } // Namespace.
24400 #endif  // Include guard.
24401 // gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/compaction.pbzero.h
24402 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
24403 
24404 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_COMPACTION_PROTO_H_
24405 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_COMPACTION_PROTO_H_
24406 
24407 #include <stddef.h>
24408 #include <stdint.h>
24409 
24410 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
24411 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
24412 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
24413 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
24414 
24415 namespace perfetto {
24416 namespace protos {
24417 namespace pbzero {
24418 
24419 
24420 class MmCompactionWakeupKcompactdFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
24421  public:
24422   MmCompactionWakeupKcompactdFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
24423   explicit MmCompactionWakeupKcompactdFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
24424   explicit MmCompactionWakeupKcompactdFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
24425   bool has_nid() const { return at<1>().valid(); }
24426   int32_t nid() const { return at<1>().as_int32(); }
24427   bool has_order() const { return at<2>().valid(); }
24428   int32_t order() const { return at<2>().as_int32(); }
24429   bool has_classzone_idx() const { return at<3>().valid(); }
24430   uint32_t classzone_idx() const { return at<3>().as_uint32(); }
24431 };
24432 
24433 class MmCompactionWakeupKcompactdFtraceEvent : public ::protozero::Message {
24434  public:
24435   using Decoder = MmCompactionWakeupKcompactdFtraceEvent_Decoder;
24436   enum : int32_t {
24437     kNidFieldNumber = 1,
24438     kOrderFieldNumber = 2,
24439     kClasszoneIdxFieldNumber = 3,
24440   };
24441   void set_nid(int32_t value) {
24442     AppendVarInt(1, value);
24443   }
24444   void set_order(int32_t value) {
24445     AppendVarInt(2, value);
24446   }
24447   void set_classzone_idx(uint32_t value) {
24448     AppendVarInt(3, value);
24449   }
24450 };
24451 
24452 class MmCompactionTryToCompactPagesFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
24453  public:
24454   MmCompactionTryToCompactPagesFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
24455   explicit MmCompactionTryToCompactPagesFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
24456   explicit MmCompactionTryToCompactPagesFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
24457   bool has_order() const { return at<1>().valid(); }
24458   int32_t order() const { return at<1>().as_int32(); }
24459   bool has_gfp_mask() const { return at<2>().valid(); }
24460   uint32_t gfp_mask() const { return at<2>().as_uint32(); }
24461   bool has_mode() const { return at<3>().valid(); }
24462   uint32_t mode() const { return at<3>().as_uint32(); }
24463 };
24464 
24465 class MmCompactionTryToCompactPagesFtraceEvent : public ::protozero::Message {
24466  public:
24467   using Decoder = MmCompactionTryToCompactPagesFtraceEvent_Decoder;
24468   enum : int32_t {
24469     kOrderFieldNumber = 1,
24470     kGfpMaskFieldNumber = 2,
24471     kModeFieldNumber = 3,
24472   };
24473   void set_order(int32_t value) {
24474     AppendVarInt(1, value);
24475   }
24476   void set_gfp_mask(uint32_t value) {
24477     AppendVarInt(2, value);
24478   }
24479   void set_mode(uint32_t value) {
24480     AppendVarInt(3, value);
24481   }
24482 };
24483 
24484 class MmCompactionSuitableFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
24485  public:
24486   MmCompactionSuitableFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
24487   explicit MmCompactionSuitableFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
24488   explicit MmCompactionSuitableFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
24489   bool has_nid() const { return at<1>().valid(); }
24490   int32_t nid() const { return at<1>().as_int32(); }
24491   bool has_idx() const { return at<2>().valid(); }
24492   uint32_t idx() const { return at<2>().as_uint32(); }
24493   bool has_order() const { return at<3>().valid(); }
24494   int32_t order() const { return at<3>().as_int32(); }
24495   bool has_ret() const { return at<4>().valid(); }
24496   int32_t ret() const { return at<4>().as_int32(); }
24497 };
24498 
24499 class MmCompactionSuitableFtraceEvent : public ::protozero::Message {
24500  public:
24501   using Decoder = MmCompactionSuitableFtraceEvent_Decoder;
24502   enum : int32_t {
24503     kNidFieldNumber = 1,
24504     kIdxFieldNumber = 2,
24505     kOrderFieldNumber = 3,
24506     kRetFieldNumber = 4,
24507   };
24508   void set_nid(int32_t value) {
24509     AppendVarInt(1, value);
24510   }
24511   void set_idx(uint32_t value) {
24512     AppendVarInt(2, value);
24513   }
24514   void set_order(int32_t value) {
24515     AppendVarInt(3, value);
24516   }
24517   void set_ret(int32_t value) {
24518     AppendVarInt(4, value);
24519   }
24520 };
24521 
24522 class MmCompactionMigratepagesFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
24523  public:
24524   MmCompactionMigratepagesFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
24525   explicit MmCompactionMigratepagesFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
24526   explicit MmCompactionMigratepagesFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
24527   bool has_nr_migrated() const { return at<1>().valid(); }
24528   uint64_t nr_migrated() const { return at<1>().as_uint64(); }
24529   bool has_nr_failed() const { return at<2>().valid(); }
24530   uint64_t nr_failed() const { return at<2>().as_uint64(); }
24531 };
24532 
24533 class MmCompactionMigratepagesFtraceEvent : public ::protozero::Message {
24534  public:
24535   using Decoder = MmCompactionMigratepagesFtraceEvent_Decoder;
24536   enum : int32_t {
24537     kNrMigratedFieldNumber = 1,
24538     kNrFailedFieldNumber = 2,
24539   };
24540   void set_nr_migrated(uint64_t value) {
24541     AppendVarInt(1, value);
24542   }
24543   void set_nr_failed(uint64_t value) {
24544     AppendVarInt(2, value);
24545   }
24546 };
24547 
24548 class MmCompactionKcompactdWakeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
24549  public:
24550   MmCompactionKcompactdWakeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
24551   explicit MmCompactionKcompactdWakeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
24552   explicit MmCompactionKcompactdWakeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
24553   bool has_nid() const { return at<1>().valid(); }
24554   int32_t nid() const { return at<1>().as_int32(); }
24555   bool has_order() const { return at<2>().valid(); }
24556   int32_t order() const { return at<2>().as_int32(); }
24557   bool has_classzone_idx() const { return at<3>().valid(); }
24558   uint32_t classzone_idx() const { return at<3>().as_uint32(); }
24559 };
24560 
24561 class MmCompactionKcompactdWakeFtraceEvent : public ::protozero::Message {
24562  public:
24563   using Decoder = MmCompactionKcompactdWakeFtraceEvent_Decoder;
24564   enum : int32_t {
24565     kNidFieldNumber = 1,
24566     kOrderFieldNumber = 2,
24567     kClasszoneIdxFieldNumber = 3,
24568   };
24569   void set_nid(int32_t value) {
24570     AppendVarInt(1, value);
24571   }
24572   void set_order(int32_t value) {
24573     AppendVarInt(2, value);
24574   }
24575   void set_classzone_idx(uint32_t value) {
24576     AppendVarInt(3, value);
24577   }
24578 };
24579 
24580 class MmCompactionKcompactdSleepFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
24581  public:
24582   MmCompactionKcompactdSleepFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
24583   explicit MmCompactionKcompactdSleepFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
24584   explicit MmCompactionKcompactdSleepFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
24585   bool has_nid() const { return at<1>().valid(); }
24586   int32_t nid() const { return at<1>().as_int32(); }
24587 };
24588 
24589 class MmCompactionKcompactdSleepFtraceEvent : public ::protozero::Message {
24590  public:
24591   using Decoder = MmCompactionKcompactdSleepFtraceEvent_Decoder;
24592   enum : int32_t {
24593     kNidFieldNumber = 1,
24594   };
24595   void set_nid(int32_t value) {
24596     AppendVarInt(1, value);
24597   }
24598 };
24599 
24600 class MmCompactionIsolateMigratepagesFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
24601  public:
24602   MmCompactionIsolateMigratepagesFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
24603   explicit MmCompactionIsolateMigratepagesFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
24604   explicit MmCompactionIsolateMigratepagesFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
24605   bool has_start_pfn() const { return at<1>().valid(); }
24606   uint64_t start_pfn() const { return at<1>().as_uint64(); }
24607   bool has_end_pfn() const { return at<2>().valid(); }
24608   uint64_t end_pfn() const { return at<2>().as_uint64(); }
24609   bool has_nr_scanned() const { return at<3>().valid(); }
24610   uint64_t nr_scanned() const { return at<3>().as_uint64(); }
24611   bool has_nr_taken() const { return at<4>().valid(); }
24612   uint64_t nr_taken() const { return at<4>().as_uint64(); }
24613 };
24614 
24615 class MmCompactionIsolateMigratepagesFtraceEvent : public ::protozero::Message {
24616  public:
24617   using Decoder = MmCompactionIsolateMigratepagesFtraceEvent_Decoder;
24618   enum : int32_t {
24619     kStartPfnFieldNumber = 1,
24620     kEndPfnFieldNumber = 2,
24621     kNrScannedFieldNumber = 3,
24622     kNrTakenFieldNumber = 4,
24623   };
24624   void set_start_pfn(uint64_t value) {
24625     AppendVarInt(1, value);
24626   }
24627   void set_end_pfn(uint64_t value) {
24628     AppendVarInt(2, value);
24629   }
24630   void set_nr_scanned(uint64_t value) {
24631     AppendVarInt(3, value);
24632   }
24633   void set_nr_taken(uint64_t value) {
24634     AppendVarInt(4, value);
24635   }
24636 };
24637 
24638 class MmCompactionIsolateFreepagesFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
24639  public:
24640   MmCompactionIsolateFreepagesFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
24641   explicit MmCompactionIsolateFreepagesFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
24642   explicit MmCompactionIsolateFreepagesFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
24643   bool has_start_pfn() const { return at<1>().valid(); }
24644   uint64_t start_pfn() const { return at<1>().as_uint64(); }
24645   bool has_end_pfn() const { return at<2>().valid(); }
24646   uint64_t end_pfn() const { return at<2>().as_uint64(); }
24647   bool has_nr_scanned() const { return at<3>().valid(); }
24648   uint64_t nr_scanned() const { return at<3>().as_uint64(); }
24649   bool has_nr_taken() const { return at<4>().valid(); }
24650   uint64_t nr_taken() const { return at<4>().as_uint64(); }
24651 };
24652 
24653 class MmCompactionIsolateFreepagesFtraceEvent : public ::protozero::Message {
24654  public:
24655   using Decoder = MmCompactionIsolateFreepagesFtraceEvent_Decoder;
24656   enum : int32_t {
24657     kStartPfnFieldNumber = 1,
24658     kEndPfnFieldNumber = 2,
24659     kNrScannedFieldNumber = 3,
24660     kNrTakenFieldNumber = 4,
24661   };
24662   void set_start_pfn(uint64_t value) {
24663     AppendVarInt(1, value);
24664   }
24665   void set_end_pfn(uint64_t value) {
24666     AppendVarInt(2, value);
24667   }
24668   void set_nr_scanned(uint64_t value) {
24669     AppendVarInt(3, value);
24670   }
24671   void set_nr_taken(uint64_t value) {
24672     AppendVarInt(4, value);
24673   }
24674 };
24675 
24676 class MmCompactionFinishedFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
24677  public:
24678   MmCompactionFinishedFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
24679   explicit MmCompactionFinishedFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
24680   explicit MmCompactionFinishedFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
24681   bool has_nid() const { return at<1>().valid(); }
24682   int32_t nid() const { return at<1>().as_int32(); }
24683   bool has_idx() const { return at<2>().valid(); }
24684   uint32_t idx() const { return at<2>().as_uint32(); }
24685   bool has_order() const { return at<3>().valid(); }
24686   int32_t order() const { return at<3>().as_int32(); }
24687   bool has_ret() const { return at<4>().valid(); }
24688   int32_t ret() const { return at<4>().as_int32(); }
24689 };
24690 
24691 class MmCompactionFinishedFtraceEvent : public ::protozero::Message {
24692  public:
24693   using Decoder = MmCompactionFinishedFtraceEvent_Decoder;
24694   enum : int32_t {
24695     kNidFieldNumber = 1,
24696     kIdxFieldNumber = 2,
24697     kOrderFieldNumber = 3,
24698     kRetFieldNumber = 4,
24699   };
24700   void set_nid(int32_t value) {
24701     AppendVarInt(1, value);
24702   }
24703   void set_idx(uint32_t value) {
24704     AppendVarInt(2, value);
24705   }
24706   void set_order(int32_t value) {
24707     AppendVarInt(3, value);
24708   }
24709   void set_ret(int32_t value) {
24710     AppendVarInt(4, value);
24711   }
24712 };
24713 
24714 class MmCompactionEndFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
24715  public:
24716   MmCompactionEndFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
24717   explicit MmCompactionEndFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
24718   explicit MmCompactionEndFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
24719   bool has_zone_start() const { return at<1>().valid(); }
24720   uint64_t zone_start() const { return at<1>().as_uint64(); }
24721   bool has_migrate_pfn() const { return at<2>().valid(); }
24722   uint64_t migrate_pfn() const { return at<2>().as_uint64(); }
24723   bool has_free_pfn() const { return at<3>().valid(); }
24724   uint64_t free_pfn() const { return at<3>().as_uint64(); }
24725   bool has_zone_end() const { return at<4>().valid(); }
24726   uint64_t zone_end() const { return at<4>().as_uint64(); }
24727   bool has_sync() const { return at<5>().valid(); }
24728   uint32_t sync() const { return at<5>().as_uint32(); }
24729   bool has_status() const { return at<6>().valid(); }
24730   int32_t status() const { return at<6>().as_int32(); }
24731 };
24732 
24733 class MmCompactionEndFtraceEvent : public ::protozero::Message {
24734  public:
24735   using Decoder = MmCompactionEndFtraceEvent_Decoder;
24736   enum : int32_t {
24737     kZoneStartFieldNumber = 1,
24738     kMigratePfnFieldNumber = 2,
24739     kFreePfnFieldNumber = 3,
24740     kZoneEndFieldNumber = 4,
24741     kSyncFieldNumber = 5,
24742     kStatusFieldNumber = 6,
24743   };
24744   void set_zone_start(uint64_t value) {
24745     AppendVarInt(1, value);
24746   }
24747   void set_migrate_pfn(uint64_t value) {
24748     AppendVarInt(2, value);
24749   }
24750   void set_free_pfn(uint64_t value) {
24751     AppendVarInt(3, value);
24752   }
24753   void set_zone_end(uint64_t value) {
24754     AppendVarInt(4, value);
24755   }
24756   void set_sync(uint32_t value) {
24757     AppendVarInt(5, value);
24758   }
24759   void set_status(int32_t value) {
24760     AppendVarInt(6, value);
24761   }
24762 };
24763 
24764 class MmCompactionDeferResetFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
24765  public:
24766   MmCompactionDeferResetFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
24767   explicit MmCompactionDeferResetFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
24768   explicit MmCompactionDeferResetFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
24769   bool has_nid() const { return at<1>().valid(); }
24770   int32_t nid() const { return at<1>().as_int32(); }
24771   bool has_idx() const { return at<2>().valid(); }
24772   uint32_t idx() const { return at<2>().as_uint32(); }
24773   bool has_order() const { return at<3>().valid(); }
24774   int32_t order() const { return at<3>().as_int32(); }
24775   bool has_considered() const { return at<4>().valid(); }
24776   uint32_t considered() const { return at<4>().as_uint32(); }
24777   bool has_defer_shift() const { return at<5>().valid(); }
24778   uint32_t defer_shift() const { return at<5>().as_uint32(); }
24779   bool has_order_failed() const { return at<6>().valid(); }
24780   int32_t order_failed() const { return at<6>().as_int32(); }
24781 };
24782 
24783 class MmCompactionDeferResetFtraceEvent : public ::protozero::Message {
24784  public:
24785   using Decoder = MmCompactionDeferResetFtraceEvent_Decoder;
24786   enum : int32_t {
24787     kNidFieldNumber = 1,
24788     kIdxFieldNumber = 2,
24789     kOrderFieldNumber = 3,
24790     kConsideredFieldNumber = 4,
24791     kDeferShiftFieldNumber = 5,
24792     kOrderFailedFieldNumber = 6,
24793   };
24794   void set_nid(int32_t value) {
24795     AppendVarInt(1, value);
24796   }
24797   void set_idx(uint32_t value) {
24798     AppendVarInt(2, value);
24799   }
24800   void set_order(int32_t value) {
24801     AppendVarInt(3, value);
24802   }
24803   void set_considered(uint32_t value) {
24804     AppendVarInt(4, value);
24805   }
24806   void set_defer_shift(uint32_t value) {
24807     AppendVarInt(5, value);
24808   }
24809   void set_order_failed(int32_t value) {
24810     AppendVarInt(6, value);
24811   }
24812 };
24813 
24814 class MmCompactionDeferredFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
24815  public:
24816   MmCompactionDeferredFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
24817   explicit MmCompactionDeferredFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
24818   explicit MmCompactionDeferredFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
24819   bool has_nid() const { return at<1>().valid(); }
24820   int32_t nid() const { return at<1>().as_int32(); }
24821   bool has_idx() const { return at<2>().valid(); }
24822   uint32_t idx() const { return at<2>().as_uint32(); }
24823   bool has_order() const { return at<3>().valid(); }
24824   int32_t order() const { return at<3>().as_int32(); }
24825   bool has_considered() const { return at<4>().valid(); }
24826   uint32_t considered() const { return at<4>().as_uint32(); }
24827   bool has_defer_shift() const { return at<5>().valid(); }
24828   uint32_t defer_shift() const { return at<5>().as_uint32(); }
24829   bool has_order_failed() const { return at<6>().valid(); }
24830   int32_t order_failed() const { return at<6>().as_int32(); }
24831 };
24832 
24833 class MmCompactionDeferredFtraceEvent : public ::protozero::Message {
24834  public:
24835   using Decoder = MmCompactionDeferredFtraceEvent_Decoder;
24836   enum : int32_t {
24837     kNidFieldNumber = 1,
24838     kIdxFieldNumber = 2,
24839     kOrderFieldNumber = 3,
24840     kConsideredFieldNumber = 4,
24841     kDeferShiftFieldNumber = 5,
24842     kOrderFailedFieldNumber = 6,
24843   };
24844   void set_nid(int32_t value) {
24845     AppendVarInt(1, value);
24846   }
24847   void set_idx(uint32_t value) {
24848     AppendVarInt(2, value);
24849   }
24850   void set_order(int32_t value) {
24851     AppendVarInt(3, value);
24852   }
24853   void set_considered(uint32_t value) {
24854     AppendVarInt(4, value);
24855   }
24856   void set_defer_shift(uint32_t value) {
24857     AppendVarInt(5, value);
24858   }
24859   void set_order_failed(int32_t value) {
24860     AppendVarInt(6, value);
24861   }
24862 };
24863 
24864 class MmCompactionDeferCompactionFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
24865  public:
24866   MmCompactionDeferCompactionFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
24867   explicit MmCompactionDeferCompactionFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
24868   explicit MmCompactionDeferCompactionFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
24869   bool has_nid() const { return at<1>().valid(); }
24870   int32_t nid() const { return at<1>().as_int32(); }
24871   bool has_idx() const { return at<2>().valid(); }
24872   uint32_t idx() const { return at<2>().as_uint32(); }
24873   bool has_order() const { return at<3>().valid(); }
24874   int32_t order() const { return at<3>().as_int32(); }
24875   bool has_considered() const { return at<4>().valid(); }
24876   uint32_t considered() const { return at<4>().as_uint32(); }
24877   bool has_defer_shift() const { return at<5>().valid(); }
24878   uint32_t defer_shift() const { return at<5>().as_uint32(); }
24879   bool has_order_failed() const { return at<6>().valid(); }
24880   int32_t order_failed() const { return at<6>().as_int32(); }
24881 };
24882 
24883 class MmCompactionDeferCompactionFtraceEvent : public ::protozero::Message {
24884  public:
24885   using Decoder = MmCompactionDeferCompactionFtraceEvent_Decoder;
24886   enum : int32_t {
24887     kNidFieldNumber = 1,
24888     kIdxFieldNumber = 2,
24889     kOrderFieldNumber = 3,
24890     kConsideredFieldNumber = 4,
24891     kDeferShiftFieldNumber = 5,
24892     kOrderFailedFieldNumber = 6,
24893   };
24894   void set_nid(int32_t value) {
24895     AppendVarInt(1, value);
24896   }
24897   void set_idx(uint32_t value) {
24898     AppendVarInt(2, value);
24899   }
24900   void set_order(int32_t value) {
24901     AppendVarInt(3, value);
24902   }
24903   void set_considered(uint32_t value) {
24904     AppendVarInt(4, value);
24905   }
24906   void set_defer_shift(uint32_t value) {
24907     AppendVarInt(5, value);
24908   }
24909   void set_order_failed(int32_t value) {
24910     AppendVarInt(6, value);
24911   }
24912 };
24913 
24914 class MmCompactionBeginFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
24915  public:
24916   MmCompactionBeginFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
24917   explicit MmCompactionBeginFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
24918   explicit MmCompactionBeginFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
24919   bool has_zone_start() const { return at<1>().valid(); }
24920   uint64_t zone_start() const { return at<1>().as_uint64(); }
24921   bool has_migrate_pfn() const { return at<2>().valid(); }
24922   uint64_t migrate_pfn() const { return at<2>().as_uint64(); }
24923   bool has_free_pfn() const { return at<3>().valid(); }
24924   uint64_t free_pfn() const { return at<3>().as_uint64(); }
24925   bool has_zone_end() const { return at<4>().valid(); }
24926   uint64_t zone_end() const { return at<4>().as_uint64(); }
24927   bool has_sync() const { return at<5>().valid(); }
24928   uint32_t sync() const { return at<5>().as_uint32(); }
24929 };
24930 
24931 class MmCompactionBeginFtraceEvent : public ::protozero::Message {
24932  public:
24933   using Decoder = MmCompactionBeginFtraceEvent_Decoder;
24934   enum : int32_t {
24935     kZoneStartFieldNumber = 1,
24936     kMigratePfnFieldNumber = 2,
24937     kFreePfnFieldNumber = 3,
24938     kZoneEndFieldNumber = 4,
24939     kSyncFieldNumber = 5,
24940   };
24941   void set_zone_start(uint64_t value) {
24942     AppendVarInt(1, value);
24943   }
24944   void set_migrate_pfn(uint64_t value) {
24945     AppendVarInt(2, value);
24946   }
24947   void set_free_pfn(uint64_t value) {
24948     AppendVarInt(3, value);
24949   }
24950   void set_zone_end(uint64_t value) {
24951     AppendVarInt(4, value);
24952   }
24953   void set_sync(uint32_t value) {
24954     AppendVarInt(5, value);
24955   }
24956 };
24957 
24958 } // Namespace.
24959 } // Namespace.
24960 } // Namespace.
24961 #endif  // Include guard.
24962 // gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/cpuhp.pbzero.h
24963 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
24964 
24965 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_CPUHP_PROTO_H_
24966 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_CPUHP_PROTO_H_
24967 
24968 #include <stddef.h>
24969 #include <stdint.h>
24970 
24971 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
24972 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
24973 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
24974 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
24975 
24976 namespace perfetto {
24977 namespace protos {
24978 namespace pbzero {
24979 
24980 
24981 class CpuhpLatencyFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
24982  public:
24983   CpuhpLatencyFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
24984   explicit CpuhpLatencyFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
24985   explicit CpuhpLatencyFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
24986   bool has_cpu() const { return at<1>().valid(); }
24987   uint32_t cpu() const { return at<1>().as_uint32(); }
24988   bool has_ret() const { return at<2>().valid(); }
24989   int32_t ret() const { return at<2>().as_int32(); }
24990   bool has_state() const { return at<3>().valid(); }
24991   uint32_t state() const { return at<3>().as_uint32(); }
24992   bool has_time() const { return at<4>().valid(); }
24993   uint64_t time() const { return at<4>().as_uint64(); }
24994 };
24995 
24996 class CpuhpLatencyFtraceEvent : public ::protozero::Message {
24997  public:
24998   using Decoder = CpuhpLatencyFtraceEvent_Decoder;
24999   enum : int32_t {
25000     kCpuFieldNumber = 1,
25001     kRetFieldNumber = 2,
25002     kStateFieldNumber = 3,
25003     kTimeFieldNumber = 4,
25004   };
25005   void set_cpu(uint32_t value) {
25006     AppendVarInt(1, value);
25007   }
25008   void set_ret(int32_t value) {
25009     AppendVarInt(2, value);
25010   }
25011   void set_state(uint32_t value) {
25012     AppendVarInt(3, value);
25013   }
25014   void set_time(uint64_t value) {
25015     AppendVarInt(4, value);
25016   }
25017 };
25018 
25019 class CpuhpEnterFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
25020  public:
25021   CpuhpEnterFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
25022   explicit CpuhpEnterFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
25023   explicit CpuhpEnterFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
25024   bool has_cpu() const { return at<1>().valid(); }
25025   uint32_t cpu() const { return at<1>().as_uint32(); }
25026   bool has_fun() const { return at<2>().valid(); }
25027   uint64_t fun() const { return at<2>().as_uint64(); }
25028   bool has_idx() const { return at<3>().valid(); }
25029   int32_t idx() const { return at<3>().as_int32(); }
25030   bool has_target() const { return at<4>().valid(); }
25031   int32_t target() const { return at<4>().as_int32(); }
25032 };
25033 
25034 class CpuhpEnterFtraceEvent : public ::protozero::Message {
25035  public:
25036   using Decoder = CpuhpEnterFtraceEvent_Decoder;
25037   enum : int32_t {
25038     kCpuFieldNumber = 1,
25039     kFunFieldNumber = 2,
25040     kIdxFieldNumber = 3,
25041     kTargetFieldNumber = 4,
25042   };
25043   void set_cpu(uint32_t value) {
25044     AppendVarInt(1, value);
25045   }
25046   void set_fun(uint64_t value) {
25047     AppendVarInt(2, value);
25048   }
25049   void set_idx(int32_t value) {
25050     AppendVarInt(3, value);
25051   }
25052   void set_target(int32_t value) {
25053     AppendVarInt(4, value);
25054   }
25055 };
25056 
25057 class CpuhpMultiEnterFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
25058  public:
25059   CpuhpMultiEnterFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
25060   explicit CpuhpMultiEnterFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
25061   explicit CpuhpMultiEnterFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
25062   bool has_cpu() const { return at<1>().valid(); }
25063   uint32_t cpu() const { return at<1>().as_uint32(); }
25064   bool has_fun() const { return at<2>().valid(); }
25065   uint64_t fun() const { return at<2>().as_uint64(); }
25066   bool has_idx() const { return at<3>().valid(); }
25067   int32_t idx() const { return at<3>().as_int32(); }
25068   bool has_target() const { return at<4>().valid(); }
25069   int32_t target() const { return at<4>().as_int32(); }
25070 };
25071 
25072 class CpuhpMultiEnterFtraceEvent : public ::protozero::Message {
25073  public:
25074   using Decoder = CpuhpMultiEnterFtraceEvent_Decoder;
25075   enum : int32_t {
25076     kCpuFieldNumber = 1,
25077     kFunFieldNumber = 2,
25078     kIdxFieldNumber = 3,
25079     kTargetFieldNumber = 4,
25080   };
25081   void set_cpu(uint32_t value) {
25082     AppendVarInt(1, value);
25083   }
25084   void set_fun(uint64_t value) {
25085     AppendVarInt(2, value);
25086   }
25087   void set_idx(int32_t value) {
25088     AppendVarInt(3, value);
25089   }
25090   void set_target(int32_t value) {
25091     AppendVarInt(4, value);
25092   }
25093 };
25094 
25095 class CpuhpExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
25096  public:
25097   CpuhpExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
25098   explicit CpuhpExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
25099   explicit CpuhpExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
25100   bool has_cpu() const { return at<1>().valid(); }
25101   uint32_t cpu() const { return at<1>().as_uint32(); }
25102   bool has_idx() const { return at<2>().valid(); }
25103   int32_t idx() const { return at<2>().as_int32(); }
25104   bool has_ret() const { return at<3>().valid(); }
25105   int32_t ret() const { return at<3>().as_int32(); }
25106   bool has_state() const { return at<4>().valid(); }
25107   int32_t state() const { return at<4>().as_int32(); }
25108 };
25109 
25110 class CpuhpExitFtraceEvent : public ::protozero::Message {
25111  public:
25112   using Decoder = CpuhpExitFtraceEvent_Decoder;
25113   enum : int32_t {
25114     kCpuFieldNumber = 1,
25115     kIdxFieldNumber = 2,
25116     kRetFieldNumber = 3,
25117     kStateFieldNumber = 4,
25118   };
25119   void set_cpu(uint32_t value) {
25120     AppendVarInt(1, value);
25121   }
25122   void set_idx(int32_t value) {
25123     AppendVarInt(2, value);
25124   }
25125   void set_ret(int32_t value) {
25126     AppendVarInt(3, value);
25127   }
25128   void set_state(int32_t value) {
25129     AppendVarInt(4, value);
25130   }
25131 };
25132 
25133 } // Namespace.
25134 } // Namespace.
25135 } // Namespace.
25136 #endif  // Include guard.
25137 // gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/ext4.pbzero.h
25138 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
25139 
25140 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_EXT4_PROTO_H_
25141 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_EXT4_PROTO_H_
25142 
25143 #include <stddef.h>
25144 #include <stdint.h>
25145 
25146 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
25147 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
25148 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
25149 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
25150 
25151 namespace perfetto {
25152 namespace protos {
25153 namespace pbzero {
25154 
25155 
25156 class Ext4ZeroRangeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
25157  public:
25158   Ext4ZeroRangeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
25159   explicit Ext4ZeroRangeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
25160   explicit Ext4ZeroRangeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
25161   bool has_dev() const { return at<1>().valid(); }
25162   uint64_t dev() const { return at<1>().as_uint64(); }
25163   bool has_ino() const { return at<2>().valid(); }
25164   uint64_t ino() const { return at<2>().as_uint64(); }
25165   bool has_offset() const { return at<3>().valid(); }
25166   int64_t offset() const { return at<3>().as_int64(); }
25167   bool has_len() const { return at<4>().valid(); }
25168   int64_t len() const { return at<4>().as_int64(); }
25169   bool has_mode() const { return at<5>().valid(); }
25170   int32_t mode() const { return at<5>().as_int32(); }
25171 };
25172 
25173 class Ext4ZeroRangeFtraceEvent : public ::protozero::Message {
25174  public:
25175   using Decoder = Ext4ZeroRangeFtraceEvent_Decoder;
25176   enum : int32_t {
25177     kDevFieldNumber = 1,
25178     kInoFieldNumber = 2,
25179     kOffsetFieldNumber = 3,
25180     kLenFieldNumber = 4,
25181     kModeFieldNumber = 5,
25182   };
25183   void set_dev(uint64_t value) {
25184     AppendVarInt(1, value);
25185   }
25186   void set_ino(uint64_t value) {
25187     AppendVarInt(2, value);
25188   }
25189   void set_offset(int64_t value) {
25190     AppendVarInt(3, value);
25191   }
25192   void set_len(int64_t value) {
25193     AppendVarInt(4, value);
25194   }
25195   void set_mode(int32_t value) {
25196     AppendVarInt(5, value);
25197   }
25198 };
25199 
25200 class Ext4WritepagesResultFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
25201  public:
25202   Ext4WritepagesResultFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
25203   explicit Ext4WritepagesResultFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
25204   explicit Ext4WritepagesResultFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
25205   bool has_dev() const { return at<1>().valid(); }
25206   uint64_t dev() const { return at<1>().as_uint64(); }
25207   bool has_ino() const { return at<2>().valid(); }
25208   uint64_t ino() const { return at<2>().as_uint64(); }
25209   bool has_ret() const { return at<3>().valid(); }
25210   int32_t ret() const { return at<3>().as_int32(); }
25211   bool has_pages_written() const { return at<4>().valid(); }
25212   int32_t pages_written() const { return at<4>().as_int32(); }
25213   bool has_pages_skipped() const { return at<5>().valid(); }
25214   int64_t pages_skipped() const { return at<5>().as_int64(); }
25215   bool has_writeback_index() const { return at<6>().valid(); }
25216   uint64_t writeback_index() const { return at<6>().as_uint64(); }
25217   bool has_sync_mode() const { return at<7>().valid(); }
25218   int32_t sync_mode() const { return at<7>().as_int32(); }
25219 };
25220 
25221 class Ext4WritepagesResultFtraceEvent : public ::protozero::Message {
25222  public:
25223   using Decoder = Ext4WritepagesResultFtraceEvent_Decoder;
25224   enum : int32_t {
25225     kDevFieldNumber = 1,
25226     kInoFieldNumber = 2,
25227     kRetFieldNumber = 3,
25228     kPagesWrittenFieldNumber = 4,
25229     kPagesSkippedFieldNumber = 5,
25230     kWritebackIndexFieldNumber = 6,
25231     kSyncModeFieldNumber = 7,
25232   };
25233   void set_dev(uint64_t value) {
25234     AppendVarInt(1, value);
25235   }
25236   void set_ino(uint64_t value) {
25237     AppendVarInt(2, value);
25238   }
25239   void set_ret(int32_t value) {
25240     AppendVarInt(3, value);
25241   }
25242   void set_pages_written(int32_t value) {
25243     AppendVarInt(4, value);
25244   }
25245   void set_pages_skipped(int64_t value) {
25246     AppendVarInt(5, value);
25247   }
25248   void set_writeback_index(uint64_t value) {
25249     AppendVarInt(6, value);
25250   }
25251   void set_sync_mode(int32_t value) {
25252     AppendVarInt(7, value);
25253   }
25254 };
25255 
25256 class Ext4WritepagesFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/10, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
25257  public:
25258   Ext4WritepagesFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
25259   explicit Ext4WritepagesFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
25260   explicit Ext4WritepagesFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
25261   bool has_dev() const { return at<1>().valid(); }
25262   uint64_t dev() const { return at<1>().as_uint64(); }
25263   bool has_ino() const { return at<2>().valid(); }
25264   uint64_t ino() const { return at<2>().as_uint64(); }
25265   bool has_nr_to_write() const { return at<3>().valid(); }
25266   int64_t nr_to_write() const { return at<3>().as_int64(); }
25267   bool has_pages_skipped() const { return at<4>().valid(); }
25268   int64_t pages_skipped() const { return at<4>().as_int64(); }
25269   bool has_range_start() const { return at<5>().valid(); }
25270   int64_t range_start() const { return at<5>().as_int64(); }
25271   bool has_range_end() const { return at<6>().valid(); }
25272   int64_t range_end() const { return at<6>().as_int64(); }
25273   bool has_writeback_index() const { return at<7>().valid(); }
25274   uint64_t writeback_index() const { return at<7>().as_uint64(); }
25275   bool has_sync_mode() const { return at<8>().valid(); }
25276   int32_t sync_mode() const { return at<8>().as_int32(); }
25277   bool has_for_kupdate() const { return at<9>().valid(); }
25278   uint32_t for_kupdate() const { return at<9>().as_uint32(); }
25279   bool has_range_cyclic() const { return at<10>().valid(); }
25280   uint32_t range_cyclic() const { return at<10>().as_uint32(); }
25281 };
25282 
25283 class Ext4WritepagesFtraceEvent : public ::protozero::Message {
25284  public:
25285   using Decoder = Ext4WritepagesFtraceEvent_Decoder;
25286   enum : int32_t {
25287     kDevFieldNumber = 1,
25288     kInoFieldNumber = 2,
25289     kNrToWriteFieldNumber = 3,
25290     kPagesSkippedFieldNumber = 4,
25291     kRangeStartFieldNumber = 5,
25292     kRangeEndFieldNumber = 6,
25293     kWritebackIndexFieldNumber = 7,
25294     kSyncModeFieldNumber = 8,
25295     kForKupdateFieldNumber = 9,
25296     kRangeCyclicFieldNumber = 10,
25297   };
25298   void set_dev(uint64_t value) {
25299     AppendVarInt(1, value);
25300   }
25301   void set_ino(uint64_t value) {
25302     AppendVarInt(2, value);
25303   }
25304   void set_nr_to_write(int64_t value) {
25305     AppendVarInt(3, value);
25306   }
25307   void set_pages_skipped(int64_t value) {
25308     AppendVarInt(4, value);
25309   }
25310   void set_range_start(int64_t value) {
25311     AppendVarInt(5, value);
25312   }
25313   void set_range_end(int64_t value) {
25314     AppendVarInt(6, value);
25315   }
25316   void set_writeback_index(uint64_t value) {
25317     AppendVarInt(7, value);
25318   }
25319   void set_sync_mode(int32_t value) {
25320     AppendVarInt(8, value);
25321   }
25322   void set_for_kupdate(uint32_t value) {
25323     AppendVarInt(9, value);
25324   }
25325   void set_range_cyclic(uint32_t value) {
25326     AppendVarInt(10, value);
25327   }
25328 };
25329 
25330 class Ext4WritepageFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
25331  public:
25332   Ext4WritepageFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
25333   explicit Ext4WritepageFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
25334   explicit Ext4WritepageFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
25335   bool has_dev() const { return at<1>().valid(); }
25336   uint64_t dev() const { return at<1>().as_uint64(); }
25337   bool has_ino() const { return at<2>().valid(); }
25338   uint64_t ino() const { return at<2>().as_uint64(); }
25339   bool has_index() const { return at<3>().valid(); }
25340   uint64_t index() const { return at<3>().as_uint64(); }
25341 };
25342 
25343 class Ext4WritepageFtraceEvent : public ::protozero::Message {
25344  public:
25345   using Decoder = Ext4WritepageFtraceEvent_Decoder;
25346   enum : int32_t {
25347     kDevFieldNumber = 1,
25348     kInoFieldNumber = 2,
25349     kIndexFieldNumber = 3,
25350   };
25351   void set_dev(uint64_t value) {
25352     AppendVarInt(1, value);
25353   }
25354   void set_ino(uint64_t value) {
25355     AppendVarInt(2, value);
25356   }
25357   void set_index(uint64_t value) {
25358     AppendVarInt(3, value);
25359   }
25360 };
25361 
25362 class Ext4WriteEndFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
25363  public:
25364   Ext4WriteEndFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
25365   explicit Ext4WriteEndFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
25366   explicit Ext4WriteEndFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
25367   bool has_dev() const { return at<1>().valid(); }
25368   uint64_t dev() const { return at<1>().as_uint64(); }
25369   bool has_ino() const { return at<2>().valid(); }
25370   uint64_t ino() const { return at<2>().as_uint64(); }
25371   bool has_pos() const { return at<3>().valid(); }
25372   int64_t pos() const { return at<3>().as_int64(); }
25373   bool has_len() const { return at<4>().valid(); }
25374   uint32_t len() const { return at<4>().as_uint32(); }
25375   bool has_copied() const { return at<5>().valid(); }
25376   uint32_t copied() const { return at<5>().as_uint32(); }
25377 };
25378 
25379 class Ext4WriteEndFtraceEvent : public ::protozero::Message {
25380  public:
25381   using Decoder = Ext4WriteEndFtraceEvent_Decoder;
25382   enum : int32_t {
25383     kDevFieldNumber = 1,
25384     kInoFieldNumber = 2,
25385     kPosFieldNumber = 3,
25386     kLenFieldNumber = 4,
25387     kCopiedFieldNumber = 5,
25388   };
25389   void set_dev(uint64_t value) {
25390     AppendVarInt(1, value);
25391   }
25392   void set_ino(uint64_t value) {
25393     AppendVarInt(2, value);
25394   }
25395   void set_pos(int64_t value) {
25396     AppendVarInt(3, value);
25397   }
25398   void set_len(uint32_t value) {
25399     AppendVarInt(4, value);
25400   }
25401   void set_copied(uint32_t value) {
25402     AppendVarInt(5, value);
25403   }
25404 };
25405 
25406 class Ext4WriteBeginFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
25407  public:
25408   Ext4WriteBeginFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
25409   explicit Ext4WriteBeginFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
25410   explicit Ext4WriteBeginFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
25411   bool has_dev() const { return at<1>().valid(); }
25412   uint64_t dev() const { return at<1>().as_uint64(); }
25413   bool has_ino() const { return at<2>().valid(); }
25414   uint64_t ino() const { return at<2>().as_uint64(); }
25415   bool has_pos() const { return at<3>().valid(); }
25416   int64_t pos() const { return at<3>().as_int64(); }
25417   bool has_len() const { return at<4>().valid(); }
25418   uint32_t len() const { return at<4>().as_uint32(); }
25419   bool has_flags() const { return at<5>().valid(); }
25420   uint32_t flags() const { return at<5>().as_uint32(); }
25421 };
25422 
25423 class Ext4WriteBeginFtraceEvent : public ::protozero::Message {
25424  public:
25425   using Decoder = Ext4WriteBeginFtraceEvent_Decoder;
25426   enum : int32_t {
25427     kDevFieldNumber = 1,
25428     kInoFieldNumber = 2,
25429     kPosFieldNumber = 3,
25430     kLenFieldNumber = 4,
25431     kFlagsFieldNumber = 5,
25432   };
25433   void set_dev(uint64_t value) {
25434     AppendVarInt(1, value);
25435   }
25436   void set_ino(uint64_t value) {
25437     AppendVarInt(2, value);
25438   }
25439   void set_pos(int64_t value) {
25440     AppendVarInt(3, value);
25441   }
25442   void set_len(uint32_t value) {
25443     AppendVarInt(4, value);
25444   }
25445   void set_flags(uint32_t value) {
25446     AppendVarInt(5, value);
25447   }
25448 };
25449 
25450 class Ext4UnlinkExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
25451  public:
25452   Ext4UnlinkExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
25453   explicit Ext4UnlinkExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
25454   explicit Ext4UnlinkExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
25455   bool has_dev() const { return at<1>().valid(); }
25456   uint64_t dev() const { return at<1>().as_uint64(); }
25457   bool has_ino() const { return at<2>().valid(); }
25458   uint64_t ino() const { return at<2>().as_uint64(); }
25459   bool has_ret() const { return at<3>().valid(); }
25460   int32_t ret() const { return at<3>().as_int32(); }
25461 };
25462 
25463 class Ext4UnlinkExitFtraceEvent : public ::protozero::Message {
25464  public:
25465   using Decoder = Ext4UnlinkExitFtraceEvent_Decoder;
25466   enum : int32_t {
25467     kDevFieldNumber = 1,
25468     kInoFieldNumber = 2,
25469     kRetFieldNumber = 3,
25470   };
25471   void set_dev(uint64_t value) {
25472     AppendVarInt(1, value);
25473   }
25474   void set_ino(uint64_t value) {
25475     AppendVarInt(2, value);
25476   }
25477   void set_ret(int32_t value) {
25478     AppendVarInt(3, value);
25479   }
25480 };
25481 
25482 class Ext4UnlinkEnterFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
25483  public:
25484   Ext4UnlinkEnterFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
25485   explicit Ext4UnlinkEnterFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
25486   explicit Ext4UnlinkEnterFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
25487   bool has_dev() const { return at<1>().valid(); }
25488   uint64_t dev() const { return at<1>().as_uint64(); }
25489   bool has_ino() const { return at<2>().valid(); }
25490   uint64_t ino() const { return at<2>().as_uint64(); }
25491   bool has_parent() const { return at<3>().valid(); }
25492   uint64_t parent() const { return at<3>().as_uint64(); }
25493   bool has_size() const { return at<4>().valid(); }
25494   int64_t size() const { return at<4>().as_int64(); }
25495 };
25496 
25497 class Ext4UnlinkEnterFtraceEvent : public ::protozero::Message {
25498  public:
25499   using Decoder = Ext4UnlinkEnterFtraceEvent_Decoder;
25500   enum : int32_t {
25501     kDevFieldNumber = 1,
25502     kInoFieldNumber = 2,
25503     kParentFieldNumber = 3,
25504     kSizeFieldNumber = 4,
25505   };
25506   void set_dev(uint64_t value) {
25507     AppendVarInt(1, value);
25508   }
25509   void set_ino(uint64_t value) {
25510     AppendVarInt(2, value);
25511   }
25512   void set_parent(uint64_t value) {
25513     AppendVarInt(3, value);
25514   }
25515   void set_size(int64_t value) {
25516     AppendVarInt(4, value);
25517   }
25518 };
25519 
25520 class Ext4TruncateExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
25521  public:
25522   Ext4TruncateExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
25523   explicit Ext4TruncateExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
25524   explicit Ext4TruncateExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
25525   bool has_dev() const { return at<1>().valid(); }
25526   uint64_t dev() const { return at<1>().as_uint64(); }
25527   bool has_ino() const { return at<2>().valid(); }
25528   uint64_t ino() const { return at<2>().as_uint64(); }
25529   bool has_blocks() const { return at<3>().valid(); }
25530   uint64_t blocks() const { return at<3>().as_uint64(); }
25531 };
25532 
25533 class Ext4TruncateExitFtraceEvent : public ::protozero::Message {
25534  public:
25535   using Decoder = Ext4TruncateExitFtraceEvent_Decoder;
25536   enum : int32_t {
25537     kDevFieldNumber = 1,
25538     kInoFieldNumber = 2,
25539     kBlocksFieldNumber = 3,
25540   };
25541   void set_dev(uint64_t value) {
25542     AppendVarInt(1, value);
25543   }
25544   void set_ino(uint64_t value) {
25545     AppendVarInt(2, value);
25546   }
25547   void set_blocks(uint64_t value) {
25548     AppendVarInt(3, value);
25549   }
25550 };
25551 
25552 class Ext4TruncateEnterFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
25553  public:
25554   Ext4TruncateEnterFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
25555   explicit Ext4TruncateEnterFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
25556   explicit Ext4TruncateEnterFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
25557   bool has_dev() const { return at<1>().valid(); }
25558   uint64_t dev() const { return at<1>().as_uint64(); }
25559   bool has_ino() const { return at<2>().valid(); }
25560   uint64_t ino() const { return at<2>().as_uint64(); }
25561   bool has_blocks() const { return at<3>().valid(); }
25562   uint64_t blocks() const { return at<3>().as_uint64(); }
25563 };
25564 
25565 class Ext4TruncateEnterFtraceEvent : public ::protozero::Message {
25566  public:
25567   using Decoder = Ext4TruncateEnterFtraceEvent_Decoder;
25568   enum : int32_t {
25569     kDevFieldNumber = 1,
25570     kInoFieldNumber = 2,
25571     kBlocksFieldNumber = 3,
25572   };
25573   void set_dev(uint64_t value) {
25574     AppendVarInt(1, value);
25575   }
25576   void set_ino(uint64_t value) {
25577     AppendVarInt(2, value);
25578   }
25579   void set_blocks(uint64_t value) {
25580     AppendVarInt(3, value);
25581   }
25582 };
25583 
25584 class Ext4TrimExtentFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
25585  public:
25586   Ext4TrimExtentFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
25587   explicit Ext4TrimExtentFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
25588   explicit Ext4TrimExtentFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
25589   bool has_dev_major() const { return at<1>().valid(); }
25590   int32_t dev_major() const { return at<1>().as_int32(); }
25591   bool has_dev_minor() const { return at<2>().valid(); }
25592   int32_t dev_minor() const { return at<2>().as_int32(); }
25593   bool has_group() const { return at<3>().valid(); }
25594   uint32_t group() const { return at<3>().as_uint32(); }
25595   bool has_start() const { return at<4>().valid(); }
25596   int32_t start() const { return at<4>().as_int32(); }
25597   bool has_len() const { return at<5>().valid(); }
25598   int32_t len() const { return at<5>().as_int32(); }
25599 };
25600 
25601 class Ext4TrimExtentFtraceEvent : public ::protozero::Message {
25602  public:
25603   using Decoder = Ext4TrimExtentFtraceEvent_Decoder;
25604   enum : int32_t {
25605     kDevMajorFieldNumber = 1,
25606     kDevMinorFieldNumber = 2,
25607     kGroupFieldNumber = 3,
25608     kStartFieldNumber = 4,
25609     kLenFieldNumber = 5,
25610   };
25611   void set_dev_major(int32_t value) {
25612     AppendVarInt(1, value);
25613   }
25614   void set_dev_minor(int32_t value) {
25615     AppendVarInt(2, value);
25616   }
25617   void set_group(uint32_t value) {
25618     AppendVarInt(3, value);
25619   }
25620   void set_start(int32_t value) {
25621     AppendVarInt(4, value);
25622   }
25623   void set_len(int32_t value) {
25624     AppendVarInt(5, value);
25625   }
25626 };
25627 
25628 class Ext4TrimAllFreeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
25629  public:
25630   Ext4TrimAllFreeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
25631   explicit Ext4TrimAllFreeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
25632   explicit Ext4TrimAllFreeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
25633   bool has_dev_major() const { return at<1>().valid(); }
25634   int32_t dev_major() const { return at<1>().as_int32(); }
25635   bool has_dev_minor() const { return at<2>().valid(); }
25636   int32_t dev_minor() const { return at<2>().as_int32(); }
25637   bool has_group() const { return at<3>().valid(); }
25638   uint32_t group() const { return at<3>().as_uint32(); }
25639   bool has_start() const { return at<4>().valid(); }
25640   int32_t start() const { return at<4>().as_int32(); }
25641   bool has_len() const { return at<5>().valid(); }
25642   int32_t len() const { return at<5>().as_int32(); }
25643 };
25644 
25645 class Ext4TrimAllFreeFtraceEvent : public ::protozero::Message {
25646  public:
25647   using Decoder = Ext4TrimAllFreeFtraceEvent_Decoder;
25648   enum : int32_t {
25649     kDevMajorFieldNumber = 1,
25650     kDevMinorFieldNumber = 2,
25651     kGroupFieldNumber = 3,
25652     kStartFieldNumber = 4,
25653     kLenFieldNumber = 5,
25654   };
25655   void set_dev_major(int32_t value) {
25656     AppendVarInt(1, value);
25657   }
25658   void set_dev_minor(int32_t value) {
25659     AppendVarInt(2, value);
25660   }
25661   void set_group(uint32_t value) {
25662     AppendVarInt(3, value);
25663   }
25664   void set_start(int32_t value) {
25665     AppendVarInt(4, value);
25666   }
25667   void set_len(int32_t value) {
25668     AppendVarInt(5, value);
25669   }
25670 };
25671 
25672 class Ext4SyncFsFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
25673  public:
25674   Ext4SyncFsFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
25675   explicit Ext4SyncFsFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
25676   explicit Ext4SyncFsFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
25677   bool has_dev() const { return at<1>().valid(); }
25678   uint64_t dev() const { return at<1>().as_uint64(); }
25679   bool has_wait() const { return at<2>().valid(); }
25680   int32_t wait() const { return at<2>().as_int32(); }
25681 };
25682 
25683 class Ext4SyncFsFtraceEvent : public ::protozero::Message {
25684  public:
25685   using Decoder = Ext4SyncFsFtraceEvent_Decoder;
25686   enum : int32_t {
25687     kDevFieldNumber = 1,
25688     kWaitFieldNumber = 2,
25689   };
25690   void set_dev(uint64_t value) {
25691     AppendVarInt(1, value);
25692   }
25693   void set_wait(int32_t value) {
25694     AppendVarInt(2, value);
25695   }
25696 };
25697 
25698 class Ext4RequestInodeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
25699  public:
25700   Ext4RequestInodeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
25701   explicit Ext4RequestInodeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
25702   explicit Ext4RequestInodeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
25703   bool has_dev() const { return at<1>().valid(); }
25704   uint64_t dev() const { return at<1>().as_uint64(); }
25705   bool has_dir() const { return at<2>().valid(); }
25706   uint64_t dir() const { return at<2>().as_uint64(); }
25707   bool has_mode() const { return at<3>().valid(); }
25708   uint32_t mode() const { return at<3>().as_uint32(); }
25709 };
25710 
25711 class Ext4RequestInodeFtraceEvent : public ::protozero::Message {
25712  public:
25713   using Decoder = Ext4RequestInodeFtraceEvent_Decoder;
25714   enum : int32_t {
25715     kDevFieldNumber = 1,
25716     kDirFieldNumber = 2,
25717     kModeFieldNumber = 3,
25718   };
25719   void set_dev(uint64_t value) {
25720     AppendVarInt(1, value);
25721   }
25722   void set_dir(uint64_t value) {
25723     AppendVarInt(2, value);
25724   }
25725   void set_mode(uint32_t value) {
25726     AppendVarInt(3, value);
25727   }
25728 };
25729 
25730 class Ext4RequestBlocksFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/10, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
25731  public:
25732   Ext4RequestBlocksFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
25733   explicit Ext4RequestBlocksFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
25734   explicit Ext4RequestBlocksFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
25735   bool has_dev() const { return at<1>().valid(); }
25736   uint64_t dev() const { return at<1>().as_uint64(); }
25737   bool has_ino() const { return at<2>().valid(); }
25738   uint64_t ino() const { return at<2>().as_uint64(); }
25739   bool has_len() const { return at<3>().valid(); }
25740   uint32_t len() const { return at<3>().as_uint32(); }
25741   bool has_logical() const { return at<4>().valid(); }
25742   uint32_t logical() const { return at<4>().as_uint32(); }
25743   bool has_lleft() const { return at<5>().valid(); }
25744   uint32_t lleft() const { return at<5>().as_uint32(); }
25745   bool has_lright() const { return at<6>().valid(); }
25746   uint32_t lright() const { return at<6>().as_uint32(); }
25747   bool has_goal() const { return at<7>().valid(); }
25748   uint64_t goal() const { return at<7>().as_uint64(); }
25749   bool has_pleft() const { return at<8>().valid(); }
25750   uint64_t pleft() const { return at<8>().as_uint64(); }
25751   bool has_pright() const { return at<9>().valid(); }
25752   uint64_t pright() const { return at<9>().as_uint64(); }
25753   bool has_flags() const { return at<10>().valid(); }
25754   uint32_t flags() const { return at<10>().as_uint32(); }
25755 };
25756 
25757 class Ext4RequestBlocksFtraceEvent : public ::protozero::Message {
25758  public:
25759   using Decoder = Ext4RequestBlocksFtraceEvent_Decoder;
25760   enum : int32_t {
25761     kDevFieldNumber = 1,
25762     kInoFieldNumber = 2,
25763     kLenFieldNumber = 3,
25764     kLogicalFieldNumber = 4,
25765     kLleftFieldNumber = 5,
25766     kLrightFieldNumber = 6,
25767     kGoalFieldNumber = 7,
25768     kPleftFieldNumber = 8,
25769     kPrightFieldNumber = 9,
25770     kFlagsFieldNumber = 10,
25771   };
25772   void set_dev(uint64_t value) {
25773     AppendVarInt(1, value);
25774   }
25775   void set_ino(uint64_t value) {
25776     AppendVarInt(2, value);
25777   }
25778   void set_len(uint32_t value) {
25779     AppendVarInt(3, value);
25780   }
25781   void set_logical(uint32_t value) {
25782     AppendVarInt(4, value);
25783   }
25784   void set_lleft(uint32_t value) {
25785     AppendVarInt(5, value);
25786   }
25787   void set_lright(uint32_t value) {
25788     AppendVarInt(6, value);
25789   }
25790   void set_goal(uint64_t value) {
25791     AppendVarInt(7, value);
25792   }
25793   void set_pleft(uint64_t value) {
25794     AppendVarInt(8, value);
25795   }
25796   void set_pright(uint64_t value) {
25797     AppendVarInt(9, value);
25798   }
25799   void set_flags(uint32_t value) {
25800     AppendVarInt(10, value);
25801   }
25802 };
25803 
25804 class Ext4RemoveBlocksFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
25805  public:
25806   Ext4RemoveBlocksFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
25807   explicit Ext4RemoveBlocksFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
25808   explicit Ext4RemoveBlocksFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
25809   bool has_dev() const { return at<1>().valid(); }
25810   uint64_t dev() const { return at<1>().as_uint64(); }
25811   bool has_ino() const { return at<2>().valid(); }
25812   uint64_t ino() const { return at<2>().as_uint64(); }
25813   bool has_from() const { return at<3>().valid(); }
25814   uint32_t from() const { return at<3>().as_uint32(); }
25815   bool has_to() const { return at<4>().valid(); }
25816   uint32_t to() const { return at<4>().as_uint32(); }
25817   bool has_partial() const { return at<5>().valid(); }
25818   int64_t partial() const { return at<5>().as_int64(); }
25819   bool has_ee_pblk() const { return at<6>().valid(); }
25820   uint64_t ee_pblk() const { return at<6>().as_uint64(); }
25821   bool has_ee_lblk() const { return at<7>().valid(); }
25822   uint32_t ee_lblk() const { return at<7>().as_uint32(); }
25823   bool has_ee_len() const { return at<8>().valid(); }
25824   uint32_t ee_len() const { return at<8>().as_uint32(); }
25825 };
25826 
25827 class Ext4RemoveBlocksFtraceEvent : public ::protozero::Message {
25828  public:
25829   using Decoder = Ext4RemoveBlocksFtraceEvent_Decoder;
25830   enum : int32_t {
25831     kDevFieldNumber = 1,
25832     kInoFieldNumber = 2,
25833     kFromFieldNumber = 3,
25834     kToFieldNumber = 4,
25835     kPartialFieldNumber = 5,
25836     kEePblkFieldNumber = 6,
25837     kEeLblkFieldNumber = 7,
25838     kEeLenFieldNumber = 8,
25839   };
25840   void set_dev(uint64_t value) {
25841     AppendVarInt(1, value);
25842   }
25843   void set_ino(uint64_t value) {
25844     AppendVarInt(2, value);
25845   }
25846   void set_from(uint32_t value) {
25847     AppendVarInt(3, value);
25848   }
25849   void set_to(uint32_t value) {
25850     AppendVarInt(4, value);
25851   }
25852   void set_partial(int64_t value) {
25853     AppendVarInt(5, value);
25854   }
25855   void set_ee_pblk(uint64_t value) {
25856     AppendVarInt(6, value);
25857   }
25858   void set_ee_lblk(uint32_t value) {
25859     AppendVarInt(7, value);
25860   }
25861   void set_ee_len(uint32_t value) {
25862     AppendVarInt(8, value);
25863   }
25864 };
25865 
25866 class Ext4ReleasepageFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
25867  public:
25868   Ext4ReleasepageFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
25869   explicit Ext4ReleasepageFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
25870   explicit Ext4ReleasepageFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
25871   bool has_dev() const { return at<1>().valid(); }
25872   uint64_t dev() const { return at<1>().as_uint64(); }
25873   bool has_ino() const { return at<2>().valid(); }
25874   uint64_t ino() const { return at<2>().as_uint64(); }
25875   bool has_index() const { return at<3>().valid(); }
25876   uint64_t index() const { return at<3>().as_uint64(); }
25877 };
25878 
25879 class Ext4ReleasepageFtraceEvent : public ::protozero::Message {
25880  public:
25881   using Decoder = Ext4ReleasepageFtraceEvent_Decoder;
25882   enum : int32_t {
25883     kDevFieldNumber = 1,
25884     kInoFieldNumber = 2,
25885     kIndexFieldNumber = 3,
25886   };
25887   void set_dev(uint64_t value) {
25888     AppendVarInt(1, value);
25889   }
25890   void set_ino(uint64_t value) {
25891     AppendVarInt(2, value);
25892   }
25893   void set_index(uint64_t value) {
25894     AppendVarInt(3, value);
25895   }
25896 };
25897 
25898 class Ext4ReadpageFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
25899  public:
25900   Ext4ReadpageFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
25901   explicit Ext4ReadpageFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
25902   explicit Ext4ReadpageFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
25903   bool has_dev() const { return at<1>().valid(); }
25904   uint64_t dev() const { return at<1>().as_uint64(); }
25905   bool has_ino() const { return at<2>().valid(); }
25906   uint64_t ino() const { return at<2>().as_uint64(); }
25907   bool has_index() const { return at<3>().valid(); }
25908   uint64_t index() const { return at<3>().as_uint64(); }
25909 };
25910 
25911 class Ext4ReadpageFtraceEvent : public ::protozero::Message {
25912  public:
25913   using Decoder = Ext4ReadpageFtraceEvent_Decoder;
25914   enum : int32_t {
25915     kDevFieldNumber = 1,
25916     kInoFieldNumber = 2,
25917     kIndexFieldNumber = 3,
25918   };
25919   void set_dev(uint64_t value) {
25920     AppendVarInt(1, value);
25921   }
25922   void set_ino(uint64_t value) {
25923     AppendVarInt(2, value);
25924   }
25925   void set_index(uint64_t value) {
25926     AppendVarInt(3, value);
25927   }
25928 };
25929 
25930 class Ext4ReadBlockBitmapLoadFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
25931  public:
25932   Ext4ReadBlockBitmapLoadFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
25933   explicit Ext4ReadBlockBitmapLoadFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
25934   explicit Ext4ReadBlockBitmapLoadFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
25935   bool has_dev() const { return at<1>().valid(); }
25936   uint64_t dev() const { return at<1>().as_uint64(); }
25937   bool has_group() const { return at<2>().valid(); }
25938   uint32_t group() const { return at<2>().as_uint32(); }
25939 };
25940 
25941 class Ext4ReadBlockBitmapLoadFtraceEvent : public ::protozero::Message {
25942  public:
25943   using Decoder = Ext4ReadBlockBitmapLoadFtraceEvent_Decoder;
25944   enum : int32_t {
25945     kDevFieldNumber = 1,
25946     kGroupFieldNumber = 2,
25947   };
25948   void set_dev(uint64_t value) {
25949     AppendVarInt(1, value);
25950   }
25951   void set_group(uint32_t value) {
25952     AppendVarInt(2, value);
25953   }
25954 };
25955 
25956 class Ext4PunchHoleFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
25957  public:
25958   Ext4PunchHoleFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
25959   explicit Ext4PunchHoleFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
25960   explicit Ext4PunchHoleFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
25961   bool has_dev() const { return at<1>().valid(); }
25962   uint64_t dev() const { return at<1>().as_uint64(); }
25963   bool has_ino() const { return at<2>().valid(); }
25964   uint64_t ino() const { return at<2>().as_uint64(); }
25965   bool has_offset() const { return at<3>().valid(); }
25966   int64_t offset() const { return at<3>().as_int64(); }
25967   bool has_len() const { return at<4>().valid(); }
25968   int64_t len() const { return at<4>().as_int64(); }
25969   bool has_mode() const { return at<5>().valid(); }
25970   int32_t mode() const { return at<5>().as_int32(); }
25971 };
25972 
25973 class Ext4PunchHoleFtraceEvent : public ::protozero::Message {
25974  public:
25975   using Decoder = Ext4PunchHoleFtraceEvent_Decoder;
25976   enum : int32_t {
25977     kDevFieldNumber = 1,
25978     kInoFieldNumber = 2,
25979     kOffsetFieldNumber = 3,
25980     kLenFieldNumber = 4,
25981     kModeFieldNumber = 5,
25982   };
25983   void set_dev(uint64_t value) {
25984     AppendVarInt(1, value);
25985   }
25986   void set_ino(uint64_t value) {
25987     AppendVarInt(2, value);
25988   }
25989   void set_offset(int64_t value) {
25990     AppendVarInt(3, value);
25991   }
25992   void set_len(int64_t value) {
25993     AppendVarInt(4, value);
25994   }
25995   void set_mode(int32_t value) {
25996     AppendVarInt(5, value);
25997   }
25998 };
25999 
26000 class Ext4OtherInodeUpdateTimeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
26001  public:
26002   Ext4OtherInodeUpdateTimeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
26003   explicit Ext4OtherInodeUpdateTimeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
26004   explicit Ext4OtherInodeUpdateTimeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
26005   bool has_dev() const { return at<1>().valid(); }
26006   uint64_t dev() const { return at<1>().as_uint64(); }
26007   bool has_ino() const { return at<2>().valid(); }
26008   uint64_t ino() const { return at<2>().as_uint64(); }
26009   bool has_orig_ino() const { return at<3>().valid(); }
26010   uint64_t orig_ino() const { return at<3>().as_uint64(); }
26011   bool has_uid() const { return at<4>().valid(); }
26012   uint32_t uid() const { return at<4>().as_uint32(); }
26013   bool has_gid() const { return at<5>().valid(); }
26014   uint32_t gid() const { return at<5>().as_uint32(); }
26015   bool has_mode() const { return at<6>().valid(); }
26016   uint32_t mode() const { return at<6>().as_uint32(); }
26017 };
26018 
26019 class Ext4OtherInodeUpdateTimeFtraceEvent : public ::protozero::Message {
26020  public:
26021   using Decoder = Ext4OtherInodeUpdateTimeFtraceEvent_Decoder;
26022   enum : int32_t {
26023     kDevFieldNumber = 1,
26024     kInoFieldNumber = 2,
26025     kOrigInoFieldNumber = 3,
26026     kUidFieldNumber = 4,
26027     kGidFieldNumber = 5,
26028     kModeFieldNumber = 6,
26029   };
26030   void set_dev(uint64_t value) {
26031     AppendVarInt(1, value);
26032   }
26033   void set_ino(uint64_t value) {
26034     AppendVarInt(2, value);
26035   }
26036   void set_orig_ino(uint64_t value) {
26037     AppendVarInt(3, value);
26038   }
26039   void set_uid(uint32_t value) {
26040     AppendVarInt(4, value);
26041   }
26042   void set_gid(uint32_t value) {
26043     AppendVarInt(5, value);
26044   }
26045   void set_mode(uint32_t value) {
26046     AppendVarInt(6, value);
26047   }
26048 };
26049 
26050 class Ext4MballocPreallocFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/10, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
26051  public:
26052   Ext4MballocPreallocFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
26053   explicit Ext4MballocPreallocFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
26054   explicit Ext4MballocPreallocFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
26055   bool has_dev() const { return at<1>().valid(); }
26056   uint64_t dev() const { return at<1>().as_uint64(); }
26057   bool has_ino() const { return at<2>().valid(); }
26058   uint64_t ino() const { return at<2>().as_uint64(); }
26059   bool has_orig_logical() const { return at<3>().valid(); }
26060   uint32_t orig_logical() const { return at<3>().as_uint32(); }
26061   bool has_orig_start() const { return at<4>().valid(); }
26062   int32_t orig_start() const { return at<4>().as_int32(); }
26063   bool has_orig_group() const { return at<5>().valid(); }
26064   uint32_t orig_group() const { return at<5>().as_uint32(); }
26065   bool has_orig_len() const { return at<6>().valid(); }
26066   int32_t orig_len() const { return at<6>().as_int32(); }
26067   bool has_result_logical() const { return at<7>().valid(); }
26068   uint32_t result_logical() const { return at<7>().as_uint32(); }
26069   bool has_result_start() const { return at<8>().valid(); }
26070   int32_t result_start() const { return at<8>().as_int32(); }
26071   bool has_result_group() const { return at<9>().valid(); }
26072   uint32_t result_group() const { return at<9>().as_uint32(); }
26073   bool has_result_len() const { return at<10>().valid(); }
26074   int32_t result_len() const { return at<10>().as_int32(); }
26075 };
26076 
26077 class Ext4MballocPreallocFtraceEvent : public ::protozero::Message {
26078  public:
26079   using Decoder = Ext4MballocPreallocFtraceEvent_Decoder;
26080   enum : int32_t {
26081     kDevFieldNumber = 1,
26082     kInoFieldNumber = 2,
26083     kOrigLogicalFieldNumber = 3,
26084     kOrigStartFieldNumber = 4,
26085     kOrigGroupFieldNumber = 5,
26086     kOrigLenFieldNumber = 6,
26087     kResultLogicalFieldNumber = 7,
26088     kResultStartFieldNumber = 8,
26089     kResultGroupFieldNumber = 9,
26090     kResultLenFieldNumber = 10,
26091   };
26092   void set_dev(uint64_t value) {
26093     AppendVarInt(1, value);
26094   }
26095   void set_ino(uint64_t value) {
26096     AppendVarInt(2, value);
26097   }
26098   void set_orig_logical(uint32_t value) {
26099     AppendVarInt(3, value);
26100   }
26101   void set_orig_start(int32_t value) {
26102     AppendVarInt(4, value);
26103   }
26104   void set_orig_group(uint32_t value) {
26105     AppendVarInt(5, value);
26106   }
26107   void set_orig_len(int32_t value) {
26108     AppendVarInt(6, value);
26109   }
26110   void set_result_logical(uint32_t value) {
26111     AppendVarInt(7, value);
26112   }
26113   void set_result_start(int32_t value) {
26114     AppendVarInt(8, value);
26115   }
26116   void set_result_group(uint32_t value) {
26117     AppendVarInt(9, value);
26118   }
26119   void set_result_len(int32_t value) {
26120     AppendVarInt(10, value);
26121   }
26122 };
26123 
26124 class Ext4MballocFreeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
26125  public:
26126   Ext4MballocFreeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
26127   explicit Ext4MballocFreeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
26128   explicit Ext4MballocFreeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
26129   bool has_dev() const { return at<1>().valid(); }
26130   uint64_t dev() const { return at<1>().as_uint64(); }
26131   bool has_ino() const { return at<2>().valid(); }
26132   uint64_t ino() const { return at<2>().as_uint64(); }
26133   bool has_result_start() const { return at<3>().valid(); }
26134   int32_t result_start() const { return at<3>().as_int32(); }
26135   bool has_result_group() const { return at<4>().valid(); }
26136   uint32_t result_group() const { return at<4>().as_uint32(); }
26137   bool has_result_len() const { return at<5>().valid(); }
26138   int32_t result_len() const { return at<5>().as_int32(); }
26139 };
26140 
26141 class Ext4MballocFreeFtraceEvent : public ::protozero::Message {
26142  public:
26143   using Decoder = Ext4MballocFreeFtraceEvent_Decoder;
26144   enum : int32_t {
26145     kDevFieldNumber = 1,
26146     kInoFieldNumber = 2,
26147     kResultStartFieldNumber = 3,
26148     kResultGroupFieldNumber = 4,
26149     kResultLenFieldNumber = 5,
26150   };
26151   void set_dev(uint64_t value) {
26152     AppendVarInt(1, value);
26153   }
26154   void set_ino(uint64_t value) {
26155     AppendVarInt(2, value);
26156   }
26157   void set_result_start(int32_t value) {
26158     AppendVarInt(3, value);
26159   }
26160   void set_result_group(uint32_t value) {
26161     AppendVarInt(4, value);
26162   }
26163   void set_result_len(int32_t value) {
26164     AppendVarInt(5, value);
26165   }
26166 };
26167 
26168 class Ext4MballocDiscardFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
26169  public:
26170   Ext4MballocDiscardFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
26171   explicit Ext4MballocDiscardFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
26172   explicit Ext4MballocDiscardFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
26173   bool has_dev() const { return at<1>().valid(); }
26174   uint64_t dev() const { return at<1>().as_uint64(); }
26175   bool has_ino() const { return at<2>().valid(); }
26176   uint64_t ino() const { return at<2>().as_uint64(); }
26177   bool has_result_start() const { return at<3>().valid(); }
26178   int32_t result_start() const { return at<3>().as_int32(); }
26179   bool has_result_group() const { return at<4>().valid(); }
26180   uint32_t result_group() const { return at<4>().as_uint32(); }
26181   bool has_result_len() const { return at<5>().valid(); }
26182   int32_t result_len() const { return at<5>().as_int32(); }
26183 };
26184 
26185 class Ext4MballocDiscardFtraceEvent : public ::protozero::Message {
26186  public:
26187   using Decoder = Ext4MballocDiscardFtraceEvent_Decoder;
26188   enum : int32_t {
26189     kDevFieldNumber = 1,
26190     kInoFieldNumber = 2,
26191     kResultStartFieldNumber = 3,
26192     kResultGroupFieldNumber = 4,
26193     kResultLenFieldNumber = 5,
26194   };
26195   void set_dev(uint64_t value) {
26196     AppendVarInt(1, value);
26197   }
26198   void set_ino(uint64_t value) {
26199     AppendVarInt(2, value);
26200   }
26201   void set_result_start(int32_t value) {
26202     AppendVarInt(3, value);
26203   }
26204   void set_result_group(uint32_t value) {
26205     AppendVarInt(4, value);
26206   }
26207   void set_result_len(int32_t value) {
26208     AppendVarInt(5, value);
26209   }
26210 };
26211 
26212 class Ext4MballocAllocFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/20, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
26213  public:
26214   Ext4MballocAllocFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
26215   explicit Ext4MballocAllocFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
26216   explicit Ext4MballocAllocFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
26217   bool has_dev() const { return at<1>().valid(); }
26218   uint64_t dev() const { return at<1>().as_uint64(); }
26219   bool has_ino() const { return at<2>().valid(); }
26220   uint64_t ino() const { return at<2>().as_uint64(); }
26221   bool has_orig_logical() const { return at<3>().valid(); }
26222   uint32_t orig_logical() const { return at<3>().as_uint32(); }
26223   bool has_orig_start() const { return at<4>().valid(); }
26224   int32_t orig_start() const { return at<4>().as_int32(); }
26225   bool has_orig_group() const { return at<5>().valid(); }
26226   uint32_t orig_group() const { return at<5>().as_uint32(); }
26227   bool has_orig_len() const { return at<6>().valid(); }
26228   int32_t orig_len() const { return at<6>().as_int32(); }
26229   bool has_goal_logical() const { return at<7>().valid(); }
26230   uint32_t goal_logical() const { return at<7>().as_uint32(); }
26231   bool has_goal_start() const { return at<8>().valid(); }
26232   int32_t goal_start() const { return at<8>().as_int32(); }
26233   bool has_goal_group() const { return at<9>().valid(); }
26234   uint32_t goal_group() const { return at<9>().as_uint32(); }
26235   bool has_goal_len() const { return at<10>().valid(); }
26236   int32_t goal_len() const { return at<10>().as_int32(); }
26237   bool has_result_logical() const { return at<11>().valid(); }
26238   uint32_t result_logical() const { return at<11>().as_uint32(); }
26239   bool has_result_start() const { return at<12>().valid(); }
26240   int32_t result_start() const { return at<12>().as_int32(); }
26241   bool has_result_group() const { return at<13>().valid(); }
26242   uint32_t result_group() const { return at<13>().as_uint32(); }
26243   bool has_result_len() const { return at<14>().valid(); }
26244   int32_t result_len() const { return at<14>().as_int32(); }
26245   bool has_found() const { return at<15>().valid(); }
26246   uint32_t found() const { return at<15>().as_uint32(); }
26247   bool has_groups() const { return at<16>().valid(); }
26248   uint32_t groups() const { return at<16>().as_uint32(); }
26249   bool has_buddy() const { return at<17>().valid(); }
26250   uint32_t buddy() const { return at<17>().as_uint32(); }
26251   bool has_flags() const { return at<18>().valid(); }
26252   uint32_t flags() const { return at<18>().as_uint32(); }
26253   bool has_tail() const { return at<19>().valid(); }
26254   uint32_t tail() const { return at<19>().as_uint32(); }
26255   bool has_cr() const { return at<20>().valid(); }
26256   uint32_t cr() const { return at<20>().as_uint32(); }
26257 };
26258 
26259 class Ext4MballocAllocFtraceEvent : public ::protozero::Message {
26260  public:
26261   using Decoder = Ext4MballocAllocFtraceEvent_Decoder;
26262   enum : int32_t {
26263     kDevFieldNumber = 1,
26264     kInoFieldNumber = 2,
26265     kOrigLogicalFieldNumber = 3,
26266     kOrigStartFieldNumber = 4,
26267     kOrigGroupFieldNumber = 5,
26268     kOrigLenFieldNumber = 6,
26269     kGoalLogicalFieldNumber = 7,
26270     kGoalStartFieldNumber = 8,
26271     kGoalGroupFieldNumber = 9,
26272     kGoalLenFieldNumber = 10,
26273     kResultLogicalFieldNumber = 11,
26274     kResultStartFieldNumber = 12,
26275     kResultGroupFieldNumber = 13,
26276     kResultLenFieldNumber = 14,
26277     kFoundFieldNumber = 15,
26278     kGroupsFieldNumber = 16,
26279     kBuddyFieldNumber = 17,
26280     kFlagsFieldNumber = 18,
26281     kTailFieldNumber = 19,
26282     kCrFieldNumber = 20,
26283   };
26284   void set_dev(uint64_t value) {
26285     AppendVarInt(1, value);
26286   }
26287   void set_ino(uint64_t value) {
26288     AppendVarInt(2, value);
26289   }
26290   void set_orig_logical(uint32_t value) {
26291     AppendVarInt(3, value);
26292   }
26293   void set_orig_start(int32_t value) {
26294     AppendVarInt(4, value);
26295   }
26296   void set_orig_group(uint32_t value) {
26297     AppendVarInt(5, value);
26298   }
26299   void set_orig_len(int32_t value) {
26300     AppendVarInt(6, value);
26301   }
26302   void set_goal_logical(uint32_t value) {
26303     AppendVarInt(7, value);
26304   }
26305   void set_goal_start(int32_t value) {
26306     AppendVarInt(8, value);
26307   }
26308   void set_goal_group(uint32_t value) {
26309     AppendVarInt(9, value);
26310   }
26311   void set_goal_len(int32_t value) {
26312     AppendVarInt(10, value);
26313   }
26314   void set_result_logical(uint32_t value) {
26315     AppendVarInt(11, value);
26316   }
26317   void set_result_start(int32_t value) {
26318     AppendVarInt(12, value);
26319   }
26320   void set_result_group(uint32_t value) {
26321     AppendVarInt(13, value);
26322   }
26323   void set_result_len(int32_t value) {
26324     AppendVarInt(14, value);
26325   }
26326   void set_found(uint32_t value) {
26327     AppendVarInt(15, value);
26328   }
26329   void set_groups(uint32_t value) {
26330     AppendVarInt(16, value);
26331   }
26332   void set_buddy(uint32_t value) {
26333     AppendVarInt(17, value);
26334   }
26335   void set_flags(uint32_t value) {
26336     AppendVarInt(18, value);
26337   }
26338   void set_tail(uint32_t value) {
26339     AppendVarInt(19, value);
26340   }
26341   void set_cr(uint32_t value) {
26342     AppendVarInt(20, value);
26343   }
26344 };
26345 
26346 class Ext4MbReleaseInodePaFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
26347  public:
26348   Ext4MbReleaseInodePaFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
26349   explicit Ext4MbReleaseInodePaFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
26350   explicit Ext4MbReleaseInodePaFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
26351   bool has_dev() const { return at<1>().valid(); }
26352   uint64_t dev() const { return at<1>().as_uint64(); }
26353   bool has_ino() const { return at<2>().valid(); }
26354   uint64_t ino() const { return at<2>().as_uint64(); }
26355   bool has_block() const { return at<3>().valid(); }
26356   uint64_t block() const { return at<3>().as_uint64(); }
26357   bool has_count() const { return at<4>().valid(); }
26358   uint32_t count() const { return at<4>().as_uint32(); }
26359 };
26360 
26361 class Ext4MbReleaseInodePaFtraceEvent : public ::protozero::Message {
26362  public:
26363   using Decoder = Ext4MbReleaseInodePaFtraceEvent_Decoder;
26364   enum : int32_t {
26365     kDevFieldNumber = 1,
26366     kInoFieldNumber = 2,
26367     kBlockFieldNumber = 3,
26368     kCountFieldNumber = 4,
26369   };
26370   void set_dev(uint64_t value) {
26371     AppendVarInt(1, value);
26372   }
26373   void set_ino(uint64_t value) {
26374     AppendVarInt(2, value);
26375   }
26376   void set_block(uint64_t value) {
26377     AppendVarInt(3, value);
26378   }
26379   void set_count(uint32_t value) {
26380     AppendVarInt(4, value);
26381   }
26382 };
26383 
26384 class Ext4MbReleaseGroupPaFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
26385  public:
26386   Ext4MbReleaseGroupPaFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
26387   explicit Ext4MbReleaseGroupPaFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
26388   explicit Ext4MbReleaseGroupPaFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
26389   bool has_dev() const { return at<1>().valid(); }
26390   uint64_t dev() const { return at<1>().as_uint64(); }
26391   bool has_pa_pstart() const { return at<2>().valid(); }
26392   uint64_t pa_pstart() const { return at<2>().as_uint64(); }
26393   bool has_pa_len() const { return at<3>().valid(); }
26394   uint32_t pa_len() const { return at<3>().as_uint32(); }
26395 };
26396 
26397 class Ext4MbReleaseGroupPaFtraceEvent : public ::protozero::Message {
26398  public:
26399   using Decoder = Ext4MbReleaseGroupPaFtraceEvent_Decoder;
26400   enum : int32_t {
26401     kDevFieldNumber = 1,
26402     kPaPstartFieldNumber = 2,
26403     kPaLenFieldNumber = 3,
26404   };
26405   void set_dev(uint64_t value) {
26406     AppendVarInt(1, value);
26407   }
26408   void set_pa_pstart(uint64_t value) {
26409     AppendVarInt(2, value);
26410   }
26411   void set_pa_len(uint32_t value) {
26412     AppendVarInt(3, value);
26413   }
26414 };
26415 
26416 class Ext4MbNewInodePaFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
26417  public:
26418   Ext4MbNewInodePaFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
26419   explicit Ext4MbNewInodePaFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
26420   explicit Ext4MbNewInodePaFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
26421   bool has_dev() const { return at<1>().valid(); }
26422   uint64_t dev() const { return at<1>().as_uint64(); }
26423   bool has_ino() const { return at<2>().valid(); }
26424   uint64_t ino() const { return at<2>().as_uint64(); }
26425   bool has_pa_pstart() const { return at<3>().valid(); }
26426   uint64_t pa_pstart() const { return at<3>().as_uint64(); }
26427   bool has_pa_lstart() const { return at<4>().valid(); }
26428   uint64_t pa_lstart() const { return at<4>().as_uint64(); }
26429   bool has_pa_len() const { return at<5>().valid(); }
26430   uint32_t pa_len() const { return at<5>().as_uint32(); }
26431 };
26432 
26433 class Ext4MbNewInodePaFtraceEvent : public ::protozero::Message {
26434  public:
26435   using Decoder = Ext4MbNewInodePaFtraceEvent_Decoder;
26436   enum : int32_t {
26437     kDevFieldNumber = 1,
26438     kInoFieldNumber = 2,
26439     kPaPstartFieldNumber = 3,
26440     kPaLstartFieldNumber = 4,
26441     kPaLenFieldNumber = 5,
26442   };
26443   void set_dev(uint64_t value) {
26444     AppendVarInt(1, value);
26445   }
26446   void set_ino(uint64_t value) {
26447     AppendVarInt(2, value);
26448   }
26449   void set_pa_pstart(uint64_t value) {
26450     AppendVarInt(3, value);
26451   }
26452   void set_pa_lstart(uint64_t value) {
26453     AppendVarInt(4, value);
26454   }
26455   void set_pa_len(uint32_t value) {
26456     AppendVarInt(5, value);
26457   }
26458 };
26459 
26460 class Ext4MbNewGroupPaFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
26461  public:
26462   Ext4MbNewGroupPaFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
26463   explicit Ext4MbNewGroupPaFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
26464   explicit Ext4MbNewGroupPaFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
26465   bool has_dev() const { return at<1>().valid(); }
26466   uint64_t dev() const { return at<1>().as_uint64(); }
26467   bool has_ino() const { return at<2>().valid(); }
26468   uint64_t ino() const { return at<2>().as_uint64(); }
26469   bool has_pa_pstart() const { return at<3>().valid(); }
26470   uint64_t pa_pstart() const { return at<3>().as_uint64(); }
26471   bool has_pa_lstart() const { return at<4>().valid(); }
26472   uint64_t pa_lstart() const { return at<4>().as_uint64(); }
26473   bool has_pa_len() const { return at<5>().valid(); }
26474   uint32_t pa_len() const { return at<5>().as_uint32(); }
26475 };
26476 
26477 class Ext4MbNewGroupPaFtraceEvent : public ::protozero::Message {
26478  public:
26479   using Decoder = Ext4MbNewGroupPaFtraceEvent_Decoder;
26480   enum : int32_t {
26481     kDevFieldNumber = 1,
26482     kInoFieldNumber = 2,
26483     kPaPstartFieldNumber = 3,
26484     kPaLstartFieldNumber = 4,
26485     kPaLenFieldNumber = 5,
26486   };
26487   void set_dev(uint64_t value) {
26488     AppendVarInt(1, value);
26489   }
26490   void set_ino(uint64_t value) {
26491     AppendVarInt(2, value);
26492   }
26493   void set_pa_pstart(uint64_t value) {
26494     AppendVarInt(3, value);
26495   }
26496   void set_pa_lstart(uint64_t value) {
26497     AppendVarInt(4, value);
26498   }
26499   void set_pa_len(uint32_t value) {
26500     AppendVarInt(5, value);
26501   }
26502 };
26503 
26504 class Ext4MbDiscardPreallocationsFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
26505  public:
26506   Ext4MbDiscardPreallocationsFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
26507   explicit Ext4MbDiscardPreallocationsFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
26508   explicit Ext4MbDiscardPreallocationsFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
26509   bool has_dev() const { return at<1>().valid(); }
26510   uint64_t dev() const { return at<1>().as_uint64(); }
26511   bool has_needed() const { return at<2>().valid(); }
26512   int32_t needed() const { return at<2>().as_int32(); }
26513 };
26514 
26515 class Ext4MbDiscardPreallocationsFtraceEvent : public ::protozero::Message {
26516  public:
26517   using Decoder = Ext4MbDiscardPreallocationsFtraceEvent_Decoder;
26518   enum : int32_t {
26519     kDevFieldNumber = 1,
26520     kNeededFieldNumber = 2,
26521   };
26522   void set_dev(uint64_t value) {
26523     AppendVarInt(1, value);
26524   }
26525   void set_needed(int32_t value) {
26526     AppendVarInt(2, value);
26527   }
26528 };
26529 
26530 class Ext4MbBuddyBitmapLoadFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
26531  public:
26532   Ext4MbBuddyBitmapLoadFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
26533   explicit Ext4MbBuddyBitmapLoadFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
26534   explicit Ext4MbBuddyBitmapLoadFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
26535   bool has_dev() const { return at<1>().valid(); }
26536   uint64_t dev() const { return at<1>().as_uint64(); }
26537   bool has_group() const { return at<2>().valid(); }
26538   uint32_t group() const { return at<2>().as_uint32(); }
26539 };
26540 
26541 class Ext4MbBuddyBitmapLoadFtraceEvent : public ::protozero::Message {
26542  public:
26543   using Decoder = Ext4MbBuddyBitmapLoadFtraceEvent_Decoder;
26544   enum : int32_t {
26545     kDevFieldNumber = 1,
26546     kGroupFieldNumber = 2,
26547   };
26548   void set_dev(uint64_t value) {
26549     AppendVarInt(1, value);
26550   }
26551   void set_group(uint32_t value) {
26552     AppendVarInt(2, value);
26553   }
26554 };
26555 
26556 class Ext4MbBitmapLoadFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
26557  public:
26558   Ext4MbBitmapLoadFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
26559   explicit Ext4MbBitmapLoadFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
26560   explicit Ext4MbBitmapLoadFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
26561   bool has_dev() const { return at<1>().valid(); }
26562   uint64_t dev() const { return at<1>().as_uint64(); }
26563   bool has_group() const { return at<2>().valid(); }
26564   uint32_t group() const { return at<2>().as_uint32(); }
26565 };
26566 
26567 class Ext4MbBitmapLoadFtraceEvent : public ::protozero::Message {
26568  public:
26569   using Decoder = Ext4MbBitmapLoadFtraceEvent_Decoder;
26570   enum : int32_t {
26571     kDevFieldNumber = 1,
26572     kGroupFieldNumber = 2,
26573   };
26574   void set_dev(uint64_t value) {
26575     AppendVarInt(1, value);
26576   }
26577   void set_group(uint32_t value) {
26578     AppendVarInt(2, value);
26579   }
26580 };
26581 
26582 class Ext4MarkInodeDirtyFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
26583  public:
26584   Ext4MarkInodeDirtyFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
26585   explicit Ext4MarkInodeDirtyFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
26586   explicit Ext4MarkInodeDirtyFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
26587   bool has_dev() const { return at<1>().valid(); }
26588   uint64_t dev() const { return at<1>().as_uint64(); }
26589   bool has_ino() const { return at<2>().valid(); }
26590   uint64_t ino() const { return at<2>().as_uint64(); }
26591   bool has_ip() const { return at<3>().valid(); }
26592   uint64_t ip() const { return at<3>().as_uint64(); }
26593 };
26594 
26595 class Ext4MarkInodeDirtyFtraceEvent : public ::protozero::Message {
26596  public:
26597   using Decoder = Ext4MarkInodeDirtyFtraceEvent_Decoder;
26598   enum : int32_t {
26599     kDevFieldNumber = 1,
26600     kInoFieldNumber = 2,
26601     kIpFieldNumber = 3,
26602   };
26603   void set_dev(uint64_t value) {
26604     AppendVarInt(1, value);
26605   }
26606   void set_ino(uint64_t value) {
26607     AppendVarInt(2, value);
26608   }
26609   void set_ip(uint64_t value) {
26610     AppendVarInt(3, value);
26611   }
26612 };
26613 
26614 class Ext4LoadInodeBitmapFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
26615  public:
26616   Ext4LoadInodeBitmapFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
26617   explicit Ext4LoadInodeBitmapFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
26618   explicit Ext4LoadInodeBitmapFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
26619   bool has_dev() const { return at<1>().valid(); }
26620   uint64_t dev() const { return at<1>().as_uint64(); }
26621   bool has_group() const { return at<2>().valid(); }
26622   uint32_t group() const { return at<2>().as_uint32(); }
26623 };
26624 
26625 class Ext4LoadInodeBitmapFtraceEvent : public ::protozero::Message {
26626  public:
26627   using Decoder = Ext4LoadInodeBitmapFtraceEvent_Decoder;
26628   enum : int32_t {
26629     kDevFieldNumber = 1,
26630     kGroupFieldNumber = 2,
26631   };
26632   void set_dev(uint64_t value) {
26633     AppendVarInt(1, value);
26634   }
26635   void set_group(uint32_t value) {
26636     AppendVarInt(2, value);
26637   }
26638 };
26639 
26640 class Ext4LoadInodeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
26641  public:
26642   Ext4LoadInodeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
26643   explicit Ext4LoadInodeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
26644   explicit Ext4LoadInodeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
26645   bool has_dev() const { return at<1>().valid(); }
26646   uint64_t dev() const { return at<1>().as_uint64(); }
26647   bool has_ino() const { return at<2>().valid(); }
26648   uint64_t ino() const { return at<2>().as_uint64(); }
26649 };
26650 
26651 class Ext4LoadInodeFtraceEvent : public ::protozero::Message {
26652  public:
26653   using Decoder = Ext4LoadInodeFtraceEvent_Decoder;
26654   enum : int32_t {
26655     kDevFieldNumber = 1,
26656     kInoFieldNumber = 2,
26657   };
26658   void set_dev(uint64_t value) {
26659     AppendVarInt(1, value);
26660   }
26661   void set_ino(uint64_t value) {
26662     AppendVarInt(2, value);
26663   }
26664 };
26665 
26666 class Ext4JournalledWriteEndFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
26667  public:
26668   Ext4JournalledWriteEndFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
26669   explicit Ext4JournalledWriteEndFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
26670   explicit Ext4JournalledWriteEndFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
26671   bool has_dev() const { return at<1>().valid(); }
26672   uint64_t dev() const { return at<1>().as_uint64(); }
26673   bool has_ino() const { return at<2>().valid(); }
26674   uint64_t ino() const { return at<2>().as_uint64(); }
26675   bool has_pos() const { return at<3>().valid(); }
26676   int64_t pos() const { return at<3>().as_int64(); }
26677   bool has_len() const { return at<4>().valid(); }
26678   uint32_t len() const { return at<4>().as_uint32(); }
26679   bool has_copied() const { return at<5>().valid(); }
26680   uint32_t copied() const { return at<5>().as_uint32(); }
26681 };
26682 
26683 class Ext4JournalledWriteEndFtraceEvent : public ::protozero::Message {
26684  public:
26685   using Decoder = Ext4JournalledWriteEndFtraceEvent_Decoder;
26686   enum : int32_t {
26687     kDevFieldNumber = 1,
26688     kInoFieldNumber = 2,
26689     kPosFieldNumber = 3,
26690     kLenFieldNumber = 4,
26691     kCopiedFieldNumber = 5,
26692   };
26693   void set_dev(uint64_t value) {
26694     AppendVarInt(1, value);
26695   }
26696   void set_ino(uint64_t value) {
26697     AppendVarInt(2, value);
26698   }
26699   void set_pos(int64_t value) {
26700     AppendVarInt(3, value);
26701   }
26702   void set_len(uint32_t value) {
26703     AppendVarInt(4, value);
26704   }
26705   void set_copied(uint32_t value) {
26706     AppendVarInt(5, value);
26707   }
26708 };
26709 
26710 class Ext4JournalledInvalidatepageFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
26711  public:
26712   Ext4JournalledInvalidatepageFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
26713   explicit Ext4JournalledInvalidatepageFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
26714   explicit Ext4JournalledInvalidatepageFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
26715   bool has_dev() const { return at<1>().valid(); }
26716   uint64_t dev() const { return at<1>().as_uint64(); }
26717   bool has_ino() const { return at<2>().valid(); }
26718   uint64_t ino() const { return at<2>().as_uint64(); }
26719   bool has_index() const { return at<3>().valid(); }
26720   uint64_t index() const { return at<3>().as_uint64(); }
26721   bool has_offset() const { return at<4>().valid(); }
26722   uint64_t offset() const { return at<4>().as_uint64(); }
26723   bool has_length() const { return at<5>().valid(); }
26724   uint32_t length() const { return at<5>().as_uint32(); }
26725 };
26726 
26727 class Ext4JournalledInvalidatepageFtraceEvent : public ::protozero::Message {
26728  public:
26729   using Decoder = Ext4JournalledInvalidatepageFtraceEvent_Decoder;
26730   enum : int32_t {
26731     kDevFieldNumber = 1,
26732     kInoFieldNumber = 2,
26733     kIndexFieldNumber = 3,
26734     kOffsetFieldNumber = 4,
26735     kLengthFieldNumber = 5,
26736   };
26737   void set_dev(uint64_t value) {
26738     AppendVarInt(1, value);
26739   }
26740   void set_ino(uint64_t value) {
26741     AppendVarInt(2, value);
26742   }
26743   void set_index(uint64_t value) {
26744     AppendVarInt(3, value);
26745   }
26746   void set_offset(uint64_t value) {
26747     AppendVarInt(4, value);
26748   }
26749   void set_length(uint32_t value) {
26750     AppendVarInt(5, value);
26751   }
26752 };
26753 
26754 class Ext4JournalStartReservedFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
26755  public:
26756   Ext4JournalStartReservedFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
26757   explicit Ext4JournalStartReservedFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
26758   explicit Ext4JournalStartReservedFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
26759   bool has_dev() const { return at<1>().valid(); }
26760   uint64_t dev() const { return at<1>().as_uint64(); }
26761   bool has_ip() const { return at<2>().valid(); }
26762   uint64_t ip() const { return at<2>().as_uint64(); }
26763   bool has_blocks() const { return at<3>().valid(); }
26764   int32_t blocks() const { return at<3>().as_int32(); }
26765 };
26766 
26767 class Ext4JournalStartReservedFtraceEvent : public ::protozero::Message {
26768  public:
26769   using Decoder = Ext4JournalStartReservedFtraceEvent_Decoder;
26770   enum : int32_t {
26771     kDevFieldNumber = 1,
26772     kIpFieldNumber = 2,
26773     kBlocksFieldNumber = 3,
26774   };
26775   void set_dev(uint64_t value) {
26776     AppendVarInt(1, value);
26777   }
26778   void set_ip(uint64_t value) {
26779     AppendVarInt(2, value);
26780   }
26781   void set_blocks(int32_t value) {
26782     AppendVarInt(3, value);
26783   }
26784 };
26785 
26786 class Ext4JournalStartFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
26787  public:
26788   Ext4JournalStartFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
26789   explicit Ext4JournalStartFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
26790   explicit Ext4JournalStartFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
26791   bool has_dev() const { return at<1>().valid(); }
26792   uint64_t dev() const { return at<1>().as_uint64(); }
26793   bool has_ip() const { return at<2>().valid(); }
26794   uint64_t ip() const { return at<2>().as_uint64(); }
26795   bool has_blocks() const { return at<3>().valid(); }
26796   int32_t blocks() const { return at<3>().as_int32(); }
26797   bool has_rsv_blocks() const { return at<4>().valid(); }
26798   int32_t rsv_blocks() const { return at<4>().as_int32(); }
26799   bool has_nblocks() const { return at<5>().valid(); }
26800   int32_t nblocks() const { return at<5>().as_int32(); }
26801 };
26802 
26803 class Ext4JournalStartFtraceEvent : public ::protozero::Message {
26804  public:
26805   using Decoder = Ext4JournalStartFtraceEvent_Decoder;
26806   enum : int32_t {
26807     kDevFieldNumber = 1,
26808     kIpFieldNumber = 2,
26809     kBlocksFieldNumber = 3,
26810     kRsvBlocksFieldNumber = 4,
26811     kNblocksFieldNumber = 5,
26812   };
26813   void set_dev(uint64_t value) {
26814     AppendVarInt(1, value);
26815   }
26816   void set_ip(uint64_t value) {
26817     AppendVarInt(2, value);
26818   }
26819   void set_blocks(int32_t value) {
26820     AppendVarInt(3, value);
26821   }
26822   void set_rsv_blocks(int32_t value) {
26823     AppendVarInt(4, value);
26824   }
26825   void set_nblocks(int32_t value) {
26826     AppendVarInt(5, value);
26827   }
26828 };
26829 
26830 class Ext4InvalidatepageFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
26831  public:
26832   Ext4InvalidatepageFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
26833   explicit Ext4InvalidatepageFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
26834   explicit Ext4InvalidatepageFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
26835   bool has_dev() const { return at<1>().valid(); }
26836   uint64_t dev() const { return at<1>().as_uint64(); }
26837   bool has_ino() const { return at<2>().valid(); }
26838   uint64_t ino() const { return at<2>().as_uint64(); }
26839   bool has_index() const { return at<3>().valid(); }
26840   uint64_t index() const { return at<3>().as_uint64(); }
26841   bool has_offset() const { return at<4>().valid(); }
26842   uint64_t offset() const { return at<4>().as_uint64(); }
26843   bool has_length() const { return at<5>().valid(); }
26844   uint32_t length() const { return at<5>().as_uint32(); }
26845 };
26846 
26847 class Ext4InvalidatepageFtraceEvent : public ::protozero::Message {
26848  public:
26849   using Decoder = Ext4InvalidatepageFtraceEvent_Decoder;
26850   enum : int32_t {
26851     kDevFieldNumber = 1,
26852     kInoFieldNumber = 2,
26853     kIndexFieldNumber = 3,
26854     kOffsetFieldNumber = 4,
26855     kLengthFieldNumber = 5,
26856   };
26857   void set_dev(uint64_t value) {
26858     AppendVarInt(1, value);
26859   }
26860   void set_ino(uint64_t value) {
26861     AppendVarInt(2, value);
26862   }
26863   void set_index(uint64_t value) {
26864     AppendVarInt(3, value);
26865   }
26866   void set_offset(uint64_t value) {
26867     AppendVarInt(4, value);
26868   }
26869   void set_length(uint32_t value) {
26870     AppendVarInt(5, value);
26871   }
26872 };
26873 
26874 class Ext4InsertRangeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
26875  public:
26876   Ext4InsertRangeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
26877   explicit Ext4InsertRangeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
26878   explicit Ext4InsertRangeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
26879   bool has_dev() const { return at<1>().valid(); }
26880   uint64_t dev() const { return at<1>().as_uint64(); }
26881   bool has_ino() const { return at<2>().valid(); }
26882   uint64_t ino() const { return at<2>().as_uint64(); }
26883   bool has_offset() const { return at<3>().valid(); }
26884   int64_t offset() const { return at<3>().as_int64(); }
26885   bool has_len() const { return at<4>().valid(); }
26886   int64_t len() const { return at<4>().as_int64(); }
26887 };
26888 
26889 class Ext4InsertRangeFtraceEvent : public ::protozero::Message {
26890  public:
26891   using Decoder = Ext4InsertRangeFtraceEvent_Decoder;
26892   enum : int32_t {
26893     kDevFieldNumber = 1,
26894     kInoFieldNumber = 2,
26895     kOffsetFieldNumber = 3,
26896     kLenFieldNumber = 4,
26897   };
26898   void set_dev(uint64_t value) {
26899     AppendVarInt(1, value);
26900   }
26901   void set_ino(uint64_t value) {
26902     AppendVarInt(2, value);
26903   }
26904   void set_offset(int64_t value) {
26905     AppendVarInt(3, value);
26906   }
26907   void set_len(int64_t value) {
26908     AppendVarInt(4, value);
26909   }
26910 };
26911 
26912 class Ext4IndMapBlocksExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
26913  public:
26914   Ext4IndMapBlocksExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
26915   explicit Ext4IndMapBlocksExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
26916   explicit Ext4IndMapBlocksExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
26917   bool has_dev() const { return at<1>().valid(); }
26918   uint64_t dev() const { return at<1>().as_uint64(); }
26919   bool has_ino() const { return at<2>().valid(); }
26920   uint64_t ino() const { return at<2>().as_uint64(); }
26921   bool has_flags() const { return at<3>().valid(); }
26922   uint32_t flags() const { return at<3>().as_uint32(); }
26923   bool has_pblk() const { return at<4>().valid(); }
26924   uint64_t pblk() const { return at<4>().as_uint64(); }
26925   bool has_lblk() const { return at<5>().valid(); }
26926   uint32_t lblk() const { return at<5>().as_uint32(); }
26927   bool has_len() const { return at<6>().valid(); }
26928   uint32_t len() const { return at<6>().as_uint32(); }
26929   bool has_mflags() const { return at<7>().valid(); }
26930   uint32_t mflags() const { return at<7>().as_uint32(); }
26931   bool has_ret() const { return at<8>().valid(); }
26932   int32_t ret() const { return at<8>().as_int32(); }
26933 };
26934 
26935 class Ext4IndMapBlocksExitFtraceEvent : public ::protozero::Message {
26936  public:
26937   using Decoder = Ext4IndMapBlocksExitFtraceEvent_Decoder;
26938   enum : int32_t {
26939     kDevFieldNumber = 1,
26940     kInoFieldNumber = 2,
26941     kFlagsFieldNumber = 3,
26942     kPblkFieldNumber = 4,
26943     kLblkFieldNumber = 5,
26944     kLenFieldNumber = 6,
26945     kMflagsFieldNumber = 7,
26946     kRetFieldNumber = 8,
26947   };
26948   void set_dev(uint64_t value) {
26949     AppendVarInt(1, value);
26950   }
26951   void set_ino(uint64_t value) {
26952     AppendVarInt(2, value);
26953   }
26954   void set_flags(uint32_t value) {
26955     AppendVarInt(3, value);
26956   }
26957   void set_pblk(uint64_t value) {
26958     AppendVarInt(4, value);
26959   }
26960   void set_lblk(uint32_t value) {
26961     AppendVarInt(5, value);
26962   }
26963   void set_len(uint32_t value) {
26964     AppendVarInt(6, value);
26965   }
26966   void set_mflags(uint32_t value) {
26967     AppendVarInt(7, value);
26968   }
26969   void set_ret(int32_t value) {
26970     AppendVarInt(8, value);
26971   }
26972 };
26973 
26974 class Ext4IndMapBlocksEnterFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
26975  public:
26976   Ext4IndMapBlocksEnterFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
26977   explicit Ext4IndMapBlocksEnterFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
26978   explicit Ext4IndMapBlocksEnterFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
26979   bool has_dev() const { return at<1>().valid(); }
26980   uint64_t dev() const { return at<1>().as_uint64(); }
26981   bool has_ino() const { return at<2>().valid(); }
26982   uint64_t ino() const { return at<2>().as_uint64(); }
26983   bool has_lblk() const { return at<3>().valid(); }
26984   uint32_t lblk() const { return at<3>().as_uint32(); }
26985   bool has_len() const { return at<4>().valid(); }
26986   uint32_t len() const { return at<4>().as_uint32(); }
26987   bool has_flags() const { return at<5>().valid(); }
26988   uint32_t flags() const { return at<5>().as_uint32(); }
26989 };
26990 
26991 class Ext4IndMapBlocksEnterFtraceEvent : public ::protozero::Message {
26992  public:
26993   using Decoder = Ext4IndMapBlocksEnterFtraceEvent_Decoder;
26994   enum : int32_t {
26995     kDevFieldNumber = 1,
26996     kInoFieldNumber = 2,
26997     kLblkFieldNumber = 3,
26998     kLenFieldNumber = 4,
26999     kFlagsFieldNumber = 5,
27000   };
27001   void set_dev(uint64_t value) {
27002     AppendVarInt(1, value);
27003   }
27004   void set_ino(uint64_t value) {
27005     AppendVarInt(2, value);
27006   }
27007   void set_lblk(uint32_t value) {
27008     AppendVarInt(3, value);
27009   }
27010   void set_len(uint32_t value) {
27011     AppendVarInt(4, value);
27012   }
27013   void set_flags(uint32_t value) {
27014     AppendVarInt(5, value);
27015   }
27016 };
27017 
27018 class Ext4GetReservedClusterAllocFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
27019  public:
27020   Ext4GetReservedClusterAllocFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
27021   explicit Ext4GetReservedClusterAllocFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
27022   explicit Ext4GetReservedClusterAllocFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
27023   bool has_dev() const { return at<1>().valid(); }
27024   uint64_t dev() const { return at<1>().as_uint64(); }
27025   bool has_ino() const { return at<2>().valid(); }
27026   uint64_t ino() const { return at<2>().as_uint64(); }
27027   bool has_lblk() const { return at<3>().valid(); }
27028   uint32_t lblk() const { return at<3>().as_uint32(); }
27029   bool has_len() const { return at<4>().valid(); }
27030   uint32_t len() const { return at<4>().as_uint32(); }
27031 };
27032 
27033 class Ext4GetReservedClusterAllocFtraceEvent : public ::protozero::Message {
27034  public:
27035   using Decoder = Ext4GetReservedClusterAllocFtraceEvent_Decoder;
27036   enum : int32_t {
27037     kDevFieldNumber = 1,
27038     kInoFieldNumber = 2,
27039     kLblkFieldNumber = 3,
27040     kLenFieldNumber = 4,
27041   };
27042   void set_dev(uint64_t value) {
27043     AppendVarInt(1, value);
27044   }
27045   void set_ino(uint64_t value) {
27046     AppendVarInt(2, value);
27047   }
27048   void set_lblk(uint32_t value) {
27049     AppendVarInt(3, value);
27050   }
27051   void set_len(uint32_t value) {
27052     AppendVarInt(4, value);
27053   }
27054 };
27055 
27056 class Ext4GetImpliedClusterAllocExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
27057  public:
27058   Ext4GetImpliedClusterAllocExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
27059   explicit Ext4GetImpliedClusterAllocExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
27060   explicit Ext4GetImpliedClusterAllocExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
27061   bool has_dev() const { return at<1>().valid(); }
27062   uint64_t dev() const { return at<1>().as_uint64(); }
27063   bool has_flags() const { return at<2>().valid(); }
27064   uint32_t flags() const { return at<2>().as_uint32(); }
27065   bool has_lblk() const { return at<3>().valid(); }
27066   uint32_t lblk() const { return at<3>().as_uint32(); }
27067   bool has_pblk() const { return at<4>().valid(); }
27068   uint64_t pblk() const { return at<4>().as_uint64(); }
27069   bool has_len() const { return at<5>().valid(); }
27070   uint32_t len() const { return at<5>().as_uint32(); }
27071   bool has_ret() const { return at<6>().valid(); }
27072   int32_t ret() const { return at<6>().as_int32(); }
27073 };
27074 
27075 class Ext4GetImpliedClusterAllocExitFtraceEvent : public ::protozero::Message {
27076  public:
27077   using Decoder = Ext4GetImpliedClusterAllocExitFtraceEvent_Decoder;
27078   enum : int32_t {
27079     kDevFieldNumber = 1,
27080     kFlagsFieldNumber = 2,
27081     kLblkFieldNumber = 3,
27082     kPblkFieldNumber = 4,
27083     kLenFieldNumber = 5,
27084     kRetFieldNumber = 6,
27085   };
27086   void set_dev(uint64_t value) {
27087     AppendVarInt(1, value);
27088   }
27089   void set_flags(uint32_t value) {
27090     AppendVarInt(2, value);
27091   }
27092   void set_lblk(uint32_t value) {
27093     AppendVarInt(3, value);
27094   }
27095   void set_pblk(uint64_t value) {
27096     AppendVarInt(4, value);
27097   }
27098   void set_len(uint32_t value) {
27099     AppendVarInt(5, value);
27100   }
27101   void set_ret(int32_t value) {
27102     AppendVarInt(6, value);
27103   }
27104 };
27105 
27106 class Ext4FreeInodeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
27107  public:
27108   Ext4FreeInodeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
27109   explicit Ext4FreeInodeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
27110   explicit Ext4FreeInodeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
27111   bool has_dev() const { return at<1>().valid(); }
27112   uint64_t dev() const { return at<1>().as_uint64(); }
27113   bool has_ino() const { return at<2>().valid(); }
27114   uint64_t ino() const { return at<2>().as_uint64(); }
27115   bool has_uid() const { return at<3>().valid(); }
27116   uint32_t uid() const { return at<3>().as_uint32(); }
27117   bool has_gid() const { return at<4>().valid(); }
27118   uint32_t gid() const { return at<4>().as_uint32(); }
27119   bool has_blocks() const { return at<5>().valid(); }
27120   uint64_t blocks() const { return at<5>().as_uint64(); }
27121   bool has_mode() const { return at<6>().valid(); }
27122   uint32_t mode() const { return at<6>().as_uint32(); }
27123 };
27124 
27125 class Ext4FreeInodeFtraceEvent : public ::protozero::Message {
27126  public:
27127   using Decoder = Ext4FreeInodeFtraceEvent_Decoder;
27128   enum : int32_t {
27129     kDevFieldNumber = 1,
27130     kInoFieldNumber = 2,
27131     kUidFieldNumber = 3,
27132     kGidFieldNumber = 4,
27133     kBlocksFieldNumber = 5,
27134     kModeFieldNumber = 6,
27135   };
27136   void set_dev(uint64_t value) {
27137     AppendVarInt(1, value);
27138   }
27139   void set_ino(uint64_t value) {
27140     AppendVarInt(2, value);
27141   }
27142   void set_uid(uint32_t value) {
27143     AppendVarInt(3, value);
27144   }
27145   void set_gid(uint32_t value) {
27146     AppendVarInt(4, value);
27147   }
27148   void set_blocks(uint64_t value) {
27149     AppendVarInt(5, value);
27150   }
27151   void set_mode(uint32_t value) {
27152     AppendVarInt(6, value);
27153   }
27154 };
27155 
27156 class Ext4FreeBlocksFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
27157  public:
27158   Ext4FreeBlocksFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
27159   explicit Ext4FreeBlocksFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
27160   explicit Ext4FreeBlocksFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
27161   bool has_dev() const { return at<1>().valid(); }
27162   uint64_t dev() const { return at<1>().as_uint64(); }
27163   bool has_ino() const { return at<2>().valid(); }
27164   uint64_t ino() const { return at<2>().as_uint64(); }
27165   bool has_block() const { return at<3>().valid(); }
27166   uint64_t block() const { return at<3>().as_uint64(); }
27167   bool has_count() const { return at<4>().valid(); }
27168   uint64_t count() const { return at<4>().as_uint64(); }
27169   bool has_flags() const { return at<5>().valid(); }
27170   int32_t flags() const { return at<5>().as_int32(); }
27171   bool has_mode() const { return at<6>().valid(); }
27172   uint32_t mode() const { return at<6>().as_uint32(); }
27173 };
27174 
27175 class Ext4FreeBlocksFtraceEvent : public ::protozero::Message {
27176  public:
27177   using Decoder = Ext4FreeBlocksFtraceEvent_Decoder;
27178   enum : int32_t {
27179     kDevFieldNumber = 1,
27180     kInoFieldNumber = 2,
27181     kBlockFieldNumber = 3,
27182     kCountFieldNumber = 4,
27183     kFlagsFieldNumber = 5,
27184     kModeFieldNumber = 6,
27185   };
27186   void set_dev(uint64_t value) {
27187     AppendVarInt(1, value);
27188   }
27189   void set_ino(uint64_t value) {
27190     AppendVarInt(2, value);
27191   }
27192   void set_block(uint64_t value) {
27193     AppendVarInt(3, value);
27194   }
27195   void set_count(uint64_t value) {
27196     AppendVarInt(4, value);
27197   }
27198   void set_flags(int32_t value) {
27199     AppendVarInt(5, value);
27200   }
27201   void set_mode(uint32_t value) {
27202     AppendVarInt(6, value);
27203   }
27204 };
27205 
27206 class Ext4ForgetFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
27207  public:
27208   Ext4ForgetFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
27209   explicit Ext4ForgetFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
27210   explicit Ext4ForgetFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
27211   bool has_dev() const { return at<1>().valid(); }
27212   uint64_t dev() const { return at<1>().as_uint64(); }
27213   bool has_ino() const { return at<2>().valid(); }
27214   uint64_t ino() const { return at<2>().as_uint64(); }
27215   bool has_block() const { return at<3>().valid(); }
27216   uint64_t block() const { return at<3>().as_uint64(); }
27217   bool has_is_metadata() const { return at<4>().valid(); }
27218   int32_t is_metadata() const { return at<4>().as_int32(); }
27219   bool has_mode() const { return at<5>().valid(); }
27220   uint32_t mode() const { return at<5>().as_uint32(); }
27221 };
27222 
27223 class Ext4ForgetFtraceEvent : public ::protozero::Message {
27224  public:
27225   using Decoder = Ext4ForgetFtraceEvent_Decoder;
27226   enum : int32_t {
27227     kDevFieldNumber = 1,
27228     kInoFieldNumber = 2,
27229     kBlockFieldNumber = 3,
27230     kIsMetadataFieldNumber = 4,
27231     kModeFieldNumber = 5,
27232   };
27233   void set_dev(uint64_t value) {
27234     AppendVarInt(1, value);
27235   }
27236   void set_ino(uint64_t value) {
27237     AppendVarInt(2, value);
27238   }
27239   void set_block(uint64_t value) {
27240     AppendVarInt(3, value);
27241   }
27242   void set_is_metadata(int32_t value) {
27243     AppendVarInt(4, value);
27244   }
27245   void set_mode(uint32_t value) {
27246     AppendVarInt(5, value);
27247   }
27248 };
27249 
27250 class Ext4FindDelallocRangeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
27251  public:
27252   Ext4FindDelallocRangeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
27253   explicit Ext4FindDelallocRangeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
27254   explicit Ext4FindDelallocRangeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
27255   bool has_dev() const { return at<1>().valid(); }
27256   uint64_t dev() const { return at<1>().as_uint64(); }
27257   bool has_ino() const { return at<2>().valid(); }
27258   uint64_t ino() const { return at<2>().as_uint64(); }
27259   bool has_from() const { return at<3>().valid(); }
27260   uint32_t from() const { return at<3>().as_uint32(); }
27261   bool has_to() const { return at<4>().valid(); }
27262   uint32_t to() const { return at<4>().as_uint32(); }
27263   bool has_reverse() const { return at<5>().valid(); }
27264   int32_t reverse() const { return at<5>().as_int32(); }
27265   bool has_found() const { return at<6>().valid(); }
27266   int32_t found() const { return at<6>().as_int32(); }
27267   bool has_found_blk() const { return at<7>().valid(); }
27268   uint32_t found_blk() const { return at<7>().as_uint32(); }
27269 };
27270 
27271 class Ext4FindDelallocRangeFtraceEvent : public ::protozero::Message {
27272  public:
27273   using Decoder = Ext4FindDelallocRangeFtraceEvent_Decoder;
27274   enum : int32_t {
27275     kDevFieldNumber = 1,
27276     kInoFieldNumber = 2,
27277     kFromFieldNumber = 3,
27278     kToFieldNumber = 4,
27279     kReverseFieldNumber = 5,
27280     kFoundFieldNumber = 6,
27281     kFoundBlkFieldNumber = 7,
27282   };
27283   void set_dev(uint64_t value) {
27284     AppendVarInt(1, value);
27285   }
27286   void set_ino(uint64_t value) {
27287     AppendVarInt(2, value);
27288   }
27289   void set_from(uint32_t value) {
27290     AppendVarInt(3, value);
27291   }
27292   void set_to(uint32_t value) {
27293     AppendVarInt(4, value);
27294   }
27295   void set_reverse(int32_t value) {
27296     AppendVarInt(5, value);
27297   }
27298   void set_found(int32_t value) {
27299     AppendVarInt(6, value);
27300   }
27301   void set_found_blk(uint32_t value) {
27302     AppendVarInt(7, value);
27303   }
27304 };
27305 
27306 class Ext4FallocateExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
27307  public:
27308   Ext4FallocateExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
27309   explicit Ext4FallocateExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
27310   explicit Ext4FallocateExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
27311   bool has_dev() const { return at<1>().valid(); }
27312   uint64_t dev() const { return at<1>().as_uint64(); }
27313   bool has_ino() const { return at<2>().valid(); }
27314   uint64_t ino() const { return at<2>().as_uint64(); }
27315   bool has_pos() const { return at<3>().valid(); }
27316   int64_t pos() const { return at<3>().as_int64(); }
27317   bool has_blocks() const { return at<4>().valid(); }
27318   uint32_t blocks() const { return at<4>().as_uint32(); }
27319   bool has_ret() const { return at<5>().valid(); }
27320   int32_t ret() const { return at<5>().as_int32(); }
27321 };
27322 
27323 class Ext4FallocateExitFtraceEvent : public ::protozero::Message {
27324  public:
27325   using Decoder = Ext4FallocateExitFtraceEvent_Decoder;
27326   enum : int32_t {
27327     kDevFieldNumber = 1,
27328     kInoFieldNumber = 2,
27329     kPosFieldNumber = 3,
27330     kBlocksFieldNumber = 4,
27331     kRetFieldNumber = 5,
27332   };
27333   void set_dev(uint64_t value) {
27334     AppendVarInt(1, value);
27335   }
27336   void set_ino(uint64_t value) {
27337     AppendVarInt(2, value);
27338   }
27339   void set_pos(int64_t value) {
27340     AppendVarInt(3, value);
27341   }
27342   void set_blocks(uint32_t value) {
27343     AppendVarInt(4, value);
27344   }
27345   void set_ret(int32_t value) {
27346     AppendVarInt(5, value);
27347   }
27348 };
27349 
27350 class Ext4FallocateEnterFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
27351  public:
27352   Ext4FallocateEnterFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
27353   explicit Ext4FallocateEnterFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
27354   explicit Ext4FallocateEnterFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
27355   bool has_dev() const { return at<1>().valid(); }
27356   uint64_t dev() const { return at<1>().as_uint64(); }
27357   bool has_ino() const { return at<2>().valid(); }
27358   uint64_t ino() const { return at<2>().as_uint64(); }
27359   bool has_offset() const { return at<3>().valid(); }
27360   int64_t offset() const { return at<3>().as_int64(); }
27361   bool has_len() const { return at<4>().valid(); }
27362   int64_t len() const { return at<4>().as_int64(); }
27363   bool has_mode() const { return at<5>().valid(); }
27364   int32_t mode() const { return at<5>().as_int32(); }
27365   bool has_pos() const { return at<6>().valid(); }
27366   int64_t pos() const { return at<6>().as_int64(); }
27367 };
27368 
27369 class Ext4FallocateEnterFtraceEvent : public ::protozero::Message {
27370  public:
27371   using Decoder = Ext4FallocateEnterFtraceEvent_Decoder;
27372   enum : int32_t {
27373     kDevFieldNumber = 1,
27374     kInoFieldNumber = 2,
27375     kOffsetFieldNumber = 3,
27376     kLenFieldNumber = 4,
27377     kModeFieldNumber = 5,
27378     kPosFieldNumber = 6,
27379   };
27380   void set_dev(uint64_t value) {
27381     AppendVarInt(1, value);
27382   }
27383   void set_ino(uint64_t value) {
27384     AppendVarInt(2, value);
27385   }
27386   void set_offset(int64_t value) {
27387     AppendVarInt(3, value);
27388   }
27389   void set_len(int64_t value) {
27390     AppendVarInt(4, value);
27391   }
27392   void set_mode(int32_t value) {
27393     AppendVarInt(5, value);
27394   }
27395   void set_pos(int64_t value) {
27396     AppendVarInt(6, value);
27397   }
27398 };
27399 
27400 class Ext4ExtShowExtentFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
27401  public:
27402   Ext4ExtShowExtentFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
27403   explicit Ext4ExtShowExtentFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
27404   explicit Ext4ExtShowExtentFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
27405   bool has_dev() const { return at<1>().valid(); }
27406   uint64_t dev() const { return at<1>().as_uint64(); }
27407   bool has_ino() const { return at<2>().valid(); }
27408   uint64_t ino() const { return at<2>().as_uint64(); }
27409   bool has_pblk() const { return at<3>().valid(); }
27410   uint64_t pblk() const { return at<3>().as_uint64(); }
27411   bool has_lblk() const { return at<4>().valid(); }
27412   uint32_t lblk() const { return at<4>().as_uint32(); }
27413   bool has_len() const { return at<5>().valid(); }
27414   uint32_t len() const { return at<5>().as_uint32(); }
27415 };
27416 
27417 class Ext4ExtShowExtentFtraceEvent : public ::protozero::Message {
27418  public:
27419   using Decoder = Ext4ExtShowExtentFtraceEvent_Decoder;
27420   enum : int32_t {
27421     kDevFieldNumber = 1,
27422     kInoFieldNumber = 2,
27423     kPblkFieldNumber = 3,
27424     kLblkFieldNumber = 4,
27425     kLenFieldNumber = 5,
27426   };
27427   void set_dev(uint64_t value) {
27428     AppendVarInt(1, value);
27429   }
27430   void set_ino(uint64_t value) {
27431     AppendVarInt(2, value);
27432   }
27433   void set_pblk(uint64_t value) {
27434     AppendVarInt(3, value);
27435   }
27436   void set_lblk(uint32_t value) {
27437     AppendVarInt(4, value);
27438   }
27439   void set_len(uint32_t value) {
27440     AppendVarInt(5, value);
27441   }
27442 };
27443 
27444 class Ext4ExtRmLeafFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
27445  public:
27446   Ext4ExtRmLeafFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
27447   explicit Ext4ExtRmLeafFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
27448   explicit Ext4ExtRmLeafFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
27449   bool has_dev() const { return at<1>().valid(); }
27450   uint64_t dev() const { return at<1>().as_uint64(); }
27451   bool has_ino() const { return at<2>().valid(); }
27452   uint64_t ino() const { return at<2>().as_uint64(); }
27453   bool has_partial() const { return at<3>().valid(); }
27454   int64_t partial() const { return at<3>().as_int64(); }
27455   bool has_start() const { return at<4>().valid(); }
27456   uint32_t start() const { return at<4>().as_uint32(); }
27457   bool has_ee_lblk() const { return at<5>().valid(); }
27458   uint32_t ee_lblk() const { return at<5>().as_uint32(); }
27459   bool has_ee_pblk() const { return at<6>().valid(); }
27460   uint64_t ee_pblk() const { return at<6>().as_uint64(); }
27461   bool has_ee_len() const { return at<7>().valid(); }
27462   int32_t ee_len() const { return at<7>().as_int32(); }
27463 };
27464 
27465 class Ext4ExtRmLeafFtraceEvent : public ::protozero::Message {
27466  public:
27467   using Decoder = Ext4ExtRmLeafFtraceEvent_Decoder;
27468   enum : int32_t {
27469     kDevFieldNumber = 1,
27470     kInoFieldNumber = 2,
27471     kPartialFieldNumber = 3,
27472     kStartFieldNumber = 4,
27473     kEeLblkFieldNumber = 5,
27474     kEePblkFieldNumber = 6,
27475     kEeLenFieldNumber = 7,
27476   };
27477   void set_dev(uint64_t value) {
27478     AppendVarInt(1, value);
27479   }
27480   void set_ino(uint64_t value) {
27481     AppendVarInt(2, value);
27482   }
27483   void set_partial(int64_t value) {
27484     AppendVarInt(3, value);
27485   }
27486   void set_start(uint32_t value) {
27487     AppendVarInt(4, value);
27488   }
27489   void set_ee_lblk(uint32_t value) {
27490     AppendVarInt(5, value);
27491   }
27492   void set_ee_pblk(uint64_t value) {
27493     AppendVarInt(6, value);
27494   }
27495   void set_ee_len(int32_t value) {
27496     AppendVarInt(7, value);
27497   }
27498 };
27499 
27500 class Ext4ExtRmIdxFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
27501  public:
27502   Ext4ExtRmIdxFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
27503   explicit Ext4ExtRmIdxFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
27504   explicit Ext4ExtRmIdxFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
27505   bool has_dev() const { return at<1>().valid(); }
27506   uint64_t dev() const { return at<1>().as_uint64(); }
27507   bool has_ino() const { return at<2>().valid(); }
27508   uint64_t ino() const { return at<2>().as_uint64(); }
27509   bool has_pblk() const { return at<3>().valid(); }
27510   uint64_t pblk() const { return at<3>().as_uint64(); }
27511 };
27512 
27513 class Ext4ExtRmIdxFtraceEvent : public ::protozero::Message {
27514  public:
27515   using Decoder = Ext4ExtRmIdxFtraceEvent_Decoder;
27516   enum : int32_t {
27517     kDevFieldNumber = 1,
27518     kInoFieldNumber = 2,
27519     kPblkFieldNumber = 3,
27520   };
27521   void set_dev(uint64_t value) {
27522     AppendVarInt(1, value);
27523   }
27524   void set_ino(uint64_t value) {
27525     AppendVarInt(2, value);
27526   }
27527   void set_pblk(uint64_t value) {
27528     AppendVarInt(3, value);
27529   }
27530 };
27531 
27532 class Ext4ExtRemoveSpaceDoneFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
27533  public:
27534   Ext4ExtRemoveSpaceDoneFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
27535   explicit Ext4ExtRemoveSpaceDoneFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
27536   explicit Ext4ExtRemoveSpaceDoneFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
27537   bool has_dev() const { return at<1>().valid(); }
27538   uint64_t dev() const { return at<1>().as_uint64(); }
27539   bool has_ino() const { return at<2>().valid(); }
27540   uint64_t ino() const { return at<2>().as_uint64(); }
27541   bool has_start() const { return at<3>().valid(); }
27542   uint32_t start() const { return at<3>().as_uint32(); }
27543   bool has_end() const { return at<4>().valid(); }
27544   uint32_t end() const { return at<4>().as_uint32(); }
27545   bool has_depth() const { return at<5>().valid(); }
27546   int32_t depth() const { return at<5>().as_int32(); }
27547   bool has_partial() const { return at<6>().valid(); }
27548   int64_t partial() const { return at<6>().as_int64(); }
27549   bool has_eh_entries() const { return at<7>().valid(); }
27550   uint32_t eh_entries() const { return at<7>().as_uint32(); }
27551 };
27552 
27553 class Ext4ExtRemoveSpaceDoneFtraceEvent : public ::protozero::Message {
27554  public:
27555   using Decoder = Ext4ExtRemoveSpaceDoneFtraceEvent_Decoder;
27556   enum : int32_t {
27557     kDevFieldNumber = 1,
27558     kInoFieldNumber = 2,
27559     kStartFieldNumber = 3,
27560     kEndFieldNumber = 4,
27561     kDepthFieldNumber = 5,
27562     kPartialFieldNumber = 6,
27563     kEhEntriesFieldNumber = 7,
27564   };
27565   void set_dev(uint64_t value) {
27566     AppendVarInt(1, value);
27567   }
27568   void set_ino(uint64_t value) {
27569     AppendVarInt(2, value);
27570   }
27571   void set_start(uint32_t value) {
27572     AppendVarInt(3, value);
27573   }
27574   void set_end(uint32_t value) {
27575     AppendVarInt(4, value);
27576   }
27577   void set_depth(int32_t value) {
27578     AppendVarInt(5, value);
27579   }
27580   void set_partial(int64_t value) {
27581     AppendVarInt(6, value);
27582   }
27583   void set_eh_entries(uint32_t value) {
27584     AppendVarInt(7, value);
27585   }
27586 };
27587 
27588 class Ext4ExtRemoveSpaceFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
27589  public:
27590   Ext4ExtRemoveSpaceFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
27591   explicit Ext4ExtRemoveSpaceFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
27592   explicit Ext4ExtRemoveSpaceFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
27593   bool has_dev() const { return at<1>().valid(); }
27594   uint64_t dev() const { return at<1>().as_uint64(); }
27595   bool has_ino() const { return at<2>().valid(); }
27596   uint64_t ino() const { return at<2>().as_uint64(); }
27597   bool has_start() const { return at<3>().valid(); }
27598   uint32_t start() const { return at<3>().as_uint32(); }
27599   bool has_end() const { return at<4>().valid(); }
27600   uint32_t end() const { return at<4>().as_uint32(); }
27601   bool has_depth() const { return at<5>().valid(); }
27602   int32_t depth() const { return at<5>().as_int32(); }
27603 };
27604 
27605 class Ext4ExtRemoveSpaceFtraceEvent : public ::protozero::Message {
27606  public:
27607   using Decoder = Ext4ExtRemoveSpaceFtraceEvent_Decoder;
27608   enum : int32_t {
27609     kDevFieldNumber = 1,
27610     kInoFieldNumber = 2,
27611     kStartFieldNumber = 3,
27612     kEndFieldNumber = 4,
27613     kDepthFieldNumber = 5,
27614   };
27615   void set_dev(uint64_t value) {
27616     AppendVarInt(1, value);
27617   }
27618   void set_ino(uint64_t value) {
27619     AppendVarInt(2, value);
27620   }
27621   void set_start(uint32_t value) {
27622     AppendVarInt(3, value);
27623   }
27624   void set_end(uint32_t value) {
27625     AppendVarInt(4, value);
27626   }
27627   void set_depth(int32_t value) {
27628     AppendVarInt(5, value);
27629   }
27630 };
27631 
27632 class Ext4ExtPutInCacheFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
27633  public:
27634   Ext4ExtPutInCacheFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
27635   explicit Ext4ExtPutInCacheFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
27636   explicit Ext4ExtPutInCacheFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
27637   bool has_dev() const { return at<1>().valid(); }
27638   uint64_t dev() const { return at<1>().as_uint64(); }
27639   bool has_ino() const { return at<2>().valid(); }
27640   uint64_t ino() const { return at<2>().as_uint64(); }
27641   bool has_lblk() const { return at<3>().valid(); }
27642   uint32_t lblk() const { return at<3>().as_uint32(); }
27643   bool has_len() const { return at<4>().valid(); }
27644   uint32_t len() const { return at<4>().as_uint32(); }
27645   bool has_start() const { return at<5>().valid(); }
27646   uint64_t start() const { return at<5>().as_uint64(); }
27647 };
27648 
27649 class Ext4ExtPutInCacheFtraceEvent : public ::protozero::Message {
27650  public:
27651   using Decoder = Ext4ExtPutInCacheFtraceEvent_Decoder;
27652   enum : int32_t {
27653     kDevFieldNumber = 1,
27654     kInoFieldNumber = 2,
27655     kLblkFieldNumber = 3,
27656     kLenFieldNumber = 4,
27657     kStartFieldNumber = 5,
27658   };
27659   void set_dev(uint64_t value) {
27660     AppendVarInt(1, value);
27661   }
27662   void set_ino(uint64_t value) {
27663     AppendVarInt(2, value);
27664   }
27665   void set_lblk(uint32_t value) {
27666     AppendVarInt(3, value);
27667   }
27668   void set_len(uint32_t value) {
27669     AppendVarInt(4, value);
27670   }
27671   void set_start(uint64_t value) {
27672     AppendVarInt(5, value);
27673   }
27674 };
27675 
27676 class Ext4ExtMapBlocksExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
27677  public:
27678   Ext4ExtMapBlocksExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
27679   explicit Ext4ExtMapBlocksExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
27680   explicit Ext4ExtMapBlocksExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
27681   bool has_dev() const { return at<1>().valid(); }
27682   uint64_t dev() const { return at<1>().as_uint64(); }
27683   bool has_ino() const { return at<2>().valid(); }
27684   uint64_t ino() const { return at<2>().as_uint64(); }
27685   bool has_flags() const { return at<3>().valid(); }
27686   uint32_t flags() const { return at<3>().as_uint32(); }
27687   bool has_pblk() const { return at<4>().valid(); }
27688   uint64_t pblk() const { return at<4>().as_uint64(); }
27689   bool has_lblk() const { return at<5>().valid(); }
27690   uint32_t lblk() const { return at<5>().as_uint32(); }
27691   bool has_len() const { return at<6>().valid(); }
27692   uint32_t len() const { return at<6>().as_uint32(); }
27693   bool has_mflags() const { return at<7>().valid(); }
27694   uint32_t mflags() const { return at<7>().as_uint32(); }
27695   bool has_ret() const { return at<8>().valid(); }
27696   int32_t ret() const { return at<8>().as_int32(); }
27697 };
27698 
27699 class Ext4ExtMapBlocksExitFtraceEvent : public ::protozero::Message {
27700  public:
27701   using Decoder = Ext4ExtMapBlocksExitFtraceEvent_Decoder;
27702   enum : int32_t {
27703     kDevFieldNumber = 1,
27704     kInoFieldNumber = 2,
27705     kFlagsFieldNumber = 3,
27706     kPblkFieldNumber = 4,
27707     kLblkFieldNumber = 5,
27708     kLenFieldNumber = 6,
27709     kMflagsFieldNumber = 7,
27710     kRetFieldNumber = 8,
27711   };
27712   void set_dev(uint64_t value) {
27713     AppendVarInt(1, value);
27714   }
27715   void set_ino(uint64_t value) {
27716     AppendVarInt(2, value);
27717   }
27718   void set_flags(uint32_t value) {
27719     AppendVarInt(3, value);
27720   }
27721   void set_pblk(uint64_t value) {
27722     AppendVarInt(4, value);
27723   }
27724   void set_lblk(uint32_t value) {
27725     AppendVarInt(5, value);
27726   }
27727   void set_len(uint32_t value) {
27728     AppendVarInt(6, value);
27729   }
27730   void set_mflags(uint32_t value) {
27731     AppendVarInt(7, value);
27732   }
27733   void set_ret(int32_t value) {
27734     AppendVarInt(8, value);
27735   }
27736 };
27737 
27738 class Ext4ExtMapBlocksEnterFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
27739  public:
27740   Ext4ExtMapBlocksEnterFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
27741   explicit Ext4ExtMapBlocksEnterFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
27742   explicit Ext4ExtMapBlocksEnterFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
27743   bool has_dev() const { return at<1>().valid(); }
27744   uint64_t dev() const { return at<1>().as_uint64(); }
27745   bool has_ino() const { return at<2>().valid(); }
27746   uint64_t ino() const { return at<2>().as_uint64(); }
27747   bool has_lblk() const { return at<3>().valid(); }
27748   uint32_t lblk() const { return at<3>().as_uint32(); }
27749   bool has_len() const { return at<4>().valid(); }
27750   uint32_t len() const { return at<4>().as_uint32(); }
27751   bool has_flags() const { return at<5>().valid(); }
27752   uint32_t flags() const { return at<5>().as_uint32(); }
27753 };
27754 
27755 class Ext4ExtMapBlocksEnterFtraceEvent : public ::protozero::Message {
27756  public:
27757   using Decoder = Ext4ExtMapBlocksEnterFtraceEvent_Decoder;
27758   enum : int32_t {
27759     kDevFieldNumber = 1,
27760     kInoFieldNumber = 2,
27761     kLblkFieldNumber = 3,
27762     kLenFieldNumber = 4,
27763     kFlagsFieldNumber = 5,
27764   };
27765   void set_dev(uint64_t value) {
27766     AppendVarInt(1, value);
27767   }
27768   void set_ino(uint64_t value) {
27769     AppendVarInt(2, value);
27770   }
27771   void set_lblk(uint32_t value) {
27772     AppendVarInt(3, value);
27773   }
27774   void set_len(uint32_t value) {
27775     AppendVarInt(4, value);
27776   }
27777   void set_flags(uint32_t value) {
27778     AppendVarInt(5, value);
27779   }
27780 };
27781 
27782 class Ext4ExtLoadExtentFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
27783  public:
27784   Ext4ExtLoadExtentFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
27785   explicit Ext4ExtLoadExtentFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
27786   explicit Ext4ExtLoadExtentFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
27787   bool has_dev() const { return at<1>().valid(); }
27788   uint64_t dev() const { return at<1>().as_uint64(); }
27789   bool has_ino() const { return at<2>().valid(); }
27790   uint64_t ino() const { return at<2>().as_uint64(); }
27791   bool has_pblk() const { return at<3>().valid(); }
27792   uint64_t pblk() const { return at<3>().as_uint64(); }
27793   bool has_lblk() const { return at<4>().valid(); }
27794   uint32_t lblk() const { return at<4>().as_uint32(); }
27795 };
27796 
27797 class Ext4ExtLoadExtentFtraceEvent : public ::protozero::Message {
27798  public:
27799   using Decoder = Ext4ExtLoadExtentFtraceEvent_Decoder;
27800   enum : int32_t {
27801     kDevFieldNumber = 1,
27802     kInoFieldNumber = 2,
27803     kPblkFieldNumber = 3,
27804     kLblkFieldNumber = 4,
27805   };
27806   void set_dev(uint64_t value) {
27807     AppendVarInt(1, value);
27808   }
27809   void set_ino(uint64_t value) {
27810     AppendVarInt(2, value);
27811   }
27812   void set_pblk(uint64_t value) {
27813     AppendVarInt(3, value);
27814   }
27815   void set_lblk(uint32_t value) {
27816     AppendVarInt(4, value);
27817   }
27818 };
27819 
27820 class Ext4ExtInCacheFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
27821  public:
27822   Ext4ExtInCacheFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
27823   explicit Ext4ExtInCacheFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
27824   explicit Ext4ExtInCacheFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
27825   bool has_dev() const { return at<1>().valid(); }
27826   uint64_t dev() const { return at<1>().as_uint64(); }
27827   bool has_ino() const { return at<2>().valid(); }
27828   uint64_t ino() const { return at<2>().as_uint64(); }
27829   bool has_lblk() const { return at<3>().valid(); }
27830   uint32_t lblk() const { return at<3>().as_uint32(); }
27831   bool has_ret() const { return at<4>().valid(); }
27832   int32_t ret() const { return at<4>().as_int32(); }
27833 };
27834 
27835 class Ext4ExtInCacheFtraceEvent : public ::protozero::Message {
27836  public:
27837   using Decoder = Ext4ExtInCacheFtraceEvent_Decoder;
27838   enum : int32_t {
27839     kDevFieldNumber = 1,
27840     kInoFieldNumber = 2,
27841     kLblkFieldNumber = 3,
27842     kRetFieldNumber = 4,
27843   };
27844   void set_dev(uint64_t value) {
27845     AppendVarInt(1, value);
27846   }
27847   void set_ino(uint64_t value) {
27848     AppendVarInt(2, value);
27849   }
27850   void set_lblk(uint32_t value) {
27851     AppendVarInt(3, value);
27852   }
27853   void set_ret(int32_t value) {
27854     AppendVarInt(4, value);
27855   }
27856 };
27857 
27858 class Ext4ExtHandleUnwrittenExtentsFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
27859  public:
27860   Ext4ExtHandleUnwrittenExtentsFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
27861   explicit Ext4ExtHandleUnwrittenExtentsFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
27862   explicit Ext4ExtHandleUnwrittenExtentsFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
27863   bool has_dev() const { return at<1>().valid(); }
27864   uint64_t dev() const { return at<1>().as_uint64(); }
27865   bool has_ino() const { return at<2>().valid(); }
27866   uint64_t ino() const { return at<2>().as_uint64(); }
27867   bool has_flags() const { return at<3>().valid(); }
27868   int32_t flags() const { return at<3>().as_int32(); }
27869   bool has_lblk() const { return at<4>().valid(); }
27870   uint32_t lblk() const { return at<4>().as_uint32(); }
27871   bool has_pblk() const { return at<5>().valid(); }
27872   uint64_t pblk() const { return at<5>().as_uint64(); }
27873   bool has_len() const { return at<6>().valid(); }
27874   uint32_t len() const { return at<6>().as_uint32(); }
27875   bool has_allocated() const { return at<7>().valid(); }
27876   uint32_t allocated() const { return at<7>().as_uint32(); }
27877   bool has_newblk() const { return at<8>().valid(); }
27878   uint64_t newblk() const { return at<8>().as_uint64(); }
27879 };
27880 
27881 class Ext4ExtHandleUnwrittenExtentsFtraceEvent : public ::protozero::Message {
27882  public:
27883   using Decoder = Ext4ExtHandleUnwrittenExtentsFtraceEvent_Decoder;
27884   enum : int32_t {
27885     kDevFieldNumber = 1,
27886     kInoFieldNumber = 2,
27887     kFlagsFieldNumber = 3,
27888     kLblkFieldNumber = 4,
27889     kPblkFieldNumber = 5,
27890     kLenFieldNumber = 6,
27891     kAllocatedFieldNumber = 7,
27892     kNewblkFieldNumber = 8,
27893   };
27894   void set_dev(uint64_t value) {
27895     AppendVarInt(1, value);
27896   }
27897   void set_ino(uint64_t value) {
27898     AppendVarInt(2, value);
27899   }
27900   void set_flags(int32_t value) {
27901     AppendVarInt(3, value);
27902   }
27903   void set_lblk(uint32_t value) {
27904     AppendVarInt(4, value);
27905   }
27906   void set_pblk(uint64_t value) {
27907     AppendVarInt(5, value);
27908   }
27909   void set_len(uint32_t value) {
27910     AppendVarInt(6, value);
27911   }
27912   void set_allocated(uint32_t value) {
27913     AppendVarInt(7, value);
27914   }
27915   void set_newblk(uint64_t value) {
27916     AppendVarInt(8, value);
27917   }
27918 };
27919 
27920 class Ext4ExtConvertToInitializedFastpathFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/10, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
27921  public:
27922   Ext4ExtConvertToInitializedFastpathFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
27923   explicit Ext4ExtConvertToInitializedFastpathFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
27924   explicit Ext4ExtConvertToInitializedFastpathFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
27925   bool has_dev() const { return at<1>().valid(); }
27926   uint64_t dev() const { return at<1>().as_uint64(); }
27927   bool has_ino() const { return at<2>().valid(); }
27928   uint64_t ino() const { return at<2>().as_uint64(); }
27929   bool has_m_lblk() const { return at<3>().valid(); }
27930   uint32_t m_lblk() const { return at<3>().as_uint32(); }
27931   bool has_m_len() const { return at<4>().valid(); }
27932   uint32_t m_len() const { return at<4>().as_uint32(); }
27933   bool has_u_lblk() const { return at<5>().valid(); }
27934   uint32_t u_lblk() const { return at<5>().as_uint32(); }
27935   bool has_u_len() const { return at<6>().valid(); }
27936   uint32_t u_len() const { return at<6>().as_uint32(); }
27937   bool has_u_pblk() const { return at<7>().valid(); }
27938   uint64_t u_pblk() const { return at<7>().as_uint64(); }
27939   bool has_i_lblk() const { return at<8>().valid(); }
27940   uint32_t i_lblk() const { return at<8>().as_uint32(); }
27941   bool has_i_len() const { return at<9>().valid(); }
27942   uint32_t i_len() const { return at<9>().as_uint32(); }
27943   bool has_i_pblk() const { return at<10>().valid(); }
27944   uint64_t i_pblk() const { return at<10>().as_uint64(); }
27945 };
27946 
27947 class Ext4ExtConvertToInitializedFastpathFtraceEvent : public ::protozero::Message {
27948  public:
27949   using Decoder = Ext4ExtConvertToInitializedFastpathFtraceEvent_Decoder;
27950   enum : int32_t {
27951     kDevFieldNumber = 1,
27952     kInoFieldNumber = 2,
27953     kMLblkFieldNumber = 3,
27954     kMLenFieldNumber = 4,
27955     kULblkFieldNumber = 5,
27956     kULenFieldNumber = 6,
27957     kUPblkFieldNumber = 7,
27958     kILblkFieldNumber = 8,
27959     kILenFieldNumber = 9,
27960     kIPblkFieldNumber = 10,
27961   };
27962   void set_dev(uint64_t value) {
27963     AppendVarInt(1, value);
27964   }
27965   void set_ino(uint64_t value) {
27966     AppendVarInt(2, value);
27967   }
27968   void set_m_lblk(uint32_t value) {
27969     AppendVarInt(3, value);
27970   }
27971   void set_m_len(uint32_t value) {
27972     AppendVarInt(4, value);
27973   }
27974   void set_u_lblk(uint32_t value) {
27975     AppendVarInt(5, value);
27976   }
27977   void set_u_len(uint32_t value) {
27978     AppendVarInt(6, value);
27979   }
27980   void set_u_pblk(uint64_t value) {
27981     AppendVarInt(7, value);
27982   }
27983   void set_i_lblk(uint32_t value) {
27984     AppendVarInt(8, value);
27985   }
27986   void set_i_len(uint32_t value) {
27987     AppendVarInt(9, value);
27988   }
27989   void set_i_pblk(uint64_t value) {
27990     AppendVarInt(10, value);
27991   }
27992 };
27993 
27994 class Ext4ExtConvertToInitializedEnterFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
27995  public:
27996   Ext4ExtConvertToInitializedEnterFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
27997   explicit Ext4ExtConvertToInitializedEnterFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
27998   explicit Ext4ExtConvertToInitializedEnterFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
27999   bool has_dev() const { return at<1>().valid(); }
28000   uint64_t dev() const { return at<1>().as_uint64(); }
28001   bool has_ino() const { return at<2>().valid(); }
28002   uint64_t ino() const { return at<2>().as_uint64(); }
28003   bool has_m_lblk() const { return at<3>().valid(); }
28004   uint32_t m_lblk() const { return at<3>().as_uint32(); }
28005   bool has_m_len() const { return at<4>().valid(); }
28006   uint32_t m_len() const { return at<4>().as_uint32(); }
28007   bool has_u_lblk() const { return at<5>().valid(); }
28008   uint32_t u_lblk() const { return at<5>().as_uint32(); }
28009   bool has_u_len() const { return at<6>().valid(); }
28010   uint32_t u_len() const { return at<6>().as_uint32(); }
28011   bool has_u_pblk() const { return at<7>().valid(); }
28012   uint64_t u_pblk() const { return at<7>().as_uint64(); }
28013 };
28014 
28015 class Ext4ExtConvertToInitializedEnterFtraceEvent : public ::protozero::Message {
28016  public:
28017   using Decoder = Ext4ExtConvertToInitializedEnterFtraceEvent_Decoder;
28018   enum : int32_t {
28019     kDevFieldNumber = 1,
28020     kInoFieldNumber = 2,
28021     kMLblkFieldNumber = 3,
28022     kMLenFieldNumber = 4,
28023     kULblkFieldNumber = 5,
28024     kULenFieldNumber = 6,
28025     kUPblkFieldNumber = 7,
28026   };
28027   void set_dev(uint64_t value) {
28028     AppendVarInt(1, value);
28029   }
28030   void set_ino(uint64_t value) {
28031     AppendVarInt(2, value);
28032   }
28033   void set_m_lblk(uint32_t value) {
28034     AppendVarInt(3, value);
28035   }
28036   void set_m_len(uint32_t value) {
28037     AppendVarInt(4, value);
28038   }
28039   void set_u_lblk(uint32_t value) {
28040     AppendVarInt(5, value);
28041   }
28042   void set_u_len(uint32_t value) {
28043     AppendVarInt(6, value);
28044   }
28045   void set_u_pblk(uint64_t value) {
28046     AppendVarInt(7, value);
28047   }
28048 };
28049 
28050 class Ext4EvictInodeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
28051  public:
28052   Ext4EvictInodeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
28053   explicit Ext4EvictInodeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
28054   explicit Ext4EvictInodeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
28055   bool has_dev() const { return at<1>().valid(); }
28056   uint64_t dev() const { return at<1>().as_uint64(); }
28057   bool has_ino() const { return at<2>().valid(); }
28058   uint64_t ino() const { return at<2>().as_uint64(); }
28059   bool has_nlink() const { return at<3>().valid(); }
28060   int32_t nlink() const { return at<3>().as_int32(); }
28061 };
28062 
28063 class Ext4EvictInodeFtraceEvent : public ::protozero::Message {
28064  public:
28065   using Decoder = Ext4EvictInodeFtraceEvent_Decoder;
28066   enum : int32_t {
28067     kDevFieldNumber = 1,
28068     kInoFieldNumber = 2,
28069     kNlinkFieldNumber = 3,
28070   };
28071   void set_dev(uint64_t value) {
28072     AppendVarInt(1, value);
28073   }
28074   void set_ino(uint64_t value) {
28075     AppendVarInt(2, value);
28076   }
28077   void set_nlink(int32_t value) {
28078     AppendVarInt(3, value);
28079   }
28080 };
28081 
28082 class Ext4EsShrinkScanExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
28083  public:
28084   Ext4EsShrinkScanExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
28085   explicit Ext4EsShrinkScanExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
28086   explicit Ext4EsShrinkScanExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
28087   bool has_dev() const { return at<1>().valid(); }
28088   uint64_t dev() const { return at<1>().as_uint64(); }
28089   bool has_nr_shrunk() const { return at<2>().valid(); }
28090   int32_t nr_shrunk() const { return at<2>().as_int32(); }
28091   bool has_cache_cnt() const { return at<3>().valid(); }
28092   int32_t cache_cnt() const { return at<3>().as_int32(); }
28093 };
28094 
28095 class Ext4EsShrinkScanExitFtraceEvent : public ::protozero::Message {
28096  public:
28097   using Decoder = Ext4EsShrinkScanExitFtraceEvent_Decoder;
28098   enum : int32_t {
28099     kDevFieldNumber = 1,
28100     kNrShrunkFieldNumber = 2,
28101     kCacheCntFieldNumber = 3,
28102   };
28103   void set_dev(uint64_t value) {
28104     AppendVarInt(1, value);
28105   }
28106   void set_nr_shrunk(int32_t value) {
28107     AppendVarInt(2, value);
28108   }
28109   void set_cache_cnt(int32_t value) {
28110     AppendVarInt(3, value);
28111   }
28112 };
28113 
28114 class Ext4EsShrinkScanEnterFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
28115  public:
28116   Ext4EsShrinkScanEnterFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
28117   explicit Ext4EsShrinkScanEnterFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
28118   explicit Ext4EsShrinkScanEnterFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
28119   bool has_dev() const { return at<1>().valid(); }
28120   uint64_t dev() const { return at<1>().as_uint64(); }
28121   bool has_nr_to_scan() const { return at<2>().valid(); }
28122   int32_t nr_to_scan() const { return at<2>().as_int32(); }
28123   bool has_cache_cnt() const { return at<3>().valid(); }
28124   int32_t cache_cnt() const { return at<3>().as_int32(); }
28125 };
28126 
28127 class Ext4EsShrinkScanEnterFtraceEvent : public ::protozero::Message {
28128  public:
28129   using Decoder = Ext4EsShrinkScanEnterFtraceEvent_Decoder;
28130   enum : int32_t {
28131     kDevFieldNumber = 1,
28132     kNrToScanFieldNumber = 2,
28133     kCacheCntFieldNumber = 3,
28134   };
28135   void set_dev(uint64_t value) {
28136     AppendVarInt(1, value);
28137   }
28138   void set_nr_to_scan(int32_t value) {
28139     AppendVarInt(2, value);
28140   }
28141   void set_cache_cnt(int32_t value) {
28142     AppendVarInt(3, value);
28143   }
28144 };
28145 
28146 class Ext4EsShrinkCountFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
28147  public:
28148   Ext4EsShrinkCountFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
28149   explicit Ext4EsShrinkCountFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
28150   explicit Ext4EsShrinkCountFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
28151   bool has_dev() const { return at<1>().valid(); }
28152   uint64_t dev() const { return at<1>().as_uint64(); }
28153   bool has_nr_to_scan() const { return at<2>().valid(); }
28154   int32_t nr_to_scan() const { return at<2>().as_int32(); }
28155   bool has_cache_cnt() const { return at<3>().valid(); }
28156   int32_t cache_cnt() const { return at<3>().as_int32(); }
28157 };
28158 
28159 class Ext4EsShrinkCountFtraceEvent : public ::protozero::Message {
28160  public:
28161   using Decoder = Ext4EsShrinkCountFtraceEvent_Decoder;
28162   enum : int32_t {
28163     kDevFieldNumber = 1,
28164     kNrToScanFieldNumber = 2,
28165     kCacheCntFieldNumber = 3,
28166   };
28167   void set_dev(uint64_t value) {
28168     AppendVarInt(1, value);
28169   }
28170   void set_nr_to_scan(int32_t value) {
28171     AppendVarInt(2, value);
28172   }
28173   void set_cache_cnt(int32_t value) {
28174     AppendVarInt(3, value);
28175   }
28176 };
28177 
28178 class Ext4EsShrinkFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
28179  public:
28180   Ext4EsShrinkFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
28181   explicit Ext4EsShrinkFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
28182   explicit Ext4EsShrinkFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
28183   bool has_dev() const { return at<1>().valid(); }
28184   uint64_t dev() const { return at<1>().as_uint64(); }
28185   bool has_nr_shrunk() const { return at<2>().valid(); }
28186   int32_t nr_shrunk() const { return at<2>().as_int32(); }
28187   bool has_scan_time() const { return at<3>().valid(); }
28188   uint64_t scan_time() const { return at<3>().as_uint64(); }
28189   bool has_nr_skipped() const { return at<4>().valid(); }
28190   int32_t nr_skipped() const { return at<4>().as_int32(); }
28191   bool has_retried() const { return at<5>().valid(); }
28192   int32_t retried() const { return at<5>().as_int32(); }
28193 };
28194 
28195 class Ext4EsShrinkFtraceEvent : public ::protozero::Message {
28196  public:
28197   using Decoder = Ext4EsShrinkFtraceEvent_Decoder;
28198   enum : int32_t {
28199     kDevFieldNumber = 1,
28200     kNrShrunkFieldNumber = 2,
28201     kScanTimeFieldNumber = 3,
28202     kNrSkippedFieldNumber = 4,
28203     kRetriedFieldNumber = 5,
28204   };
28205   void set_dev(uint64_t value) {
28206     AppendVarInt(1, value);
28207   }
28208   void set_nr_shrunk(int32_t value) {
28209     AppendVarInt(2, value);
28210   }
28211   void set_scan_time(uint64_t value) {
28212     AppendVarInt(3, value);
28213   }
28214   void set_nr_skipped(int32_t value) {
28215     AppendVarInt(4, value);
28216   }
28217   void set_retried(int32_t value) {
28218     AppendVarInt(5, value);
28219   }
28220 };
28221 
28222 class Ext4EsRemoveExtentFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
28223  public:
28224   Ext4EsRemoveExtentFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
28225   explicit Ext4EsRemoveExtentFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
28226   explicit Ext4EsRemoveExtentFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
28227   bool has_dev() const { return at<1>().valid(); }
28228   uint64_t dev() const { return at<1>().as_uint64(); }
28229   bool has_ino() const { return at<2>().valid(); }
28230   uint64_t ino() const { return at<2>().as_uint64(); }
28231   bool has_lblk() const { return at<3>().valid(); }
28232   int64_t lblk() const { return at<3>().as_int64(); }
28233   bool has_len() const { return at<4>().valid(); }
28234   int64_t len() const { return at<4>().as_int64(); }
28235 };
28236 
28237 class Ext4EsRemoveExtentFtraceEvent : public ::protozero::Message {
28238  public:
28239   using Decoder = Ext4EsRemoveExtentFtraceEvent_Decoder;
28240   enum : int32_t {
28241     kDevFieldNumber = 1,
28242     kInoFieldNumber = 2,
28243     kLblkFieldNumber = 3,
28244     kLenFieldNumber = 4,
28245   };
28246   void set_dev(uint64_t value) {
28247     AppendVarInt(1, value);
28248   }
28249   void set_ino(uint64_t value) {
28250     AppendVarInt(2, value);
28251   }
28252   void set_lblk(int64_t value) {
28253     AppendVarInt(3, value);
28254   }
28255   void set_len(int64_t value) {
28256     AppendVarInt(4, value);
28257   }
28258 };
28259 
28260 class Ext4EsLookupExtentExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
28261  public:
28262   Ext4EsLookupExtentExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
28263   explicit Ext4EsLookupExtentExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
28264   explicit Ext4EsLookupExtentExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
28265   bool has_dev() const { return at<1>().valid(); }
28266   uint64_t dev() const { return at<1>().as_uint64(); }
28267   bool has_ino() const { return at<2>().valid(); }
28268   uint64_t ino() const { return at<2>().as_uint64(); }
28269   bool has_lblk() const { return at<3>().valid(); }
28270   uint32_t lblk() const { return at<3>().as_uint32(); }
28271   bool has_len() const { return at<4>().valid(); }
28272   uint32_t len() const { return at<4>().as_uint32(); }
28273   bool has_pblk() const { return at<5>().valid(); }
28274   uint64_t pblk() const { return at<5>().as_uint64(); }
28275   bool has_status() const { return at<6>().valid(); }
28276   uint64_t status() const { return at<6>().as_uint64(); }
28277   bool has_found() const { return at<7>().valid(); }
28278   int32_t found() const { return at<7>().as_int32(); }
28279 };
28280 
28281 class Ext4EsLookupExtentExitFtraceEvent : public ::protozero::Message {
28282  public:
28283   using Decoder = Ext4EsLookupExtentExitFtraceEvent_Decoder;
28284   enum : int32_t {
28285     kDevFieldNumber = 1,
28286     kInoFieldNumber = 2,
28287     kLblkFieldNumber = 3,
28288     kLenFieldNumber = 4,
28289     kPblkFieldNumber = 5,
28290     kStatusFieldNumber = 6,
28291     kFoundFieldNumber = 7,
28292   };
28293   void set_dev(uint64_t value) {
28294     AppendVarInt(1, value);
28295   }
28296   void set_ino(uint64_t value) {
28297     AppendVarInt(2, value);
28298   }
28299   void set_lblk(uint32_t value) {
28300     AppendVarInt(3, value);
28301   }
28302   void set_len(uint32_t value) {
28303     AppendVarInt(4, value);
28304   }
28305   void set_pblk(uint64_t value) {
28306     AppendVarInt(5, value);
28307   }
28308   void set_status(uint64_t value) {
28309     AppendVarInt(6, value);
28310   }
28311   void set_found(int32_t value) {
28312     AppendVarInt(7, value);
28313   }
28314 };
28315 
28316 class Ext4EsLookupExtentEnterFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
28317  public:
28318   Ext4EsLookupExtentEnterFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
28319   explicit Ext4EsLookupExtentEnterFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
28320   explicit Ext4EsLookupExtentEnterFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
28321   bool has_dev() const { return at<1>().valid(); }
28322   uint64_t dev() const { return at<1>().as_uint64(); }
28323   bool has_ino() const { return at<2>().valid(); }
28324   uint64_t ino() const { return at<2>().as_uint64(); }
28325   bool has_lblk() const { return at<3>().valid(); }
28326   uint32_t lblk() const { return at<3>().as_uint32(); }
28327 };
28328 
28329 class Ext4EsLookupExtentEnterFtraceEvent : public ::protozero::Message {
28330  public:
28331   using Decoder = Ext4EsLookupExtentEnterFtraceEvent_Decoder;
28332   enum : int32_t {
28333     kDevFieldNumber = 1,
28334     kInoFieldNumber = 2,
28335     kLblkFieldNumber = 3,
28336   };
28337   void set_dev(uint64_t value) {
28338     AppendVarInt(1, value);
28339   }
28340   void set_ino(uint64_t value) {
28341     AppendVarInt(2, value);
28342   }
28343   void set_lblk(uint32_t value) {
28344     AppendVarInt(3, value);
28345   }
28346 };
28347 
28348 class Ext4EsInsertExtentFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
28349  public:
28350   Ext4EsInsertExtentFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
28351   explicit Ext4EsInsertExtentFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
28352   explicit Ext4EsInsertExtentFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
28353   bool has_dev() const { return at<1>().valid(); }
28354   uint64_t dev() const { return at<1>().as_uint64(); }
28355   bool has_ino() const { return at<2>().valid(); }
28356   uint64_t ino() const { return at<2>().as_uint64(); }
28357   bool has_lblk() const { return at<3>().valid(); }
28358   uint32_t lblk() const { return at<3>().as_uint32(); }
28359   bool has_len() const { return at<4>().valid(); }
28360   uint32_t len() const { return at<4>().as_uint32(); }
28361   bool has_pblk() const { return at<5>().valid(); }
28362   uint64_t pblk() const { return at<5>().as_uint64(); }
28363   bool has_status() const { return at<6>().valid(); }
28364   uint64_t status() const { return at<6>().as_uint64(); }
28365 };
28366 
28367 class Ext4EsInsertExtentFtraceEvent : public ::protozero::Message {
28368  public:
28369   using Decoder = Ext4EsInsertExtentFtraceEvent_Decoder;
28370   enum : int32_t {
28371     kDevFieldNumber = 1,
28372     kInoFieldNumber = 2,
28373     kLblkFieldNumber = 3,
28374     kLenFieldNumber = 4,
28375     kPblkFieldNumber = 5,
28376     kStatusFieldNumber = 6,
28377   };
28378   void set_dev(uint64_t value) {
28379     AppendVarInt(1, value);
28380   }
28381   void set_ino(uint64_t value) {
28382     AppendVarInt(2, value);
28383   }
28384   void set_lblk(uint32_t value) {
28385     AppendVarInt(3, value);
28386   }
28387   void set_len(uint32_t value) {
28388     AppendVarInt(4, value);
28389   }
28390   void set_pblk(uint64_t value) {
28391     AppendVarInt(5, value);
28392   }
28393   void set_status(uint64_t value) {
28394     AppendVarInt(6, value);
28395   }
28396 };
28397 
28398 class Ext4EsFindDelayedExtentRangeExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
28399  public:
28400   Ext4EsFindDelayedExtentRangeExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
28401   explicit Ext4EsFindDelayedExtentRangeExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
28402   explicit Ext4EsFindDelayedExtentRangeExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
28403   bool has_dev() const { return at<1>().valid(); }
28404   uint64_t dev() const { return at<1>().as_uint64(); }
28405   bool has_ino() const { return at<2>().valid(); }
28406   uint64_t ino() const { return at<2>().as_uint64(); }
28407   bool has_lblk() const { return at<3>().valid(); }
28408   uint32_t lblk() const { return at<3>().as_uint32(); }
28409   bool has_len() const { return at<4>().valid(); }
28410   uint32_t len() const { return at<4>().as_uint32(); }
28411   bool has_pblk() const { return at<5>().valid(); }
28412   uint64_t pblk() const { return at<5>().as_uint64(); }
28413   bool has_status() const { return at<6>().valid(); }
28414   uint64_t status() const { return at<6>().as_uint64(); }
28415 };
28416 
28417 class Ext4EsFindDelayedExtentRangeExitFtraceEvent : public ::protozero::Message {
28418  public:
28419   using Decoder = Ext4EsFindDelayedExtentRangeExitFtraceEvent_Decoder;
28420   enum : int32_t {
28421     kDevFieldNumber = 1,
28422     kInoFieldNumber = 2,
28423     kLblkFieldNumber = 3,
28424     kLenFieldNumber = 4,
28425     kPblkFieldNumber = 5,
28426     kStatusFieldNumber = 6,
28427   };
28428   void set_dev(uint64_t value) {
28429     AppendVarInt(1, value);
28430   }
28431   void set_ino(uint64_t value) {
28432     AppendVarInt(2, value);
28433   }
28434   void set_lblk(uint32_t value) {
28435     AppendVarInt(3, value);
28436   }
28437   void set_len(uint32_t value) {
28438     AppendVarInt(4, value);
28439   }
28440   void set_pblk(uint64_t value) {
28441     AppendVarInt(5, value);
28442   }
28443   void set_status(uint64_t value) {
28444     AppendVarInt(6, value);
28445   }
28446 };
28447 
28448 class Ext4EsFindDelayedExtentRangeEnterFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
28449  public:
28450   Ext4EsFindDelayedExtentRangeEnterFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
28451   explicit Ext4EsFindDelayedExtentRangeEnterFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
28452   explicit Ext4EsFindDelayedExtentRangeEnterFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
28453   bool has_dev() const { return at<1>().valid(); }
28454   uint64_t dev() const { return at<1>().as_uint64(); }
28455   bool has_ino() const { return at<2>().valid(); }
28456   uint64_t ino() const { return at<2>().as_uint64(); }
28457   bool has_lblk() const { return at<3>().valid(); }
28458   uint32_t lblk() const { return at<3>().as_uint32(); }
28459 };
28460 
28461 class Ext4EsFindDelayedExtentRangeEnterFtraceEvent : public ::protozero::Message {
28462  public:
28463   using Decoder = Ext4EsFindDelayedExtentRangeEnterFtraceEvent_Decoder;
28464   enum : int32_t {
28465     kDevFieldNumber = 1,
28466     kInoFieldNumber = 2,
28467     kLblkFieldNumber = 3,
28468   };
28469   void set_dev(uint64_t value) {
28470     AppendVarInt(1, value);
28471   }
28472   void set_ino(uint64_t value) {
28473     AppendVarInt(2, value);
28474   }
28475   void set_lblk(uint32_t value) {
28476     AppendVarInt(3, value);
28477   }
28478 };
28479 
28480 class Ext4EsCacheExtentFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
28481  public:
28482   Ext4EsCacheExtentFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
28483   explicit Ext4EsCacheExtentFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
28484   explicit Ext4EsCacheExtentFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
28485   bool has_dev() const { return at<1>().valid(); }
28486   uint64_t dev() const { return at<1>().as_uint64(); }
28487   bool has_ino() const { return at<2>().valid(); }
28488   uint64_t ino() const { return at<2>().as_uint64(); }
28489   bool has_lblk() const { return at<3>().valid(); }
28490   uint32_t lblk() const { return at<3>().as_uint32(); }
28491   bool has_len() const { return at<4>().valid(); }
28492   uint32_t len() const { return at<4>().as_uint32(); }
28493   bool has_pblk() const { return at<5>().valid(); }
28494   uint64_t pblk() const { return at<5>().as_uint64(); }
28495   bool has_status() const { return at<6>().valid(); }
28496   uint32_t status() const { return at<6>().as_uint32(); }
28497 };
28498 
28499 class Ext4EsCacheExtentFtraceEvent : public ::protozero::Message {
28500  public:
28501   using Decoder = Ext4EsCacheExtentFtraceEvent_Decoder;
28502   enum : int32_t {
28503     kDevFieldNumber = 1,
28504     kInoFieldNumber = 2,
28505     kLblkFieldNumber = 3,
28506     kLenFieldNumber = 4,
28507     kPblkFieldNumber = 5,
28508     kStatusFieldNumber = 6,
28509   };
28510   void set_dev(uint64_t value) {
28511     AppendVarInt(1, value);
28512   }
28513   void set_ino(uint64_t value) {
28514     AppendVarInt(2, value);
28515   }
28516   void set_lblk(uint32_t value) {
28517     AppendVarInt(3, value);
28518   }
28519   void set_len(uint32_t value) {
28520     AppendVarInt(4, value);
28521   }
28522   void set_pblk(uint64_t value) {
28523     AppendVarInt(5, value);
28524   }
28525   void set_status(uint32_t value) {
28526     AppendVarInt(6, value);
28527   }
28528 };
28529 
28530 class Ext4DropInodeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
28531  public:
28532   Ext4DropInodeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
28533   explicit Ext4DropInodeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
28534   explicit Ext4DropInodeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
28535   bool has_dev() const { return at<1>().valid(); }
28536   uint64_t dev() const { return at<1>().as_uint64(); }
28537   bool has_ino() const { return at<2>().valid(); }
28538   uint64_t ino() const { return at<2>().as_uint64(); }
28539   bool has_drop() const { return at<3>().valid(); }
28540   int32_t drop() const { return at<3>().as_int32(); }
28541 };
28542 
28543 class Ext4DropInodeFtraceEvent : public ::protozero::Message {
28544  public:
28545   using Decoder = Ext4DropInodeFtraceEvent_Decoder;
28546   enum : int32_t {
28547     kDevFieldNumber = 1,
28548     kInoFieldNumber = 2,
28549     kDropFieldNumber = 3,
28550   };
28551   void set_dev(uint64_t value) {
28552     AppendVarInt(1, value);
28553   }
28554   void set_ino(uint64_t value) {
28555     AppendVarInt(2, value);
28556   }
28557   void set_drop(int32_t value) {
28558     AppendVarInt(3, value);
28559   }
28560 };
28561 
28562 class Ext4DiscardPreallocationsFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
28563  public:
28564   Ext4DiscardPreallocationsFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
28565   explicit Ext4DiscardPreallocationsFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
28566   explicit Ext4DiscardPreallocationsFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
28567   bool has_dev() const { return at<1>().valid(); }
28568   uint64_t dev() const { return at<1>().as_uint64(); }
28569   bool has_ino() const { return at<2>().valid(); }
28570   uint64_t ino() const { return at<2>().as_uint64(); }
28571 };
28572 
28573 class Ext4DiscardPreallocationsFtraceEvent : public ::protozero::Message {
28574  public:
28575   using Decoder = Ext4DiscardPreallocationsFtraceEvent_Decoder;
28576   enum : int32_t {
28577     kDevFieldNumber = 1,
28578     kInoFieldNumber = 2,
28579   };
28580   void set_dev(uint64_t value) {
28581     AppendVarInt(1, value);
28582   }
28583   void set_ino(uint64_t value) {
28584     AppendVarInt(2, value);
28585   }
28586 };
28587 
28588 class Ext4DiscardBlocksFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
28589  public:
28590   Ext4DiscardBlocksFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
28591   explicit Ext4DiscardBlocksFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
28592   explicit Ext4DiscardBlocksFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
28593   bool has_dev() const { return at<1>().valid(); }
28594   uint64_t dev() const { return at<1>().as_uint64(); }
28595   bool has_blk() const { return at<2>().valid(); }
28596   uint64_t blk() const { return at<2>().as_uint64(); }
28597   bool has_count() const { return at<3>().valid(); }
28598   uint64_t count() const { return at<3>().as_uint64(); }
28599 };
28600 
28601 class Ext4DiscardBlocksFtraceEvent : public ::protozero::Message {
28602  public:
28603   using Decoder = Ext4DiscardBlocksFtraceEvent_Decoder;
28604   enum : int32_t {
28605     kDevFieldNumber = 1,
28606     kBlkFieldNumber = 2,
28607     kCountFieldNumber = 3,
28608   };
28609   void set_dev(uint64_t value) {
28610     AppendVarInt(1, value);
28611   }
28612   void set_blk(uint64_t value) {
28613     AppendVarInt(2, value);
28614   }
28615   void set_count(uint64_t value) {
28616     AppendVarInt(3, value);
28617   }
28618 };
28619 
28620 class Ext4DirectIOExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
28621  public:
28622   Ext4DirectIOExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
28623   explicit Ext4DirectIOExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
28624   explicit Ext4DirectIOExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
28625   bool has_dev() const { return at<1>().valid(); }
28626   uint64_t dev() const { return at<1>().as_uint64(); }
28627   bool has_ino() const { return at<2>().valid(); }
28628   uint64_t ino() const { return at<2>().as_uint64(); }
28629   bool has_pos() const { return at<3>().valid(); }
28630   int64_t pos() const { return at<3>().as_int64(); }
28631   bool has_len() const { return at<4>().valid(); }
28632   uint64_t len() const { return at<4>().as_uint64(); }
28633   bool has_rw() const { return at<5>().valid(); }
28634   int32_t rw() const { return at<5>().as_int32(); }
28635   bool has_ret() const { return at<6>().valid(); }
28636   int32_t ret() const { return at<6>().as_int32(); }
28637 };
28638 
28639 class Ext4DirectIOExitFtraceEvent : public ::protozero::Message {
28640  public:
28641   using Decoder = Ext4DirectIOExitFtraceEvent_Decoder;
28642   enum : int32_t {
28643     kDevFieldNumber = 1,
28644     kInoFieldNumber = 2,
28645     kPosFieldNumber = 3,
28646     kLenFieldNumber = 4,
28647     kRwFieldNumber = 5,
28648     kRetFieldNumber = 6,
28649   };
28650   void set_dev(uint64_t value) {
28651     AppendVarInt(1, value);
28652   }
28653   void set_ino(uint64_t value) {
28654     AppendVarInt(2, value);
28655   }
28656   void set_pos(int64_t value) {
28657     AppendVarInt(3, value);
28658   }
28659   void set_len(uint64_t value) {
28660     AppendVarInt(4, value);
28661   }
28662   void set_rw(int32_t value) {
28663     AppendVarInt(5, value);
28664   }
28665   void set_ret(int32_t value) {
28666     AppendVarInt(6, value);
28667   }
28668 };
28669 
28670 class Ext4DirectIOEnterFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
28671  public:
28672   Ext4DirectIOEnterFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
28673   explicit Ext4DirectIOEnterFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
28674   explicit Ext4DirectIOEnterFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
28675   bool has_dev() const { return at<1>().valid(); }
28676   uint64_t dev() const { return at<1>().as_uint64(); }
28677   bool has_ino() const { return at<2>().valid(); }
28678   uint64_t ino() const { return at<2>().as_uint64(); }
28679   bool has_pos() const { return at<3>().valid(); }
28680   int64_t pos() const { return at<3>().as_int64(); }
28681   bool has_len() const { return at<4>().valid(); }
28682   uint64_t len() const { return at<4>().as_uint64(); }
28683   bool has_rw() const { return at<5>().valid(); }
28684   int32_t rw() const { return at<5>().as_int32(); }
28685 };
28686 
28687 class Ext4DirectIOEnterFtraceEvent : public ::protozero::Message {
28688  public:
28689   using Decoder = Ext4DirectIOEnterFtraceEvent_Decoder;
28690   enum : int32_t {
28691     kDevFieldNumber = 1,
28692     kInoFieldNumber = 2,
28693     kPosFieldNumber = 3,
28694     kLenFieldNumber = 4,
28695     kRwFieldNumber = 5,
28696   };
28697   void set_dev(uint64_t value) {
28698     AppendVarInt(1, value);
28699   }
28700   void set_ino(uint64_t value) {
28701     AppendVarInt(2, value);
28702   }
28703   void set_pos(int64_t value) {
28704     AppendVarInt(3, value);
28705   }
28706   void set_len(uint64_t value) {
28707     AppendVarInt(4, value);
28708   }
28709   void set_rw(int32_t value) {
28710     AppendVarInt(5, value);
28711   }
28712 };
28713 
28714 class Ext4DaWritePagesExtentFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
28715  public:
28716   Ext4DaWritePagesExtentFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
28717   explicit Ext4DaWritePagesExtentFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
28718   explicit Ext4DaWritePagesExtentFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
28719   bool has_dev() const { return at<1>().valid(); }
28720   uint64_t dev() const { return at<1>().as_uint64(); }
28721   bool has_ino() const { return at<2>().valid(); }
28722   uint64_t ino() const { return at<2>().as_uint64(); }
28723   bool has_lblk() const { return at<3>().valid(); }
28724   uint64_t lblk() const { return at<3>().as_uint64(); }
28725   bool has_len() const { return at<4>().valid(); }
28726   uint32_t len() const { return at<4>().as_uint32(); }
28727   bool has_flags() const { return at<5>().valid(); }
28728   uint32_t flags() const { return at<5>().as_uint32(); }
28729 };
28730 
28731 class Ext4DaWritePagesExtentFtraceEvent : public ::protozero::Message {
28732  public:
28733   using Decoder = Ext4DaWritePagesExtentFtraceEvent_Decoder;
28734   enum : int32_t {
28735     kDevFieldNumber = 1,
28736     kInoFieldNumber = 2,
28737     kLblkFieldNumber = 3,
28738     kLenFieldNumber = 4,
28739     kFlagsFieldNumber = 5,
28740   };
28741   void set_dev(uint64_t value) {
28742     AppendVarInt(1, value);
28743   }
28744   void set_ino(uint64_t value) {
28745     AppendVarInt(2, value);
28746   }
28747   void set_lblk(uint64_t value) {
28748     AppendVarInt(3, value);
28749   }
28750   void set_len(uint32_t value) {
28751     AppendVarInt(4, value);
28752   }
28753   void set_flags(uint32_t value) {
28754     AppendVarInt(5, value);
28755   }
28756 };
28757 
28758 class Ext4DaWritePagesFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/10, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
28759  public:
28760   Ext4DaWritePagesFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
28761   explicit Ext4DaWritePagesFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
28762   explicit Ext4DaWritePagesFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
28763   bool has_dev() const { return at<1>().valid(); }
28764   uint64_t dev() const { return at<1>().as_uint64(); }
28765   bool has_ino() const { return at<2>().valid(); }
28766   uint64_t ino() const { return at<2>().as_uint64(); }
28767   bool has_first_page() const { return at<3>().valid(); }
28768   uint64_t first_page() const { return at<3>().as_uint64(); }
28769   bool has_nr_to_write() const { return at<4>().valid(); }
28770   int64_t nr_to_write() const { return at<4>().as_int64(); }
28771   bool has_sync_mode() const { return at<5>().valid(); }
28772   int32_t sync_mode() const { return at<5>().as_int32(); }
28773   bool has_b_blocknr() const { return at<6>().valid(); }
28774   uint64_t b_blocknr() const { return at<6>().as_uint64(); }
28775   bool has_b_size() const { return at<7>().valid(); }
28776   uint32_t b_size() const { return at<7>().as_uint32(); }
28777   bool has_b_state() const { return at<8>().valid(); }
28778   uint32_t b_state() const { return at<8>().as_uint32(); }
28779   bool has_io_done() const { return at<9>().valid(); }
28780   int32_t io_done() const { return at<9>().as_int32(); }
28781   bool has_pages_written() const { return at<10>().valid(); }
28782   int32_t pages_written() const { return at<10>().as_int32(); }
28783 };
28784 
28785 class Ext4DaWritePagesFtraceEvent : public ::protozero::Message {
28786  public:
28787   using Decoder = Ext4DaWritePagesFtraceEvent_Decoder;
28788   enum : int32_t {
28789     kDevFieldNumber = 1,
28790     kInoFieldNumber = 2,
28791     kFirstPageFieldNumber = 3,
28792     kNrToWriteFieldNumber = 4,
28793     kSyncModeFieldNumber = 5,
28794     kBBlocknrFieldNumber = 6,
28795     kBSizeFieldNumber = 7,
28796     kBStateFieldNumber = 8,
28797     kIoDoneFieldNumber = 9,
28798     kPagesWrittenFieldNumber = 10,
28799   };
28800   void set_dev(uint64_t value) {
28801     AppendVarInt(1, value);
28802   }
28803   void set_ino(uint64_t value) {
28804     AppendVarInt(2, value);
28805   }
28806   void set_first_page(uint64_t value) {
28807     AppendVarInt(3, value);
28808   }
28809   void set_nr_to_write(int64_t value) {
28810     AppendVarInt(4, value);
28811   }
28812   void set_sync_mode(int32_t value) {
28813     AppendVarInt(5, value);
28814   }
28815   void set_b_blocknr(uint64_t value) {
28816     AppendVarInt(6, value);
28817   }
28818   void set_b_size(uint32_t value) {
28819     AppendVarInt(7, value);
28820   }
28821   void set_b_state(uint32_t value) {
28822     AppendVarInt(8, value);
28823   }
28824   void set_io_done(int32_t value) {
28825     AppendVarInt(9, value);
28826   }
28827   void set_pages_written(int32_t value) {
28828     AppendVarInt(10, value);
28829   }
28830 };
28831 
28832 class Ext4DaUpdateReserveSpaceFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/9, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
28833  public:
28834   Ext4DaUpdateReserveSpaceFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
28835   explicit Ext4DaUpdateReserveSpaceFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
28836   explicit Ext4DaUpdateReserveSpaceFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
28837   bool has_dev() const { return at<1>().valid(); }
28838   uint64_t dev() const { return at<1>().as_uint64(); }
28839   bool has_ino() const { return at<2>().valid(); }
28840   uint64_t ino() const { return at<2>().as_uint64(); }
28841   bool has_i_blocks() const { return at<3>().valid(); }
28842   uint64_t i_blocks() const { return at<3>().as_uint64(); }
28843   bool has_used_blocks() const { return at<4>().valid(); }
28844   int32_t used_blocks() const { return at<4>().as_int32(); }
28845   bool has_reserved_data_blocks() const { return at<5>().valid(); }
28846   int32_t reserved_data_blocks() const { return at<5>().as_int32(); }
28847   bool has_reserved_meta_blocks() const { return at<6>().valid(); }
28848   int32_t reserved_meta_blocks() const { return at<6>().as_int32(); }
28849   bool has_allocated_meta_blocks() const { return at<7>().valid(); }
28850   int32_t allocated_meta_blocks() const { return at<7>().as_int32(); }
28851   bool has_quota_claim() const { return at<8>().valid(); }
28852   int32_t quota_claim() const { return at<8>().as_int32(); }
28853   bool has_mode() const { return at<9>().valid(); }
28854   uint32_t mode() const { return at<9>().as_uint32(); }
28855 };
28856 
28857 class Ext4DaUpdateReserveSpaceFtraceEvent : public ::protozero::Message {
28858  public:
28859   using Decoder = Ext4DaUpdateReserveSpaceFtraceEvent_Decoder;
28860   enum : int32_t {
28861     kDevFieldNumber = 1,
28862     kInoFieldNumber = 2,
28863     kIBlocksFieldNumber = 3,
28864     kUsedBlocksFieldNumber = 4,
28865     kReservedDataBlocksFieldNumber = 5,
28866     kReservedMetaBlocksFieldNumber = 6,
28867     kAllocatedMetaBlocksFieldNumber = 7,
28868     kQuotaClaimFieldNumber = 8,
28869     kModeFieldNumber = 9,
28870   };
28871   void set_dev(uint64_t value) {
28872     AppendVarInt(1, value);
28873   }
28874   void set_ino(uint64_t value) {
28875     AppendVarInt(2, value);
28876   }
28877   void set_i_blocks(uint64_t value) {
28878     AppendVarInt(3, value);
28879   }
28880   void set_used_blocks(int32_t value) {
28881     AppendVarInt(4, value);
28882   }
28883   void set_reserved_data_blocks(int32_t value) {
28884     AppendVarInt(5, value);
28885   }
28886   void set_reserved_meta_blocks(int32_t value) {
28887     AppendVarInt(6, value);
28888   }
28889   void set_allocated_meta_blocks(int32_t value) {
28890     AppendVarInt(7, value);
28891   }
28892   void set_quota_claim(int32_t value) {
28893     AppendVarInt(8, value);
28894   }
28895   void set_mode(uint32_t value) {
28896     AppendVarInt(9, value);
28897   }
28898 };
28899 
28900 class Ext4DaReserveSpaceFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
28901  public:
28902   Ext4DaReserveSpaceFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
28903   explicit Ext4DaReserveSpaceFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
28904   explicit Ext4DaReserveSpaceFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
28905   bool has_dev() const { return at<1>().valid(); }
28906   uint64_t dev() const { return at<1>().as_uint64(); }
28907   bool has_ino() const { return at<2>().valid(); }
28908   uint64_t ino() const { return at<2>().as_uint64(); }
28909   bool has_i_blocks() const { return at<3>().valid(); }
28910   uint64_t i_blocks() const { return at<3>().as_uint64(); }
28911   bool has_reserved_data_blocks() const { return at<4>().valid(); }
28912   int32_t reserved_data_blocks() const { return at<4>().as_int32(); }
28913   bool has_reserved_meta_blocks() const { return at<5>().valid(); }
28914   int32_t reserved_meta_blocks() const { return at<5>().as_int32(); }
28915   bool has_mode() const { return at<6>().valid(); }
28916   uint32_t mode() const { return at<6>().as_uint32(); }
28917   bool has_md_needed() const { return at<7>().valid(); }
28918   int32_t md_needed() const { return at<7>().as_int32(); }
28919 };
28920 
28921 class Ext4DaReserveSpaceFtraceEvent : public ::protozero::Message {
28922  public:
28923   using Decoder = Ext4DaReserveSpaceFtraceEvent_Decoder;
28924   enum : int32_t {
28925     kDevFieldNumber = 1,
28926     kInoFieldNumber = 2,
28927     kIBlocksFieldNumber = 3,
28928     kReservedDataBlocksFieldNumber = 4,
28929     kReservedMetaBlocksFieldNumber = 5,
28930     kModeFieldNumber = 6,
28931     kMdNeededFieldNumber = 7,
28932   };
28933   void set_dev(uint64_t value) {
28934     AppendVarInt(1, value);
28935   }
28936   void set_ino(uint64_t value) {
28937     AppendVarInt(2, value);
28938   }
28939   void set_i_blocks(uint64_t value) {
28940     AppendVarInt(3, value);
28941   }
28942   void set_reserved_data_blocks(int32_t value) {
28943     AppendVarInt(4, value);
28944   }
28945   void set_reserved_meta_blocks(int32_t value) {
28946     AppendVarInt(5, value);
28947   }
28948   void set_mode(uint32_t value) {
28949     AppendVarInt(6, value);
28950   }
28951   void set_md_needed(int32_t value) {
28952     AppendVarInt(7, value);
28953   }
28954 };
28955 
28956 class Ext4DaReleaseSpaceFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
28957  public:
28958   Ext4DaReleaseSpaceFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
28959   explicit Ext4DaReleaseSpaceFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
28960   explicit Ext4DaReleaseSpaceFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
28961   bool has_dev() const { return at<1>().valid(); }
28962   uint64_t dev() const { return at<1>().as_uint64(); }
28963   bool has_ino() const { return at<2>().valid(); }
28964   uint64_t ino() const { return at<2>().as_uint64(); }
28965   bool has_i_blocks() const { return at<3>().valid(); }
28966   uint64_t i_blocks() const { return at<3>().as_uint64(); }
28967   bool has_freed_blocks() const { return at<4>().valid(); }
28968   int32_t freed_blocks() const { return at<4>().as_int32(); }
28969   bool has_reserved_data_blocks() const { return at<5>().valid(); }
28970   int32_t reserved_data_blocks() const { return at<5>().as_int32(); }
28971   bool has_reserved_meta_blocks() const { return at<6>().valid(); }
28972   int32_t reserved_meta_blocks() const { return at<6>().as_int32(); }
28973   bool has_allocated_meta_blocks() const { return at<7>().valid(); }
28974   int32_t allocated_meta_blocks() const { return at<7>().as_int32(); }
28975   bool has_mode() const { return at<8>().valid(); }
28976   uint32_t mode() const { return at<8>().as_uint32(); }
28977 };
28978 
28979 class Ext4DaReleaseSpaceFtraceEvent : public ::protozero::Message {
28980  public:
28981   using Decoder = Ext4DaReleaseSpaceFtraceEvent_Decoder;
28982   enum : int32_t {
28983     kDevFieldNumber = 1,
28984     kInoFieldNumber = 2,
28985     kIBlocksFieldNumber = 3,
28986     kFreedBlocksFieldNumber = 4,
28987     kReservedDataBlocksFieldNumber = 5,
28988     kReservedMetaBlocksFieldNumber = 6,
28989     kAllocatedMetaBlocksFieldNumber = 7,
28990     kModeFieldNumber = 8,
28991   };
28992   void set_dev(uint64_t value) {
28993     AppendVarInt(1, value);
28994   }
28995   void set_ino(uint64_t value) {
28996     AppendVarInt(2, value);
28997   }
28998   void set_i_blocks(uint64_t value) {
28999     AppendVarInt(3, value);
29000   }
29001   void set_freed_blocks(int32_t value) {
29002     AppendVarInt(4, value);
29003   }
29004   void set_reserved_data_blocks(int32_t value) {
29005     AppendVarInt(5, value);
29006   }
29007   void set_reserved_meta_blocks(int32_t value) {
29008     AppendVarInt(6, value);
29009   }
29010   void set_allocated_meta_blocks(int32_t value) {
29011     AppendVarInt(7, value);
29012   }
29013   void set_mode(uint32_t value) {
29014     AppendVarInt(8, value);
29015   }
29016 };
29017 
29018 class Ext4CollapseRangeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
29019  public:
29020   Ext4CollapseRangeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
29021   explicit Ext4CollapseRangeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
29022   explicit Ext4CollapseRangeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
29023   bool has_dev() const { return at<1>().valid(); }
29024   uint64_t dev() const { return at<1>().as_uint64(); }
29025   bool has_ino() const { return at<2>().valid(); }
29026   uint64_t ino() const { return at<2>().as_uint64(); }
29027   bool has_offset() const { return at<3>().valid(); }
29028   int64_t offset() const { return at<3>().as_int64(); }
29029   bool has_len() const { return at<4>().valid(); }
29030   int64_t len() const { return at<4>().as_int64(); }
29031 };
29032 
29033 class Ext4CollapseRangeFtraceEvent : public ::protozero::Message {
29034  public:
29035   using Decoder = Ext4CollapseRangeFtraceEvent_Decoder;
29036   enum : int32_t {
29037     kDevFieldNumber = 1,
29038     kInoFieldNumber = 2,
29039     kOffsetFieldNumber = 3,
29040     kLenFieldNumber = 4,
29041   };
29042   void set_dev(uint64_t value) {
29043     AppendVarInt(1, value);
29044   }
29045   void set_ino(uint64_t value) {
29046     AppendVarInt(2, value);
29047   }
29048   void set_offset(int64_t value) {
29049     AppendVarInt(3, value);
29050   }
29051   void set_len(int64_t value) {
29052     AppendVarInt(4, value);
29053   }
29054 };
29055 
29056 class Ext4BeginOrderedTruncateFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
29057  public:
29058   Ext4BeginOrderedTruncateFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
29059   explicit Ext4BeginOrderedTruncateFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
29060   explicit Ext4BeginOrderedTruncateFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
29061   bool has_dev() const { return at<1>().valid(); }
29062   uint64_t dev() const { return at<1>().as_uint64(); }
29063   bool has_ino() const { return at<2>().valid(); }
29064   uint64_t ino() const { return at<2>().as_uint64(); }
29065   bool has_new_size() const { return at<3>().valid(); }
29066   int64_t new_size() const { return at<3>().as_int64(); }
29067 };
29068 
29069 class Ext4BeginOrderedTruncateFtraceEvent : public ::protozero::Message {
29070  public:
29071   using Decoder = Ext4BeginOrderedTruncateFtraceEvent_Decoder;
29072   enum : int32_t {
29073     kDevFieldNumber = 1,
29074     kInoFieldNumber = 2,
29075     kNewSizeFieldNumber = 3,
29076   };
29077   void set_dev(uint64_t value) {
29078     AppendVarInt(1, value);
29079   }
29080   void set_ino(uint64_t value) {
29081     AppendVarInt(2, value);
29082   }
29083   void set_new_size(int64_t value) {
29084     AppendVarInt(3, value);
29085   }
29086 };
29087 
29088 class Ext4AllocateInodeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
29089  public:
29090   Ext4AllocateInodeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
29091   explicit Ext4AllocateInodeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
29092   explicit Ext4AllocateInodeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
29093   bool has_dev() const { return at<1>().valid(); }
29094   uint64_t dev() const { return at<1>().as_uint64(); }
29095   bool has_ino() const { return at<2>().valid(); }
29096   uint64_t ino() const { return at<2>().as_uint64(); }
29097   bool has_dir() const { return at<3>().valid(); }
29098   uint64_t dir() const { return at<3>().as_uint64(); }
29099   bool has_mode() const { return at<4>().valid(); }
29100   uint32_t mode() const { return at<4>().as_uint32(); }
29101 };
29102 
29103 class Ext4AllocateInodeFtraceEvent : public ::protozero::Message {
29104  public:
29105   using Decoder = Ext4AllocateInodeFtraceEvent_Decoder;
29106   enum : int32_t {
29107     kDevFieldNumber = 1,
29108     kInoFieldNumber = 2,
29109     kDirFieldNumber = 3,
29110     kModeFieldNumber = 4,
29111   };
29112   void set_dev(uint64_t value) {
29113     AppendVarInt(1, value);
29114   }
29115   void set_ino(uint64_t value) {
29116     AppendVarInt(2, value);
29117   }
29118   void set_dir(uint64_t value) {
29119     AppendVarInt(3, value);
29120   }
29121   void set_mode(uint32_t value) {
29122     AppendVarInt(4, value);
29123   }
29124 };
29125 
29126 class Ext4AllocateBlocksFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/11, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
29127  public:
29128   Ext4AllocateBlocksFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
29129   explicit Ext4AllocateBlocksFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
29130   explicit Ext4AllocateBlocksFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
29131   bool has_dev() const { return at<1>().valid(); }
29132   uint64_t dev() const { return at<1>().as_uint64(); }
29133   bool has_ino() const { return at<2>().valid(); }
29134   uint64_t ino() const { return at<2>().as_uint64(); }
29135   bool has_block() const { return at<3>().valid(); }
29136   uint64_t block() const { return at<3>().as_uint64(); }
29137   bool has_len() const { return at<4>().valid(); }
29138   uint32_t len() const { return at<4>().as_uint32(); }
29139   bool has_logical() const { return at<5>().valid(); }
29140   uint32_t logical() const { return at<5>().as_uint32(); }
29141   bool has_lleft() const { return at<6>().valid(); }
29142   uint32_t lleft() const { return at<6>().as_uint32(); }
29143   bool has_lright() const { return at<7>().valid(); }
29144   uint32_t lright() const { return at<7>().as_uint32(); }
29145   bool has_goal() const { return at<8>().valid(); }
29146   uint64_t goal() const { return at<8>().as_uint64(); }
29147   bool has_pleft() const { return at<9>().valid(); }
29148   uint64_t pleft() const { return at<9>().as_uint64(); }
29149   bool has_pright() const { return at<10>().valid(); }
29150   uint64_t pright() const { return at<10>().as_uint64(); }
29151   bool has_flags() const { return at<11>().valid(); }
29152   uint32_t flags() const { return at<11>().as_uint32(); }
29153 };
29154 
29155 class Ext4AllocateBlocksFtraceEvent : public ::protozero::Message {
29156  public:
29157   using Decoder = Ext4AllocateBlocksFtraceEvent_Decoder;
29158   enum : int32_t {
29159     kDevFieldNumber = 1,
29160     kInoFieldNumber = 2,
29161     kBlockFieldNumber = 3,
29162     kLenFieldNumber = 4,
29163     kLogicalFieldNumber = 5,
29164     kLleftFieldNumber = 6,
29165     kLrightFieldNumber = 7,
29166     kGoalFieldNumber = 8,
29167     kPleftFieldNumber = 9,
29168     kPrightFieldNumber = 10,
29169     kFlagsFieldNumber = 11,
29170   };
29171   void set_dev(uint64_t value) {
29172     AppendVarInt(1, value);
29173   }
29174   void set_ino(uint64_t value) {
29175     AppendVarInt(2, value);
29176   }
29177   void set_block(uint64_t value) {
29178     AppendVarInt(3, value);
29179   }
29180   void set_len(uint32_t value) {
29181     AppendVarInt(4, value);
29182   }
29183   void set_logical(uint32_t value) {
29184     AppendVarInt(5, value);
29185   }
29186   void set_lleft(uint32_t value) {
29187     AppendVarInt(6, value);
29188   }
29189   void set_lright(uint32_t value) {
29190     AppendVarInt(7, value);
29191   }
29192   void set_goal(uint64_t value) {
29193     AppendVarInt(8, value);
29194   }
29195   void set_pleft(uint64_t value) {
29196     AppendVarInt(9, value);
29197   }
29198   void set_pright(uint64_t value) {
29199     AppendVarInt(10, value);
29200   }
29201   void set_flags(uint32_t value) {
29202     AppendVarInt(11, value);
29203   }
29204 };
29205 
29206 class Ext4AllocDaBlocksFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
29207  public:
29208   Ext4AllocDaBlocksFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
29209   explicit Ext4AllocDaBlocksFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
29210   explicit Ext4AllocDaBlocksFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
29211   bool has_dev() const { return at<1>().valid(); }
29212   uint64_t dev() const { return at<1>().as_uint64(); }
29213   bool has_ino() const { return at<2>().valid(); }
29214   uint64_t ino() const { return at<2>().as_uint64(); }
29215   bool has_data_blocks() const { return at<3>().valid(); }
29216   uint32_t data_blocks() const { return at<3>().as_uint32(); }
29217   bool has_meta_blocks() const { return at<4>().valid(); }
29218   uint32_t meta_blocks() const { return at<4>().as_uint32(); }
29219 };
29220 
29221 class Ext4AllocDaBlocksFtraceEvent : public ::protozero::Message {
29222  public:
29223   using Decoder = Ext4AllocDaBlocksFtraceEvent_Decoder;
29224   enum : int32_t {
29225     kDevFieldNumber = 1,
29226     kInoFieldNumber = 2,
29227     kDataBlocksFieldNumber = 3,
29228     kMetaBlocksFieldNumber = 4,
29229   };
29230   void set_dev(uint64_t value) {
29231     AppendVarInt(1, value);
29232   }
29233   void set_ino(uint64_t value) {
29234     AppendVarInt(2, value);
29235   }
29236   void set_data_blocks(uint32_t value) {
29237     AppendVarInt(3, value);
29238   }
29239   void set_meta_blocks(uint32_t value) {
29240     AppendVarInt(4, value);
29241   }
29242 };
29243 
29244 class Ext4SyncFileExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
29245  public:
29246   Ext4SyncFileExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
29247   explicit Ext4SyncFileExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
29248   explicit Ext4SyncFileExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
29249   bool has_dev() const { return at<1>().valid(); }
29250   uint64_t dev() const { return at<1>().as_uint64(); }
29251   bool has_ino() const { return at<2>().valid(); }
29252   uint64_t ino() const { return at<2>().as_uint64(); }
29253   bool has_ret() const { return at<3>().valid(); }
29254   int32_t ret() const { return at<3>().as_int32(); }
29255 };
29256 
29257 class Ext4SyncFileExitFtraceEvent : public ::protozero::Message {
29258  public:
29259   using Decoder = Ext4SyncFileExitFtraceEvent_Decoder;
29260   enum : int32_t {
29261     kDevFieldNumber = 1,
29262     kInoFieldNumber = 2,
29263     kRetFieldNumber = 3,
29264   };
29265   void set_dev(uint64_t value) {
29266     AppendVarInt(1, value);
29267   }
29268   void set_ino(uint64_t value) {
29269     AppendVarInt(2, value);
29270   }
29271   void set_ret(int32_t value) {
29272     AppendVarInt(3, value);
29273   }
29274 };
29275 
29276 class Ext4SyncFileEnterFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
29277  public:
29278   Ext4SyncFileEnterFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
29279   explicit Ext4SyncFileEnterFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
29280   explicit Ext4SyncFileEnterFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
29281   bool has_dev() const { return at<1>().valid(); }
29282   uint64_t dev() const { return at<1>().as_uint64(); }
29283   bool has_ino() const { return at<2>().valid(); }
29284   uint64_t ino() const { return at<2>().as_uint64(); }
29285   bool has_parent() const { return at<3>().valid(); }
29286   uint64_t parent() const { return at<3>().as_uint64(); }
29287   bool has_datasync() const { return at<4>().valid(); }
29288   int32_t datasync() const { return at<4>().as_int32(); }
29289 };
29290 
29291 class Ext4SyncFileEnterFtraceEvent : public ::protozero::Message {
29292  public:
29293   using Decoder = Ext4SyncFileEnterFtraceEvent_Decoder;
29294   enum : int32_t {
29295     kDevFieldNumber = 1,
29296     kInoFieldNumber = 2,
29297     kParentFieldNumber = 3,
29298     kDatasyncFieldNumber = 4,
29299   };
29300   void set_dev(uint64_t value) {
29301     AppendVarInt(1, value);
29302   }
29303   void set_ino(uint64_t value) {
29304     AppendVarInt(2, value);
29305   }
29306   void set_parent(uint64_t value) {
29307     AppendVarInt(3, value);
29308   }
29309   void set_datasync(int32_t value) {
29310     AppendVarInt(4, value);
29311   }
29312 };
29313 
29314 class Ext4DaWriteEndFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
29315  public:
29316   Ext4DaWriteEndFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
29317   explicit Ext4DaWriteEndFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
29318   explicit Ext4DaWriteEndFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
29319   bool has_dev() const { return at<1>().valid(); }
29320   uint64_t dev() const { return at<1>().as_uint64(); }
29321   bool has_ino() const { return at<2>().valid(); }
29322   uint64_t ino() const { return at<2>().as_uint64(); }
29323   bool has_pos() const { return at<3>().valid(); }
29324   int64_t pos() const { return at<3>().as_int64(); }
29325   bool has_len() const { return at<4>().valid(); }
29326   uint32_t len() const { return at<4>().as_uint32(); }
29327   bool has_copied() const { return at<5>().valid(); }
29328   uint32_t copied() const { return at<5>().as_uint32(); }
29329 };
29330 
29331 class Ext4DaWriteEndFtraceEvent : public ::protozero::Message {
29332  public:
29333   using Decoder = Ext4DaWriteEndFtraceEvent_Decoder;
29334   enum : int32_t {
29335     kDevFieldNumber = 1,
29336     kInoFieldNumber = 2,
29337     kPosFieldNumber = 3,
29338     kLenFieldNumber = 4,
29339     kCopiedFieldNumber = 5,
29340   };
29341   void set_dev(uint64_t value) {
29342     AppendVarInt(1, value);
29343   }
29344   void set_ino(uint64_t value) {
29345     AppendVarInt(2, value);
29346   }
29347   void set_pos(int64_t value) {
29348     AppendVarInt(3, value);
29349   }
29350   void set_len(uint32_t value) {
29351     AppendVarInt(4, value);
29352   }
29353   void set_copied(uint32_t value) {
29354     AppendVarInt(5, value);
29355   }
29356 };
29357 
29358 class Ext4DaWriteBeginFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
29359  public:
29360   Ext4DaWriteBeginFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
29361   explicit Ext4DaWriteBeginFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
29362   explicit Ext4DaWriteBeginFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
29363   bool has_dev() const { return at<1>().valid(); }
29364   uint64_t dev() const { return at<1>().as_uint64(); }
29365   bool has_ino() const { return at<2>().valid(); }
29366   uint64_t ino() const { return at<2>().as_uint64(); }
29367   bool has_pos() const { return at<3>().valid(); }
29368   int64_t pos() const { return at<3>().as_int64(); }
29369   bool has_len() const { return at<4>().valid(); }
29370   uint32_t len() const { return at<4>().as_uint32(); }
29371   bool has_flags() const { return at<5>().valid(); }
29372   uint32_t flags() const { return at<5>().as_uint32(); }
29373 };
29374 
29375 class Ext4DaWriteBeginFtraceEvent : public ::protozero::Message {
29376  public:
29377   using Decoder = Ext4DaWriteBeginFtraceEvent_Decoder;
29378   enum : int32_t {
29379     kDevFieldNumber = 1,
29380     kInoFieldNumber = 2,
29381     kPosFieldNumber = 3,
29382     kLenFieldNumber = 4,
29383     kFlagsFieldNumber = 5,
29384   };
29385   void set_dev(uint64_t value) {
29386     AppendVarInt(1, value);
29387   }
29388   void set_ino(uint64_t value) {
29389     AppendVarInt(2, value);
29390   }
29391   void set_pos(int64_t value) {
29392     AppendVarInt(3, value);
29393   }
29394   void set_len(uint32_t value) {
29395     AppendVarInt(4, value);
29396   }
29397   void set_flags(uint32_t value) {
29398     AppendVarInt(5, value);
29399   }
29400 };
29401 
29402 } // Namespace.
29403 } // Namespace.
29404 } // Namespace.
29405 #endif  // Include guard.
29406 // gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/f2fs.pbzero.h
29407 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
29408 
29409 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_F2FS_PROTO_H_
29410 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_F2FS_PROTO_H_
29411 
29412 #include <stddef.h>
29413 #include <stdint.h>
29414 
29415 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
29416 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
29417 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
29418 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
29419 
29420 namespace perfetto {
29421 namespace protos {
29422 namespace pbzero {
29423 
29424 
29425 class F2fsWriteEndFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
29426  public:
29427   F2fsWriteEndFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
29428   explicit F2fsWriteEndFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
29429   explicit F2fsWriteEndFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
29430   bool has_dev() const { return at<1>().valid(); }
29431   uint64_t dev() const { return at<1>().as_uint64(); }
29432   bool has_ino() const { return at<2>().valid(); }
29433   uint64_t ino() const { return at<2>().as_uint64(); }
29434   bool has_pos() const { return at<3>().valid(); }
29435   int64_t pos() const { return at<3>().as_int64(); }
29436   bool has_len() const { return at<4>().valid(); }
29437   uint32_t len() const { return at<4>().as_uint32(); }
29438   bool has_copied() const { return at<5>().valid(); }
29439   uint32_t copied() const { return at<5>().as_uint32(); }
29440 };
29441 
29442 class F2fsWriteEndFtraceEvent : public ::protozero::Message {
29443  public:
29444   using Decoder = F2fsWriteEndFtraceEvent_Decoder;
29445   enum : int32_t {
29446     kDevFieldNumber = 1,
29447     kInoFieldNumber = 2,
29448     kPosFieldNumber = 3,
29449     kLenFieldNumber = 4,
29450     kCopiedFieldNumber = 5,
29451   };
29452   void set_dev(uint64_t value) {
29453     AppendVarInt(1, value);
29454   }
29455   void set_ino(uint64_t value) {
29456     AppendVarInt(2, value);
29457   }
29458   void set_pos(int64_t value) {
29459     AppendVarInt(3, value);
29460   }
29461   void set_len(uint32_t value) {
29462     AppendVarInt(4, value);
29463   }
29464   void set_copied(uint32_t value) {
29465     AppendVarInt(5, value);
29466   }
29467 };
29468 
29469 class F2fsWriteCheckpointFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
29470  public:
29471   F2fsWriteCheckpointFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
29472   explicit F2fsWriteCheckpointFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
29473   explicit F2fsWriteCheckpointFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
29474   bool has_dev() const { return at<1>().valid(); }
29475   uint64_t dev() const { return at<1>().as_uint64(); }
29476   bool has_is_umount() const { return at<2>().valid(); }
29477   uint32_t is_umount() const { return at<2>().as_uint32(); }
29478   bool has_msg() const { return at<3>().valid(); }
29479   ::protozero::ConstChars msg() const { return at<3>().as_string(); }
29480 };
29481 
29482 class F2fsWriteCheckpointFtraceEvent : public ::protozero::Message {
29483  public:
29484   using Decoder = F2fsWriteCheckpointFtraceEvent_Decoder;
29485   enum : int32_t {
29486     kDevFieldNumber = 1,
29487     kIsUmountFieldNumber = 2,
29488     kMsgFieldNumber = 3,
29489   };
29490   void set_dev(uint64_t value) {
29491     AppendVarInt(1, value);
29492   }
29493   void set_is_umount(uint32_t value) {
29494     AppendVarInt(2, value);
29495   }
29496   void set_msg(const std::string& value) {
29497     AppendBytes(3, value.data(), value.size());
29498   }
29499   void set_msg(const char* data, size_t size) {
29500     AppendBytes(3, data, size);
29501   }
29502 };
29503 
29504 class F2fsWriteBeginFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
29505  public:
29506   F2fsWriteBeginFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
29507   explicit F2fsWriteBeginFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
29508   explicit F2fsWriteBeginFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
29509   bool has_dev() const { return at<1>().valid(); }
29510   uint64_t dev() const { return at<1>().as_uint64(); }
29511   bool has_ino() const { return at<2>().valid(); }
29512   uint64_t ino() const { return at<2>().as_uint64(); }
29513   bool has_pos() const { return at<3>().valid(); }
29514   int64_t pos() const { return at<3>().as_int64(); }
29515   bool has_len() const { return at<4>().valid(); }
29516   uint32_t len() const { return at<4>().as_uint32(); }
29517   bool has_flags() const { return at<5>().valid(); }
29518   uint32_t flags() const { return at<5>().as_uint32(); }
29519 };
29520 
29521 class F2fsWriteBeginFtraceEvent : public ::protozero::Message {
29522  public:
29523   using Decoder = F2fsWriteBeginFtraceEvent_Decoder;
29524   enum : int32_t {
29525     kDevFieldNumber = 1,
29526     kInoFieldNumber = 2,
29527     kPosFieldNumber = 3,
29528     kLenFieldNumber = 4,
29529     kFlagsFieldNumber = 5,
29530   };
29531   void set_dev(uint64_t value) {
29532     AppendVarInt(1, value);
29533   }
29534   void set_ino(uint64_t value) {
29535     AppendVarInt(2, value);
29536   }
29537   void set_pos(int64_t value) {
29538     AppendVarInt(3, value);
29539   }
29540   void set_len(uint32_t value) {
29541     AppendVarInt(4, value);
29542   }
29543   void set_flags(uint32_t value) {
29544     AppendVarInt(5, value);
29545   }
29546 };
29547 
29548 class F2fsVmPageMkwriteFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
29549  public:
29550   F2fsVmPageMkwriteFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
29551   explicit F2fsVmPageMkwriteFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
29552   explicit F2fsVmPageMkwriteFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
29553   bool has_dev() const { return at<1>().valid(); }
29554   uint64_t dev() const { return at<1>().as_uint64(); }
29555   bool has_ino() const { return at<2>().valid(); }
29556   uint64_t ino() const { return at<2>().as_uint64(); }
29557   bool has_type() const { return at<3>().valid(); }
29558   int32_t type() const { return at<3>().as_int32(); }
29559   bool has_dir() const { return at<4>().valid(); }
29560   int32_t dir() const { return at<4>().as_int32(); }
29561   bool has_index() const { return at<5>().valid(); }
29562   uint64_t index() const { return at<5>().as_uint64(); }
29563   bool has_dirty() const { return at<6>().valid(); }
29564   int32_t dirty() const { return at<6>().as_int32(); }
29565 };
29566 
29567 class F2fsVmPageMkwriteFtraceEvent : public ::protozero::Message {
29568  public:
29569   using Decoder = F2fsVmPageMkwriteFtraceEvent_Decoder;
29570   enum : int32_t {
29571     kDevFieldNumber = 1,
29572     kInoFieldNumber = 2,
29573     kTypeFieldNumber = 3,
29574     kDirFieldNumber = 4,
29575     kIndexFieldNumber = 5,
29576     kDirtyFieldNumber = 6,
29577   };
29578   void set_dev(uint64_t value) {
29579     AppendVarInt(1, value);
29580   }
29581   void set_ino(uint64_t value) {
29582     AppendVarInt(2, value);
29583   }
29584   void set_type(int32_t value) {
29585     AppendVarInt(3, value);
29586   }
29587   void set_dir(int32_t value) {
29588     AppendVarInt(4, value);
29589   }
29590   void set_index(uint64_t value) {
29591     AppendVarInt(5, value);
29592   }
29593   void set_dirty(int32_t value) {
29594     AppendVarInt(6, value);
29595   }
29596 };
29597 
29598 class F2fsUnlinkExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
29599  public:
29600   F2fsUnlinkExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
29601   explicit F2fsUnlinkExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
29602   explicit F2fsUnlinkExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
29603   bool has_dev() const { return at<1>().valid(); }
29604   uint64_t dev() const { return at<1>().as_uint64(); }
29605   bool has_ino() const { return at<2>().valid(); }
29606   uint64_t ino() const { return at<2>().as_uint64(); }
29607   bool has_ret() const { return at<3>().valid(); }
29608   int32_t ret() const { return at<3>().as_int32(); }
29609 };
29610 
29611 class F2fsUnlinkExitFtraceEvent : public ::protozero::Message {
29612  public:
29613   using Decoder = F2fsUnlinkExitFtraceEvent_Decoder;
29614   enum : int32_t {
29615     kDevFieldNumber = 1,
29616     kInoFieldNumber = 2,
29617     kRetFieldNumber = 3,
29618   };
29619   void set_dev(uint64_t value) {
29620     AppendVarInt(1, value);
29621   }
29622   void set_ino(uint64_t value) {
29623     AppendVarInt(2, value);
29624   }
29625   void set_ret(int32_t value) {
29626     AppendVarInt(3, value);
29627   }
29628 };
29629 
29630 class F2fsUnlinkEnterFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
29631  public:
29632   F2fsUnlinkEnterFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
29633   explicit F2fsUnlinkEnterFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
29634   explicit F2fsUnlinkEnterFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
29635   bool has_dev() const { return at<1>().valid(); }
29636   uint64_t dev() const { return at<1>().as_uint64(); }
29637   bool has_ino() const { return at<2>().valid(); }
29638   uint64_t ino() const { return at<2>().as_uint64(); }
29639   bool has_size() const { return at<3>().valid(); }
29640   int64_t size() const { return at<3>().as_int64(); }
29641   bool has_blocks() const { return at<4>().valid(); }
29642   uint64_t blocks() const { return at<4>().as_uint64(); }
29643   bool has_name() const { return at<5>().valid(); }
29644   ::protozero::ConstChars name() const { return at<5>().as_string(); }
29645 };
29646 
29647 class F2fsUnlinkEnterFtraceEvent : public ::protozero::Message {
29648  public:
29649   using Decoder = F2fsUnlinkEnterFtraceEvent_Decoder;
29650   enum : int32_t {
29651     kDevFieldNumber = 1,
29652     kInoFieldNumber = 2,
29653     kSizeFieldNumber = 3,
29654     kBlocksFieldNumber = 4,
29655     kNameFieldNumber = 5,
29656   };
29657   void set_dev(uint64_t value) {
29658     AppendVarInt(1, value);
29659   }
29660   void set_ino(uint64_t value) {
29661     AppendVarInt(2, value);
29662   }
29663   void set_size(int64_t value) {
29664     AppendVarInt(3, value);
29665   }
29666   void set_blocks(uint64_t value) {
29667     AppendVarInt(4, value);
29668   }
29669   void set_name(const std::string& value) {
29670     AppendBytes(5, value.data(), value.size());
29671   }
29672   void set_name(const char* data, size_t size) {
29673     AppendBytes(5, data, size);
29674   }
29675 };
29676 
29677 class F2fsTruncatePartialNodesFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
29678  public:
29679   F2fsTruncatePartialNodesFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
29680   explicit F2fsTruncatePartialNodesFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
29681   explicit F2fsTruncatePartialNodesFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
29682   bool has_dev() const { return at<1>().valid(); }
29683   uint64_t dev() const { return at<1>().as_uint64(); }
29684   bool has_ino() const { return at<2>().valid(); }
29685   uint64_t ino() const { return at<2>().as_uint64(); }
29686   bool has_nid() const { return at<3>().valid(); }
29687   uint32_t nid() const { return at<3>().as_uint32(); }
29688   bool has_depth() const { return at<4>().valid(); }
29689   int32_t depth() const { return at<4>().as_int32(); }
29690   bool has_err() const { return at<5>().valid(); }
29691   int32_t err() const { return at<5>().as_int32(); }
29692 };
29693 
29694 class F2fsTruncatePartialNodesFtraceEvent : public ::protozero::Message {
29695  public:
29696   using Decoder = F2fsTruncatePartialNodesFtraceEvent_Decoder;
29697   enum : int32_t {
29698     kDevFieldNumber = 1,
29699     kInoFieldNumber = 2,
29700     kNidFieldNumber = 3,
29701     kDepthFieldNumber = 4,
29702     kErrFieldNumber = 5,
29703   };
29704   void set_dev(uint64_t value) {
29705     AppendVarInt(1, value);
29706   }
29707   void set_ino(uint64_t value) {
29708     AppendVarInt(2, value);
29709   }
29710   void set_nid(uint32_t value) {
29711     AppendVarInt(3, value);
29712   }
29713   void set_depth(int32_t value) {
29714     AppendVarInt(4, value);
29715   }
29716   void set_err(int32_t value) {
29717     AppendVarInt(5, value);
29718   }
29719 };
29720 
29721 class F2fsTruncateNodesExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
29722  public:
29723   F2fsTruncateNodesExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
29724   explicit F2fsTruncateNodesExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
29725   explicit F2fsTruncateNodesExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
29726   bool has_dev() const { return at<1>().valid(); }
29727   uint64_t dev() const { return at<1>().as_uint64(); }
29728   bool has_ino() const { return at<2>().valid(); }
29729   uint64_t ino() const { return at<2>().as_uint64(); }
29730   bool has_ret() const { return at<3>().valid(); }
29731   int32_t ret() const { return at<3>().as_int32(); }
29732 };
29733 
29734 class F2fsTruncateNodesExitFtraceEvent : public ::protozero::Message {
29735  public:
29736   using Decoder = F2fsTruncateNodesExitFtraceEvent_Decoder;
29737   enum : int32_t {
29738     kDevFieldNumber = 1,
29739     kInoFieldNumber = 2,
29740     kRetFieldNumber = 3,
29741   };
29742   void set_dev(uint64_t value) {
29743     AppendVarInt(1, value);
29744   }
29745   void set_ino(uint64_t value) {
29746     AppendVarInt(2, value);
29747   }
29748   void set_ret(int32_t value) {
29749     AppendVarInt(3, value);
29750   }
29751 };
29752 
29753 class F2fsTruncateNodesEnterFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
29754  public:
29755   F2fsTruncateNodesEnterFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
29756   explicit F2fsTruncateNodesEnterFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
29757   explicit F2fsTruncateNodesEnterFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
29758   bool has_dev() const { return at<1>().valid(); }
29759   uint64_t dev() const { return at<1>().as_uint64(); }
29760   bool has_ino() const { return at<2>().valid(); }
29761   uint64_t ino() const { return at<2>().as_uint64(); }
29762   bool has_nid() const { return at<3>().valid(); }
29763   uint32_t nid() const { return at<3>().as_uint32(); }
29764   bool has_blk_addr() const { return at<4>().valid(); }
29765   uint32_t blk_addr() const { return at<4>().as_uint32(); }
29766 };
29767 
29768 class F2fsTruncateNodesEnterFtraceEvent : public ::protozero::Message {
29769  public:
29770   using Decoder = F2fsTruncateNodesEnterFtraceEvent_Decoder;
29771   enum : int32_t {
29772     kDevFieldNumber = 1,
29773     kInoFieldNumber = 2,
29774     kNidFieldNumber = 3,
29775     kBlkAddrFieldNumber = 4,
29776   };
29777   void set_dev(uint64_t value) {
29778     AppendVarInt(1, value);
29779   }
29780   void set_ino(uint64_t value) {
29781     AppendVarInt(2, value);
29782   }
29783   void set_nid(uint32_t value) {
29784     AppendVarInt(3, value);
29785   }
29786   void set_blk_addr(uint32_t value) {
29787     AppendVarInt(4, value);
29788   }
29789 };
29790 
29791 class F2fsTruncateNodeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
29792  public:
29793   F2fsTruncateNodeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
29794   explicit F2fsTruncateNodeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
29795   explicit F2fsTruncateNodeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
29796   bool has_dev() const { return at<1>().valid(); }
29797   uint64_t dev() const { return at<1>().as_uint64(); }
29798   bool has_ino() const { return at<2>().valid(); }
29799   uint64_t ino() const { return at<2>().as_uint64(); }
29800   bool has_nid() const { return at<3>().valid(); }
29801   uint32_t nid() const { return at<3>().as_uint32(); }
29802   bool has_blk_addr() const { return at<4>().valid(); }
29803   uint32_t blk_addr() const { return at<4>().as_uint32(); }
29804 };
29805 
29806 class F2fsTruncateNodeFtraceEvent : public ::protozero::Message {
29807  public:
29808   using Decoder = F2fsTruncateNodeFtraceEvent_Decoder;
29809   enum : int32_t {
29810     kDevFieldNumber = 1,
29811     kInoFieldNumber = 2,
29812     kNidFieldNumber = 3,
29813     kBlkAddrFieldNumber = 4,
29814   };
29815   void set_dev(uint64_t value) {
29816     AppendVarInt(1, value);
29817   }
29818   void set_ino(uint64_t value) {
29819     AppendVarInt(2, value);
29820   }
29821   void set_nid(uint32_t value) {
29822     AppendVarInt(3, value);
29823   }
29824   void set_blk_addr(uint32_t value) {
29825     AppendVarInt(4, value);
29826   }
29827 };
29828 
29829 class F2fsTruncateInodeBlocksExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
29830  public:
29831   F2fsTruncateInodeBlocksExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
29832   explicit F2fsTruncateInodeBlocksExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
29833   explicit F2fsTruncateInodeBlocksExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
29834   bool has_dev() const { return at<1>().valid(); }
29835   uint64_t dev() const { return at<1>().as_uint64(); }
29836   bool has_ino() const { return at<2>().valid(); }
29837   uint64_t ino() const { return at<2>().as_uint64(); }
29838   bool has_ret() const { return at<3>().valid(); }
29839   int32_t ret() const { return at<3>().as_int32(); }
29840 };
29841 
29842 class F2fsTruncateInodeBlocksExitFtraceEvent : public ::protozero::Message {
29843  public:
29844   using Decoder = F2fsTruncateInodeBlocksExitFtraceEvent_Decoder;
29845   enum : int32_t {
29846     kDevFieldNumber = 1,
29847     kInoFieldNumber = 2,
29848     kRetFieldNumber = 3,
29849   };
29850   void set_dev(uint64_t value) {
29851     AppendVarInt(1, value);
29852   }
29853   void set_ino(uint64_t value) {
29854     AppendVarInt(2, value);
29855   }
29856   void set_ret(int32_t value) {
29857     AppendVarInt(3, value);
29858   }
29859 };
29860 
29861 class F2fsTruncateInodeBlocksEnterFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
29862  public:
29863   F2fsTruncateInodeBlocksEnterFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
29864   explicit F2fsTruncateInodeBlocksEnterFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
29865   explicit F2fsTruncateInodeBlocksEnterFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
29866   bool has_dev() const { return at<1>().valid(); }
29867   uint64_t dev() const { return at<1>().as_uint64(); }
29868   bool has_ino() const { return at<2>().valid(); }
29869   uint64_t ino() const { return at<2>().as_uint64(); }
29870   bool has_size() const { return at<3>().valid(); }
29871   int64_t size() const { return at<3>().as_int64(); }
29872   bool has_blocks() const { return at<4>().valid(); }
29873   uint64_t blocks() const { return at<4>().as_uint64(); }
29874   bool has_from() const { return at<5>().valid(); }
29875   uint64_t from() const { return at<5>().as_uint64(); }
29876 };
29877 
29878 class F2fsTruncateInodeBlocksEnterFtraceEvent : public ::protozero::Message {
29879  public:
29880   using Decoder = F2fsTruncateInodeBlocksEnterFtraceEvent_Decoder;
29881   enum : int32_t {
29882     kDevFieldNumber = 1,
29883     kInoFieldNumber = 2,
29884     kSizeFieldNumber = 3,
29885     kBlocksFieldNumber = 4,
29886     kFromFieldNumber = 5,
29887   };
29888   void set_dev(uint64_t value) {
29889     AppendVarInt(1, value);
29890   }
29891   void set_ino(uint64_t value) {
29892     AppendVarInt(2, value);
29893   }
29894   void set_size(int64_t value) {
29895     AppendVarInt(3, value);
29896   }
29897   void set_blocks(uint64_t value) {
29898     AppendVarInt(4, value);
29899   }
29900   void set_from(uint64_t value) {
29901     AppendVarInt(5, value);
29902   }
29903 };
29904 
29905 class F2fsTruncateDataBlocksRangeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
29906  public:
29907   F2fsTruncateDataBlocksRangeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
29908   explicit F2fsTruncateDataBlocksRangeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
29909   explicit F2fsTruncateDataBlocksRangeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
29910   bool has_dev() const { return at<1>().valid(); }
29911   uint64_t dev() const { return at<1>().as_uint64(); }
29912   bool has_ino() const { return at<2>().valid(); }
29913   uint64_t ino() const { return at<2>().as_uint64(); }
29914   bool has_nid() const { return at<3>().valid(); }
29915   uint32_t nid() const { return at<3>().as_uint32(); }
29916   bool has_ofs() const { return at<4>().valid(); }
29917   uint32_t ofs() const { return at<4>().as_uint32(); }
29918   bool has_free() const { return at<5>().valid(); }
29919   int32_t free() const { return at<5>().as_int32(); }
29920 };
29921 
29922 class F2fsTruncateDataBlocksRangeFtraceEvent : public ::protozero::Message {
29923  public:
29924   using Decoder = F2fsTruncateDataBlocksRangeFtraceEvent_Decoder;
29925   enum : int32_t {
29926     kDevFieldNumber = 1,
29927     kInoFieldNumber = 2,
29928     kNidFieldNumber = 3,
29929     kOfsFieldNumber = 4,
29930     kFreeFieldNumber = 5,
29931   };
29932   void set_dev(uint64_t value) {
29933     AppendVarInt(1, value);
29934   }
29935   void set_ino(uint64_t value) {
29936     AppendVarInt(2, value);
29937   }
29938   void set_nid(uint32_t value) {
29939     AppendVarInt(3, value);
29940   }
29941   void set_ofs(uint32_t value) {
29942     AppendVarInt(4, value);
29943   }
29944   void set_free(int32_t value) {
29945     AppendVarInt(5, value);
29946   }
29947 };
29948 
29949 class F2fsTruncateBlocksExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
29950  public:
29951   F2fsTruncateBlocksExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
29952   explicit F2fsTruncateBlocksExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
29953   explicit F2fsTruncateBlocksExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
29954   bool has_dev() const { return at<1>().valid(); }
29955   uint64_t dev() const { return at<1>().as_uint64(); }
29956   bool has_ino() const { return at<2>().valid(); }
29957   uint64_t ino() const { return at<2>().as_uint64(); }
29958   bool has_ret() const { return at<3>().valid(); }
29959   int32_t ret() const { return at<3>().as_int32(); }
29960 };
29961 
29962 class F2fsTruncateBlocksExitFtraceEvent : public ::protozero::Message {
29963  public:
29964   using Decoder = F2fsTruncateBlocksExitFtraceEvent_Decoder;
29965   enum : int32_t {
29966     kDevFieldNumber = 1,
29967     kInoFieldNumber = 2,
29968     kRetFieldNumber = 3,
29969   };
29970   void set_dev(uint64_t value) {
29971     AppendVarInt(1, value);
29972   }
29973   void set_ino(uint64_t value) {
29974     AppendVarInt(2, value);
29975   }
29976   void set_ret(int32_t value) {
29977     AppendVarInt(3, value);
29978   }
29979 };
29980 
29981 class F2fsTruncateBlocksEnterFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
29982  public:
29983   F2fsTruncateBlocksEnterFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
29984   explicit F2fsTruncateBlocksEnterFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
29985   explicit F2fsTruncateBlocksEnterFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
29986   bool has_dev() const { return at<1>().valid(); }
29987   uint64_t dev() const { return at<1>().as_uint64(); }
29988   bool has_ino() const { return at<2>().valid(); }
29989   uint64_t ino() const { return at<2>().as_uint64(); }
29990   bool has_size() const { return at<3>().valid(); }
29991   int64_t size() const { return at<3>().as_int64(); }
29992   bool has_blocks() const { return at<4>().valid(); }
29993   uint64_t blocks() const { return at<4>().as_uint64(); }
29994   bool has_from() const { return at<5>().valid(); }
29995   uint64_t from() const { return at<5>().as_uint64(); }
29996 };
29997 
29998 class F2fsTruncateBlocksEnterFtraceEvent : public ::protozero::Message {
29999  public:
30000   using Decoder = F2fsTruncateBlocksEnterFtraceEvent_Decoder;
30001   enum : int32_t {
30002     kDevFieldNumber = 1,
30003     kInoFieldNumber = 2,
30004     kSizeFieldNumber = 3,
30005     kBlocksFieldNumber = 4,
30006     kFromFieldNumber = 5,
30007   };
30008   void set_dev(uint64_t value) {
30009     AppendVarInt(1, value);
30010   }
30011   void set_ino(uint64_t value) {
30012     AppendVarInt(2, value);
30013   }
30014   void set_size(int64_t value) {
30015     AppendVarInt(3, value);
30016   }
30017   void set_blocks(uint64_t value) {
30018     AppendVarInt(4, value);
30019   }
30020   void set_from(uint64_t value) {
30021     AppendVarInt(5, value);
30022   }
30023 };
30024 
30025 class F2fsTruncateFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
30026  public:
30027   F2fsTruncateFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
30028   explicit F2fsTruncateFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
30029   explicit F2fsTruncateFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
30030   bool has_dev() const { return at<1>().valid(); }
30031   uint64_t dev() const { return at<1>().as_uint64(); }
30032   bool has_ino() const { return at<2>().valid(); }
30033   uint64_t ino() const { return at<2>().as_uint64(); }
30034   bool has_pino() const { return at<3>().valid(); }
30035   uint64_t pino() const { return at<3>().as_uint64(); }
30036   bool has_mode() const { return at<4>().valid(); }
30037   uint32_t mode() const { return at<4>().as_uint32(); }
30038   bool has_size() const { return at<5>().valid(); }
30039   int64_t size() const { return at<5>().as_int64(); }
30040   bool has_nlink() const { return at<6>().valid(); }
30041   uint32_t nlink() const { return at<6>().as_uint32(); }
30042   bool has_blocks() const { return at<7>().valid(); }
30043   uint64_t blocks() const { return at<7>().as_uint64(); }
30044   bool has_advise() const { return at<8>().valid(); }
30045   uint32_t advise() const { return at<8>().as_uint32(); }
30046 };
30047 
30048 class F2fsTruncateFtraceEvent : public ::protozero::Message {
30049  public:
30050   using Decoder = F2fsTruncateFtraceEvent_Decoder;
30051   enum : int32_t {
30052     kDevFieldNumber = 1,
30053     kInoFieldNumber = 2,
30054     kPinoFieldNumber = 3,
30055     kModeFieldNumber = 4,
30056     kSizeFieldNumber = 5,
30057     kNlinkFieldNumber = 6,
30058     kBlocksFieldNumber = 7,
30059     kAdviseFieldNumber = 8,
30060   };
30061   void set_dev(uint64_t value) {
30062     AppendVarInt(1, value);
30063   }
30064   void set_ino(uint64_t value) {
30065     AppendVarInt(2, value);
30066   }
30067   void set_pino(uint64_t value) {
30068     AppendVarInt(3, value);
30069   }
30070   void set_mode(uint32_t value) {
30071     AppendVarInt(4, value);
30072   }
30073   void set_size(int64_t value) {
30074     AppendVarInt(5, value);
30075   }
30076   void set_nlink(uint32_t value) {
30077     AppendVarInt(6, value);
30078   }
30079   void set_blocks(uint64_t value) {
30080     AppendVarInt(7, value);
30081   }
30082   void set_advise(uint32_t value) {
30083     AppendVarInt(8, value);
30084   }
30085 };
30086 
30087 class F2fsSyncFsFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
30088  public:
30089   F2fsSyncFsFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
30090   explicit F2fsSyncFsFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
30091   explicit F2fsSyncFsFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
30092   bool has_dev() const { return at<1>().valid(); }
30093   uint64_t dev() const { return at<1>().as_uint64(); }
30094   bool has_dirty() const { return at<2>().valid(); }
30095   int32_t dirty() const { return at<2>().as_int32(); }
30096   bool has_wait() const { return at<3>().valid(); }
30097   int32_t wait() const { return at<3>().as_int32(); }
30098 };
30099 
30100 class F2fsSyncFsFtraceEvent : public ::protozero::Message {
30101  public:
30102   using Decoder = F2fsSyncFsFtraceEvent_Decoder;
30103   enum : int32_t {
30104     kDevFieldNumber = 1,
30105     kDirtyFieldNumber = 2,
30106     kWaitFieldNumber = 3,
30107   };
30108   void set_dev(uint64_t value) {
30109     AppendVarInt(1, value);
30110   }
30111   void set_dirty(int32_t value) {
30112     AppendVarInt(2, value);
30113   }
30114   void set_wait(int32_t value) {
30115     AppendVarInt(3, value);
30116   }
30117 };
30118 
30119 class F2fsSyncFileExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
30120  public:
30121   F2fsSyncFileExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
30122   explicit F2fsSyncFileExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
30123   explicit F2fsSyncFileExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
30124   bool has_dev() const { return at<1>().valid(); }
30125   uint64_t dev() const { return at<1>().as_uint64(); }
30126   bool has_ino() const { return at<2>().valid(); }
30127   uint64_t ino() const { return at<2>().as_uint64(); }
30128   bool has_need_cp() const { return at<3>().valid(); }
30129   uint32_t need_cp() const { return at<3>().as_uint32(); }
30130   bool has_datasync() const { return at<4>().valid(); }
30131   int32_t datasync() const { return at<4>().as_int32(); }
30132   bool has_ret() const { return at<5>().valid(); }
30133   int32_t ret() const { return at<5>().as_int32(); }
30134 };
30135 
30136 class F2fsSyncFileExitFtraceEvent : public ::protozero::Message {
30137  public:
30138   using Decoder = F2fsSyncFileExitFtraceEvent_Decoder;
30139   enum : int32_t {
30140     kDevFieldNumber = 1,
30141     kInoFieldNumber = 2,
30142     kNeedCpFieldNumber = 3,
30143     kDatasyncFieldNumber = 4,
30144     kRetFieldNumber = 5,
30145   };
30146   void set_dev(uint64_t value) {
30147     AppendVarInt(1, value);
30148   }
30149   void set_ino(uint64_t value) {
30150     AppendVarInt(2, value);
30151   }
30152   void set_need_cp(uint32_t value) {
30153     AppendVarInt(3, value);
30154   }
30155   void set_datasync(int32_t value) {
30156     AppendVarInt(4, value);
30157   }
30158   void set_ret(int32_t value) {
30159     AppendVarInt(5, value);
30160   }
30161 };
30162 
30163 class F2fsSyncFileEnterFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
30164  public:
30165   F2fsSyncFileEnterFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
30166   explicit F2fsSyncFileEnterFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
30167   explicit F2fsSyncFileEnterFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
30168   bool has_dev() const { return at<1>().valid(); }
30169   uint64_t dev() const { return at<1>().as_uint64(); }
30170   bool has_ino() const { return at<2>().valid(); }
30171   uint64_t ino() const { return at<2>().as_uint64(); }
30172   bool has_pino() const { return at<3>().valid(); }
30173   uint64_t pino() const { return at<3>().as_uint64(); }
30174   bool has_mode() const { return at<4>().valid(); }
30175   uint32_t mode() const { return at<4>().as_uint32(); }
30176   bool has_size() const { return at<5>().valid(); }
30177   int64_t size() const { return at<5>().as_int64(); }
30178   bool has_nlink() const { return at<6>().valid(); }
30179   uint32_t nlink() const { return at<6>().as_uint32(); }
30180   bool has_blocks() const { return at<7>().valid(); }
30181   uint64_t blocks() const { return at<7>().as_uint64(); }
30182   bool has_advise() const { return at<8>().valid(); }
30183   uint32_t advise() const { return at<8>().as_uint32(); }
30184 };
30185 
30186 class F2fsSyncFileEnterFtraceEvent : public ::protozero::Message {
30187  public:
30188   using Decoder = F2fsSyncFileEnterFtraceEvent_Decoder;
30189   enum : int32_t {
30190     kDevFieldNumber = 1,
30191     kInoFieldNumber = 2,
30192     kPinoFieldNumber = 3,
30193     kModeFieldNumber = 4,
30194     kSizeFieldNumber = 5,
30195     kNlinkFieldNumber = 6,
30196     kBlocksFieldNumber = 7,
30197     kAdviseFieldNumber = 8,
30198   };
30199   void set_dev(uint64_t value) {
30200     AppendVarInt(1, value);
30201   }
30202   void set_ino(uint64_t value) {
30203     AppendVarInt(2, value);
30204   }
30205   void set_pino(uint64_t value) {
30206     AppendVarInt(3, value);
30207   }
30208   void set_mode(uint32_t value) {
30209     AppendVarInt(4, value);
30210   }
30211   void set_size(int64_t value) {
30212     AppendVarInt(5, value);
30213   }
30214   void set_nlink(uint32_t value) {
30215     AppendVarInt(6, value);
30216   }
30217   void set_blocks(uint64_t value) {
30218     AppendVarInt(7, value);
30219   }
30220   void set_advise(uint32_t value) {
30221     AppendVarInt(8, value);
30222   }
30223 };
30224 
30225 class F2fsSubmitWritePageFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
30226  public:
30227   F2fsSubmitWritePageFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
30228   explicit F2fsSubmitWritePageFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
30229   explicit F2fsSubmitWritePageFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
30230   bool has_dev() const { return at<1>().valid(); }
30231   uint64_t dev() const { return at<1>().as_uint64(); }
30232   bool has_ino() const { return at<2>().valid(); }
30233   uint64_t ino() const { return at<2>().as_uint64(); }
30234   bool has_type() const { return at<3>().valid(); }
30235   int32_t type() const { return at<3>().as_int32(); }
30236   bool has_index() const { return at<4>().valid(); }
30237   uint64_t index() const { return at<4>().as_uint64(); }
30238   bool has_block() const { return at<5>().valid(); }
30239   uint32_t block() const { return at<5>().as_uint32(); }
30240 };
30241 
30242 class F2fsSubmitWritePageFtraceEvent : public ::protozero::Message {
30243  public:
30244   using Decoder = F2fsSubmitWritePageFtraceEvent_Decoder;
30245   enum : int32_t {
30246     kDevFieldNumber = 1,
30247     kInoFieldNumber = 2,
30248     kTypeFieldNumber = 3,
30249     kIndexFieldNumber = 4,
30250     kBlockFieldNumber = 5,
30251   };
30252   void set_dev(uint64_t value) {
30253     AppendVarInt(1, value);
30254   }
30255   void set_ino(uint64_t value) {
30256     AppendVarInt(2, value);
30257   }
30258   void set_type(int32_t value) {
30259     AppendVarInt(3, value);
30260   }
30261   void set_index(uint64_t value) {
30262     AppendVarInt(4, value);
30263   }
30264   void set_block(uint32_t value) {
30265     AppendVarInt(5, value);
30266   }
30267 };
30268 
30269 class F2fsSetPageDirtyFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
30270  public:
30271   F2fsSetPageDirtyFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
30272   explicit F2fsSetPageDirtyFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
30273   explicit F2fsSetPageDirtyFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
30274   bool has_dev() const { return at<1>().valid(); }
30275   uint64_t dev() const { return at<1>().as_uint64(); }
30276   bool has_ino() const { return at<2>().valid(); }
30277   uint64_t ino() const { return at<2>().as_uint64(); }
30278   bool has_type() const { return at<3>().valid(); }
30279   int32_t type() const { return at<3>().as_int32(); }
30280   bool has_dir() const { return at<4>().valid(); }
30281   int32_t dir() const { return at<4>().as_int32(); }
30282   bool has_index() const { return at<5>().valid(); }
30283   uint64_t index() const { return at<5>().as_uint64(); }
30284   bool has_dirty() const { return at<6>().valid(); }
30285   int32_t dirty() const { return at<6>().as_int32(); }
30286 };
30287 
30288 class F2fsSetPageDirtyFtraceEvent : public ::protozero::Message {
30289  public:
30290   using Decoder = F2fsSetPageDirtyFtraceEvent_Decoder;
30291   enum : int32_t {
30292     kDevFieldNumber = 1,
30293     kInoFieldNumber = 2,
30294     kTypeFieldNumber = 3,
30295     kDirFieldNumber = 4,
30296     kIndexFieldNumber = 5,
30297     kDirtyFieldNumber = 6,
30298   };
30299   void set_dev(uint64_t value) {
30300     AppendVarInt(1, value);
30301   }
30302   void set_ino(uint64_t value) {
30303     AppendVarInt(2, value);
30304   }
30305   void set_type(int32_t value) {
30306     AppendVarInt(3, value);
30307   }
30308   void set_dir(int32_t value) {
30309     AppendVarInt(4, value);
30310   }
30311   void set_index(uint64_t value) {
30312     AppendVarInt(5, value);
30313   }
30314   void set_dirty(int32_t value) {
30315     AppendVarInt(6, value);
30316   }
30317 };
30318 
30319 class F2fsReserveNewBlockFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
30320  public:
30321   F2fsReserveNewBlockFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
30322   explicit F2fsReserveNewBlockFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
30323   explicit F2fsReserveNewBlockFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
30324   bool has_dev() const { return at<1>().valid(); }
30325   uint64_t dev() const { return at<1>().as_uint64(); }
30326   bool has_nid() const { return at<2>().valid(); }
30327   uint32_t nid() const { return at<2>().as_uint32(); }
30328   bool has_ofs_in_node() const { return at<3>().valid(); }
30329   uint32_t ofs_in_node() const { return at<3>().as_uint32(); }
30330 };
30331 
30332 class F2fsReserveNewBlockFtraceEvent : public ::protozero::Message {
30333  public:
30334   using Decoder = F2fsReserveNewBlockFtraceEvent_Decoder;
30335   enum : int32_t {
30336     kDevFieldNumber = 1,
30337     kNidFieldNumber = 2,
30338     kOfsInNodeFieldNumber = 3,
30339   };
30340   void set_dev(uint64_t value) {
30341     AppendVarInt(1, value);
30342   }
30343   void set_nid(uint32_t value) {
30344     AppendVarInt(2, value);
30345   }
30346   void set_ofs_in_node(uint32_t value) {
30347     AppendVarInt(3, value);
30348   }
30349 };
30350 
30351 class F2fsReadpageFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
30352  public:
30353   F2fsReadpageFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
30354   explicit F2fsReadpageFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
30355   explicit F2fsReadpageFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
30356   bool has_dev() const { return at<1>().valid(); }
30357   uint64_t dev() const { return at<1>().as_uint64(); }
30358   bool has_ino() const { return at<2>().valid(); }
30359   uint64_t ino() const { return at<2>().as_uint64(); }
30360   bool has_index() const { return at<3>().valid(); }
30361   uint64_t index() const { return at<3>().as_uint64(); }
30362   bool has_blkaddr() const { return at<4>().valid(); }
30363   uint64_t blkaddr() const { return at<4>().as_uint64(); }
30364   bool has_type() const { return at<5>().valid(); }
30365   int32_t type() const { return at<5>().as_int32(); }
30366 };
30367 
30368 class F2fsReadpageFtraceEvent : public ::protozero::Message {
30369  public:
30370   using Decoder = F2fsReadpageFtraceEvent_Decoder;
30371   enum : int32_t {
30372     kDevFieldNumber = 1,
30373     kInoFieldNumber = 2,
30374     kIndexFieldNumber = 3,
30375     kBlkaddrFieldNumber = 4,
30376     kTypeFieldNumber = 5,
30377   };
30378   void set_dev(uint64_t value) {
30379     AppendVarInt(1, value);
30380   }
30381   void set_ino(uint64_t value) {
30382     AppendVarInt(2, value);
30383   }
30384   void set_index(uint64_t value) {
30385     AppendVarInt(3, value);
30386   }
30387   void set_blkaddr(uint64_t value) {
30388     AppendVarInt(4, value);
30389   }
30390   void set_type(int32_t value) {
30391     AppendVarInt(5, value);
30392   }
30393 };
30394 
30395 class F2fsNewInodeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
30396  public:
30397   F2fsNewInodeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
30398   explicit F2fsNewInodeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
30399   explicit F2fsNewInodeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
30400   bool has_dev() const { return at<1>().valid(); }
30401   uint64_t dev() const { return at<1>().as_uint64(); }
30402   bool has_ino() const { return at<2>().valid(); }
30403   uint64_t ino() const { return at<2>().as_uint64(); }
30404   bool has_ret() const { return at<3>().valid(); }
30405   int32_t ret() const { return at<3>().as_int32(); }
30406 };
30407 
30408 class F2fsNewInodeFtraceEvent : public ::protozero::Message {
30409  public:
30410   using Decoder = F2fsNewInodeFtraceEvent_Decoder;
30411   enum : int32_t {
30412     kDevFieldNumber = 1,
30413     kInoFieldNumber = 2,
30414     kRetFieldNumber = 3,
30415   };
30416   void set_dev(uint64_t value) {
30417     AppendVarInt(1, value);
30418   }
30419   void set_ino(uint64_t value) {
30420     AppendVarInt(2, value);
30421   }
30422   void set_ret(int32_t value) {
30423     AppendVarInt(3, value);
30424   }
30425 };
30426 
30427 class F2fsIgetExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
30428  public:
30429   F2fsIgetExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
30430   explicit F2fsIgetExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
30431   explicit F2fsIgetExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
30432   bool has_dev() const { return at<1>().valid(); }
30433   uint64_t dev() const { return at<1>().as_uint64(); }
30434   bool has_ino() const { return at<2>().valid(); }
30435   uint64_t ino() const { return at<2>().as_uint64(); }
30436   bool has_ret() const { return at<3>().valid(); }
30437   int32_t ret() const { return at<3>().as_int32(); }
30438 };
30439 
30440 class F2fsIgetExitFtraceEvent : public ::protozero::Message {
30441  public:
30442   using Decoder = F2fsIgetExitFtraceEvent_Decoder;
30443   enum : int32_t {
30444     kDevFieldNumber = 1,
30445     kInoFieldNumber = 2,
30446     kRetFieldNumber = 3,
30447   };
30448   void set_dev(uint64_t value) {
30449     AppendVarInt(1, value);
30450   }
30451   void set_ino(uint64_t value) {
30452     AppendVarInt(2, value);
30453   }
30454   void set_ret(int32_t value) {
30455     AppendVarInt(3, value);
30456   }
30457 };
30458 
30459 class F2fsIgetFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
30460  public:
30461   F2fsIgetFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
30462   explicit F2fsIgetFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
30463   explicit F2fsIgetFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
30464   bool has_dev() const { return at<1>().valid(); }
30465   uint64_t dev() const { return at<1>().as_uint64(); }
30466   bool has_ino() const { return at<2>().valid(); }
30467   uint64_t ino() const { return at<2>().as_uint64(); }
30468   bool has_pino() const { return at<3>().valid(); }
30469   uint64_t pino() const { return at<3>().as_uint64(); }
30470   bool has_mode() const { return at<4>().valid(); }
30471   uint32_t mode() const { return at<4>().as_uint32(); }
30472   bool has_size() const { return at<5>().valid(); }
30473   int64_t size() const { return at<5>().as_int64(); }
30474   bool has_nlink() const { return at<6>().valid(); }
30475   uint32_t nlink() const { return at<6>().as_uint32(); }
30476   bool has_blocks() const { return at<7>().valid(); }
30477   uint64_t blocks() const { return at<7>().as_uint64(); }
30478   bool has_advise() const { return at<8>().valid(); }
30479   uint32_t advise() const { return at<8>().as_uint32(); }
30480 };
30481 
30482 class F2fsIgetFtraceEvent : public ::protozero::Message {
30483  public:
30484   using Decoder = F2fsIgetFtraceEvent_Decoder;
30485   enum : int32_t {
30486     kDevFieldNumber = 1,
30487     kInoFieldNumber = 2,
30488     kPinoFieldNumber = 3,
30489     kModeFieldNumber = 4,
30490     kSizeFieldNumber = 5,
30491     kNlinkFieldNumber = 6,
30492     kBlocksFieldNumber = 7,
30493     kAdviseFieldNumber = 8,
30494   };
30495   void set_dev(uint64_t value) {
30496     AppendVarInt(1, value);
30497   }
30498   void set_ino(uint64_t value) {
30499     AppendVarInt(2, value);
30500   }
30501   void set_pino(uint64_t value) {
30502     AppendVarInt(3, value);
30503   }
30504   void set_mode(uint32_t value) {
30505     AppendVarInt(4, value);
30506   }
30507   void set_size(int64_t value) {
30508     AppendVarInt(5, value);
30509   }
30510   void set_nlink(uint32_t value) {
30511     AppendVarInt(6, value);
30512   }
30513   void set_blocks(uint64_t value) {
30514     AppendVarInt(7, value);
30515   }
30516   void set_advise(uint32_t value) {
30517     AppendVarInt(8, value);
30518   }
30519 };
30520 
30521 class F2fsGetVictimFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/10, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
30522  public:
30523   F2fsGetVictimFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
30524   explicit F2fsGetVictimFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
30525   explicit F2fsGetVictimFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
30526   bool has_dev() const { return at<1>().valid(); }
30527   uint64_t dev() const { return at<1>().as_uint64(); }
30528   bool has_type() const { return at<2>().valid(); }
30529   int32_t type() const { return at<2>().as_int32(); }
30530   bool has_gc_type() const { return at<3>().valid(); }
30531   int32_t gc_type() const { return at<3>().as_int32(); }
30532   bool has_alloc_mode() const { return at<4>().valid(); }
30533   int32_t alloc_mode() const { return at<4>().as_int32(); }
30534   bool has_gc_mode() const { return at<5>().valid(); }
30535   int32_t gc_mode() const { return at<5>().as_int32(); }
30536   bool has_victim() const { return at<6>().valid(); }
30537   uint32_t victim() const { return at<6>().as_uint32(); }
30538   bool has_ofs_unit() const { return at<7>().valid(); }
30539   uint32_t ofs_unit() const { return at<7>().as_uint32(); }
30540   bool has_pre_victim() const { return at<8>().valid(); }
30541   uint32_t pre_victim() const { return at<8>().as_uint32(); }
30542   bool has_prefree() const { return at<9>().valid(); }
30543   uint32_t prefree() const { return at<9>().as_uint32(); }
30544   bool has_free() const { return at<10>().valid(); }
30545   uint32_t free() const { return at<10>().as_uint32(); }
30546 };
30547 
30548 class F2fsGetVictimFtraceEvent : public ::protozero::Message {
30549  public:
30550   using Decoder = F2fsGetVictimFtraceEvent_Decoder;
30551   enum : int32_t {
30552     kDevFieldNumber = 1,
30553     kTypeFieldNumber = 2,
30554     kGcTypeFieldNumber = 3,
30555     kAllocModeFieldNumber = 4,
30556     kGcModeFieldNumber = 5,
30557     kVictimFieldNumber = 6,
30558     kOfsUnitFieldNumber = 7,
30559     kPreVictimFieldNumber = 8,
30560     kPrefreeFieldNumber = 9,
30561     kFreeFieldNumber = 10,
30562   };
30563   void set_dev(uint64_t value) {
30564     AppendVarInt(1, value);
30565   }
30566   void set_type(int32_t value) {
30567     AppendVarInt(2, value);
30568   }
30569   void set_gc_type(int32_t value) {
30570     AppendVarInt(3, value);
30571   }
30572   void set_alloc_mode(int32_t value) {
30573     AppendVarInt(4, value);
30574   }
30575   void set_gc_mode(int32_t value) {
30576     AppendVarInt(5, value);
30577   }
30578   void set_victim(uint32_t value) {
30579     AppendVarInt(6, value);
30580   }
30581   void set_ofs_unit(uint32_t value) {
30582     AppendVarInt(7, value);
30583   }
30584   void set_pre_victim(uint32_t value) {
30585     AppendVarInt(8, value);
30586   }
30587   void set_prefree(uint32_t value) {
30588     AppendVarInt(9, value);
30589   }
30590   void set_free(uint32_t value) {
30591     AppendVarInt(10, value);
30592   }
30593 };
30594 
30595 class F2fsGetDataBlockFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
30596  public:
30597   F2fsGetDataBlockFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
30598   explicit F2fsGetDataBlockFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
30599   explicit F2fsGetDataBlockFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
30600   bool has_dev() const { return at<1>().valid(); }
30601   uint64_t dev() const { return at<1>().as_uint64(); }
30602   bool has_ino() const { return at<2>().valid(); }
30603   uint64_t ino() const { return at<2>().as_uint64(); }
30604   bool has_iblock() const { return at<3>().valid(); }
30605   uint64_t iblock() const { return at<3>().as_uint64(); }
30606   bool has_bh_start() const { return at<4>().valid(); }
30607   uint64_t bh_start() const { return at<4>().as_uint64(); }
30608   bool has_bh_size() const { return at<5>().valid(); }
30609   uint64_t bh_size() const { return at<5>().as_uint64(); }
30610   bool has_ret() const { return at<6>().valid(); }
30611   int32_t ret() const { return at<6>().as_int32(); }
30612 };
30613 
30614 class F2fsGetDataBlockFtraceEvent : public ::protozero::Message {
30615  public:
30616   using Decoder = F2fsGetDataBlockFtraceEvent_Decoder;
30617   enum : int32_t {
30618     kDevFieldNumber = 1,
30619     kInoFieldNumber = 2,
30620     kIblockFieldNumber = 3,
30621     kBhStartFieldNumber = 4,
30622     kBhSizeFieldNumber = 5,
30623     kRetFieldNumber = 6,
30624   };
30625   void set_dev(uint64_t value) {
30626     AppendVarInt(1, value);
30627   }
30628   void set_ino(uint64_t value) {
30629     AppendVarInt(2, value);
30630   }
30631   void set_iblock(uint64_t value) {
30632     AppendVarInt(3, value);
30633   }
30634   void set_bh_start(uint64_t value) {
30635     AppendVarInt(4, value);
30636   }
30637   void set_bh_size(uint64_t value) {
30638     AppendVarInt(5, value);
30639   }
30640   void set_ret(int32_t value) {
30641     AppendVarInt(6, value);
30642   }
30643 };
30644 
30645 class F2fsFallocateFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
30646  public:
30647   F2fsFallocateFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
30648   explicit F2fsFallocateFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
30649   explicit F2fsFallocateFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
30650   bool has_dev() const { return at<1>().valid(); }
30651   uint64_t dev() const { return at<1>().as_uint64(); }
30652   bool has_ino() const { return at<2>().valid(); }
30653   uint64_t ino() const { return at<2>().as_uint64(); }
30654   bool has_mode() const { return at<3>().valid(); }
30655   int32_t mode() const { return at<3>().as_int32(); }
30656   bool has_offset() const { return at<4>().valid(); }
30657   int64_t offset() const { return at<4>().as_int64(); }
30658   bool has_len() const { return at<5>().valid(); }
30659   int64_t len() const { return at<5>().as_int64(); }
30660   bool has_size() const { return at<6>().valid(); }
30661   int64_t size() const { return at<6>().as_int64(); }
30662   bool has_blocks() const { return at<7>().valid(); }
30663   uint64_t blocks() const { return at<7>().as_uint64(); }
30664   bool has_ret() const { return at<8>().valid(); }
30665   int32_t ret() const { return at<8>().as_int32(); }
30666 };
30667 
30668 class F2fsFallocateFtraceEvent : public ::protozero::Message {
30669  public:
30670   using Decoder = F2fsFallocateFtraceEvent_Decoder;
30671   enum : int32_t {
30672     kDevFieldNumber = 1,
30673     kInoFieldNumber = 2,
30674     kModeFieldNumber = 3,
30675     kOffsetFieldNumber = 4,
30676     kLenFieldNumber = 5,
30677     kSizeFieldNumber = 6,
30678     kBlocksFieldNumber = 7,
30679     kRetFieldNumber = 8,
30680   };
30681   void set_dev(uint64_t value) {
30682     AppendVarInt(1, value);
30683   }
30684   void set_ino(uint64_t value) {
30685     AppendVarInt(2, value);
30686   }
30687   void set_mode(int32_t value) {
30688     AppendVarInt(3, value);
30689   }
30690   void set_offset(int64_t value) {
30691     AppendVarInt(4, value);
30692   }
30693   void set_len(int64_t value) {
30694     AppendVarInt(5, value);
30695   }
30696   void set_size(int64_t value) {
30697     AppendVarInt(6, value);
30698   }
30699   void set_blocks(uint64_t value) {
30700     AppendVarInt(7, value);
30701   }
30702   void set_ret(int32_t value) {
30703     AppendVarInt(8, value);
30704   }
30705 };
30706 
30707 class F2fsEvictInodeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
30708  public:
30709   F2fsEvictInodeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
30710   explicit F2fsEvictInodeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
30711   explicit F2fsEvictInodeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
30712   bool has_dev() const { return at<1>().valid(); }
30713   uint64_t dev() const { return at<1>().as_uint64(); }
30714   bool has_ino() const { return at<2>().valid(); }
30715   uint64_t ino() const { return at<2>().as_uint64(); }
30716   bool has_pino() const { return at<3>().valid(); }
30717   uint64_t pino() const { return at<3>().as_uint64(); }
30718   bool has_mode() const { return at<4>().valid(); }
30719   uint32_t mode() const { return at<4>().as_uint32(); }
30720   bool has_size() const { return at<5>().valid(); }
30721   int64_t size() const { return at<5>().as_int64(); }
30722   bool has_nlink() const { return at<6>().valid(); }
30723   uint32_t nlink() const { return at<6>().as_uint32(); }
30724   bool has_blocks() const { return at<7>().valid(); }
30725   uint64_t blocks() const { return at<7>().as_uint64(); }
30726   bool has_advise() const { return at<8>().valid(); }
30727   uint32_t advise() const { return at<8>().as_uint32(); }
30728 };
30729 
30730 class F2fsEvictInodeFtraceEvent : public ::protozero::Message {
30731  public:
30732   using Decoder = F2fsEvictInodeFtraceEvent_Decoder;
30733   enum : int32_t {
30734     kDevFieldNumber = 1,
30735     kInoFieldNumber = 2,
30736     kPinoFieldNumber = 3,
30737     kModeFieldNumber = 4,
30738     kSizeFieldNumber = 5,
30739     kNlinkFieldNumber = 6,
30740     kBlocksFieldNumber = 7,
30741     kAdviseFieldNumber = 8,
30742   };
30743   void set_dev(uint64_t value) {
30744     AppendVarInt(1, value);
30745   }
30746   void set_ino(uint64_t value) {
30747     AppendVarInt(2, value);
30748   }
30749   void set_pino(uint64_t value) {
30750     AppendVarInt(3, value);
30751   }
30752   void set_mode(uint32_t value) {
30753     AppendVarInt(4, value);
30754   }
30755   void set_size(int64_t value) {
30756     AppendVarInt(5, value);
30757   }
30758   void set_nlink(uint32_t value) {
30759     AppendVarInt(6, value);
30760   }
30761   void set_blocks(uint64_t value) {
30762     AppendVarInt(7, value);
30763   }
30764   void set_advise(uint32_t value) {
30765     AppendVarInt(8, value);
30766   }
30767 };
30768 
30769 class F2fsDoSubmitBioFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
30770  public:
30771   F2fsDoSubmitBioFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
30772   explicit F2fsDoSubmitBioFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
30773   explicit F2fsDoSubmitBioFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
30774   bool has_dev() const { return at<1>().valid(); }
30775   uint64_t dev() const { return at<1>().as_uint64(); }
30776   bool has_btype() const { return at<2>().valid(); }
30777   int32_t btype() const { return at<2>().as_int32(); }
30778   bool has_sync() const { return at<3>().valid(); }
30779   uint32_t sync() const { return at<3>().as_uint32(); }
30780   bool has_sector() const { return at<4>().valid(); }
30781   uint64_t sector() const { return at<4>().as_uint64(); }
30782   bool has_size() const { return at<5>().valid(); }
30783   uint32_t size() const { return at<5>().as_uint32(); }
30784 };
30785 
30786 class F2fsDoSubmitBioFtraceEvent : public ::protozero::Message {
30787  public:
30788   using Decoder = F2fsDoSubmitBioFtraceEvent_Decoder;
30789   enum : int32_t {
30790     kDevFieldNumber = 1,
30791     kBtypeFieldNumber = 2,
30792     kSyncFieldNumber = 3,
30793     kSectorFieldNumber = 4,
30794     kSizeFieldNumber = 5,
30795   };
30796   void set_dev(uint64_t value) {
30797     AppendVarInt(1, value);
30798   }
30799   void set_btype(int32_t value) {
30800     AppendVarInt(2, value);
30801   }
30802   void set_sync(uint32_t value) {
30803     AppendVarInt(3, value);
30804   }
30805   void set_sector(uint64_t value) {
30806     AppendVarInt(4, value);
30807   }
30808   void set_size(uint32_t value) {
30809     AppendVarInt(5, value);
30810   }
30811 };
30812 
30813 } // Namespace.
30814 } // Namespace.
30815 } // Namespace.
30816 #endif  // Include guard.
30817 // gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/fence.pbzero.h
30818 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
30819 
30820 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_FENCE_PROTO_H_
30821 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_FENCE_PROTO_H_
30822 
30823 #include <stddef.h>
30824 #include <stdint.h>
30825 
30826 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
30827 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
30828 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
30829 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
30830 
30831 namespace perfetto {
30832 namespace protos {
30833 namespace pbzero {
30834 
30835 
30836 class FenceSignaledFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
30837  public:
30838   FenceSignaledFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
30839   explicit FenceSignaledFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
30840   explicit FenceSignaledFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
30841   bool has_context() const { return at<1>().valid(); }
30842   uint32_t context() const { return at<1>().as_uint32(); }
30843   bool has_driver() const { return at<2>().valid(); }
30844   ::protozero::ConstChars driver() const { return at<2>().as_string(); }
30845   bool has_seqno() const { return at<3>().valid(); }
30846   uint32_t seqno() const { return at<3>().as_uint32(); }
30847   bool has_timeline() const { return at<4>().valid(); }
30848   ::protozero::ConstChars timeline() const { return at<4>().as_string(); }
30849 };
30850 
30851 class FenceSignaledFtraceEvent : public ::protozero::Message {
30852  public:
30853   using Decoder = FenceSignaledFtraceEvent_Decoder;
30854   enum : int32_t {
30855     kContextFieldNumber = 1,
30856     kDriverFieldNumber = 2,
30857     kSeqnoFieldNumber = 3,
30858     kTimelineFieldNumber = 4,
30859   };
30860   void set_context(uint32_t value) {
30861     AppendVarInt(1, value);
30862   }
30863   void set_driver(const std::string& value) {
30864     AppendBytes(2, value.data(), value.size());
30865   }
30866   void set_driver(const char* data, size_t size) {
30867     AppendBytes(2, data, size);
30868   }
30869   void set_seqno(uint32_t value) {
30870     AppendVarInt(3, value);
30871   }
30872   void set_timeline(const std::string& value) {
30873     AppendBytes(4, value.data(), value.size());
30874   }
30875   void set_timeline(const char* data, size_t size) {
30876     AppendBytes(4, data, size);
30877   }
30878 };
30879 
30880 class FenceEnableSignalFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
30881  public:
30882   FenceEnableSignalFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
30883   explicit FenceEnableSignalFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
30884   explicit FenceEnableSignalFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
30885   bool has_context() const { return at<1>().valid(); }
30886   uint32_t context() const { return at<1>().as_uint32(); }
30887   bool has_driver() const { return at<2>().valid(); }
30888   ::protozero::ConstChars driver() const { return at<2>().as_string(); }
30889   bool has_seqno() const { return at<3>().valid(); }
30890   uint32_t seqno() const { return at<3>().as_uint32(); }
30891   bool has_timeline() const { return at<4>().valid(); }
30892   ::protozero::ConstChars timeline() const { return at<4>().as_string(); }
30893 };
30894 
30895 class FenceEnableSignalFtraceEvent : public ::protozero::Message {
30896  public:
30897   using Decoder = FenceEnableSignalFtraceEvent_Decoder;
30898   enum : int32_t {
30899     kContextFieldNumber = 1,
30900     kDriverFieldNumber = 2,
30901     kSeqnoFieldNumber = 3,
30902     kTimelineFieldNumber = 4,
30903   };
30904   void set_context(uint32_t value) {
30905     AppendVarInt(1, value);
30906   }
30907   void set_driver(const std::string& value) {
30908     AppendBytes(2, value.data(), value.size());
30909   }
30910   void set_driver(const char* data, size_t size) {
30911     AppendBytes(2, data, size);
30912   }
30913   void set_seqno(uint32_t value) {
30914     AppendVarInt(3, value);
30915   }
30916   void set_timeline(const std::string& value) {
30917     AppendBytes(4, value.data(), value.size());
30918   }
30919   void set_timeline(const char* data, size_t size) {
30920     AppendBytes(4, data, size);
30921   }
30922 };
30923 
30924 class FenceDestroyFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
30925  public:
30926   FenceDestroyFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
30927   explicit FenceDestroyFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
30928   explicit FenceDestroyFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
30929   bool has_context() const { return at<1>().valid(); }
30930   uint32_t context() const { return at<1>().as_uint32(); }
30931   bool has_driver() const { return at<2>().valid(); }
30932   ::protozero::ConstChars driver() const { return at<2>().as_string(); }
30933   bool has_seqno() const { return at<3>().valid(); }
30934   uint32_t seqno() const { return at<3>().as_uint32(); }
30935   bool has_timeline() const { return at<4>().valid(); }
30936   ::protozero::ConstChars timeline() const { return at<4>().as_string(); }
30937 };
30938 
30939 class FenceDestroyFtraceEvent : public ::protozero::Message {
30940  public:
30941   using Decoder = FenceDestroyFtraceEvent_Decoder;
30942   enum : int32_t {
30943     kContextFieldNumber = 1,
30944     kDriverFieldNumber = 2,
30945     kSeqnoFieldNumber = 3,
30946     kTimelineFieldNumber = 4,
30947   };
30948   void set_context(uint32_t value) {
30949     AppendVarInt(1, value);
30950   }
30951   void set_driver(const std::string& value) {
30952     AppendBytes(2, value.data(), value.size());
30953   }
30954   void set_driver(const char* data, size_t size) {
30955     AppendBytes(2, data, size);
30956   }
30957   void set_seqno(uint32_t value) {
30958     AppendVarInt(3, value);
30959   }
30960   void set_timeline(const std::string& value) {
30961     AppendBytes(4, value.data(), value.size());
30962   }
30963   void set_timeline(const char* data, size_t size) {
30964     AppendBytes(4, data, size);
30965   }
30966 };
30967 
30968 class FenceInitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
30969  public:
30970   FenceInitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
30971   explicit FenceInitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
30972   explicit FenceInitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
30973   bool has_context() const { return at<1>().valid(); }
30974   uint32_t context() const { return at<1>().as_uint32(); }
30975   bool has_driver() const { return at<2>().valid(); }
30976   ::protozero::ConstChars driver() const { return at<2>().as_string(); }
30977   bool has_seqno() const { return at<3>().valid(); }
30978   uint32_t seqno() const { return at<3>().as_uint32(); }
30979   bool has_timeline() const { return at<4>().valid(); }
30980   ::protozero::ConstChars timeline() const { return at<4>().as_string(); }
30981 };
30982 
30983 class FenceInitFtraceEvent : public ::protozero::Message {
30984  public:
30985   using Decoder = FenceInitFtraceEvent_Decoder;
30986   enum : int32_t {
30987     kContextFieldNumber = 1,
30988     kDriverFieldNumber = 2,
30989     kSeqnoFieldNumber = 3,
30990     kTimelineFieldNumber = 4,
30991   };
30992   void set_context(uint32_t value) {
30993     AppendVarInt(1, value);
30994   }
30995   void set_driver(const std::string& value) {
30996     AppendBytes(2, value.data(), value.size());
30997   }
30998   void set_driver(const char* data, size_t size) {
30999     AppendBytes(2, data, size);
31000   }
31001   void set_seqno(uint32_t value) {
31002     AppendVarInt(3, value);
31003   }
31004   void set_timeline(const std::string& value) {
31005     AppendBytes(4, value.data(), value.size());
31006   }
31007   void set_timeline(const char* data, size_t size) {
31008     AppendBytes(4, data, size);
31009   }
31010 };
31011 
31012 } // Namespace.
31013 } // Namespace.
31014 } // Namespace.
31015 #endif  // Include guard.
31016 // gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/filemap.pbzero.h
31017 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
31018 
31019 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_FILEMAP_PROTO_H_
31020 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_FILEMAP_PROTO_H_
31021 
31022 #include <stddef.h>
31023 #include <stdint.h>
31024 
31025 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
31026 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
31027 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
31028 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
31029 
31030 namespace perfetto {
31031 namespace protos {
31032 namespace pbzero {
31033 
31034 
31035 class MmFilemapDeleteFromPageCacheFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
31036  public:
31037   MmFilemapDeleteFromPageCacheFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
31038   explicit MmFilemapDeleteFromPageCacheFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
31039   explicit MmFilemapDeleteFromPageCacheFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
31040   bool has_pfn() const { return at<1>().valid(); }
31041   uint64_t pfn() const { return at<1>().as_uint64(); }
31042   bool has_i_ino() const { return at<2>().valid(); }
31043   uint64_t i_ino() const { return at<2>().as_uint64(); }
31044   bool has_index() const { return at<3>().valid(); }
31045   uint64_t index() const { return at<3>().as_uint64(); }
31046   bool has_s_dev() const { return at<4>().valid(); }
31047   uint64_t s_dev() const { return at<4>().as_uint64(); }
31048   bool has_page() const { return at<5>().valid(); }
31049   uint64_t page() const { return at<5>().as_uint64(); }
31050 };
31051 
31052 class MmFilemapDeleteFromPageCacheFtraceEvent : public ::protozero::Message {
31053  public:
31054   using Decoder = MmFilemapDeleteFromPageCacheFtraceEvent_Decoder;
31055   enum : int32_t {
31056     kPfnFieldNumber = 1,
31057     kIInoFieldNumber = 2,
31058     kIndexFieldNumber = 3,
31059     kSDevFieldNumber = 4,
31060     kPageFieldNumber = 5,
31061   };
31062   void set_pfn(uint64_t value) {
31063     AppendVarInt(1, value);
31064   }
31065   void set_i_ino(uint64_t value) {
31066     AppendVarInt(2, value);
31067   }
31068   void set_index(uint64_t value) {
31069     AppendVarInt(3, value);
31070   }
31071   void set_s_dev(uint64_t value) {
31072     AppendVarInt(4, value);
31073   }
31074   void set_page(uint64_t value) {
31075     AppendVarInt(5, value);
31076   }
31077 };
31078 
31079 class MmFilemapAddToPageCacheFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
31080  public:
31081   MmFilemapAddToPageCacheFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
31082   explicit MmFilemapAddToPageCacheFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
31083   explicit MmFilemapAddToPageCacheFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
31084   bool has_pfn() const { return at<1>().valid(); }
31085   uint64_t pfn() const { return at<1>().as_uint64(); }
31086   bool has_i_ino() const { return at<2>().valid(); }
31087   uint64_t i_ino() const { return at<2>().as_uint64(); }
31088   bool has_index() const { return at<3>().valid(); }
31089   uint64_t index() const { return at<3>().as_uint64(); }
31090   bool has_s_dev() const { return at<4>().valid(); }
31091   uint64_t s_dev() const { return at<4>().as_uint64(); }
31092   bool has_page() const { return at<5>().valid(); }
31093   uint64_t page() const { return at<5>().as_uint64(); }
31094 };
31095 
31096 class MmFilemapAddToPageCacheFtraceEvent : public ::protozero::Message {
31097  public:
31098   using Decoder = MmFilemapAddToPageCacheFtraceEvent_Decoder;
31099   enum : int32_t {
31100     kPfnFieldNumber = 1,
31101     kIInoFieldNumber = 2,
31102     kIndexFieldNumber = 3,
31103     kSDevFieldNumber = 4,
31104     kPageFieldNumber = 5,
31105   };
31106   void set_pfn(uint64_t value) {
31107     AppendVarInt(1, value);
31108   }
31109   void set_i_ino(uint64_t value) {
31110     AppendVarInt(2, value);
31111   }
31112   void set_index(uint64_t value) {
31113     AppendVarInt(3, value);
31114   }
31115   void set_s_dev(uint64_t value) {
31116     AppendVarInt(4, value);
31117   }
31118   void set_page(uint64_t value) {
31119     AppendVarInt(5, value);
31120   }
31121 };
31122 
31123 } // Namespace.
31124 } // Namespace.
31125 } // Namespace.
31126 #endif  // Include guard.
31127 // gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/ftrace.pbzero.h
31128 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
31129 
31130 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_FTRACE_PROTO_H_
31131 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_FTRACE_PROTO_H_
31132 
31133 #include <stddef.h>
31134 #include <stdint.h>
31135 
31136 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
31137 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
31138 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
31139 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
31140 
31141 namespace perfetto {
31142 namespace protos {
31143 namespace pbzero {
31144 
31145 
31146 class PrintFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
31147  public:
31148   PrintFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
31149   explicit PrintFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
31150   explicit PrintFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
31151   bool has_ip() const { return at<1>().valid(); }
31152   uint64_t ip() const { return at<1>().as_uint64(); }
31153   bool has_buf() const { return at<2>().valid(); }
31154   ::protozero::ConstChars buf() const { return at<2>().as_string(); }
31155 };
31156 
31157 class PrintFtraceEvent : public ::protozero::Message {
31158  public:
31159   using Decoder = PrintFtraceEvent_Decoder;
31160   enum : int32_t {
31161     kIpFieldNumber = 1,
31162     kBufFieldNumber = 2,
31163   };
31164   void set_ip(uint64_t value) {
31165     AppendVarInt(1, value);
31166   }
31167   void set_buf(const std::string& value) {
31168     AppendBytes(2, value.data(), value.size());
31169   }
31170   void set_buf(const char* data, size_t size) {
31171     AppendBytes(2, data, size);
31172   }
31173 };
31174 
31175 } // Namespace.
31176 } // Namespace.
31177 } // Namespace.
31178 #endif  // Include guard.
31179 // gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/gpu_mem.pbzero.h
31180 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
31181 
31182 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_GPU_MEM_PROTO_H_
31183 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_GPU_MEM_PROTO_H_
31184 
31185 #include <stddef.h>
31186 #include <stdint.h>
31187 
31188 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
31189 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
31190 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
31191 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
31192 
31193 namespace perfetto {
31194 namespace protos {
31195 namespace pbzero {
31196 
31197 
31198 class GpuMemTotalFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
31199  public:
31200   GpuMemTotalFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
31201   explicit GpuMemTotalFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
31202   explicit GpuMemTotalFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
31203   bool has_gpu_id() const { return at<1>().valid(); }
31204   uint32_t gpu_id() const { return at<1>().as_uint32(); }
31205   bool has_pid() const { return at<2>().valid(); }
31206   uint32_t pid() const { return at<2>().as_uint32(); }
31207   bool has_size() const { return at<3>().valid(); }
31208   uint64_t size() const { return at<3>().as_uint64(); }
31209 };
31210 
31211 class GpuMemTotalFtraceEvent : public ::protozero::Message {
31212  public:
31213   using Decoder = GpuMemTotalFtraceEvent_Decoder;
31214   enum : int32_t {
31215     kGpuIdFieldNumber = 1,
31216     kPidFieldNumber = 2,
31217     kSizeFieldNumber = 3,
31218   };
31219   void set_gpu_id(uint32_t value) {
31220     AppendVarInt(1, value);
31221   }
31222   void set_pid(uint32_t value) {
31223     AppendVarInt(2, value);
31224   }
31225   void set_size(uint64_t value) {
31226     AppendVarInt(3, value);
31227   }
31228 };
31229 
31230 } // Namespace.
31231 } // Namespace.
31232 } // Namespace.
31233 #endif  // Include guard.
31234 // gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/i2c.pbzero.h
31235 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
31236 
31237 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_I2C_PROTO_H_
31238 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_I2C_PROTO_H_
31239 
31240 #include <stddef.h>
31241 #include <stdint.h>
31242 
31243 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
31244 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
31245 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
31246 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
31247 
31248 namespace perfetto {
31249 namespace protos {
31250 namespace pbzero {
31251 
31252 
31253 class SmbusReplyFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
31254  public:
31255   SmbusReplyFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
31256   explicit SmbusReplyFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
31257   explicit SmbusReplyFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
31258   bool has_adapter_nr() const { return at<1>().valid(); }
31259   int32_t adapter_nr() const { return at<1>().as_int32(); }
31260   bool has_addr() const { return at<2>().valid(); }
31261   uint32_t addr() const { return at<2>().as_uint32(); }
31262   bool has_flags() const { return at<3>().valid(); }
31263   uint32_t flags() const { return at<3>().as_uint32(); }
31264   bool has_command() const { return at<4>().valid(); }
31265   uint32_t command() const { return at<4>().as_uint32(); }
31266   bool has_len() const { return at<5>().valid(); }
31267   uint32_t len() const { return at<5>().as_uint32(); }
31268   bool has_protocol() const { return at<6>().valid(); }
31269   uint32_t protocol() const { return at<6>().as_uint32(); }
31270 };
31271 
31272 class SmbusReplyFtraceEvent : public ::protozero::Message {
31273  public:
31274   using Decoder = SmbusReplyFtraceEvent_Decoder;
31275   enum : int32_t {
31276     kAdapterNrFieldNumber = 1,
31277     kAddrFieldNumber = 2,
31278     kFlagsFieldNumber = 3,
31279     kCommandFieldNumber = 4,
31280     kLenFieldNumber = 5,
31281     kProtocolFieldNumber = 6,
31282   };
31283   void set_adapter_nr(int32_t value) {
31284     AppendVarInt(1, value);
31285   }
31286   void set_addr(uint32_t value) {
31287     AppendVarInt(2, value);
31288   }
31289   void set_flags(uint32_t value) {
31290     AppendVarInt(3, value);
31291   }
31292   void set_command(uint32_t value) {
31293     AppendVarInt(4, value);
31294   }
31295   void set_len(uint32_t value) {
31296     AppendVarInt(5, value);
31297   }
31298   void set_protocol(uint32_t value) {
31299     AppendVarInt(6, value);
31300   }
31301 };
31302 
31303 class SmbusResultFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
31304  public:
31305   SmbusResultFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
31306   explicit SmbusResultFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
31307   explicit SmbusResultFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
31308   bool has_adapter_nr() const { return at<1>().valid(); }
31309   int32_t adapter_nr() const { return at<1>().as_int32(); }
31310   bool has_addr() const { return at<2>().valid(); }
31311   uint32_t addr() const { return at<2>().as_uint32(); }
31312   bool has_flags() const { return at<3>().valid(); }
31313   uint32_t flags() const { return at<3>().as_uint32(); }
31314   bool has_read_write() const { return at<4>().valid(); }
31315   uint32_t read_write() const { return at<4>().as_uint32(); }
31316   bool has_command() const { return at<5>().valid(); }
31317   uint32_t command() const { return at<5>().as_uint32(); }
31318   bool has_res() const { return at<6>().valid(); }
31319   int32_t res() const { return at<6>().as_int32(); }
31320   bool has_protocol() const { return at<7>().valid(); }
31321   uint32_t protocol() const { return at<7>().as_uint32(); }
31322 };
31323 
31324 class SmbusResultFtraceEvent : public ::protozero::Message {
31325  public:
31326   using Decoder = SmbusResultFtraceEvent_Decoder;
31327   enum : int32_t {
31328     kAdapterNrFieldNumber = 1,
31329     kAddrFieldNumber = 2,
31330     kFlagsFieldNumber = 3,
31331     kReadWriteFieldNumber = 4,
31332     kCommandFieldNumber = 5,
31333     kResFieldNumber = 6,
31334     kProtocolFieldNumber = 7,
31335   };
31336   void set_adapter_nr(int32_t value) {
31337     AppendVarInt(1, value);
31338   }
31339   void set_addr(uint32_t value) {
31340     AppendVarInt(2, value);
31341   }
31342   void set_flags(uint32_t value) {
31343     AppendVarInt(3, value);
31344   }
31345   void set_read_write(uint32_t value) {
31346     AppendVarInt(4, value);
31347   }
31348   void set_command(uint32_t value) {
31349     AppendVarInt(5, value);
31350   }
31351   void set_res(int32_t value) {
31352     AppendVarInt(6, value);
31353   }
31354   void set_protocol(uint32_t value) {
31355     AppendVarInt(7, value);
31356   }
31357 };
31358 
31359 class SmbusWriteFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
31360  public:
31361   SmbusWriteFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
31362   explicit SmbusWriteFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
31363   explicit SmbusWriteFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
31364   bool has_adapter_nr() const { return at<1>().valid(); }
31365   int32_t adapter_nr() const { return at<1>().as_int32(); }
31366   bool has_addr() const { return at<2>().valid(); }
31367   uint32_t addr() const { return at<2>().as_uint32(); }
31368   bool has_flags() const { return at<3>().valid(); }
31369   uint32_t flags() const { return at<3>().as_uint32(); }
31370   bool has_command() const { return at<4>().valid(); }
31371   uint32_t command() const { return at<4>().as_uint32(); }
31372   bool has_len() const { return at<5>().valid(); }
31373   uint32_t len() const { return at<5>().as_uint32(); }
31374   bool has_protocol() const { return at<6>().valid(); }
31375   uint32_t protocol() const { return at<6>().as_uint32(); }
31376 };
31377 
31378 class SmbusWriteFtraceEvent : public ::protozero::Message {
31379  public:
31380   using Decoder = SmbusWriteFtraceEvent_Decoder;
31381   enum : int32_t {
31382     kAdapterNrFieldNumber = 1,
31383     kAddrFieldNumber = 2,
31384     kFlagsFieldNumber = 3,
31385     kCommandFieldNumber = 4,
31386     kLenFieldNumber = 5,
31387     kProtocolFieldNumber = 6,
31388   };
31389   void set_adapter_nr(int32_t value) {
31390     AppendVarInt(1, value);
31391   }
31392   void set_addr(uint32_t value) {
31393     AppendVarInt(2, value);
31394   }
31395   void set_flags(uint32_t value) {
31396     AppendVarInt(3, value);
31397   }
31398   void set_command(uint32_t value) {
31399     AppendVarInt(4, value);
31400   }
31401   void set_len(uint32_t value) {
31402     AppendVarInt(5, value);
31403   }
31404   void set_protocol(uint32_t value) {
31405     AppendVarInt(6, value);
31406   }
31407 };
31408 
31409 class SmbusReadFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
31410  public:
31411   SmbusReadFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
31412   explicit SmbusReadFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
31413   explicit SmbusReadFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
31414   bool has_adapter_nr() const { return at<1>().valid(); }
31415   int32_t adapter_nr() const { return at<1>().as_int32(); }
31416   bool has_flags() const { return at<2>().valid(); }
31417   uint32_t flags() const { return at<2>().as_uint32(); }
31418   bool has_addr() const { return at<3>().valid(); }
31419   uint32_t addr() const { return at<3>().as_uint32(); }
31420   bool has_command() const { return at<4>().valid(); }
31421   uint32_t command() const { return at<4>().as_uint32(); }
31422   bool has_protocol() const { return at<5>().valid(); }
31423   uint32_t protocol() const { return at<5>().as_uint32(); }
31424 };
31425 
31426 class SmbusReadFtraceEvent : public ::protozero::Message {
31427  public:
31428   using Decoder = SmbusReadFtraceEvent_Decoder;
31429   enum : int32_t {
31430     kAdapterNrFieldNumber = 1,
31431     kFlagsFieldNumber = 2,
31432     kAddrFieldNumber = 3,
31433     kCommandFieldNumber = 4,
31434     kProtocolFieldNumber = 5,
31435   };
31436   void set_adapter_nr(int32_t value) {
31437     AppendVarInt(1, value);
31438   }
31439   void set_flags(uint32_t value) {
31440     AppendVarInt(2, value);
31441   }
31442   void set_addr(uint32_t value) {
31443     AppendVarInt(3, value);
31444   }
31445   void set_command(uint32_t value) {
31446     AppendVarInt(4, value);
31447   }
31448   void set_protocol(uint32_t value) {
31449     AppendVarInt(5, value);
31450   }
31451 };
31452 
31453 class I2cReplyFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
31454  public:
31455   I2cReplyFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
31456   explicit I2cReplyFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
31457   explicit I2cReplyFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
31458   bool has_adapter_nr() const { return at<1>().valid(); }
31459   int32_t adapter_nr() const { return at<1>().as_int32(); }
31460   bool has_msg_nr() const { return at<2>().valid(); }
31461   uint32_t msg_nr() const { return at<2>().as_uint32(); }
31462   bool has_addr() const { return at<3>().valid(); }
31463   uint32_t addr() const { return at<3>().as_uint32(); }
31464   bool has_flags() const { return at<4>().valid(); }
31465   uint32_t flags() const { return at<4>().as_uint32(); }
31466   bool has_len() const { return at<5>().valid(); }
31467   uint32_t len() const { return at<5>().as_uint32(); }
31468   bool has_buf() const { return at<6>().valid(); }
31469   uint32_t buf() const { return at<6>().as_uint32(); }
31470 };
31471 
31472 class I2cReplyFtraceEvent : public ::protozero::Message {
31473  public:
31474   using Decoder = I2cReplyFtraceEvent_Decoder;
31475   enum : int32_t {
31476     kAdapterNrFieldNumber = 1,
31477     kMsgNrFieldNumber = 2,
31478     kAddrFieldNumber = 3,
31479     kFlagsFieldNumber = 4,
31480     kLenFieldNumber = 5,
31481     kBufFieldNumber = 6,
31482   };
31483   void set_adapter_nr(int32_t value) {
31484     AppendVarInt(1, value);
31485   }
31486   void set_msg_nr(uint32_t value) {
31487     AppendVarInt(2, value);
31488   }
31489   void set_addr(uint32_t value) {
31490     AppendVarInt(3, value);
31491   }
31492   void set_flags(uint32_t value) {
31493     AppendVarInt(4, value);
31494   }
31495   void set_len(uint32_t value) {
31496     AppendVarInt(5, value);
31497   }
31498   void set_buf(uint32_t value) {
31499     AppendVarInt(6, value);
31500   }
31501 };
31502 
31503 class I2cResultFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
31504  public:
31505   I2cResultFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
31506   explicit I2cResultFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
31507   explicit I2cResultFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
31508   bool has_adapter_nr() const { return at<1>().valid(); }
31509   int32_t adapter_nr() const { return at<1>().as_int32(); }
31510   bool has_nr_msgs() const { return at<2>().valid(); }
31511   uint32_t nr_msgs() const { return at<2>().as_uint32(); }
31512   bool has_ret() const { return at<3>().valid(); }
31513   int32_t ret() const { return at<3>().as_int32(); }
31514 };
31515 
31516 class I2cResultFtraceEvent : public ::protozero::Message {
31517  public:
31518   using Decoder = I2cResultFtraceEvent_Decoder;
31519   enum : int32_t {
31520     kAdapterNrFieldNumber = 1,
31521     kNrMsgsFieldNumber = 2,
31522     kRetFieldNumber = 3,
31523   };
31524   void set_adapter_nr(int32_t value) {
31525     AppendVarInt(1, value);
31526   }
31527   void set_nr_msgs(uint32_t value) {
31528     AppendVarInt(2, value);
31529   }
31530   void set_ret(int32_t value) {
31531     AppendVarInt(3, value);
31532   }
31533 };
31534 
31535 class I2cWriteFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
31536  public:
31537   I2cWriteFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
31538   explicit I2cWriteFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
31539   explicit I2cWriteFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
31540   bool has_adapter_nr() const { return at<1>().valid(); }
31541   int32_t adapter_nr() const { return at<1>().as_int32(); }
31542   bool has_msg_nr() const { return at<2>().valid(); }
31543   uint32_t msg_nr() const { return at<2>().as_uint32(); }
31544   bool has_addr() const { return at<3>().valid(); }
31545   uint32_t addr() const { return at<3>().as_uint32(); }
31546   bool has_flags() const { return at<4>().valid(); }
31547   uint32_t flags() const { return at<4>().as_uint32(); }
31548   bool has_len() const { return at<5>().valid(); }
31549   uint32_t len() const { return at<5>().as_uint32(); }
31550   bool has_buf() const { return at<6>().valid(); }
31551   uint32_t buf() const { return at<6>().as_uint32(); }
31552 };
31553 
31554 class I2cWriteFtraceEvent : public ::protozero::Message {
31555  public:
31556   using Decoder = I2cWriteFtraceEvent_Decoder;
31557   enum : int32_t {
31558     kAdapterNrFieldNumber = 1,
31559     kMsgNrFieldNumber = 2,
31560     kAddrFieldNumber = 3,
31561     kFlagsFieldNumber = 4,
31562     kLenFieldNumber = 5,
31563     kBufFieldNumber = 6,
31564   };
31565   void set_adapter_nr(int32_t value) {
31566     AppendVarInt(1, value);
31567   }
31568   void set_msg_nr(uint32_t value) {
31569     AppendVarInt(2, value);
31570   }
31571   void set_addr(uint32_t value) {
31572     AppendVarInt(3, value);
31573   }
31574   void set_flags(uint32_t value) {
31575     AppendVarInt(4, value);
31576   }
31577   void set_len(uint32_t value) {
31578     AppendVarInt(5, value);
31579   }
31580   void set_buf(uint32_t value) {
31581     AppendVarInt(6, value);
31582   }
31583 };
31584 
31585 class I2cReadFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
31586  public:
31587   I2cReadFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
31588   explicit I2cReadFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
31589   explicit I2cReadFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
31590   bool has_adapter_nr() const { return at<1>().valid(); }
31591   int32_t adapter_nr() const { return at<1>().as_int32(); }
31592   bool has_msg_nr() const { return at<2>().valid(); }
31593   uint32_t msg_nr() const { return at<2>().as_uint32(); }
31594   bool has_addr() const { return at<3>().valid(); }
31595   uint32_t addr() const { return at<3>().as_uint32(); }
31596   bool has_flags() const { return at<4>().valid(); }
31597   uint32_t flags() const { return at<4>().as_uint32(); }
31598   bool has_len() const { return at<5>().valid(); }
31599   uint32_t len() const { return at<5>().as_uint32(); }
31600 };
31601 
31602 class I2cReadFtraceEvent : public ::protozero::Message {
31603  public:
31604   using Decoder = I2cReadFtraceEvent_Decoder;
31605   enum : int32_t {
31606     kAdapterNrFieldNumber = 1,
31607     kMsgNrFieldNumber = 2,
31608     kAddrFieldNumber = 3,
31609     kFlagsFieldNumber = 4,
31610     kLenFieldNumber = 5,
31611   };
31612   void set_adapter_nr(int32_t value) {
31613     AppendVarInt(1, value);
31614   }
31615   void set_msg_nr(uint32_t value) {
31616     AppendVarInt(2, value);
31617   }
31618   void set_addr(uint32_t value) {
31619     AppendVarInt(3, value);
31620   }
31621   void set_flags(uint32_t value) {
31622     AppendVarInt(4, value);
31623   }
31624   void set_len(uint32_t value) {
31625     AppendVarInt(5, value);
31626   }
31627 };
31628 
31629 } // Namespace.
31630 } // Namespace.
31631 } // Namespace.
31632 #endif  // Include guard.
31633 // gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/ion.pbzero.h
31634 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
31635 
31636 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_ION_PROTO_H_
31637 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_ION_PROTO_H_
31638 
31639 #include <stddef.h>
31640 #include <stdint.h>
31641 
31642 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
31643 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
31644 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
31645 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
31646 
31647 namespace perfetto {
31648 namespace protos {
31649 namespace pbzero {
31650 
31651 
31652 class IonStatFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
31653  public:
31654   IonStatFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
31655   explicit IonStatFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
31656   explicit IonStatFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
31657   bool has_buffer_id() const { return at<1>().valid(); }
31658   uint32_t buffer_id() const { return at<1>().as_uint32(); }
31659   bool has_len() const { return at<2>().valid(); }
31660   int64_t len() const { return at<2>().as_int64(); }
31661   bool has_total_allocated() const { return at<3>().valid(); }
31662   uint64_t total_allocated() const { return at<3>().as_uint64(); }
31663 };
31664 
31665 class IonStatFtraceEvent : public ::protozero::Message {
31666  public:
31667   using Decoder = IonStatFtraceEvent_Decoder;
31668   enum : int32_t {
31669     kBufferIdFieldNumber = 1,
31670     kLenFieldNumber = 2,
31671     kTotalAllocatedFieldNumber = 3,
31672   };
31673   void set_buffer_id(uint32_t value) {
31674     AppendVarInt(1, value);
31675   }
31676   void set_len(int64_t value) {
31677     AppendVarInt(2, value);
31678   }
31679   void set_total_allocated(uint64_t value) {
31680     AppendVarInt(3, value);
31681   }
31682 };
31683 
31684 } // Namespace.
31685 } // Namespace.
31686 } // Namespace.
31687 #endif  // Include guard.
31688 // gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/ipi.pbzero.h
31689 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
31690 
31691 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_IPI_PROTO_H_
31692 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_IPI_PROTO_H_
31693 
31694 #include <stddef.h>
31695 #include <stdint.h>
31696 
31697 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
31698 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
31699 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
31700 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
31701 
31702 namespace perfetto {
31703 namespace protos {
31704 namespace pbzero {
31705 
31706 
31707 class IpiRaiseFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
31708  public:
31709   IpiRaiseFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
31710   explicit IpiRaiseFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
31711   explicit IpiRaiseFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
31712   bool has_target_cpus() const { return at<1>().valid(); }
31713   uint32_t target_cpus() const { return at<1>().as_uint32(); }
31714   bool has_reason() const { return at<2>().valid(); }
31715   ::protozero::ConstChars reason() const { return at<2>().as_string(); }
31716 };
31717 
31718 class IpiRaiseFtraceEvent : public ::protozero::Message {
31719  public:
31720   using Decoder = IpiRaiseFtraceEvent_Decoder;
31721   enum : int32_t {
31722     kTargetCpusFieldNumber = 1,
31723     kReasonFieldNumber = 2,
31724   };
31725   void set_target_cpus(uint32_t value) {
31726     AppendVarInt(1, value);
31727   }
31728   void set_reason(const std::string& value) {
31729     AppendBytes(2, value.data(), value.size());
31730   }
31731   void set_reason(const char* data, size_t size) {
31732     AppendBytes(2, data, size);
31733   }
31734 };
31735 
31736 class IpiExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
31737  public:
31738   IpiExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
31739   explicit IpiExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
31740   explicit IpiExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
31741   bool has_reason() const { return at<1>().valid(); }
31742   ::protozero::ConstChars reason() const { return at<1>().as_string(); }
31743 };
31744 
31745 class IpiExitFtraceEvent : public ::protozero::Message {
31746  public:
31747   using Decoder = IpiExitFtraceEvent_Decoder;
31748   enum : int32_t {
31749     kReasonFieldNumber = 1,
31750   };
31751   void set_reason(const std::string& value) {
31752     AppendBytes(1, value.data(), value.size());
31753   }
31754   void set_reason(const char* data, size_t size) {
31755     AppendBytes(1, data, size);
31756   }
31757 };
31758 
31759 class IpiEntryFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
31760  public:
31761   IpiEntryFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
31762   explicit IpiEntryFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
31763   explicit IpiEntryFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
31764   bool has_reason() const { return at<1>().valid(); }
31765   ::protozero::ConstChars reason() const { return at<1>().as_string(); }
31766 };
31767 
31768 class IpiEntryFtraceEvent : public ::protozero::Message {
31769  public:
31770   using Decoder = IpiEntryFtraceEvent_Decoder;
31771   enum : int32_t {
31772     kReasonFieldNumber = 1,
31773   };
31774   void set_reason(const std::string& value) {
31775     AppendBytes(1, value.data(), value.size());
31776   }
31777   void set_reason(const char* data, size_t size) {
31778     AppendBytes(1, data, size);
31779   }
31780 };
31781 
31782 } // Namespace.
31783 } // Namespace.
31784 } // Namespace.
31785 #endif  // Include guard.
31786 // gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/irq.pbzero.h
31787 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
31788 
31789 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_IRQ_PROTO_H_
31790 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_IRQ_PROTO_H_
31791 
31792 #include <stddef.h>
31793 #include <stdint.h>
31794 
31795 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
31796 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
31797 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
31798 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
31799 
31800 namespace perfetto {
31801 namespace protos {
31802 namespace pbzero {
31803 
31804 
31805 class IrqHandlerExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
31806  public:
31807   IrqHandlerExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
31808   explicit IrqHandlerExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
31809   explicit IrqHandlerExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
31810   bool has_irq() const { return at<1>().valid(); }
31811   int32_t irq() const { return at<1>().as_int32(); }
31812   bool has_ret() const { return at<2>().valid(); }
31813   int32_t ret() const { return at<2>().as_int32(); }
31814 };
31815 
31816 class IrqHandlerExitFtraceEvent : public ::protozero::Message {
31817  public:
31818   using Decoder = IrqHandlerExitFtraceEvent_Decoder;
31819   enum : int32_t {
31820     kIrqFieldNumber = 1,
31821     kRetFieldNumber = 2,
31822   };
31823   void set_irq(int32_t value) {
31824     AppendVarInt(1, value);
31825   }
31826   void set_ret(int32_t value) {
31827     AppendVarInt(2, value);
31828   }
31829 };
31830 
31831 class IrqHandlerEntryFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
31832  public:
31833   IrqHandlerEntryFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
31834   explicit IrqHandlerEntryFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
31835   explicit IrqHandlerEntryFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
31836   bool has_irq() const { return at<1>().valid(); }
31837   int32_t irq() const { return at<1>().as_int32(); }
31838   bool has_name() const { return at<2>().valid(); }
31839   ::protozero::ConstChars name() const { return at<2>().as_string(); }
31840   bool has_handler() const { return at<3>().valid(); }
31841   uint32_t handler() const { return at<3>().as_uint32(); }
31842 };
31843 
31844 class IrqHandlerEntryFtraceEvent : public ::protozero::Message {
31845  public:
31846   using Decoder = IrqHandlerEntryFtraceEvent_Decoder;
31847   enum : int32_t {
31848     kIrqFieldNumber = 1,
31849     kNameFieldNumber = 2,
31850     kHandlerFieldNumber = 3,
31851   };
31852   void set_irq(int32_t value) {
31853     AppendVarInt(1, value);
31854   }
31855   void set_name(const std::string& value) {
31856     AppendBytes(2, value.data(), value.size());
31857   }
31858   void set_name(const char* data, size_t size) {
31859     AppendBytes(2, data, size);
31860   }
31861   void set_handler(uint32_t value) {
31862     AppendVarInt(3, value);
31863   }
31864 };
31865 
31866 class SoftirqRaiseFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
31867  public:
31868   SoftirqRaiseFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
31869   explicit SoftirqRaiseFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
31870   explicit SoftirqRaiseFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
31871   bool has_vec() const { return at<1>().valid(); }
31872   uint32_t vec() const { return at<1>().as_uint32(); }
31873 };
31874 
31875 class SoftirqRaiseFtraceEvent : public ::protozero::Message {
31876  public:
31877   using Decoder = SoftirqRaiseFtraceEvent_Decoder;
31878   enum : int32_t {
31879     kVecFieldNumber = 1,
31880   };
31881   void set_vec(uint32_t value) {
31882     AppendVarInt(1, value);
31883   }
31884 };
31885 
31886 class SoftirqExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
31887  public:
31888   SoftirqExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
31889   explicit SoftirqExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
31890   explicit SoftirqExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
31891   bool has_vec() const { return at<1>().valid(); }
31892   uint32_t vec() const { return at<1>().as_uint32(); }
31893 };
31894 
31895 class SoftirqExitFtraceEvent : public ::protozero::Message {
31896  public:
31897   using Decoder = SoftirqExitFtraceEvent_Decoder;
31898   enum : int32_t {
31899     kVecFieldNumber = 1,
31900   };
31901   void set_vec(uint32_t value) {
31902     AppendVarInt(1, value);
31903   }
31904 };
31905 
31906 class SoftirqEntryFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
31907  public:
31908   SoftirqEntryFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
31909   explicit SoftirqEntryFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
31910   explicit SoftirqEntryFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
31911   bool has_vec() const { return at<1>().valid(); }
31912   uint32_t vec() const { return at<1>().as_uint32(); }
31913 };
31914 
31915 class SoftirqEntryFtraceEvent : public ::protozero::Message {
31916  public:
31917   using Decoder = SoftirqEntryFtraceEvent_Decoder;
31918   enum : int32_t {
31919     kVecFieldNumber = 1,
31920   };
31921   void set_vec(uint32_t value) {
31922     AppendVarInt(1, value);
31923   }
31924 };
31925 
31926 } // Namespace.
31927 } // Namespace.
31928 } // Namespace.
31929 #endif  // Include guard.
31930 // gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/kmem.pbzero.h
31931 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
31932 
31933 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_KMEM_PROTO_H_
31934 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_KMEM_PROTO_H_
31935 
31936 #include <stddef.h>
31937 #include <stdint.h>
31938 
31939 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
31940 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
31941 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
31942 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
31943 
31944 namespace perfetto {
31945 namespace protos {
31946 namespace pbzero {
31947 
31948 
31949 class IonBufferDestroyFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
31950  public:
31951   IonBufferDestroyFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
31952   explicit IonBufferDestroyFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
31953   explicit IonBufferDestroyFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
31954   bool has_addr() const { return at<1>().valid(); }
31955   uint64_t addr() const { return at<1>().as_uint64(); }
31956   bool has_len() const { return at<2>().valid(); }
31957   uint64_t len() const { return at<2>().as_uint64(); }
31958 };
31959 
31960 class IonBufferDestroyFtraceEvent : public ::protozero::Message {
31961  public:
31962   using Decoder = IonBufferDestroyFtraceEvent_Decoder;
31963   enum : int32_t {
31964     kAddrFieldNumber = 1,
31965     kLenFieldNumber = 2,
31966   };
31967   void set_addr(uint64_t value) {
31968     AppendVarInt(1, value);
31969   }
31970   void set_len(uint64_t value) {
31971     AppendVarInt(2, value);
31972   }
31973 };
31974 
31975 class IonBufferCreateFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
31976  public:
31977   IonBufferCreateFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
31978   explicit IonBufferCreateFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
31979   explicit IonBufferCreateFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
31980   bool has_addr() const { return at<1>().valid(); }
31981   uint64_t addr() const { return at<1>().as_uint64(); }
31982   bool has_len() const { return at<2>().valid(); }
31983   uint64_t len() const { return at<2>().as_uint64(); }
31984 };
31985 
31986 class IonBufferCreateFtraceEvent : public ::protozero::Message {
31987  public:
31988   using Decoder = IonBufferCreateFtraceEvent_Decoder;
31989   enum : int32_t {
31990     kAddrFieldNumber = 1,
31991     kLenFieldNumber = 2,
31992   };
31993   void set_addr(uint64_t value) {
31994     AppendVarInt(1, value);
31995   }
31996   void set_len(uint64_t value) {
31997     AppendVarInt(2, value);
31998   }
31999 };
32000 
32001 class IonHeapGrowFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
32002  public:
32003   IonHeapGrowFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
32004   explicit IonHeapGrowFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
32005   explicit IonHeapGrowFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
32006   bool has_heap_name() const { return at<1>().valid(); }
32007   ::protozero::ConstChars heap_name() const { return at<1>().as_string(); }
32008   bool has_len() const { return at<2>().valid(); }
32009   uint64_t len() const { return at<2>().as_uint64(); }
32010   bool has_total_allocated() const { return at<3>().valid(); }
32011   int64_t total_allocated() const { return at<3>().as_int64(); }
32012 };
32013 
32014 class IonHeapGrowFtraceEvent : public ::protozero::Message {
32015  public:
32016   using Decoder = IonHeapGrowFtraceEvent_Decoder;
32017   enum : int32_t {
32018     kHeapNameFieldNumber = 1,
32019     kLenFieldNumber = 2,
32020     kTotalAllocatedFieldNumber = 3,
32021   };
32022   void set_heap_name(const std::string& value) {
32023     AppendBytes(1, value.data(), value.size());
32024   }
32025   void set_heap_name(const char* data, size_t size) {
32026     AppendBytes(1, data, size);
32027   }
32028   void set_len(uint64_t value) {
32029     AppendVarInt(2, value);
32030   }
32031   void set_total_allocated(int64_t value) {
32032     AppendVarInt(3, value);
32033   }
32034 };
32035 
32036 class IonHeapShrinkFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
32037  public:
32038   IonHeapShrinkFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
32039   explicit IonHeapShrinkFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
32040   explicit IonHeapShrinkFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
32041   bool has_heap_name() const { return at<1>().valid(); }
32042   ::protozero::ConstChars heap_name() const { return at<1>().as_string(); }
32043   bool has_len() const { return at<2>().valid(); }
32044   uint64_t len() const { return at<2>().as_uint64(); }
32045   bool has_total_allocated() const { return at<3>().valid(); }
32046   int64_t total_allocated() const { return at<3>().as_int64(); }
32047 };
32048 
32049 class IonHeapShrinkFtraceEvent : public ::protozero::Message {
32050  public:
32051   using Decoder = IonHeapShrinkFtraceEvent_Decoder;
32052   enum : int32_t {
32053     kHeapNameFieldNumber = 1,
32054     kLenFieldNumber = 2,
32055     kTotalAllocatedFieldNumber = 3,
32056   };
32057   void set_heap_name(const std::string& value) {
32058     AppendBytes(1, value.data(), value.size());
32059   }
32060   void set_heap_name(const char* data, size_t size) {
32061     AppendBytes(1, data, size);
32062   }
32063   void set_len(uint64_t value) {
32064     AppendVarInt(2, value);
32065   }
32066   void set_total_allocated(int64_t value) {
32067     AppendVarInt(3, value);
32068   }
32069 };
32070 
32071 class RssStatFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
32072  public:
32073   RssStatFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
32074   explicit RssStatFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
32075   explicit RssStatFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
32076   bool has_member() const { return at<1>().valid(); }
32077   int32_t member() const { return at<1>().as_int32(); }
32078   bool has_size() const { return at<2>().valid(); }
32079   int64_t size() const { return at<2>().as_int64(); }
32080   bool has_curr() const { return at<3>().valid(); }
32081   uint32_t curr() const { return at<3>().as_uint32(); }
32082   bool has_mm_id() const { return at<4>().valid(); }
32083   uint32_t mm_id() const { return at<4>().as_uint32(); }
32084 };
32085 
32086 class RssStatFtraceEvent : public ::protozero::Message {
32087  public:
32088   using Decoder = RssStatFtraceEvent_Decoder;
32089   enum : int32_t {
32090     kMemberFieldNumber = 1,
32091     kSizeFieldNumber = 2,
32092     kCurrFieldNumber = 3,
32093     kMmIdFieldNumber = 4,
32094   };
32095   void set_member(int32_t value) {
32096     AppendVarInt(1, value);
32097   }
32098   void set_size(int64_t value) {
32099     AppendVarInt(2, value);
32100   }
32101   void set_curr(uint32_t value) {
32102     AppendVarInt(3, value);
32103   }
32104   void set_mm_id(uint32_t value) {
32105     AppendVarInt(4, value);
32106   }
32107 };
32108 
32109 class MmPagePcpuDrainFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
32110  public:
32111   MmPagePcpuDrainFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
32112   explicit MmPagePcpuDrainFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
32113   explicit MmPagePcpuDrainFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
32114   bool has_migratetype() const { return at<1>().valid(); }
32115   int32_t migratetype() const { return at<1>().as_int32(); }
32116   bool has_order() const { return at<2>().valid(); }
32117   uint32_t order() const { return at<2>().as_uint32(); }
32118   bool has_page() const { return at<3>().valid(); }
32119   uint64_t page() const { return at<3>().as_uint64(); }
32120   bool has_pfn() const { return at<4>().valid(); }
32121   uint64_t pfn() const { return at<4>().as_uint64(); }
32122 };
32123 
32124 class MmPagePcpuDrainFtraceEvent : public ::protozero::Message {
32125  public:
32126   using Decoder = MmPagePcpuDrainFtraceEvent_Decoder;
32127   enum : int32_t {
32128     kMigratetypeFieldNumber = 1,
32129     kOrderFieldNumber = 2,
32130     kPageFieldNumber = 3,
32131     kPfnFieldNumber = 4,
32132   };
32133   void set_migratetype(int32_t value) {
32134     AppendVarInt(1, value);
32135   }
32136   void set_order(uint32_t value) {
32137     AppendVarInt(2, value);
32138   }
32139   void set_page(uint64_t value) {
32140     AppendVarInt(3, value);
32141   }
32142   void set_pfn(uint64_t value) {
32143     AppendVarInt(4, value);
32144   }
32145 };
32146 
32147 class MmPageFreeBatchedFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
32148  public:
32149   MmPageFreeBatchedFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
32150   explicit MmPageFreeBatchedFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
32151   explicit MmPageFreeBatchedFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
32152   bool has_cold() const { return at<1>().valid(); }
32153   int32_t cold() const { return at<1>().as_int32(); }
32154   bool has_page() const { return at<2>().valid(); }
32155   uint64_t page() const { return at<2>().as_uint64(); }
32156   bool has_pfn() const { return at<3>().valid(); }
32157   uint64_t pfn() const { return at<3>().as_uint64(); }
32158 };
32159 
32160 class MmPageFreeBatchedFtraceEvent : public ::protozero::Message {
32161  public:
32162   using Decoder = MmPageFreeBatchedFtraceEvent_Decoder;
32163   enum : int32_t {
32164     kColdFieldNumber = 1,
32165     kPageFieldNumber = 2,
32166     kPfnFieldNumber = 3,
32167   };
32168   void set_cold(int32_t value) {
32169     AppendVarInt(1, value);
32170   }
32171   void set_page(uint64_t value) {
32172     AppendVarInt(2, value);
32173   }
32174   void set_pfn(uint64_t value) {
32175     AppendVarInt(3, value);
32176   }
32177 };
32178 
32179 class MmPageFreeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
32180  public:
32181   MmPageFreeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
32182   explicit MmPageFreeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
32183   explicit MmPageFreeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
32184   bool has_order() const { return at<1>().valid(); }
32185   uint32_t order() const { return at<1>().as_uint32(); }
32186   bool has_page() const { return at<2>().valid(); }
32187   uint64_t page() const { return at<2>().as_uint64(); }
32188   bool has_pfn() const { return at<3>().valid(); }
32189   uint64_t pfn() const { return at<3>().as_uint64(); }
32190 };
32191 
32192 class MmPageFreeFtraceEvent : public ::protozero::Message {
32193  public:
32194   using Decoder = MmPageFreeFtraceEvent_Decoder;
32195   enum : int32_t {
32196     kOrderFieldNumber = 1,
32197     kPageFieldNumber = 2,
32198     kPfnFieldNumber = 3,
32199   };
32200   void set_order(uint32_t value) {
32201     AppendVarInt(1, value);
32202   }
32203   void set_page(uint64_t value) {
32204     AppendVarInt(2, value);
32205   }
32206   void set_pfn(uint64_t value) {
32207     AppendVarInt(3, value);
32208   }
32209 };
32210 
32211 class MmPageAllocZoneLockedFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
32212  public:
32213   MmPageAllocZoneLockedFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
32214   explicit MmPageAllocZoneLockedFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
32215   explicit MmPageAllocZoneLockedFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
32216   bool has_migratetype() const { return at<1>().valid(); }
32217   int32_t migratetype() const { return at<1>().as_int32(); }
32218   bool has_order() const { return at<2>().valid(); }
32219   uint32_t order() const { return at<2>().as_uint32(); }
32220   bool has_page() const { return at<3>().valid(); }
32221   uint64_t page() const { return at<3>().as_uint64(); }
32222   bool has_pfn() const { return at<4>().valid(); }
32223   uint64_t pfn() const { return at<4>().as_uint64(); }
32224 };
32225 
32226 class MmPageAllocZoneLockedFtraceEvent : public ::protozero::Message {
32227  public:
32228   using Decoder = MmPageAllocZoneLockedFtraceEvent_Decoder;
32229   enum : int32_t {
32230     kMigratetypeFieldNumber = 1,
32231     kOrderFieldNumber = 2,
32232     kPageFieldNumber = 3,
32233     kPfnFieldNumber = 4,
32234   };
32235   void set_migratetype(int32_t value) {
32236     AppendVarInt(1, value);
32237   }
32238   void set_order(uint32_t value) {
32239     AppendVarInt(2, value);
32240   }
32241   void set_page(uint64_t value) {
32242     AppendVarInt(3, value);
32243   }
32244   void set_pfn(uint64_t value) {
32245     AppendVarInt(4, value);
32246   }
32247 };
32248 
32249 class MmPageAllocExtfragFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
32250  public:
32251   MmPageAllocExtfragFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
32252   explicit MmPageAllocExtfragFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
32253   explicit MmPageAllocExtfragFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
32254   bool has_alloc_migratetype() const { return at<1>().valid(); }
32255   int32_t alloc_migratetype() const { return at<1>().as_int32(); }
32256   bool has_alloc_order() const { return at<2>().valid(); }
32257   int32_t alloc_order() const { return at<2>().as_int32(); }
32258   bool has_fallback_migratetype() const { return at<3>().valid(); }
32259   int32_t fallback_migratetype() const { return at<3>().as_int32(); }
32260   bool has_fallback_order() const { return at<4>().valid(); }
32261   int32_t fallback_order() const { return at<4>().as_int32(); }
32262   bool has_page() const { return at<5>().valid(); }
32263   uint64_t page() const { return at<5>().as_uint64(); }
32264   bool has_change_ownership() const { return at<6>().valid(); }
32265   int32_t change_ownership() const { return at<6>().as_int32(); }
32266   bool has_pfn() const { return at<7>().valid(); }
32267   uint64_t pfn() const { return at<7>().as_uint64(); }
32268 };
32269 
32270 class MmPageAllocExtfragFtraceEvent : public ::protozero::Message {
32271  public:
32272   using Decoder = MmPageAllocExtfragFtraceEvent_Decoder;
32273   enum : int32_t {
32274     kAllocMigratetypeFieldNumber = 1,
32275     kAllocOrderFieldNumber = 2,
32276     kFallbackMigratetypeFieldNumber = 3,
32277     kFallbackOrderFieldNumber = 4,
32278     kPageFieldNumber = 5,
32279     kChangeOwnershipFieldNumber = 6,
32280     kPfnFieldNumber = 7,
32281   };
32282   void set_alloc_migratetype(int32_t value) {
32283     AppendVarInt(1, value);
32284   }
32285   void set_alloc_order(int32_t value) {
32286     AppendVarInt(2, value);
32287   }
32288   void set_fallback_migratetype(int32_t value) {
32289     AppendVarInt(3, value);
32290   }
32291   void set_fallback_order(int32_t value) {
32292     AppendVarInt(4, value);
32293   }
32294   void set_page(uint64_t value) {
32295     AppendVarInt(5, value);
32296   }
32297   void set_change_ownership(int32_t value) {
32298     AppendVarInt(6, value);
32299   }
32300   void set_pfn(uint64_t value) {
32301     AppendVarInt(7, value);
32302   }
32303 };
32304 
32305 class MmPageAllocFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
32306  public:
32307   MmPageAllocFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
32308   explicit MmPageAllocFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
32309   explicit MmPageAllocFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
32310   bool has_gfp_flags() const { return at<1>().valid(); }
32311   uint32_t gfp_flags() const { return at<1>().as_uint32(); }
32312   bool has_migratetype() const { return at<2>().valid(); }
32313   int32_t migratetype() const { return at<2>().as_int32(); }
32314   bool has_order() const { return at<3>().valid(); }
32315   uint32_t order() const { return at<3>().as_uint32(); }
32316   bool has_page() const { return at<4>().valid(); }
32317   uint64_t page() const { return at<4>().as_uint64(); }
32318   bool has_pfn() const { return at<5>().valid(); }
32319   uint64_t pfn() const { return at<5>().as_uint64(); }
32320 };
32321 
32322 class MmPageAllocFtraceEvent : public ::protozero::Message {
32323  public:
32324   using Decoder = MmPageAllocFtraceEvent_Decoder;
32325   enum : int32_t {
32326     kGfpFlagsFieldNumber = 1,
32327     kMigratetypeFieldNumber = 2,
32328     kOrderFieldNumber = 3,
32329     kPageFieldNumber = 4,
32330     kPfnFieldNumber = 5,
32331   };
32332   void set_gfp_flags(uint32_t value) {
32333     AppendVarInt(1, value);
32334   }
32335   void set_migratetype(int32_t value) {
32336     AppendVarInt(2, value);
32337   }
32338   void set_order(uint32_t value) {
32339     AppendVarInt(3, value);
32340   }
32341   void set_page(uint64_t value) {
32342     AppendVarInt(4, value);
32343   }
32344   void set_pfn(uint64_t value) {
32345     AppendVarInt(5, value);
32346   }
32347 };
32348 
32349 class MigrateRetryFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
32350  public:
32351   MigrateRetryFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
32352   explicit MigrateRetryFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
32353   explicit MigrateRetryFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
32354   bool has_tries() const { return at<1>().valid(); }
32355   int32_t tries() const { return at<1>().as_int32(); }
32356 };
32357 
32358 class MigrateRetryFtraceEvent : public ::protozero::Message {
32359  public:
32360   using Decoder = MigrateRetryFtraceEvent_Decoder;
32361   enum : int32_t {
32362     kTriesFieldNumber = 1,
32363   };
32364   void set_tries(int32_t value) {
32365     AppendVarInt(1, value);
32366   }
32367 };
32368 
32369 class MigratePagesStartFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
32370  public:
32371   MigratePagesStartFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
32372   explicit MigratePagesStartFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
32373   explicit MigratePagesStartFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
32374   bool has_mode() const { return at<1>().valid(); }
32375   int32_t mode() const { return at<1>().as_int32(); }
32376 };
32377 
32378 class MigratePagesStartFtraceEvent : public ::protozero::Message {
32379  public:
32380   using Decoder = MigratePagesStartFtraceEvent_Decoder;
32381   enum : int32_t {
32382     kModeFieldNumber = 1,
32383   };
32384   void set_mode(int32_t value) {
32385     AppendVarInt(1, value);
32386   }
32387 };
32388 
32389 class MigratePagesEndFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
32390  public:
32391   MigratePagesEndFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
32392   explicit MigratePagesEndFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
32393   explicit MigratePagesEndFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
32394   bool has_mode() const { return at<1>().valid(); }
32395   int32_t mode() const { return at<1>().as_int32(); }
32396 };
32397 
32398 class MigratePagesEndFtraceEvent : public ::protozero::Message {
32399  public:
32400   using Decoder = MigratePagesEndFtraceEvent_Decoder;
32401   enum : int32_t {
32402     kModeFieldNumber = 1,
32403   };
32404   void set_mode(int32_t value) {
32405     AppendVarInt(1, value);
32406   }
32407 };
32408 
32409 class KmemCacheFreeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
32410  public:
32411   KmemCacheFreeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
32412   explicit KmemCacheFreeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
32413   explicit KmemCacheFreeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
32414   bool has_call_site() const { return at<1>().valid(); }
32415   uint64_t call_site() const { return at<1>().as_uint64(); }
32416   bool has_ptr() const { return at<2>().valid(); }
32417   uint64_t ptr() const { return at<2>().as_uint64(); }
32418 };
32419 
32420 class KmemCacheFreeFtraceEvent : public ::protozero::Message {
32421  public:
32422   using Decoder = KmemCacheFreeFtraceEvent_Decoder;
32423   enum : int32_t {
32424     kCallSiteFieldNumber = 1,
32425     kPtrFieldNumber = 2,
32426   };
32427   void set_call_site(uint64_t value) {
32428     AppendVarInt(1, value);
32429   }
32430   void set_ptr(uint64_t value) {
32431     AppendVarInt(2, value);
32432   }
32433 };
32434 
32435 class KmemCacheAllocNodeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
32436  public:
32437   KmemCacheAllocNodeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
32438   explicit KmemCacheAllocNodeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
32439   explicit KmemCacheAllocNodeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
32440   bool has_bytes_alloc() const { return at<1>().valid(); }
32441   uint64_t bytes_alloc() const { return at<1>().as_uint64(); }
32442   bool has_bytes_req() const { return at<2>().valid(); }
32443   uint64_t bytes_req() const { return at<2>().as_uint64(); }
32444   bool has_call_site() const { return at<3>().valid(); }
32445   uint64_t call_site() const { return at<3>().as_uint64(); }
32446   bool has_gfp_flags() const { return at<4>().valid(); }
32447   uint32_t gfp_flags() const { return at<4>().as_uint32(); }
32448   bool has_node() const { return at<5>().valid(); }
32449   int32_t node() const { return at<5>().as_int32(); }
32450   bool has_ptr() const { return at<6>().valid(); }
32451   uint64_t ptr() const { return at<6>().as_uint64(); }
32452 };
32453 
32454 class KmemCacheAllocNodeFtraceEvent : public ::protozero::Message {
32455  public:
32456   using Decoder = KmemCacheAllocNodeFtraceEvent_Decoder;
32457   enum : int32_t {
32458     kBytesAllocFieldNumber = 1,
32459     kBytesReqFieldNumber = 2,
32460     kCallSiteFieldNumber = 3,
32461     kGfpFlagsFieldNumber = 4,
32462     kNodeFieldNumber = 5,
32463     kPtrFieldNumber = 6,
32464   };
32465   void set_bytes_alloc(uint64_t value) {
32466     AppendVarInt(1, value);
32467   }
32468   void set_bytes_req(uint64_t value) {
32469     AppendVarInt(2, value);
32470   }
32471   void set_call_site(uint64_t value) {
32472     AppendVarInt(3, value);
32473   }
32474   void set_gfp_flags(uint32_t value) {
32475     AppendVarInt(4, value);
32476   }
32477   void set_node(int32_t value) {
32478     AppendVarInt(5, value);
32479   }
32480   void set_ptr(uint64_t value) {
32481     AppendVarInt(6, value);
32482   }
32483 };
32484 
32485 class KmemCacheAllocFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
32486  public:
32487   KmemCacheAllocFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
32488   explicit KmemCacheAllocFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
32489   explicit KmemCacheAllocFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
32490   bool has_bytes_alloc() const { return at<1>().valid(); }
32491   uint64_t bytes_alloc() const { return at<1>().as_uint64(); }
32492   bool has_bytes_req() const { return at<2>().valid(); }
32493   uint64_t bytes_req() const { return at<2>().as_uint64(); }
32494   bool has_call_site() const { return at<3>().valid(); }
32495   uint64_t call_site() const { return at<3>().as_uint64(); }
32496   bool has_gfp_flags() const { return at<4>().valid(); }
32497   uint32_t gfp_flags() const { return at<4>().as_uint32(); }
32498   bool has_ptr() const { return at<5>().valid(); }
32499   uint64_t ptr() const { return at<5>().as_uint64(); }
32500 };
32501 
32502 class KmemCacheAllocFtraceEvent : public ::protozero::Message {
32503  public:
32504   using Decoder = KmemCacheAllocFtraceEvent_Decoder;
32505   enum : int32_t {
32506     kBytesAllocFieldNumber = 1,
32507     kBytesReqFieldNumber = 2,
32508     kCallSiteFieldNumber = 3,
32509     kGfpFlagsFieldNumber = 4,
32510     kPtrFieldNumber = 5,
32511   };
32512   void set_bytes_alloc(uint64_t value) {
32513     AppendVarInt(1, value);
32514   }
32515   void set_bytes_req(uint64_t value) {
32516     AppendVarInt(2, value);
32517   }
32518   void set_call_site(uint64_t value) {
32519     AppendVarInt(3, value);
32520   }
32521   void set_gfp_flags(uint32_t value) {
32522     AppendVarInt(4, value);
32523   }
32524   void set_ptr(uint64_t value) {
32525     AppendVarInt(5, value);
32526   }
32527 };
32528 
32529 class KmallocNodeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
32530  public:
32531   KmallocNodeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
32532   explicit KmallocNodeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
32533   explicit KmallocNodeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
32534   bool has_bytes_alloc() const { return at<1>().valid(); }
32535   uint64_t bytes_alloc() const { return at<1>().as_uint64(); }
32536   bool has_bytes_req() const { return at<2>().valid(); }
32537   uint64_t bytes_req() const { return at<2>().as_uint64(); }
32538   bool has_call_site() const { return at<3>().valid(); }
32539   uint64_t call_site() const { return at<3>().as_uint64(); }
32540   bool has_gfp_flags() const { return at<4>().valid(); }
32541   uint32_t gfp_flags() const { return at<4>().as_uint32(); }
32542   bool has_node() const { return at<5>().valid(); }
32543   int32_t node() const { return at<5>().as_int32(); }
32544   bool has_ptr() const { return at<6>().valid(); }
32545   uint64_t ptr() const { return at<6>().as_uint64(); }
32546 };
32547 
32548 class KmallocNodeFtraceEvent : public ::protozero::Message {
32549  public:
32550   using Decoder = KmallocNodeFtraceEvent_Decoder;
32551   enum : int32_t {
32552     kBytesAllocFieldNumber = 1,
32553     kBytesReqFieldNumber = 2,
32554     kCallSiteFieldNumber = 3,
32555     kGfpFlagsFieldNumber = 4,
32556     kNodeFieldNumber = 5,
32557     kPtrFieldNumber = 6,
32558   };
32559   void set_bytes_alloc(uint64_t value) {
32560     AppendVarInt(1, value);
32561   }
32562   void set_bytes_req(uint64_t value) {
32563     AppendVarInt(2, value);
32564   }
32565   void set_call_site(uint64_t value) {
32566     AppendVarInt(3, value);
32567   }
32568   void set_gfp_flags(uint32_t value) {
32569     AppendVarInt(4, value);
32570   }
32571   void set_node(int32_t value) {
32572     AppendVarInt(5, value);
32573   }
32574   void set_ptr(uint64_t value) {
32575     AppendVarInt(6, value);
32576   }
32577 };
32578 
32579 class KmallocFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
32580  public:
32581   KmallocFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
32582   explicit KmallocFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
32583   explicit KmallocFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
32584   bool has_bytes_alloc() const { return at<1>().valid(); }
32585   uint64_t bytes_alloc() const { return at<1>().as_uint64(); }
32586   bool has_bytes_req() const { return at<2>().valid(); }
32587   uint64_t bytes_req() const { return at<2>().as_uint64(); }
32588   bool has_call_site() const { return at<3>().valid(); }
32589   uint64_t call_site() const { return at<3>().as_uint64(); }
32590   bool has_gfp_flags() const { return at<4>().valid(); }
32591   uint32_t gfp_flags() const { return at<4>().as_uint32(); }
32592   bool has_ptr() const { return at<5>().valid(); }
32593   uint64_t ptr() const { return at<5>().as_uint64(); }
32594 };
32595 
32596 class KmallocFtraceEvent : public ::protozero::Message {
32597  public:
32598   using Decoder = KmallocFtraceEvent_Decoder;
32599   enum : int32_t {
32600     kBytesAllocFieldNumber = 1,
32601     kBytesReqFieldNumber = 2,
32602     kCallSiteFieldNumber = 3,
32603     kGfpFlagsFieldNumber = 4,
32604     kPtrFieldNumber = 5,
32605   };
32606   void set_bytes_alloc(uint64_t value) {
32607     AppendVarInt(1, value);
32608   }
32609   void set_bytes_req(uint64_t value) {
32610     AppendVarInt(2, value);
32611   }
32612   void set_call_site(uint64_t value) {
32613     AppendVarInt(3, value);
32614   }
32615   void set_gfp_flags(uint32_t value) {
32616     AppendVarInt(4, value);
32617   }
32618   void set_ptr(uint64_t value) {
32619     AppendVarInt(5, value);
32620   }
32621 };
32622 
32623 class KfreeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
32624  public:
32625   KfreeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
32626   explicit KfreeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
32627   explicit KfreeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
32628   bool has_call_site() const { return at<1>().valid(); }
32629   uint64_t call_site() const { return at<1>().as_uint64(); }
32630   bool has_ptr() const { return at<2>().valid(); }
32631   uint64_t ptr() const { return at<2>().as_uint64(); }
32632 };
32633 
32634 class KfreeFtraceEvent : public ::protozero::Message {
32635  public:
32636   using Decoder = KfreeFtraceEvent_Decoder;
32637   enum : int32_t {
32638     kCallSiteFieldNumber = 1,
32639     kPtrFieldNumber = 2,
32640   };
32641   void set_call_site(uint64_t value) {
32642     AppendVarInt(1, value);
32643   }
32644   void set_ptr(uint64_t value) {
32645     AppendVarInt(2, value);
32646   }
32647 };
32648 
32649 class IonSecureCmaShrinkPoolStartFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
32650  public:
32651   IonSecureCmaShrinkPoolStartFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
32652   explicit IonSecureCmaShrinkPoolStartFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
32653   explicit IonSecureCmaShrinkPoolStartFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
32654   bool has_drained_size() const { return at<1>().valid(); }
32655   uint64_t drained_size() const { return at<1>().as_uint64(); }
32656   bool has_skipped_size() const { return at<2>().valid(); }
32657   uint64_t skipped_size() const { return at<2>().as_uint64(); }
32658 };
32659 
32660 class IonSecureCmaShrinkPoolStartFtraceEvent : public ::protozero::Message {
32661  public:
32662   using Decoder = IonSecureCmaShrinkPoolStartFtraceEvent_Decoder;
32663   enum : int32_t {
32664     kDrainedSizeFieldNumber = 1,
32665     kSkippedSizeFieldNumber = 2,
32666   };
32667   void set_drained_size(uint64_t value) {
32668     AppendVarInt(1, value);
32669   }
32670   void set_skipped_size(uint64_t value) {
32671     AppendVarInt(2, value);
32672   }
32673 };
32674 
32675 class IonSecureCmaShrinkPoolEndFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
32676  public:
32677   IonSecureCmaShrinkPoolEndFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
32678   explicit IonSecureCmaShrinkPoolEndFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
32679   explicit IonSecureCmaShrinkPoolEndFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
32680   bool has_drained_size() const { return at<1>().valid(); }
32681   uint64_t drained_size() const { return at<1>().as_uint64(); }
32682   bool has_skipped_size() const { return at<2>().valid(); }
32683   uint64_t skipped_size() const { return at<2>().as_uint64(); }
32684 };
32685 
32686 class IonSecureCmaShrinkPoolEndFtraceEvent : public ::protozero::Message {
32687  public:
32688   using Decoder = IonSecureCmaShrinkPoolEndFtraceEvent_Decoder;
32689   enum : int32_t {
32690     kDrainedSizeFieldNumber = 1,
32691     kSkippedSizeFieldNumber = 2,
32692   };
32693   void set_drained_size(uint64_t value) {
32694     AppendVarInt(1, value);
32695   }
32696   void set_skipped_size(uint64_t value) {
32697     AppendVarInt(2, value);
32698   }
32699 };
32700 
32701 class IonSecureCmaAllocateStartFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
32702  public:
32703   IonSecureCmaAllocateStartFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
32704   explicit IonSecureCmaAllocateStartFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
32705   explicit IonSecureCmaAllocateStartFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
32706   bool has_align() const { return at<1>().valid(); }
32707   uint64_t align() const { return at<1>().as_uint64(); }
32708   bool has_flags() const { return at<2>().valid(); }
32709   uint64_t flags() const { return at<2>().as_uint64(); }
32710   bool has_heap_name() const { return at<3>().valid(); }
32711   ::protozero::ConstChars heap_name() const { return at<3>().as_string(); }
32712   bool has_len() const { return at<4>().valid(); }
32713   uint64_t len() const { return at<4>().as_uint64(); }
32714 };
32715 
32716 class IonSecureCmaAllocateStartFtraceEvent : public ::protozero::Message {
32717  public:
32718   using Decoder = IonSecureCmaAllocateStartFtraceEvent_Decoder;
32719   enum : int32_t {
32720     kAlignFieldNumber = 1,
32721     kFlagsFieldNumber = 2,
32722     kHeapNameFieldNumber = 3,
32723     kLenFieldNumber = 4,
32724   };
32725   void set_align(uint64_t value) {
32726     AppendVarInt(1, value);
32727   }
32728   void set_flags(uint64_t value) {
32729     AppendVarInt(2, value);
32730   }
32731   void set_heap_name(const std::string& value) {
32732     AppendBytes(3, value.data(), value.size());
32733   }
32734   void set_heap_name(const char* data, size_t size) {
32735     AppendBytes(3, data, size);
32736   }
32737   void set_len(uint64_t value) {
32738     AppendVarInt(4, value);
32739   }
32740 };
32741 
32742 class IonSecureCmaAllocateEndFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
32743  public:
32744   IonSecureCmaAllocateEndFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
32745   explicit IonSecureCmaAllocateEndFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
32746   explicit IonSecureCmaAllocateEndFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
32747   bool has_align() const { return at<1>().valid(); }
32748   uint64_t align() const { return at<1>().as_uint64(); }
32749   bool has_flags() const { return at<2>().valid(); }
32750   uint64_t flags() const { return at<2>().as_uint64(); }
32751   bool has_heap_name() const { return at<3>().valid(); }
32752   ::protozero::ConstChars heap_name() const { return at<3>().as_string(); }
32753   bool has_len() const { return at<4>().valid(); }
32754   uint64_t len() const { return at<4>().as_uint64(); }
32755 };
32756 
32757 class IonSecureCmaAllocateEndFtraceEvent : public ::protozero::Message {
32758  public:
32759   using Decoder = IonSecureCmaAllocateEndFtraceEvent_Decoder;
32760   enum : int32_t {
32761     kAlignFieldNumber = 1,
32762     kFlagsFieldNumber = 2,
32763     kHeapNameFieldNumber = 3,
32764     kLenFieldNumber = 4,
32765   };
32766   void set_align(uint64_t value) {
32767     AppendVarInt(1, value);
32768   }
32769   void set_flags(uint64_t value) {
32770     AppendVarInt(2, value);
32771   }
32772   void set_heap_name(const std::string& value) {
32773     AppendBytes(3, value.data(), value.size());
32774   }
32775   void set_heap_name(const char* data, size_t size) {
32776     AppendBytes(3, data, size);
32777   }
32778   void set_len(uint64_t value) {
32779     AppendVarInt(4, value);
32780   }
32781 };
32782 
32783 class IonSecureCmaAddToPoolStartFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
32784  public:
32785   IonSecureCmaAddToPoolStartFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
32786   explicit IonSecureCmaAddToPoolStartFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
32787   explicit IonSecureCmaAddToPoolStartFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
32788   bool has_is_prefetch() const { return at<1>().valid(); }
32789   uint32_t is_prefetch() const { return at<1>().as_uint32(); }
32790   bool has_len() const { return at<2>().valid(); }
32791   uint64_t len() const { return at<2>().as_uint64(); }
32792   bool has_pool_total() const { return at<3>().valid(); }
32793   int32_t pool_total() const { return at<3>().as_int32(); }
32794 };
32795 
32796 class IonSecureCmaAddToPoolStartFtraceEvent : public ::protozero::Message {
32797  public:
32798   using Decoder = IonSecureCmaAddToPoolStartFtraceEvent_Decoder;
32799   enum : int32_t {
32800     kIsPrefetchFieldNumber = 1,
32801     kLenFieldNumber = 2,
32802     kPoolTotalFieldNumber = 3,
32803   };
32804   void set_is_prefetch(uint32_t value) {
32805     AppendVarInt(1, value);
32806   }
32807   void set_len(uint64_t value) {
32808     AppendVarInt(2, value);
32809   }
32810   void set_pool_total(int32_t value) {
32811     AppendVarInt(3, value);
32812   }
32813 };
32814 
32815 class IonSecureCmaAddToPoolEndFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
32816  public:
32817   IonSecureCmaAddToPoolEndFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
32818   explicit IonSecureCmaAddToPoolEndFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
32819   explicit IonSecureCmaAddToPoolEndFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
32820   bool has_is_prefetch() const { return at<1>().valid(); }
32821   uint32_t is_prefetch() const { return at<1>().as_uint32(); }
32822   bool has_len() const { return at<2>().valid(); }
32823   uint64_t len() const { return at<2>().as_uint64(); }
32824   bool has_pool_total() const { return at<3>().valid(); }
32825   int32_t pool_total() const { return at<3>().as_int32(); }
32826 };
32827 
32828 class IonSecureCmaAddToPoolEndFtraceEvent : public ::protozero::Message {
32829  public:
32830   using Decoder = IonSecureCmaAddToPoolEndFtraceEvent_Decoder;
32831   enum : int32_t {
32832     kIsPrefetchFieldNumber = 1,
32833     kLenFieldNumber = 2,
32834     kPoolTotalFieldNumber = 3,
32835   };
32836   void set_is_prefetch(uint32_t value) {
32837     AppendVarInt(1, value);
32838   }
32839   void set_len(uint64_t value) {
32840     AppendVarInt(2, value);
32841   }
32842   void set_pool_total(int32_t value) {
32843     AppendVarInt(3, value);
32844   }
32845 };
32846 
32847 class IonPrefetchingFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
32848  public:
32849   IonPrefetchingFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
32850   explicit IonPrefetchingFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
32851   explicit IonPrefetchingFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
32852   bool has_len() const { return at<1>().valid(); }
32853   uint64_t len() const { return at<1>().as_uint64(); }
32854 };
32855 
32856 class IonPrefetchingFtraceEvent : public ::protozero::Message {
32857  public:
32858   using Decoder = IonPrefetchingFtraceEvent_Decoder;
32859   enum : int32_t {
32860     kLenFieldNumber = 1,
32861   };
32862   void set_len(uint64_t value) {
32863     AppendVarInt(1, value);
32864   }
32865 };
32866 
32867 class IonCpSecureBufferStartFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
32868  public:
32869   IonCpSecureBufferStartFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
32870   explicit IonCpSecureBufferStartFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
32871   explicit IonCpSecureBufferStartFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
32872   bool has_align() const { return at<1>().valid(); }
32873   uint64_t align() const { return at<1>().as_uint64(); }
32874   bool has_flags() const { return at<2>().valid(); }
32875   uint64_t flags() const { return at<2>().as_uint64(); }
32876   bool has_heap_name() const { return at<3>().valid(); }
32877   ::protozero::ConstChars heap_name() const { return at<3>().as_string(); }
32878   bool has_len() const { return at<4>().valid(); }
32879   uint64_t len() const { return at<4>().as_uint64(); }
32880 };
32881 
32882 class IonCpSecureBufferStartFtraceEvent : public ::protozero::Message {
32883  public:
32884   using Decoder = IonCpSecureBufferStartFtraceEvent_Decoder;
32885   enum : int32_t {
32886     kAlignFieldNumber = 1,
32887     kFlagsFieldNumber = 2,
32888     kHeapNameFieldNumber = 3,
32889     kLenFieldNumber = 4,
32890   };
32891   void set_align(uint64_t value) {
32892     AppendVarInt(1, value);
32893   }
32894   void set_flags(uint64_t value) {
32895     AppendVarInt(2, value);
32896   }
32897   void set_heap_name(const std::string& value) {
32898     AppendBytes(3, value.data(), value.size());
32899   }
32900   void set_heap_name(const char* data, size_t size) {
32901     AppendBytes(3, data, size);
32902   }
32903   void set_len(uint64_t value) {
32904     AppendVarInt(4, value);
32905   }
32906 };
32907 
32908 class IonCpSecureBufferEndFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
32909  public:
32910   IonCpSecureBufferEndFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
32911   explicit IonCpSecureBufferEndFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
32912   explicit IonCpSecureBufferEndFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
32913   bool has_align() const { return at<1>().valid(); }
32914   uint64_t align() const { return at<1>().as_uint64(); }
32915   bool has_flags() const { return at<2>().valid(); }
32916   uint64_t flags() const { return at<2>().as_uint64(); }
32917   bool has_heap_name() const { return at<3>().valid(); }
32918   ::protozero::ConstChars heap_name() const { return at<3>().as_string(); }
32919   bool has_len() const { return at<4>().valid(); }
32920   uint64_t len() const { return at<4>().as_uint64(); }
32921 };
32922 
32923 class IonCpSecureBufferEndFtraceEvent : public ::protozero::Message {
32924  public:
32925   using Decoder = IonCpSecureBufferEndFtraceEvent_Decoder;
32926   enum : int32_t {
32927     kAlignFieldNumber = 1,
32928     kFlagsFieldNumber = 2,
32929     kHeapNameFieldNumber = 3,
32930     kLenFieldNumber = 4,
32931   };
32932   void set_align(uint64_t value) {
32933     AppendVarInt(1, value);
32934   }
32935   void set_flags(uint64_t value) {
32936     AppendVarInt(2, value);
32937   }
32938   void set_heap_name(const std::string& value) {
32939     AppendBytes(3, value.data(), value.size());
32940   }
32941   void set_heap_name(const char* data, size_t size) {
32942     AppendBytes(3, data, size);
32943   }
32944   void set_len(uint64_t value) {
32945     AppendVarInt(4, value);
32946   }
32947 };
32948 
32949 class IonCpAllocRetryFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
32950  public:
32951   IonCpAllocRetryFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
32952   explicit IonCpAllocRetryFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
32953   explicit IonCpAllocRetryFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
32954   bool has_tries() const { return at<1>().valid(); }
32955   int32_t tries() const { return at<1>().as_int32(); }
32956 };
32957 
32958 class IonCpAllocRetryFtraceEvent : public ::protozero::Message {
32959  public:
32960   using Decoder = IonCpAllocRetryFtraceEvent_Decoder;
32961   enum : int32_t {
32962     kTriesFieldNumber = 1,
32963   };
32964   void set_tries(int32_t value) {
32965     AppendVarInt(1, value);
32966   }
32967 };
32968 
32969 class IonAllocBufferStartFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
32970  public:
32971   IonAllocBufferStartFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
32972   explicit IonAllocBufferStartFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
32973   explicit IonAllocBufferStartFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
32974   bool has_client_name() const { return at<1>().valid(); }
32975   ::protozero::ConstChars client_name() const { return at<1>().as_string(); }
32976   bool has_flags() const { return at<2>().valid(); }
32977   uint32_t flags() const { return at<2>().as_uint32(); }
32978   bool has_heap_name() const { return at<3>().valid(); }
32979   ::protozero::ConstChars heap_name() const { return at<3>().as_string(); }
32980   bool has_len() const { return at<4>().valid(); }
32981   uint64_t len() const { return at<4>().as_uint64(); }
32982   bool has_mask() const { return at<5>().valid(); }
32983   uint32_t mask() const { return at<5>().as_uint32(); }
32984 };
32985 
32986 class IonAllocBufferStartFtraceEvent : public ::protozero::Message {
32987  public:
32988   using Decoder = IonAllocBufferStartFtraceEvent_Decoder;
32989   enum : int32_t {
32990     kClientNameFieldNumber = 1,
32991     kFlagsFieldNumber = 2,
32992     kHeapNameFieldNumber = 3,
32993     kLenFieldNumber = 4,
32994     kMaskFieldNumber = 5,
32995   };
32996   void set_client_name(const std::string& value) {
32997     AppendBytes(1, value.data(), value.size());
32998   }
32999   void set_client_name(const char* data, size_t size) {
33000     AppendBytes(1, data, size);
33001   }
33002   void set_flags(uint32_t value) {
33003     AppendVarInt(2, value);
33004   }
33005   void set_heap_name(const std::string& value) {
33006     AppendBytes(3, value.data(), value.size());
33007   }
33008   void set_heap_name(const char* data, size_t size) {
33009     AppendBytes(3, data, size);
33010   }
33011   void set_len(uint64_t value) {
33012     AppendVarInt(4, value);
33013   }
33014   void set_mask(uint32_t value) {
33015     AppendVarInt(5, value);
33016   }
33017 };
33018 
33019 class IonAllocBufferFallbackFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
33020  public:
33021   IonAllocBufferFallbackFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
33022   explicit IonAllocBufferFallbackFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
33023   explicit IonAllocBufferFallbackFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
33024   bool has_client_name() const { return at<1>().valid(); }
33025   ::protozero::ConstChars client_name() const { return at<1>().as_string(); }
33026   bool has_error() const { return at<2>().valid(); }
33027   int64_t error() const { return at<2>().as_int64(); }
33028   bool has_flags() const { return at<3>().valid(); }
33029   uint32_t flags() const { return at<3>().as_uint32(); }
33030   bool has_heap_name() const { return at<4>().valid(); }
33031   ::protozero::ConstChars heap_name() const { return at<4>().as_string(); }
33032   bool has_len() const { return at<5>().valid(); }
33033   uint64_t len() const { return at<5>().as_uint64(); }
33034   bool has_mask() const { return at<6>().valid(); }
33035   uint32_t mask() const { return at<6>().as_uint32(); }
33036 };
33037 
33038 class IonAllocBufferFallbackFtraceEvent : public ::protozero::Message {
33039  public:
33040   using Decoder = IonAllocBufferFallbackFtraceEvent_Decoder;
33041   enum : int32_t {
33042     kClientNameFieldNumber = 1,
33043     kErrorFieldNumber = 2,
33044     kFlagsFieldNumber = 3,
33045     kHeapNameFieldNumber = 4,
33046     kLenFieldNumber = 5,
33047     kMaskFieldNumber = 6,
33048   };
33049   void set_client_name(const std::string& value) {
33050     AppendBytes(1, value.data(), value.size());
33051   }
33052   void set_client_name(const char* data, size_t size) {
33053     AppendBytes(1, data, size);
33054   }
33055   void set_error(int64_t value) {
33056     AppendVarInt(2, value);
33057   }
33058   void set_flags(uint32_t value) {
33059     AppendVarInt(3, value);
33060   }
33061   void set_heap_name(const std::string& value) {
33062     AppendBytes(4, value.data(), value.size());
33063   }
33064   void set_heap_name(const char* data, size_t size) {
33065     AppendBytes(4, data, size);
33066   }
33067   void set_len(uint64_t value) {
33068     AppendVarInt(5, value);
33069   }
33070   void set_mask(uint32_t value) {
33071     AppendVarInt(6, value);
33072   }
33073 };
33074 
33075 class IonAllocBufferFailFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
33076  public:
33077   IonAllocBufferFailFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
33078   explicit IonAllocBufferFailFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
33079   explicit IonAllocBufferFailFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
33080   bool has_client_name() const { return at<1>().valid(); }
33081   ::protozero::ConstChars client_name() const { return at<1>().as_string(); }
33082   bool has_error() const { return at<2>().valid(); }
33083   int64_t error() const { return at<2>().as_int64(); }
33084   bool has_flags() const { return at<3>().valid(); }
33085   uint32_t flags() const { return at<3>().as_uint32(); }
33086   bool has_heap_name() const { return at<4>().valid(); }
33087   ::protozero::ConstChars heap_name() const { return at<4>().as_string(); }
33088   bool has_len() const { return at<5>().valid(); }
33089   uint64_t len() const { return at<5>().as_uint64(); }
33090   bool has_mask() const { return at<6>().valid(); }
33091   uint32_t mask() const { return at<6>().as_uint32(); }
33092 };
33093 
33094 class IonAllocBufferFailFtraceEvent : public ::protozero::Message {
33095  public:
33096   using Decoder = IonAllocBufferFailFtraceEvent_Decoder;
33097   enum : int32_t {
33098     kClientNameFieldNumber = 1,
33099     kErrorFieldNumber = 2,
33100     kFlagsFieldNumber = 3,
33101     kHeapNameFieldNumber = 4,
33102     kLenFieldNumber = 5,
33103     kMaskFieldNumber = 6,
33104   };
33105   void set_client_name(const std::string& value) {
33106     AppendBytes(1, value.data(), value.size());
33107   }
33108   void set_client_name(const char* data, size_t size) {
33109     AppendBytes(1, data, size);
33110   }
33111   void set_error(int64_t value) {
33112     AppendVarInt(2, value);
33113   }
33114   void set_flags(uint32_t value) {
33115     AppendVarInt(3, value);
33116   }
33117   void set_heap_name(const std::string& value) {
33118     AppendBytes(4, value.data(), value.size());
33119   }
33120   void set_heap_name(const char* data, size_t size) {
33121     AppendBytes(4, data, size);
33122   }
33123   void set_len(uint64_t value) {
33124     AppendVarInt(5, value);
33125   }
33126   void set_mask(uint32_t value) {
33127     AppendVarInt(6, value);
33128   }
33129 };
33130 
33131 class IonAllocBufferEndFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
33132  public:
33133   IonAllocBufferEndFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
33134   explicit IonAllocBufferEndFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
33135   explicit IonAllocBufferEndFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
33136   bool has_client_name() const { return at<1>().valid(); }
33137   ::protozero::ConstChars client_name() const { return at<1>().as_string(); }
33138   bool has_flags() const { return at<2>().valid(); }
33139   uint32_t flags() const { return at<2>().as_uint32(); }
33140   bool has_heap_name() const { return at<3>().valid(); }
33141   ::protozero::ConstChars heap_name() const { return at<3>().as_string(); }
33142   bool has_len() const { return at<4>().valid(); }
33143   uint64_t len() const { return at<4>().as_uint64(); }
33144   bool has_mask() const { return at<5>().valid(); }
33145   uint32_t mask() const { return at<5>().as_uint32(); }
33146 };
33147 
33148 class IonAllocBufferEndFtraceEvent : public ::protozero::Message {
33149  public:
33150   using Decoder = IonAllocBufferEndFtraceEvent_Decoder;
33151   enum : int32_t {
33152     kClientNameFieldNumber = 1,
33153     kFlagsFieldNumber = 2,
33154     kHeapNameFieldNumber = 3,
33155     kLenFieldNumber = 4,
33156     kMaskFieldNumber = 5,
33157   };
33158   void set_client_name(const std::string& value) {
33159     AppendBytes(1, value.data(), value.size());
33160   }
33161   void set_client_name(const char* data, size_t size) {
33162     AppendBytes(1, data, size);
33163   }
33164   void set_flags(uint32_t value) {
33165     AppendVarInt(2, value);
33166   }
33167   void set_heap_name(const std::string& value) {
33168     AppendBytes(3, value.data(), value.size());
33169   }
33170   void set_heap_name(const char* data, size_t size) {
33171     AppendBytes(3, data, size);
33172   }
33173   void set_len(uint64_t value) {
33174     AppendVarInt(4, value);
33175   }
33176   void set_mask(uint32_t value) {
33177     AppendVarInt(5, value);
33178   }
33179 };
33180 
33181 class IommuSecPtblMapRangeStartFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
33182  public:
33183   IommuSecPtblMapRangeStartFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
33184   explicit IommuSecPtblMapRangeStartFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
33185   explicit IommuSecPtblMapRangeStartFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
33186   bool has_len() const { return at<1>().valid(); }
33187   uint64_t len() const { return at<1>().as_uint64(); }
33188   bool has_num() const { return at<2>().valid(); }
33189   int32_t num() const { return at<2>().as_int32(); }
33190   bool has_pa() const { return at<3>().valid(); }
33191   uint32_t pa() const { return at<3>().as_uint32(); }
33192   bool has_sec_id() const { return at<4>().valid(); }
33193   int32_t sec_id() const { return at<4>().as_int32(); }
33194   bool has_va() const { return at<5>().valid(); }
33195   uint64_t va() const { return at<5>().as_uint64(); }
33196 };
33197 
33198 class IommuSecPtblMapRangeStartFtraceEvent : public ::protozero::Message {
33199  public:
33200   using Decoder = IommuSecPtblMapRangeStartFtraceEvent_Decoder;
33201   enum : int32_t {
33202     kLenFieldNumber = 1,
33203     kNumFieldNumber = 2,
33204     kPaFieldNumber = 3,
33205     kSecIdFieldNumber = 4,
33206     kVaFieldNumber = 5,
33207   };
33208   void set_len(uint64_t value) {
33209     AppendVarInt(1, value);
33210   }
33211   void set_num(int32_t value) {
33212     AppendVarInt(2, value);
33213   }
33214   void set_pa(uint32_t value) {
33215     AppendVarInt(3, value);
33216   }
33217   void set_sec_id(int32_t value) {
33218     AppendVarInt(4, value);
33219   }
33220   void set_va(uint64_t value) {
33221     AppendVarInt(5, value);
33222   }
33223 };
33224 
33225 class IommuSecPtblMapRangeEndFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
33226  public:
33227   IommuSecPtblMapRangeEndFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
33228   explicit IommuSecPtblMapRangeEndFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
33229   explicit IommuSecPtblMapRangeEndFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
33230   bool has_len() const { return at<1>().valid(); }
33231   uint64_t len() const { return at<1>().as_uint64(); }
33232   bool has_num() const { return at<2>().valid(); }
33233   int32_t num() const { return at<2>().as_int32(); }
33234   bool has_pa() const { return at<3>().valid(); }
33235   uint32_t pa() const { return at<3>().as_uint32(); }
33236   bool has_sec_id() const { return at<4>().valid(); }
33237   int32_t sec_id() const { return at<4>().as_int32(); }
33238   bool has_va() const { return at<5>().valid(); }
33239   uint64_t va() const { return at<5>().as_uint64(); }
33240 };
33241 
33242 class IommuSecPtblMapRangeEndFtraceEvent : public ::protozero::Message {
33243  public:
33244   using Decoder = IommuSecPtblMapRangeEndFtraceEvent_Decoder;
33245   enum : int32_t {
33246     kLenFieldNumber = 1,
33247     kNumFieldNumber = 2,
33248     kPaFieldNumber = 3,
33249     kSecIdFieldNumber = 4,
33250     kVaFieldNumber = 5,
33251   };
33252   void set_len(uint64_t value) {
33253     AppendVarInt(1, value);
33254   }
33255   void set_num(int32_t value) {
33256     AppendVarInt(2, value);
33257   }
33258   void set_pa(uint32_t value) {
33259     AppendVarInt(3, value);
33260   }
33261   void set_sec_id(int32_t value) {
33262     AppendVarInt(4, value);
33263   }
33264   void set_va(uint64_t value) {
33265     AppendVarInt(5, value);
33266   }
33267 };
33268 
33269 class IommuMapRangeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
33270  public:
33271   IommuMapRangeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
33272   explicit IommuMapRangeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
33273   explicit IommuMapRangeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
33274   bool has_chunk_size() const { return at<1>().valid(); }
33275   uint64_t chunk_size() const { return at<1>().as_uint64(); }
33276   bool has_len() const { return at<2>().valid(); }
33277   uint64_t len() const { return at<2>().as_uint64(); }
33278   bool has_pa() const { return at<3>().valid(); }
33279   uint64_t pa() const { return at<3>().as_uint64(); }
33280   bool has_va() const { return at<4>().valid(); }
33281   uint64_t va() const { return at<4>().as_uint64(); }
33282 };
33283 
33284 class IommuMapRangeFtraceEvent : public ::protozero::Message {
33285  public:
33286   using Decoder = IommuMapRangeFtraceEvent_Decoder;
33287   enum : int32_t {
33288     kChunkSizeFieldNumber = 1,
33289     kLenFieldNumber = 2,
33290     kPaFieldNumber = 3,
33291     kVaFieldNumber = 4,
33292   };
33293   void set_chunk_size(uint64_t value) {
33294     AppendVarInt(1, value);
33295   }
33296   void set_len(uint64_t value) {
33297     AppendVarInt(2, value);
33298   }
33299   void set_pa(uint64_t value) {
33300     AppendVarInt(3, value);
33301   }
33302   void set_va(uint64_t value) {
33303     AppendVarInt(4, value);
33304   }
33305 };
33306 
33307 class DmaAllocContiguousRetryFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
33308  public:
33309   DmaAllocContiguousRetryFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
33310   explicit DmaAllocContiguousRetryFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
33311   explicit DmaAllocContiguousRetryFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
33312   bool has_tries() const { return at<1>().valid(); }
33313   int32_t tries() const { return at<1>().as_int32(); }
33314 };
33315 
33316 class DmaAllocContiguousRetryFtraceEvent : public ::protozero::Message {
33317  public:
33318   using Decoder = DmaAllocContiguousRetryFtraceEvent_Decoder;
33319   enum : int32_t {
33320     kTriesFieldNumber = 1,
33321   };
33322   void set_tries(int32_t value) {
33323     AppendVarInt(1, value);
33324   }
33325 };
33326 
33327 class AllocPagesSysStartFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
33328  public:
33329   AllocPagesSysStartFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
33330   explicit AllocPagesSysStartFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
33331   explicit AllocPagesSysStartFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
33332   bool has_gfp_flags() const { return at<1>().valid(); }
33333   uint32_t gfp_flags() const { return at<1>().as_uint32(); }
33334   bool has_order() const { return at<2>().valid(); }
33335   uint32_t order() const { return at<2>().as_uint32(); }
33336 };
33337 
33338 class AllocPagesSysStartFtraceEvent : public ::protozero::Message {
33339  public:
33340   using Decoder = AllocPagesSysStartFtraceEvent_Decoder;
33341   enum : int32_t {
33342     kGfpFlagsFieldNumber = 1,
33343     kOrderFieldNumber = 2,
33344   };
33345   void set_gfp_flags(uint32_t value) {
33346     AppendVarInt(1, value);
33347   }
33348   void set_order(uint32_t value) {
33349     AppendVarInt(2, value);
33350   }
33351 };
33352 
33353 class AllocPagesSysFailFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
33354  public:
33355   AllocPagesSysFailFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
33356   explicit AllocPagesSysFailFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
33357   explicit AllocPagesSysFailFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
33358   bool has_gfp_flags() const { return at<1>().valid(); }
33359   uint32_t gfp_flags() const { return at<1>().as_uint32(); }
33360   bool has_order() const { return at<2>().valid(); }
33361   uint32_t order() const { return at<2>().as_uint32(); }
33362 };
33363 
33364 class AllocPagesSysFailFtraceEvent : public ::protozero::Message {
33365  public:
33366   using Decoder = AllocPagesSysFailFtraceEvent_Decoder;
33367   enum : int32_t {
33368     kGfpFlagsFieldNumber = 1,
33369     kOrderFieldNumber = 2,
33370   };
33371   void set_gfp_flags(uint32_t value) {
33372     AppendVarInt(1, value);
33373   }
33374   void set_order(uint32_t value) {
33375     AppendVarInt(2, value);
33376   }
33377 };
33378 
33379 class AllocPagesSysEndFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
33380  public:
33381   AllocPagesSysEndFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
33382   explicit AllocPagesSysEndFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
33383   explicit AllocPagesSysEndFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
33384   bool has_gfp_flags() const { return at<1>().valid(); }
33385   uint32_t gfp_flags() const { return at<1>().as_uint32(); }
33386   bool has_order() const { return at<2>().valid(); }
33387   uint32_t order() const { return at<2>().as_uint32(); }
33388 };
33389 
33390 class AllocPagesSysEndFtraceEvent : public ::protozero::Message {
33391  public:
33392   using Decoder = AllocPagesSysEndFtraceEvent_Decoder;
33393   enum : int32_t {
33394     kGfpFlagsFieldNumber = 1,
33395     kOrderFieldNumber = 2,
33396   };
33397   void set_gfp_flags(uint32_t value) {
33398     AppendVarInt(1, value);
33399   }
33400   void set_order(uint32_t value) {
33401     AppendVarInt(2, value);
33402   }
33403 };
33404 
33405 class AllocPagesIommuStartFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
33406  public:
33407   AllocPagesIommuStartFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
33408   explicit AllocPagesIommuStartFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
33409   explicit AllocPagesIommuStartFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
33410   bool has_gfp_flags() const { return at<1>().valid(); }
33411   uint32_t gfp_flags() const { return at<1>().as_uint32(); }
33412   bool has_order() const { return at<2>().valid(); }
33413   uint32_t order() const { return at<2>().as_uint32(); }
33414 };
33415 
33416 class AllocPagesIommuStartFtraceEvent : public ::protozero::Message {
33417  public:
33418   using Decoder = AllocPagesIommuStartFtraceEvent_Decoder;
33419   enum : int32_t {
33420     kGfpFlagsFieldNumber = 1,
33421     kOrderFieldNumber = 2,
33422   };
33423   void set_gfp_flags(uint32_t value) {
33424     AppendVarInt(1, value);
33425   }
33426   void set_order(uint32_t value) {
33427     AppendVarInt(2, value);
33428   }
33429 };
33430 
33431 class AllocPagesIommuFailFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
33432  public:
33433   AllocPagesIommuFailFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
33434   explicit AllocPagesIommuFailFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
33435   explicit AllocPagesIommuFailFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
33436   bool has_gfp_flags() const { return at<1>().valid(); }
33437   uint32_t gfp_flags() const { return at<1>().as_uint32(); }
33438   bool has_order() const { return at<2>().valid(); }
33439   uint32_t order() const { return at<2>().as_uint32(); }
33440 };
33441 
33442 class AllocPagesIommuFailFtraceEvent : public ::protozero::Message {
33443  public:
33444   using Decoder = AllocPagesIommuFailFtraceEvent_Decoder;
33445   enum : int32_t {
33446     kGfpFlagsFieldNumber = 1,
33447     kOrderFieldNumber = 2,
33448   };
33449   void set_gfp_flags(uint32_t value) {
33450     AppendVarInt(1, value);
33451   }
33452   void set_order(uint32_t value) {
33453     AppendVarInt(2, value);
33454   }
33455 };
33456 
33457 class AllocPagesIommuEndFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
33458  public:
33459   AllocPagesIommuEndFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
33460   explicit AllocPagesIommuEndFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
33461   explicit AllocPagesIommuEndFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
33462   bool has_gfp_flags() const { return at<1>().valid(); }
33463   uint32_t gfp_flags() const { return at<1>().as_uint32(); }
33464   bool has_order() const { return at<2>().valid(); }
33465   uint32_t order() const { return at<2>().as_uint32(); }
33466 };
33467 
33468 class AllocPagesIommuEndFtraceEvent : public ::protozero::Message {
33469  public:
33470   using Decoder = AllocPagesIommuEndFtraceEvent_Decoder;
33471   enum : int32_t {
33472     kGfpFlagsFieldNumber = 1,
33473     kOrderFieldNumber = 2,
33474   };
33475   void set_gfp_flags(uint32_t value) {
33476     AppendVarInt(1, value);
33477   }
33478   void set_order(uint32_t value) {
33479     AppendVarInt(2, value);
33480   }
33481 };
33482 
33483 } // Namespace.
33484 } // Namespace.
33485 } // Namespace.
33486 #endif  // Include guard.
33487 // gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/lowmemorykiller.pbzero.h
33488 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
33489 
33490 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_LOWMEMORYKILLER_PROTO_H_
33491 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_LOWMEMORYKILLER_PROTO_H_
33492 
33493 #include <stddef.h>
33494 #include <stdint.h>
33495 
33496 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
33497 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
33498 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
33499 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
33500 
33501 namespace perfetto {
33502 namespace protos {
33503 namespace pbzero {
33504 
33505 
33506 class LowmemoryKillFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
33507  public:
33508   LowmemoryKillFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
33509   explicit LowmemoryKillFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
33510   explicit LowmemoryKillFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
33511   bool has_comm() const { return at<1>().valid(); }
33512   ::protozero::ConstChars comm() const { return at<1>().as_string(); }
33513   bool has_pid() const { return at<2>().valid(); }
33514   int32_t pid() const { return at<2>().as_int32(); }
33515   bool has_pagecache_size() const { return at<3>().valid(); }
33516   int64_t pagecache_size() const { return at<3>().as_int64(); }
33517   bool has_pagecache_limit() const { return at<4>().valid(); }
33518   int64_t pagecache_limit() const { return at<4>().as_int64(); }
33519   bool has_free() const { return at<5>().valid(); }
33520   int64_t free() const { return at<5>().as_int64(); }
33521 };
33522 
33523 class LowmemoryKillFtraceEvent : public ::protozero::Message {
33524  public:
33525   using Decoder = LowmemoryKillFtraceEvent_Decoder;
33526   enum : int32_t {
33527     kCommFieldNumber = 1,
33528     kPidFieldNumber = 2,
33529     kPagecacheSizeFieldNumber = 3,
33530     kPagecacheLimitFieldNumber = 4,
33531     kFreeFieldNumber = 5,
33532   };
33533   void set_comm(const std::string& value) {
33534     AppendBytes(1, value.data(), value.size());
33535   }
33536   void set_comm(const char* data, size_t size) {
33537     AppendBytes(1, data, size);
33538   }
33539   void set_pid(int32_t value) {
33540     AppendVarInt(2, value);
33541   }
33542   void set_pagecache_size(int64_t value) {
33543     AppendVarInt(3, value);
33544   }
33545   void set_pagecache_limit(int64_t value) {
33546     AppendVarInt(4, value);
33547   }
33548   void set_free(int64_t value) {
33549     AppendVarInt(5, value);
33550   }
33551 };
33552 
33553 } // Namespace.
33554 } // Namespace.
33555 } // Namespace.
33556 #endif  // Include guard.
33557 // gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/mdss.pbzero.h
33558 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
33559 
33560 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_MDSS_PROTO_H_
33561 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_MDSS_PROTO_H_
33562 
33563 #include <stddef.h>
33564 #include <stdint.h>
33565 
33566 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
33567 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
33568 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
33569 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
33570 
33571 namespace perfetto {
33572 namespace protos {
33573 namespace pbzero {
33574 
33575 
33576 class RotatorBwAoAsContextFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
33577  public:
33578   RotatorBwAoAsContextFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
33579   explicit RotatorBwAoAsContextFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
33580   explicit RotatorBwAoAsContextFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
33581   bool has_state() const { return at<1>().valid(); }
33582   uint32_t state() const { return at<1>().as_uint32(); }
33583 };
33584 
33585 class RotatorBwAoAsContextFtraceEvent : public ::protozero::Message {
33586  public:
33587   using Decoder = RotatorBwAoAsContextFtraceEvent_Decoder;
33588   enum : int32_t {
33589     kStateFieldNumber = 1,
33590   };
33591   void set_state(uint32_t value) {
33592     AppendVarInt(1, value);
33593   }
33594 };
33595 
33596 class MdpPerfUpdateBusFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
33597  public:
33598   MdpPerfUpdateBusFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
33599   explicit MdpPerfUpdateBusFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
33600   explicit MdpPerfUpdateBusFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
33601   bool has_client() const { return at<1>().valid(); }
33602   int32_t client() const { return at<1>().as_int32(); }
33603   bool has_ab_quota() const { return at<2>().valid(); }
33604   uint64_t ab_quota() const { return at<2>().as_uint64(); }
33605   bool has_ib_quota() const { return at<3>().valid(); }
33606   uint64_t ib_quota() const { return at<3>().as_uint64(); }
33607 };
33608 
33609 class MdpPerfUpdateBusFtraceEvent : public ::protozero::Message {
33610  public:
33611   using Decoder = MdpPerfUpdateBusFtraceEvent_Decoder;
33612   enum : int32_t {
33613     kClientFieldNumber = 1,
33614     kAbQuotaFieldNumber = 2,
33615     kIbQuotaFieldNumber = 3,
33616   };
33617   void set_client(int32_t value) {
33618     AppendVarInt(1, value);
33619   }
33620   void set_ab_quota(uint64_t value) {
33621     AppendVarInt(2, value);
33622   }
33623   void set_ib_quota(uint64_t value) {
33624     AppendVarInt(3, value);
33625   }
33626 };
33627 
33628 class MdpPerfPrefillCalcFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/10, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
33629  public:
33630   MdpPerfPrefillCalcFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
33631   explicit MdpPerfPrefillCalcFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
33632   explicit MdpPerfPrefillCalcFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
33633   bool has_pnum() const { return at<1>().valid(); }
33634   uint32_t pnum() const { return at<1>().as_uint32(); }
33635   bool has_latency_buf() const { return at<2>().valid(); }
33636   uint32_t latency_buf() const { return at<2>().as_uint32(); }
33637   bool has_ot() const { return at<3>().valid(); }
33638   uint32_t ot() const { return at<3>().as_uint32(); }
33639   bool has_y_buf() const { return at<4>().valid(); }
33640   uint32_t y_buf() const { return at<4>().as_uint32(); }
33641   bool has_y_scaler() const { return at<5>().valid(); }
33642   uint32_t y_scaler() const { return at<5>().as_uint32(); }
33643   bool has_pp_lines() const { return at<6>().valid(); }
33644   uint32_t pp_lines() const { return at<6>().as_uint32(); }
33645   bool has_pp_bytes() const { return at<7>().valid(); }
33646   uint32_t pp_bytes() const { return at<7>().as_uint32(); }
33647   bool has_post_sc() const { return at<8>().valid(); }
33648   uint32_t post_sc() const { return at<8>().as_uint32(); }
33649   bool has_fbc_bytes() const { return at<9>().valid(); }
33650   uint32_t fbc_bytes() const { return at<9>().as_uint32(); }
33651   bool has_prefill_bytes() const { return at<10>().valid(); }
33652   uint32_t prefill_bytes() const { return at<10>().as_uint32(); }
33653 };
33654 
33655 class MdpPerfPrefillCalcFtraceEvent : public ::protozero::Message {
33656  public:
33657   using Decoder = MdpPerfPrefillCalcFtraceEvent_Decoder;
33658   enum : int32_t {
33659     kPnumFieldNumber = 1,
33660     kLatencyBufFieldNumber = 2,
33661     kOtFieldNumber = 3,
33662     kYBufFieldNumber = 4,
33663     kYScalerFieldNumber = 5,
33664     kPpLinesFieldNumber = 6,
33665     kPpBytesFieldNumber = 7,
33666     kPostScFieldNumber = 8,
33667     kFbcBytesFieldNumber = 9,
33668     kPrefillBytesFieldNumber = 10,
33669   };
33670   void set_pnum(uint32_t value) {
33671     AppendVarInt(1, value);
33672   }
33673   void set_latency_buf(uint32_t value) {
33674     AppendVarInt(2, value);
33675   }
33676   void set_ot(uint32_t value) {
33677     AppendVarInt(3, value);
33678   }
33679   void set_y_buf(uint32_t value) {
33680     AppendVarInt(4, value);
33681   }
33682   void set_y_scaler(uint32_t value) {
33683     AppendVarInt(5, value);
33684   }
33685   void set_pp_lines(uint32_t value) {
33686     AppendVarInt(6, value);
33687   }
33688   void set_pp_bytes(uint32_t value) {
33689     AppendVarInt(7, value);
33690   }
33691   void set_post_sc(uint32_t value) {
33692     AppendVarInt(8, value);
33693   }
33694   void set_fbc_bytes(uint32_t value) {
33695     AppendVarInt(9, value);
33696   }
33697   void set_prefill_bytes(uint32_t value) {
33698     AppendVarInt(10, value);
33699   }
33700 };
33701 
33702 class MdpCmdWaitPingpongFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
33703  public:
33704   MdpCmdWaitPingpongFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
33705   explicit MdpCmdWaitPingpongFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
33706   explicit MdpCmdWaitPingpongFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
33707   bool has_ctl_num() const { return at<1>().valid(); }
33708   uint32_t ctl_num() const { return at<1>().as_uint32(); }
33709   bool has_kickoff_cnt() const { return at<2>().valid(); }
33710   int32_t kickoff_cnt() const { return at<2>().as_int32(); }
33711 };
33712 
33713 class MdpCmdWaitPingpongFtraceEvent : public ::protozero::Message {
33714  public:
33715   using Decoder = MdpCmdWaitPingpongFtraceEvent_Decoder;
33716   enum : int32_t {
33717     kCtlNumFieldNumber = 1,
33718     kKickoffCntFieldNumber = 2,
33719   };
33720   void set_ctl_num(uint32_t value) {
33721     AppendVarInt(1, value);
33722   }
33723   void set_kickoff_cnt(int32_t value) {
33724     AppendVarInt(2, value);
33725   }
33726 };
33727 
33728 class MdpVideoUnderrunDoneFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
33729  public:
33730   MdpVideoUnderrunDoneFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
33731   explicit MdpVideoUnderrunDoneFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
33732   explicit MdpVideoUnderrunDoneFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
33733   bool has_ctl_num() const { return at<1>().valid(); }
33734   uint32_t ctl_num() const { return at<1>().as_uint32(); }
33735   bool has_underrun_cnt() const { return at<2>().valid(); }
33736   uint32_t underrun_cnt() const { return at<2>().as_uint32(); }
33737 };
33738 
33739 class MdpVideoUnderrunDoneFtraceEvent : public ::protozero::Message {
33740  public:
33741   using Decoder = MdpVideoUnderrunDoneFtraceEvent_Decoder;
33742   enum : int32_t {
33743     kCtlNumFieldNumber = 1,
33744     kUnderrunCntFieldNumber = 2,
33745   };
33746   void set_ctl_num(uint32_t value) {
33747     AppendVarInt(1, value);
33748   }
33749   void set_underrun_cnt(uint32_t value) {
33750     AppendVarInt(2, value);
33751   }
33752 };
33753 
33754 class MdpPerfSetWmLevelsFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
33755  public:
33756   MdpPerfSetWmLevelsFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
33757   explicit MdpPerfSetWmLevelsFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
33758   explicit MdpPerfSetWmLevelsFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
33759   bool has_pnum() const { return at<1>().valid(); }
33760   uint32_t pnum() const { return at<1>().as_uint32(); }
33761   bool has_use_space() const { return at<2>().valid(); }
33762   uint32_t use_space() const { return at<2>().as_uint32(); }
33763   bool has_priority_bytes() const { return at<3>().valid(); }
33764   uint32_t priority_bytes() const { return at<3>().as_uint32(); }
33765   bool has_wm0() const { return at<4>().valid(); }
33766   uint32_t wm0() const { return at<4>().as_uint32(); }
33767   bool has_wm1() const { return at<5>().valid(); }
33768   uint32_t wm1() const { return at<5>().as_uint32(); }
33769   bool has_wm2() const { return at<6>().valid(); }
33770   uint32_t wm2() const { return at<6>().as_uint32(); }
33771   bool has_mb_cnt() const { return at<7>().valid(); }
33772   uint32_t mb_cnt() const { return at<7>().as_uint32(); }
33773   bool has_mb_size() const { return at<8>().valid(); }
33774   uint32_t mb_size() const { return at<8>().as_uint32(); }
33775 };
33776 
33777 class MdpPerfSetWmLevelsFtraceEvent : public ::protozero::Message {
33778  public:
33779   using Decoder = MdpPerfSetWmLevelsFtraceEvent_Decoder;
33780   enum : int32_t {
33781     kPnumFieldNumber = 1,
33782     kUseSpaceFieldNumber = 2,
33783     kPriorityBytesFieldNumber = 3,
33784     kWm0FieldNumber = 4,
33785     kWm1FieldNumber = 5,
33786     kWm2FieldNumber = 6,
33787     kMbCntFieldNumber = 7,
33788     kMbSizeFieldNumber = 8,
33789   };
33790   void set_pnum(uint32_t value) {
33791     AppendVarInt(1, value);
33792   }
33793   void set_use_space(uint32_t value) {
33794     AppendVarInt(2, value);
33795   }
33796   void set_priority_bytes(uint32_t value) {
33797     AppendVarInt(3, value);
33798   }
33799   void set_wm0(uint32_t value) {
33800     AppendVarInt(4, value);
33801   }
33802   void set_wm1(uint32_t value) {
33803     AppendVarInt(5, value);
33804   }
33805   void set_wm2(uint32_t value) {
33806     AppendVarInt(6, value);
33807   }
33808   void set_mb_cnt(uint32_t value) {
33809     AppendVarInt(7, value);
33810   }
33811   void set_mb_size(uint32_t value) {
33812     AppendVarInt(8, value);
33813   }
33814 };
33815 
33816 class MdpMixerUpdateFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
33817  public:
33818   MdpMixerUpdateFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
33819   explicit MdpMixerUpdateFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
33820   explicit MdpMixerUpdateFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
33821   bool has_mixer_num() const { return at<1>().valid(); }
33822   uint32_t mixer_num() const { return at<1>().as_uint32(); }
33823 };
33824 
33825 class MdpMixerUpdateFtraceEvent : public ::protozero::Message {
33826  public:
33827   using Decoder = MdpMixerUpdateFtraceEvent_Decoder;
33828   enum : int32_t {
33829     kMixerNumFieldNumber = 1,
33830   };
33831   void set_mixer_num(uint32_t value) {
33832     AppendVarInt(1, value);
33833   }
33834 };
33835 
33836 class MdpCmdReleaseBwFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
33837  public:
33838   MdpCmdReleaseBwFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
33839   explicit MdpCmdReleaseBwFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
33840   explicit MdpCmdReleaseBwFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
33841   bool has_ctl_num() const { return at<1>().valid(); }
33842   uint32_t ctl_num() const { return at<1>().as_uint32(); }
33843 };
33844 
33845 class MdpCmdReleaseBwFtraceEvent : public ::protozero::Message {
33846  public:
33847   using Decoder = MdpCmdReleaseBwFtraceEvent_Decoder;
33848   enum : int32_t {
33849     kCtlNumFieldNumber = 1,
33850   };
33851   void set_ctl_num(uint32_t value) {
33852     AppendVarInt(1, value);
33853   }
33854 };
33855 
33856 class MdpTraceCounterFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
33857  public:
33858   MdpTraceCounterFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
33859   explicit MdpTraceCounterFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
33860   explicit MdpTraceCounterFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
33861   bool has_pid() const { return at<1>().valid(); }
33862   int32_t pid() const { return at<1>().as_int32(); }
33863   bool has_counter_name() const { return at<2>().valid(); }
33864   ::protozero::ConstChars counter_name() const { return at<2>().as_string(); }
33865   bool has_value() const { return at<3>().valid(); }
33866   int32_t value() const { return at<3>().as_int32(); }
33867 };
33868 
33869 class MdpTraceCounterFtraceEvent : public ::protozero::Message {
33870  public:
33871   using Decoder = MdpTraceCounterFtraceEvent_Decoder;
33872   enum : int32_t {
33873     kPidFieldNumber = 1,
33874     kCounterNameFieldNumber = 2,
33875     kValueFieldNumber = 3,
33876   };
33877   void set_pid(int32_t value) {
33878     AppendVarInt(1, value);
33879   }
33880   void set_counter_name(const std::string& value) {
33881     AppendBytes(2, value.data(), value.size());
33882   }
33883   void set_counter_name(const char* data, size_t size) {
33884     AppendBytes(2, data, size);
33885   }
33886   void set_value(int32_t value) {
33887     AppendVarInt(3, value);
33888   }
33889 };
33890 
33891 class MdpPerfSetQosLutsFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
33892  public:
33893   MdpPerfSetQosLutsFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
33894   explicit MdpPerfSetQosLutsFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
33895   explicit MdpPerfSetQosLutsFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
33896   bool has_pnum() const { return at<1>().valid(); }
33897   uint32_t pnum() const { return at<1>().as_uint32(); }
33898   bool has_fmt() const { return at<2>().valid(); }
33899   uint32_t fmt() const { return at<2>().as_uint32(); }
33900   bool has_intf() const { return at<3>().valid(); }
33901   uint32_t intf() const { return at<3>().as_uint32(); }
33902   bool has_rot() const { return at<4>().valid(); }
33903   uint32_t rot() const { return at<4>().as_uint32(); }
33904   bool has_fl() const { return at<5>().valid(); }
33905   uint32_t fl() const { return at<5>().as_uint32(); }
33906   bool has_lut() const { return at<6>().valid(); }
33907   uint32_t lut() const { return at<6>().as_uint32(); }
33908   bool has_linear() const { return at<7>().valid(); }
33909   uint32_t linear() const { return at<7>().as_uint32(); }
33910 };
33911 
33912 class MdpPerfSetQosLutsFtraceEvent : public ::protozero::Message {
33913  public:
33914   using Decoder = MdpPerfSetQosLutsFtraceEvent_Decoder;
33915   enum : int32_t {
33916     kPnumFieldNumber = 1,
33917     kFmtFieldNumber = 2,
33918     kIntfFieldNumber = 3,
33919     kRotFieldNumber = 4,
33920     kFlFieldNumber = 5,
33921     kLutFieldNumber = 6,
33922     kLinearFieldNumber = 7,
33923   };
33924   void set_pnum(uint32_t value) {
33925     AppendVarInt(1, value);
33926   }
33927   void set_fmt(uint32_t value) {
33928     AppendVarInt(2, value);
33929   }
33930   void set_intf(uint32_t value) {
33931     AppendVarInt(3, value);
33932   }
33933   void set_rot(uint32_t value) {
33934     AppendVarInt(4, value);
33935   }
33936   void set_fl(uint32_t value) {
33937     AppendVarInt(5, value);
33938   }
33939   void set_lut(uint32_t value) {
33940     AppendVarInt(6, value);
33941   }
33942   void set_linear(uint32_t value) {
33943     AppendVarInt(7, value);
33944   }
33945 };
33946 
33947 class MdpMisrCrcFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
33948  public:
33949   MdpMisrCrcFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
33950   explicit MdpMisrCrcFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
33951   explicit MdpMisrCrcFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
33952   bool has_block_id() const { return at<1>().valid(); }
33953   uint32_t block_id() const { return at<1>().as_uint32(); }
33954   bool has_vsync_cnt() const { return at<2>().valid(); }
33955   uint32_t vsync_cnt() const { return at<2>().as_uint32(); }
33956   bool has_crc() const { return at<3>().valid(); }
33957   uint32_t crc() const { return at<3>().as_uint32(); }
33958 };
33959 
33960 class MdpMisrCrcFtraceEvent : public ::protozero::Message {
33961  public:
33962   using Decoder = MdpMisrCrcFtraceEvent_Decoder;
33963   enum : int32_t {
33964     kBlockIdFieldNumber = 1,
33965     kVsyncCntFieldNumber = 2,
33966     kCrcFieldNumber = 3,
33967   };
33968   void set_block_id(uint32_t value) {
33969     AppendVarInt(1, value);
33970   }
33971   void set_vsync_cnt(uint32_t value) {
33972     AppendVarInt(2, value);
33973   }
33974   void set_crc(uint32_t value) {
33975     AppendVarInt(3, value);
33976   }
33977 };
33978 
33979 class MdpCmdReadptrDoneFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
33980  public:
33981   MdpCmdReadptrDoneFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
33982   explicit MdpCmdReadptrDoneFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
33983   explicit MdpCmdReadptrDoneFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
33984   bool has_ctl_num() const { return at<1>().valid(); }
33985   uint32_t ctl_num() const { return at<1>().as_uint32(); }
33986   bool has_koff_cnt() const { return at<2>().valid(); }
33987   int32_t koff_cnt() const { return at<2>().as_int32(); }
33988 };
33989 
33990 class MdpCmdReadptrDoneFtraceEvent : public ::protozero::Message {
33991  public:
33992   using Decoder = MdpCmdReadptrDoneFtraceEvent_Decoder;
33993   enum : int32_t {
33994     kCtlNumFieldNumber = 1,
33995     kKoffCntFieldNumber = 2,
33996   };
33997   void set_ctl_num(uint32_t value) {
33998     AppendVarInt(1, value);
33999   }
34000   void set_koff_cnt(int32_t value) {
34001     AppendVarInt(2, value);
34002   }
34003 };
34004 
34005 class MdpSsppSetFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/16, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
34006  public:
34007   MdpSsppSetFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
34008   explicit MdpSsppSetFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
34009   explicit MdpSsppSetFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
34010   bool has_num() const { return at<1>().valid(); }
34011   uint32_t num() const { return at<1>().as_uint32(); }
34012   bool has_play_cnt() const { return at<2>().valid(); }
34013   uint32_t play_cnt() const { return at<2>().as_uint32(); }
34014   bool has_mixer() const { return at<3>().valid(); }
34015   uint32_t mixer() const { return at<3>().as_uint32(); }
34016   bool has_stage() const { return at<4>().valid(); }
34017   uint32_t stage() const { return at<4>().as_uint32(); }
34018   bool has_flags() const { return at<5>().valid(); }
34019   uint32_t flags() const { return at<5>().as_uint32(); }
34020   bool has_format() const { return at<6>().valid(); }
34021   uint32_t format() const { return at<6>().as_uint32(); }
34022   bool has_img_w() const { return at<7>().valid(); }
34023   uint32_t img_w() const { return at<7>().as_uint32(); }
34024   bool has_img_h() const { return at<8>().valid(); }
34025   uint32_t img_h() const { return at<8>().as_uint32(); }
34026   bool has_src_x() const { return at<9>().valid(); }
34027   uint32_t src_x() const { return at<9>().as_uint32(); }
34028   bool has_src_y() const { return at<10>().valid(); }
34029   uint32_t src_y() const { return at<10>().as_uint32(); }
34030   bool has_src_w() const { return at<11>().valid(); }
34031   uint32_t src_w() const { return at<11>().as_uint32(); }
34032   bool has_src_h() const { return at<12>().valid(); }
34033   uint32_t src_h() const { return at<12>().as_uint32(); }
34034   bool has_dst_x() const { return at<13>().valid(); }
34035   uint32_t dst_x() const { return at<13>().as_uint32(); }
34036   bool has_dst_y() const { return at<14>().valid(); }
34037   uint32_t dst_y() const { return at<14>().as_uint32(); }
34038   bool has_dst_w() const { return at<15>().valid(); }
34039   uint32_t dst_w() const { return at<15>().as_uint32(); }
34040   bool has_dst_h() const { return at<16>().valid(); }
34041   uint32_t dst_h() const { return at<16>().as_uint32(); }
34042 };
34043 
34044 class MdpSsppSetFtraceEvent : public ::protozero::Message {
34045  public:
34046   using Decoder = MdpSsppSetFtraceEvent_Decoder;
34047   enum : int32_t {
34048     kNumFieldNumber = 1,
34049     kPlayCntFieldNumber = 2,
34050     kMixerFieldNumber = 3,
34051     kStageFieldNumber = 4,
34052     kFlagsFieldNumber = 5,
34053     kFormatFieldNumber = 6,
34054     kImgWFieldNumber = 7,
34055     kImgHFieldNumber = 8,
34056     kSrcXFieldNumber = 9,
34057     kSrcYFieldNumber = 10,
34058     kSrcWFieldNumber = 11,
34059     kSrcHFieldNumber = 12,
34060     kDstXFieldNumber = 13,
34061     kDstYFieldNumber = 14,
34062     kDstWFieldNumber = 15,
34063     kDstHFieldNumber = 16,
34064   };
34065   void set_num(uint32_t value) {
34066     AppendVarInt(1, value);
34067   }
34068   void set_play_cnt(uint32_t value) {
34069     AppendVarInt(2, value);
34070   }
34071   void set_mixer(uint32_t value) {
34072     AppendVarInt(3, value);
34073   }
34074   void set_stage(uint32_t value) {
34075     AppendVarInt(4, value);
34076   }
34077   void set_flags(uint32_t value) {
34078     AppendVarInt(5, value);
34079   }
34080   void set_format(uint32_t value) {
34081     AppendVarInt(6, value);
34082   }
34083   void set_img_w(uint32_t value) {
34084     AppendVarInt(7, value);
34085   }
34086   void set_img_h(uint32_t value) {
34087     AppendVarInt(8, value);
34088   }
34089   void set_src_x(uint32_t value) {
34090     AppendVarInt(9, value);
34091   }
34092   void set_src_y(uint32_t value) {
34093     AppendVarInt(10, value);
34094   }
34095   void set_src_w(uint32_t value) {
34096     AppendVarInt(11, value);
34097   }
34098   void set_src_h(uint32_t value) {
34099     AppendVarInt(12, value);
34100   }
34101   void set_dst_x(uint32_t value) {
34102     AppendVarInt(13, value);
34103   }
34104   void set_dst_y(uint32_t value) {
34105     AppendVarInt(14, value);
34106   }
34107   void set_dst_w(uint32_t value) {
34108     AppendVarInt(15, value);
34109   }
34110   void set_dst_h(uint32_t value) {
34111     AppendVarInt(16, value);
34112   }
34113 };
34114 
34115 class MdpPerfSetPanicLutsFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
34116  public:
34117   MdpPerfSetPanicLutsFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
34118   explicit MdpPerfSetPanicLutsFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
34119   explicit MdpPerfSetPanicLutsFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
34120   bool has_pnum() const { return at<1>().valid(); }
34121   uint32_t pnum() const { return at<1>().as_uint32(); }
34122   bool has_fmt() const { return at<2>().valid(); }
34123   uint32_t fmt() const { return at<2>().as_uint32(); }
34124   bool has_mode() const { return at<3>().valid(); }
34125   uint32_t mode() const { return at<3>().as_uint32(); }
34126   bool has_panic_lut() const { return at<4>().valid(); }
34127   uint32_t panic_lut() const { return at<4>().as_uint32(); }
34128   bool has_robust_lut() const { return at<5>().valid(); }
34129   uint32_t robust_lut() const { return at<5>().as_uint32(); }
34130 };
34131 
34132 class MdpPerfSetPanicLutsFtraceEvent : public ::protozero::Message {
34133  public:
34134   using Decoder = MdpPerfSetPanicLutsFtraceEvent_Decoder;
34135   enum : int32_t {
34136     kPnumFieldNumber = 1,
34137     kFmtFieldNumber = 2,
34138     kModeFieldNumber = 3,
34139     kPanicLutFieldNumber = 4,
34140     kRobustLutFieldNumber = 5,
34141   };
34142   void set_pnum(uint32_t value) {
34143     AppendVarInt(1, value);
34144   }
34145   void set_fmt(uint32_t value) {
34146     AppendVarInt(2, value);
34147   }
34148   void set_mode(uint32_t value) {
34149     AppendVarInt(3, value);
34150   }
34151   void set_panic_lut(uint32_t value) {
34152     AppendVarInt(4, value);
34153   }
34154   void set_robust_lut(uint32_t value) {
34155     AppendVarInt(5, value);
34156   }
34157 };
34158 
34159 class MdpCompareBwFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
34160  public:
34161   MdpCompareBwFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
34162   explicit MdpCompareBwFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
34163   explicit MdpCompareBwFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
34164   bool has_new_ab() const { return at<1>().valid(); }
34165   uint64_t new_ab() const { return at<1>().as_uint64(); }
34166   bool has_new_ib() const { return at<2>().valid(); }
34167   uint64_t new_ib() const { return at<2>().as_uint64(); }
34168   bool has_new_wb() const { return at<3>().valid(); }
34169   uint64_t new_wb() const { return at<3>().as_uint64(); }
34170   bool has_old_ab() const { return at<4>().valid(); }
34171   uint64_t old_ab() const { return at<4>().as_uint64(); }
34172   bool has_old_ib() const { return at<5>().valid(); }
34173   uint64_t old_ib() const { return at<5>().as_uint64(); }
34174   bool has_old_wb() const { return at<6>().valid(); }
34175   uint64_t old_wb() const { return at<6>().as_uint64(); }
34176   bool has_params_changed() const { return at<7>().valid(); }
34177   uint32_t params_changed() const { return at<7>().as_uint32(); }
34178   bool has_update_bw() const { return at<8>().valid(); }
34179   uint32_t update_bw() const { return at<8>().as_uint32(); }
34180 };
34181 
34182 class MdpCompareBwFtraceEvent : public ::protozero::Message {
34183  public:
34184   using Decoder = MdpCompareBwFtraceEvent_Decoder;
34185   enum : int32_t {
34186     kNewAbFieldNumber = 1,
34187     kNewIbFieldNumber = 2,
34188     kNewWbFieldNumber = 3,
34189     kOldAbFieldNumber = 4,
34190     kOldIbFieldNumber = 5,
34191     kOldWbFieldNumber = 6,
34192     kParamsChangedFieldNumber = 7,
34193     kUpdateBwFieldNumber = 8,
34194   };
34195   void set_new_ab(uint64_t value) {
34196     AppendVarInt(1, value);
34197   }
34198   void set_new_ib(uint64_t value) {
34199     AppendVarInt(2, value);
34200   }
34201   void set_new_wb(uint64_t value) {
34202     AppendVarInt(3, value);
34203   }
34204   void set_old_ab(uint64_t value) {
34205     AppendVarInt(4, value);
34206   }
34207   void set_old_ib(uint64_t value) {
34208     AppendVarInt(5, value);
34209   }
34210   void set_old_wb(uint64_t value) {
34211     AppendVarInt(6, value);
34212   }
34213   void set_params_changed(uint32_t value) {
34214     AppendVarInt(7, value);
34215   }
34216   void set_update_bw(uint32_t value) {
34217     AppendVarInt(8, value);
34218   }
34219 };
34220 
34221 class MdpCmdPingpongDoneFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
34222  public:
34223   MdpCmdPingpongDoneFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
34224   explicit MdpCmdPingpongDoneFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
34225   explicit MdpCmdPingpongDoneFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
34226   bool has_ctl_num() const { return at<1>().valid(); }
34227   uint32_t ctl_num() const { return at<1>().as_uint32(); }
34228   bool has_intf_num() const { return at<2>().valid(); }
34229   uint32_t intf_num() const { return at<2>().as_uint32(); }
34230   bool has_pp_num() const { return at<3>().valid(); }
34231   uint32_t pp_num() const { return at<3>().as_uint32(); }
34232   bool has_koff_cnt() const { return at<4>().valid(); }
34233   int32_t koff_cnt() const { return at<4>().as_int32(); }
34234 };
34235 
34236 class MdpCmdPingpongDoneFtraceEvent : public ::protozero::Message {
34237  public:
34238   using Decoder = MdpCmdPingpongDoneFtraceEvent_Decoder;
34239   enum : int32_t {
34240     kCtlNumFieldNumber = 1,
34241     kIntfNumFieldNumber = 2,
34242     kPpNumFieldNumber = 3,
34243     kKoffCntFieldNumber = 4,
34244   };
34245   void set_ctl_num(uint32_t value) {
34246     AppendVarInt(1, value);
34247   }
34248   void set_intf_num(uint32_t value) {
34249     AppendVarInt(2, value);
34250   }
34251   void set_pp_num(uint32_t value) {
34252     AppendVarInt(3, value);
34253   }
34254   void set_koff_cnt(int32_t value) {
34255     AppendVarInt(4, value);
34256   }
34257 };
34258 
34259 class TracingMarkWriteFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
34260  public:
34261   TracingMarkWriteFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
34262   explicit TracingMarkWriteFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
34263   explicit TracingMarkWriteFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
34264   bool has_pid() const { return at<1>().valid(); }
34265   int32_t pid() const { return at<1>().as_int32(); }
34266   bool has_trace_name() const { return at<2>().valid(); }
34267   ::protozero::ConstChars trace_name() const { return at<2>().as_string(); }
34268   bool has_trace_begin() const { return at<3>().valid(); }
34269   uint32_t trace_begin() const { return at<3>().as_uint32(); }
34270 };
34271 
34272 class TracingMarkWriteFtraceEvent : public ::protozero::Message {
34273  public:
34274   using Decoder = TracingMarkWriteFtraceEvent_Decoder;
34275   enum : int32_t {
34276     kPidFieldNumber = 1,
34277     kTraceNameFieldNumber = 2,
34278     kTraceBeginFieldNumber = 3,
34279   };
34280   void set_pid(int32_t value) {
34281     AppendVarInt(1, value);
34282   }
34283   void set_trace_name(const std::string& value) {
34284     AppendBytes(2, value.data(), value.size());
34285   }
34286   void set_trace_name(const char* data, size_t size) {
34287     AppendBytes(2, data, size);
34288   }
34289   void set_trace_begin(uint32_t value) {
34290     AppendVarInt(3, value);
34291   }
34292 };
34293 
34294 class MdpSsppChangeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/16, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
34295  public:
34296   MdpSsppChangeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
34297   explicit MdpSsppChangeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
34298   explicit MdpSsppChangeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
34299   bool has_num() const { return at<1>().valid(); }
34300   uint32_t num() const { return at<1>().as_uint32(); }
34301   bool has_play_cnt() const { return at<2>().valid(); }
34302   uint32_t play_cnt() const { return at<2>().as_uint32(); }
34303   bool has_mixer() const { return at<3>().valid(); }
34304   uint32_t mixer() const { return at<3>().as_uint32(); }
34305   bool has_stage() const { return at<4>().valid(); }
34306   uint32_t stage() const { return at<4>().as_uint32(); }
34307   bool has_flags() const { return at<5>().valid(); }
34308   uint32_t flags() const { return at<5>().as_uint32(); }
34309   bool has_format() const { return at<6>().valid(); }
34310   uint32_t format() const { return at<6>().as_uint32(); }
34311   bool has_img_w() const { return at<7>().valid(); }
34312   uint32_t img_w() const { return at<7>().as_uint32(); }
34313   bool has_img_h() const { return at<8>().valid(); }
34314   uint32_t img_h() const { return at<8>().as_uint32(); }
34315   bool has_src_x() const { return at<9>().valid(); }
34316   uint32_t src_x() const { return at<9>().as_uint32(); }
34317   bool has_src_y() const { return at<10>().valid(); }
34318   uint32_t src_y() const { return at<10>().as_uint32(); }
34319   bool has_src_w() const { return at<11>().valid(); }
34320   uint32_t src_w() const { return at<11>().as_uint32(); }
34321   bool has_src_h() const { return at<12>().valid(); }
34322   uint32_t src_h() const { return at<12>().as_uint32(); }
34323   bool has_dst_x() const { return at<13>().valid(); }
34324   uint32_t dst_x() const { return at<13>().as_uint32(); }
34325   bool has_dst_y() const { return at<14>().valid(); }
34326   uint32_t dst_y() const { return at<14>().as_uint32(); }
34327   bool has_dst_w() const { return at<15>().valid(); }
34328   uint32_t dst_w() const { return at<15>().as_uint32(); }
34329   bool has_dst_h() const { return at<16>().valid(); }
34330   uint32_t dst_h() const { return at<16>().as_uint32(); }
34331 };
34332 
34333 class MdpSsppChangeFtraceEvent : public ::protozero::Message {
34334  public:
34335   using Decoder = MdpSsppChangeFtraceEvent_Decoder;
34336   enum : int32_t {
34337     kNumFieldNumber = 1,
34338     kPlayCntFieldNumber = 2,
34339     kMixerFieldNumber = 3,
34340     kStageFieldNumber = 4,
34341     kFlagsFieldNumber = 5,
34342     kFormatFieldNumber = 6,
34343     kImgWFieldNumber = 7,
34344     kImgHFieldNumber = 8,
34345     kSrcXFieldNumber = 9,
34346     kSrcYFieldNumber = 10,
34347     kSrcWFieldNumber = 11,
34348     kSrcHFieldNumber = 12,
34349     kDstXFieldNumber = 13,
34350     kDstYFieldNumber = 14,
34351     kDstWFieldNumber = 15,
34352     kDstHFieldNumber = 16,
34353   };
34354   void set_num(uint32_t value) {
34355     AppendVarInt(1, value);
34356   }
34357   void set_play_cnt(uint32_t value) {
34358     AppendVarInt(2, value);
34359   }
34360   void set_mixer(uint32_t value) {
34361     AppendVarInt(3, value);
34362   }
34363   void set_stage(uint32_t value) {
34364     AppendVarInt(4, value);
34365   }
34366   void set_flags(uint32_t value) {
34367     AppendVarInt(5, value);
34368   }
34369   void set_format(uint32_t value) {
34370     AppendVarInt(6, value);
34371   }
34372   void set_img_w(uint32_t value) {
34373     AppendVarInt(7, value);
34374   }
34375   void set_img_h(uint32_t value) {
34376     AppendVarInt(8, value);
34377   }
34378   void set_src_x(uint32_t value) {
34379     AppendVarInt(9, value);
34380   }
34381   void set_src_y(uint32_t value) {
34382     AppendVarInt(10, value);
34383   }
34384   void set_src_w(uint32_t value) {
34385     AppendVarInt(11, value);
34386   }
34387   void set_src_h(uint32_t value) {
34388     AppendVarInt(12, value);
34389   }
34390   void set_dst_x(uint32_t value) {
34391     AppendVarInt(13, value);
34392   }
34393   void set_dst_y(uint32_t value) {
34394     AppendVarInt(14, value);
34395   }
34396   void set_dst_w(uint32_t value) {
34397     AppendVarInt(15, value);
34398   }
34399   void set_dst_h(uint32_t value) {
34400     AppendVarInt(16, value);
34401   }
34402 };
34403 
34404 class MdpPerfSetOtFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
34405  public:
34406   MdpPerfSetOtFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
34407   explicit MdpPerfSetOtFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
34408   explicit MdpPerfSetOtFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
34409   bool has_pnum() const { return at<1>().valid(); }
34410   uint32_t pnum() const { return at<1>().as_uint32(); }
34411   bool has_xin_id() const { return at<2>().valid(); }
34412   uint32_t xin_id() const { return at<2>().as_uint32(); }
34413   bool has_rd_lim() const { return at<3>().valid(); }
34414   uint32_t rd_lim() const { return at<3>().as_uint32(); }
34415   bool has_is_vbif_rt() const { return at<4>().valid(); }
34416   uint32_t is_vbif_rt() const { return at<4>().as_uint32(); }
34417 };
34418 
34419 class MdpPerfSetOtFtraceEvent : public ::protozero::Message {
34420  public:
34421   using Decoder = MdpPerfSetOtFtraceEvent_Decoder;
34422   enum : int32_t {
34423     kPnumFieldNumber = 1,
34424     kXinIdFieldNumber = 2,
34425     kRdLimFieldNumber = 3,
34426     kIsVbifRtFieldNumber = 4,
34427   };
34428   void set_pnum(uint32_t value) {
34429     AppendVarInt(1, value);
34430   }
34431   void set_xin_id(uint32_t value) {
34432     AppendVarInt(2, value);
34433   }
34434   void set_rd_lim(uint32_t value) {
34435     AppendVarInt(3, value);
34436   }
34437   void set_is_vbif_rt(uint32_t value) {
34438     AppendVarInt(4, value);
34439   }
34440 };
34441 
34442 class MdpCommitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
34443  public:
34444   MdpCommitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
34445   explicit MdpCommitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
34446   explicit MdpCommitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
34447   bool has_num() const { return at<1>().valid(); }
34448   uint32_t num() const { return at<1>().as_uint32(); }
34449   bool has_play_cnt() const { return at<2>().valid(); }
34450   uint32_t play_cnt() const { return at<2>().as_uint32(); }
34451   bool has_clk_rate() const { return at<3>().valid(); }
34452   uint32_t clk_rate() const { return at<3>().as_uint32(); }
34453   bool has_bandwidth() const { return at<4>().valid(); }
34454   uint64_t bandwidth() const { return at<4>().as_uint64(); }
34455 };
34456 
34457 class MdpCommitFtraceEvent : public ::protozero::Message {
34458  public:
34459   using Decoder = MdpCommitFtraceEvent_Decoder;
34460   enum : int32_t {
34461     kNumFieldNumber = 1,
34462     kPlayCntFieldNumber = 2,
34463     kClkRateFieldNumber = 3,
34464     kBandwidthFieldNumber = 4,
34465   };
34466   void set_num(uint32_t value) {
34467     AppendVarInt(1, value);
34468   }
34469   void set_play_cnt(uint32_t value) {
34470     AppendVarInt(2, value);
34471   }
34472   void set_clk_rate(uint32_t value) {
34473     AppendVarInt(3, value);
34474   }
34475   void set_bandwidth(uint64_t value) {
34476     AppendVarInt(4, value);
34477   }
34478 };
34479 
34480 class MdpCmdKickoffFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
34481  public:
34482   MdpCmdKickoffFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
34483   explicit MdpCmdKickoffFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
34484   explicit MdpCmdKickoffFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
34485   bool has_ctl_num() const { return at<1>().valid(); }
34486   uint32_t ctl_num() const { return at<1>().as_uint32(); }
34487   bool has_kickoff_cnt() const { return at<2>().valid(); }
34488   int32_t kickoff_cnt() const { return at<2>().as_int32(); }
34489 };
34490 
34491 class MdpCmdKickoffFtraceEvent : public ::protozero::Message {
34492  public:
34493   using Decoder = MdpCmdKickoffFtraceEvent_Decoder;
34494   enum : int32_t {
34495     kCtlNumFieldNumber = 1,
34496     kKickoffCntFieldNumber = 2,
34497   };
34498   void set_ctl_num(uint32_t value) {
34499     AppendVarInt(1, value);
34500   }
34501   void set_kickoff_cnt(int32_t value) {
34502     AppendVarInt(2, value);
34503   }
34504 };
34505 
34506 } // Namespace.
34507 } // Namespace.
34508 } // Namespace.
34509 #endif  // Include guard.
34510 // gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/mm_event.pbzero.h
34511 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
34512 
34513 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_MM_EVENT_PROTO_H_
34514 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_MM_EVENT_PROTO_H_
34515 
34516 #include <stddef.h>
34517 #include <stdint.h>
34518 
34519 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
34520 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
34521 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
34522 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
34523 
34524 namespace perfetto {
34525 namespace protos {
34526 namespace pbzero {
34527 
34528 
34529 class MmEventRecordFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
34530  public:
34531   MmEventRecordFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
34532   explicit MmEventRecordFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
34533   explicit MmEventRecordFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
34534   bool has_avg_lat() const { return at<1>().valid(); }
34535   uint32_t avg_lat() const { return at<1>().as_uint32(); }
34536   bool has_count() const { return at<2>().valid(); }
34537   uint32_t count() const { return at<2>().as_uint32(); }
34538   bool has_max_lat() const { return at<3>().valid(); }
34539   uint32_t max_lat() const { return at<3>().as_uint32(); }
34540   bool has_type() const { return at<4>().valid(); }
34541   uint32_t type() const { return at<4>().as_uint32(); }
34542 };
34543 
34544 class MmEventRecordFtraceEvent : public ::protozero::Message {
34545  public:
34546   using Decoder = MmEventRecordFtraceEvent_Decoder;
34547   enum : int32_t {
34548     kAvgLatFieldNumber = 1,
34549     kCountFieldNumber = 2,
34550     kMaxLatFieldNumber = 3,
34551     kTypeFieldNumber = 4,
34552   };
34553   void set_avg_lat(uint32_t value) {
34554     AppendVarInt(1, value);
34555   }
34556   void set_count(uint32_t value) {
34557     AppendVarInt(2, value);
34558   }
34559   void set_max_lat(uint32_t value) {
34560     AppendVarInt(3, value);
34561   }
34562   void set_type(uint32_t value) {
34563     AppendVarInt(4, value);
34564   }
34565 };
34566 
34567 } // Namespace.
34568 } // Namespace.
34569 } // Namespace.
34570 #endif  // Include guard.
34571 // gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/oom.pbzero.h
34572 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
34573 
34574 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_OOM_PROTO_H_
34575 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_OOM_PROTO_H_
34576 
34577 #include <stddef.h>
34578 #include <stdint.h>
34579 
34580 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
34581 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
34582 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
34583 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
34584 
34585 namespace perfetto {
34586 namespace protos {
34587 namespace pbzero {
34588 
34589 
34590 class MarkVictimFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
34591  public:
34592   MarkVictimFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
34593   explicit MarkVictimFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
34594   explicit MarkVictimFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
34595   bool has_pid() const { return at<1>().valid(); }
34596   int32_t pid() const { return at<1>().as_int32(); }
34597 };
34598 
34599 class MarkVictimFtraceEvent : public ::protozero::Message {
34600  public:
34601   using Decoder = MarkVictimFtraceEvent_Decoder;
34602   enum : int32_t {
34603     kPidFieldNumber = 1,
34604   };
34605   void set_pid(int32_t value) {
34606     AppendVarInt(1, value);
34607   }
34608 };
34609 
34610 class OomScoreAdjUpdateFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
34611  public:
34612   OomScoreAdjUpdateFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
34613   explicit OomScoreAdjUpdateFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
34614   explicit OomScoreAdjUpdateFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
34615   bool has_comm() const { return at<1>().valid(); }
34616   ::protozero::ConstChars comm() const { return at<1>().as_string(); }
34617   bool has_oom_score_adj() const { return at<2>().valid(); }
34618   int32_t oom_score_adj() const { return at<2>().as_int32(); }
34619   bool has_pid() const { return at<3>().valid(); }
34620   int32_t pid() const { return at<3>().as_int32(); }
34621 };
34622 
34623 class OomScoreAdjUpdateFtraceEvent : public ::protozero::Message {
34624  public:
34625   using Decoder = OomScoreAdjUpdateFtraceEvent_Decoder;
34626   enum : int32_t {
34627     kCommFieldNumber = 1,
34628     kOomScoreAdjFieldNumber = 2,
34629     kPidFieldNumber = 3,
34630   };
34631   void set_comm(const std::string& value) {
34632     AppendBytes(1, value.data(), value.size());
34633   }
34634   void set_comm(const char* data, size_t size) {
34635     AppendBytes(1, data, size);
34636   }
34637   void set_oom_score_adj(int32_t value) {
34638     AppendVarInt(2, value);
34639   }
34640   void set_pid(int32_t value) {
34641     AppendVarInt(3, value);
34642   }
34643 };
34644 
34645 } // Namespace.
34646 } // Namespace.
34647 } // Namespace.
34648 #endif  // Include guard.
34649 // gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/power.pbzero.h
34650 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
34651 
34652 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_POWER_PROTO_H_
34653 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_POWER_PROTO_H_
34654 
34655 #include <stddef.h>
34656 #include <stdint.h>
34657 
34658 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
34659 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
34660 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
34661 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
34662 
34663 namespace perfetto {
34664 namespace protos {
34665 namespace pbzero {
34666 
34667 
34668 class GpuFrequencyFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
34669  public:
34670   GpuFrequencyFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
34671   explicit GpuFrequencyFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
34672   explicit GpuFrequencyFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
34673   bool has_gpu_id() const { return at<1>().valid(); }
34674   uint32_t gpu_id() const { return at<1>().as_uint32(); }
34675   bool has_state() const { return at<2>().valid(); }
34676   uint32_t state() const { return at<2>().as_uint32(); }
34677 };
34678 
34679 class GpuFrequencyFtraceEvent : public ::protozero::Message {
34680  public:
34681   using Decoder = GpuFrequencyFtraceEvent_Decoder;
34682   enum : int32_t {
34683     kGpuIdFieldNumber = 1,
34684     kStateFieldNumber = 2,
34685   };
34686   void set_gpu_id(uint32_t value) {
34687     AppendVarInt(1, value);
34688   }
34689   void set_state(uint32_t value) {
34690     AppendVarInt(2, value);
34691   }
34692 };
34693 
34694 class SuspendResumeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
34695  public:
34696   SuspendResumeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
34697   explicit SuspendResumeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
34698   explicit SuspendResumeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
34699   bool has_action() const { return at<1>().valid(); }
34700   ::protozero::ConstChars action() const { return at<1>().as_string(); }
34701   bool has_val() const { return at<2>().valid(); }
34702   int32_t val() const { return at<2>().as_int32(); }
34703   bool has_start() const { return at<3>().valid(); }
34704   uint32_t start() const { return at<3>().as_uint32(); }
34705 };
34706 
34707 class SuspendResumeFtraceEvent : public ::protozero::Message {
34708  public:
34709   using Decoder = SuspendResumeFtraceEvent_Decoder;
34710   enum : int32_t {
34711     kActionFieldNumber = 1,
34712     kValFieldNumber = 2,
34713     kStartFieldNumber = 3,
34714   };
34715   void set_action(const std::string& value) {
34716     AppendBytes(1, value.data(), value.size());
34717   }
34718   void set_action(const char* data, size_t size) {
34719     AppendBytes(1, data, size);
34720   }
34721   void set_val(int32_t value) {
34722     AppendVarInt(2, value);
34723   }
34724   void set_start(uint32_t value) {
34725     AppendVarInt(3, value);
34726   }
34727 };
34728 
34729 class ClockSetRateFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
34730  public:
34731   ClockSetRateFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
34732   explicit ClockSetRateFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
34733   explicit ClockSetRateFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
34734   bool has_name() const { return at<1>().valid(); }
34735   ::protozero::ConstChars name() const { return at<1>().as_string(); }
34736   bool has_state() const { return at<2>().valid(); }
34737   uint64_t state() const { return at<2>().as_uint64(); }
34738   bool has_cpu_id() const { return at<3>().valid(); }
34739   uint64_t cpu_id() const { return at<3>().as_uint64(); }
34740 };
34741 
34742 class ClockSetRateFtraceEvent : public ::protozero::Message {
34743  public:
34744   using Decoder = ClockSetRateFtraceEvent_Decoder;
34745   enum : int32_t {
34746     kNameFieldNumber = 1,
34747     kStateFieldNumber = 2,
34748     kCpuIdFieldNumber = 3,
34749   };
34750   void set_name(const std::string& value) {
34751     AppendBytes(1, value.data(), value.size());
34752   }
34753   void set_name(const char* data, size_t size) {
34754     AppendBytes(1, data, size);
34755   }
34756   void set_state(uint64_t value) {
34757     AppendVarInt(2, value);
34758   }
34759   void set_cpu_id(uint64_t value) {
34760     AppendVarInt(3, value);
34761   }
34762 };
34763 
34764 class ClockDisableFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
34765  public:
34766   ClockDisableFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
34767   explicit ClockDisableFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
34768   explicit ClockDisableFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
34769   bool has_name() const { return at<1>().valid(); }
34770   ::protozero::ConstChars name() const { return at<1>().as_string(); }
34771   bool has_state() const { return at<2>().valid(); }
34772   uint64_t state() const { return at<2>().as_uint64(); }
34773   bool has_cpu_id() const { return at<3>().valid(); }
34774   uint64_t cpu_id() const { return at<3>().as_uint64(); }
34775 };
34776 
34777 class ClockDisableFtraceEvent : public ::protozero::Message {
34778  public:
34779   using Decoder = ClockDisableFtraceEvent_Decoder;
34780   enum : int32_t {
34781     kNameFieldNumber = 1,
34782     kStateFieldNumber = 2,
34783     kCpuIdFieldNumber = 3,
34784   };
34785   void set_name(const std::string& value) {
34786     AppendBytes(1, value.data(), value.size());
34787   }
34788   void set_name(const char* data, size_t size) {
34789     AppendBytes(1, data, size);
34790   }
34791   void set_state(uint64_t value) {
34792     AppendVarInt(2, value);
34793   }
34794   void set_cpu_id(uint64_t value) {
34795     AppendVarInt(3, value);
34796   }
34797 };
34798 
34799 class ClockEnableFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
34800  public:
34801   ClockEnableFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
34802   explicit ClockEnableFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
34803   explicit ClockEnableFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
34804   bool has_name() const { return at<1>().valid(); }
34805   ::protozero::ConstChars name() const { return at<1>().as_string(); }
34806   bool has_state() const { return at<2>().valid(); }
34807   uint64_t state() const { return at<2>().as_uint64(); }
34808   bool has_cpu_id() const { return at<3>().valid(); }
34809   uint64_t cpu_id() const { return at<3>().as_uint64(); }
34810 };
34811 
34812 class ClockEnableFtraceEvent : public ::protozero::Message {
34813  public:
34814   using Decoder = ClockEnableFtraceEvent_Decoder;
34815   enum : int32_t {
34816     kNameFieldNumber = 1,
34817     kStateFieldNumber = 2,
34818     kCpuIdFieldNumber = 3,
34819   };
34820   void set_name(const std::string& value) {
34821     AppendBytes(1, value.data(), value.size());
34822   }
34823   void set_name(const char* data, size_t size) {
34824     AppendBytes(1, data, size);
34825   }
34826   void set_state(uint64_t value) {
34827     AppendVarInt(2, value);
34828   }
34829   void set_cpu_id(uint64_t value) {
34830     AppendVarInt(3, value);
34831   }
34832 };
34833 
34834 class CpuIdleFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
34835  public:
34836   CpuIdleFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
34837   explicit CpuIdleFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
34838   explicit CpuIdleFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
34839   bool has_state() const { return at<1>().valid(); }
34840   uint32_t state() const { return at<1>().as_uint32(); }
34841   bool has_cpu_id() const { return at<2>().valid(); }
34842   uint32_t cpu_id() const { return at<2>().as_uint32(); }
34843 };
34844 
34845 class CpuIdleFtraceEvent : public ::protozero::Message {
34846  public:
34847   using Decoder = CpuIdleFtraceEvent_Decoder;
34848   enum : int32_t {
34849     kStateFieldNumber = 1,
34850     kCpuIdFieldNumber = 2,
34851   };
34852   void set_state(uint32_t value) {
34853     AppendVarInt(1, value);
34854   }
34855   void set_cpu_id(uint32_t value) {
34856     AppendVarInt(2, value);
34857   }
34858 };
34859 
34860 class CpuFrequencyLimitsFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
34861  public:
34862   CpuFrequencyLimitsFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
34863   explicit CpuFrequencyLimitsFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
34864   explicit CpuFrequencyLimitsFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
34865   bool has_min_freq() const { return at<1>().valid(); }
34866   uint32_t min_freq() const { return at<1>().as_uint32(); }
34867   bool has_max_freq() const { return at<2>().valid(); }
34868   uint32_t max_freq() const { return at<2>().as_uint32(); }
34869   bool has_cpu_id() const { return at<3>().valid(); }
34870   uint32_t cpu_id() const { return at<3>().as_uint32(); }
34871 };
34872 
34873 class CpuFrequencyLimitsFtraceEvent : public ::protozero::Message {
34874  public:
34875   using Decoder = CpuFrequencyLimitsFtraceEvent_Decoder;
34876   enum : int32_t {
34877     kMinFreqFieldNumber = 1,
34878     kMaxFreqFieldNumber = 2,
34879     kCpuIdFieldNumber = 3,
34880   };
34881   void set_min_freq(uint32_t value) {
34882     AppendVarInt(1, value);
34883   }
34884   void set_max_freq(uint32_t value) {
34885     AppendVarInt(2, value);
34886   }
34887   void set_cpu_id(uint32_t value) {
34888     AppendVarInt(3, value);
34889   }
34890 };
34891 
34892 class CpuFrequencyFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
34893  public:
34894   CpuFrequencyFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
34895   explicit CpuFrequencyFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
34896   explicit CpuFrequencyFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
34897   bool has_state() const { return at<1>().valid(); }
34898   uint32_t state() const { return at<1>().as_uint32(); }
34899   bool has_cpu_id() const { return at<2>().valid(); }
34900   uint32_t cpu_id() const { return at<2>().as_uint32(); }
34901 };
34902 
34903 class CpuFrequencyFtraceEvent : public ::protozero::Message {
34904  public:
34905   using Decoder = CpuFrequencyFtraceEvent_Decoder;
34906   enum : int32_t {
34907     kStateFieldNumber = 1,
34908     kCpuIdFieldNumber = 2,
34909   };
34910   void set_state(uint32_t value) {
34911     AppendVarInt(1, value);
34912   }
34913   void set_cpu_id(uint32_t value) {
34914     AppendVarInt(2, value);
34915   }
34916 };
34917 
34918 } // Namespace.
34919 } // Namespace.
34920 } // Namespace.
34921 #endif  // Include guard.
34922 // gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/raw_syscalls.pbzero.h
34923 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
34924 
34925 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_RAW_SYSCALLS_PROTO_H_
34926 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_RAW_SYSCALLS_PROTO_H_
34927 
34928 #include <stddef.h>
34929 #include <stdint.h>
34930 
34931 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
34932 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
34933 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
34934 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
34935 
34936 namespace perfetto {
34937 namespace protos {
34938 namespace pbzero {
34939 
34940 
34941 class SysExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
34942  public:
34943   SysExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
34944   explicit SysExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
34945   explicit SysExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
34946   bool has_id() const { return at<1>().valid(); }
34947   int64_t id() const { return at<1>().as_int64(); }
34948   bool has_ret() const { return at<2>().valid(); }
34949   int64_t ret() const { return at<2>().as_int64(); }
34950 };
34951 
34952 class SysExitFtraceEvent : public ::protozero::Message {
34953  public:
34954   using Decoder = SysExitFtraceEvent_Decoder;
34955   enum : int32_t {
34956     kIdFieldNumber = 1,
34957     kRetFieldNumber = 2,
34958   };
34959   void set_id(int64_t value) {
34960     AppendVarInt(1, value);
34961   }
34962   void set_ret(int64_t value) {
34963     AppendVarInt(2, value);
34964   }
34965 };
34966 
34967 class SysEnterFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
34968  public:
34969   SysEnterFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
34970   explicit SysEnterFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
34971   explicit SysEnterFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
34972   bool has_id() const { return at<1>().valid(); }
34973   int64_t id() const { return at<1>().as_int64(); }
34974 };
34975 
34976 class SysEnterFtraceEvent : public ::protozero::Message {
34977  public:
34978   using Decoder = SysEnterFtraceEvent_Decoder;
34979   enum : int32_t {
34980     kIdFieldNumber = 1,
34981   };
34982   void set_id(int64_t value) {
34983     AppendVarInt(1, value);
34984   }
34985 };
34986 
34987 } // Namespace.
34988 } // Namespace.
34989 } // Namespace.
34990 #endif  // Include guard.
34991 // gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/regulator.pbzero.h
34992 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
34993 
34994 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_REGULATOR_PROTO_H_
34995 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_REGULATOR_PROTO_H_
34996 
34997 #include <stddef.h>
34998 #include <stdint.h>
34999 
35000 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
35001 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
35002 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
35003 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
35004 
35005 namespace perfetto {
35006 namespace protos {
35007 namespace pbzero {
35008 
35009 
35010 class RegulatorSetVoltageCompleteFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
35011  public:
35012   RegulatorSetVoltageCompleteFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
35013   explicit RegulatorSetVoltageCompleteFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
35014   explicit RegulatorSetVoltageCompleteFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
35015   bool has_name() const { return at<1>().valid(); }
35016   ::protozero::ConstChars name() const { return at<1>().as_string(); }
35017   bool has_val() const { return at<2>().valid(); }
35018   uint32_t val() const { return at<2>().as_uint32(); }
35019 };
35020 
35021 class RegulatorSetVoltageCompleteFtraceEvent : public ::protozero::Message {
35022  public:
35023   using Decoder = RegulatorSetVoltageCompleteFtraceEvent_Decoder;
35024   enum : int32_t {
35025     kNameFieldNumber = 1,
35026     kValFieldNumber = 2,
35027   };
35028   void set_name(const std::string& value) {
35029     AppendBytes(1, value.data(), value.size());
35030   }
35031   void set_name(const char* data, size_t size) {
35032     AppendBytes(1, data, size);
35033   }
35034   void set_val(uint32_t value) {
35035     AppendVarInt(2, value);
35036   }
35037 };
35038 
35039 class RegulatorSetVoltageFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
35040  public:
35041   RegulatorSetVoltageFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
35042   explicit RegulatorSetVoltageFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
35043   explicit RegulatorSetVoltageFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
35044   bool has_name() const { return at<1>().valid(); }
35045   ::protozero::ConstChars name() const { return at<1>().as_string(); }
35046   bool has_min() const { return at<2>().valid(); }
35047   int32_t min() const { return at<2>().as_int32(); }
35048   bool has_max() const { return at<3>().valid(); }
35049   int32_t max() const { return at<3>().as_int32(); }
35050 };
35051 
35052 class RegulatorSetVoltageFtraceEvent : public ::protozero::Message {
35053  public:
35054   using Decoder = RegulatorSetVoltageFtraceEvent_Decoder;
35055   enum : int32_t {
35056     kNameFieldNumber = 1,
35057     kMinFieldNumber = 2,
35058     kMaxFieldNumber = 3,
35059   };
35060   void set_name(const std::string& value) {
35061     AppendBytes(1, value.data(), value.size());
35062   }
35063   void set_name(const char* data, size_t size) {
35064     AppendBytes(1, data, size);
35065   }
35066   void set_min(int32_t value) {
35067     AppendVarInt(2, value);
35068   }
35069   void set_max(int32_t value) {
35070     AppendVarInt(3, value);
35071   }
35072 };
35073 
35074 class RegulatorEnableDelayFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
35075  public:
35076   RegulatorEnableDelayFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
35077   explicit RegulatorEnableDelayFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
35078   explicit RegulatorEnableDelayFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
35079   bool has_name() const { return at<1>().valid(); }
35080   ::protozero::ConstChars name() const { return at<1>().as_string(); }
35081 };
35082 
35083 class RegulatorEnableDelayFtraceEvent : public ::protozero::Message {
35084  public:
35085   using Decoder = RegulatorEnableDelayFtraceEvent_Decoder;
35086   enum : int32_t {
35087     kNameFieldNumber = 1,
35088   };
35089   void set_name(const std::string& value) {
35090     AppendBytes(1, value.data(), value.size());
35091   }
35092   void set_name(const char* data, size_t size) {
35093     AppendBytes(1, data, size);
35094   }
35095 };
35096 
35097 class RegulatorEnableCompleteFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
35098  public:
35099   RegulatorEnableCompleteFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
35100   explicit RegulatorEnableCompleteFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
35101   explicit RegulatorEnableCompleteFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
35102   bool has_name() const { return at<1>().valid(); }
35103   ::protozero::ConstChars name() const { return at<1>().as_string(); }
35104 };
35105 
35106 class RegulatorEnableCompleteFtraceEvent : public ::protozero::Message {
35107  public:
35108   using Decoder = RegulatorEnableCompleteFtraceEvent_Decoder;
35109   enum : int32_t {
35110     kNameFieldNumber = 1,
35111   };
35112   void set_name(const std::string& value) {
35113     AppendBytes(1, value.data(), value.size());
35114   }
35115   void set_name(const char* data, size_t size) {
35116     AppendBytes(1, data, size);
35117   }
35118 };
35119 
35120 class RegulatorEnableFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
35121  public:
35122   RegulatorEnableFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
35123   explicit RegulatorEnableFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
35124   explicit RegulatorEnableFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
35125   bool has_name() const { return at<1>().valid(); }
35126   ::protozero::ConstChars name() const { return at<1>().as_string(); }
35127 };
35128 
35129 class RegulatorEnableFtraceEvent : public ::protozero::Message {
35130  public:
35131   using Decoder = RegulatorEnableFtraceEvent_Decoder;
35132   enum : int32_t {
35133     kNameFieldNumber = 1,
35134   };
35135   void set_name(const std::string& value) {
35136     AppendBytes(1, value.data(), value.size());
35137   }
35138   void set_name(const char* data, size_t size) {
35139     AppendBytes(1, data, size);
35140   }
35141 };
35142 
35143 class RegulatorDisableCompleteFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
35144  public:
35145   RegulatorDisableCompleteFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
35146   explicit RegulatorDisableCompleteFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
35147   explicit RegulatorDisableCompleteFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
35148   bool has_name() const { return at<1>().valid(); }
35149   ::protozero::ConstChars name() const { return at<1>().as_string(); }
35150 };
35151 
35152 class RegulatorDisableCompleteFtraceEvent : public ::protozero::Message {
35153  public:
35154   using Decoder = RegulatorDisableCompleteFtraceEvent_Decoder;
35155   enum : int32_t {
35156     kNameFieldNumber = 1,
35157   };
35158   void set_name(const std::string& value) {
35159     AppendBytes(1, value.data(), value.size());
35160   }
35161   void set_name(const char* data, size_t size) {
35162     AppendBytes(1, data, size);
35163   }
35164 };
35165 
35166 class RegulatorDisableFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
35167  public:
35168   RegulatorDisableFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
35169   explicit RegulatorDisableFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
35170   explicit RegulatorDisableFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
35171   bool has_name() const { return at<1>().valid(); }
35172   ::protozero::ConstChars name() const { return at<1>().as_string(); }
35173 };
35174 
35175 class RegulatorDisableFtraceEvent : public ::protozero::Message {
35176  public:
35177   using Decoder = RegulatorDisableFtraceEvent_Decoder;
35178   enum : int32_t {
35179     kNameFieldNumber = 1,
35180   };
35181   void set_name(const std::string& value) {
35182     AppendBytes(1, value.data(), value.size());
35183   }
35184   void set_name(const char* data, size_t size) {
35185     AppendBytes(1, data, size);
35186   }
35187 };
35188 
35189 } // Namespace.
35190 } // Namespace.
35191 } // Namespace.
35192 #endif  // Include guard.
35193 // gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/sched.pbzero.h
35194 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
35195 
35196 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_SCHED_PROTO_H_
35197 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_SCHED_PROTO_H_
35198 
35199 #include <stddef.h>
35200 #include <stdint.h>
35201 
35202 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
35203 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
35204 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
35205 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
35206 
35207 namespace perfetto {
35208 namespace protos {
35209 namespace pbzero {
35210 
35211 
35212 class SchedProcessWaitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
35213  public:
35214   SchedProcessWaitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
35215   explicit SchedProcessWaitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
35216   explicit SchedProcessWaitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
35217   bool has_comm() const { return at<1>().valid(); }
35218   ::protozero::ConstChars comm() const { return at<1>().as_string(); }
35219   bool has_pid() const { return at<2>().valid(); }
35220   int32_t pid() const { return at<2>().as_int32(); }
35221   bool has_prio() const { return at<3>().valid(); }
35222   int32_t prio() const { return at<3>().as_int32(); }
35223 };
35224 
35225 class SchedProcessWaitFtraceEvent : public ::protozero::Message {
35226  public:
35227   using Decoder = SchedProcessWaitFtraceEvent_Decoder;
35228   enum : int32_t {
35229     kCommFieldNumber = 1,
35230     kPidFieldNumber = 2,
35231     kPrioFieldNumber = 3,
35232   };
35233   void set_comm(const std::string& value) {
35234     AppendBytes(1, value.data(), value.size());
35235   }
35236   void set_comm(const char* data, size_t size) {
35237     AppendBytes(1, data, size);
35238   }
35239   void set_pid(int32_t value) {
35240     AppendVarInt(2, value);
35241   }
35242   void set_prio(int32_t value) {
35243     AppendVarInt(3, value);
35244   }
35245 };
35246 
35247 class SchedProcessHangFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
35248  public:
35249   SchedProcessHangFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
35250   explicit SchedProcessHangFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
35251   explicit SchedProcessHangFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
35252   bool has_comm() const { return at<1>().valid(); }
35253   ::protozero::ConstChars comm() const { return at<1>().as_string(); }
35254   bool has_pid() const { return at<2>().valid(); }
35255   int32_t pid() const { return at<2>().as_int32(); }
35256 };
35257 
35258 class SchedProcessHangFtraceEvent : public ::protozero::Message {
35259  public:
35260   using Decoder = SchedProcessHangFtraceEvent_Decoder;
35261   enum : int32_t {
35262     kCommFieldNumber = 1,
35263     kPidFieldNumber = 2,
35264   };
35265   void set_comm(const std::string& value) {
35266     AppendBytes(1, value.data(), value.size());
35267   }
35268   void set_comm(const char* data, size_t size) {
35269     AppendBytes(1, data, size);
35270   }
35271   void set_pid(int32_t value) {
35272     AppendVarInt(2, value);
35273   }
35274 };
35275 
35276 class SchedProcessFreeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
35277  public:
35278   SchedProcessFreeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
35279   explicit SchedProcessFreeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
35280   explicit SchedProcessFreeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
35281   bool has_comm() const { return at<1>().valid(); }
35282   ::protozero::ConstChars comm() const { return at<1>().as_string(); }
35283   bool has_pid() const { return at<2>().valid(); }
35284   int32_t pid() const { return at<2>().as_int32(); }
35285   bool has_prio() const { return at<3>().valid(); }
35286   int32_t prio() const { return at<3>().as_int32(); }
35287 };
35288 
35289 class SchedProcessFreeFtraceEvent : public ::protozero::Message {
35290  public:
35291   using Decoder = SchedProcessFreeFtraceEvent_Decoder;
35292   enum : int32_t {
35293     kCommFieldNumber = 1,
35294     kPidFieldNumber = 2,
35295     kPrioFieldNumber = 3,
35296   };
35297   void set_comm(const std::string& value) {
35298     AppendBytes(1, value.data(), value.size());
35299   }
35300   void set_comm(const char* data, size_t size) {
35301     AppendBytes(1, data, size);
35302   }
35303   void set_pid(int32_t value) {
35304     AppendVarInt(2, value);
35305   }
35306   void set_prio(int32_t value) {
35307     AppendVarInt(3, value);
35308   }
35309 };
35310 
35311 class SchedProcessForkFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
35312  public:
35313   SchedProcessForkFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
35314   explicit SchedProcessForkFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
35315   explicit SchedProcessForkFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
35316   bool has_parent_comm() const { return at<1>().valid(); }
35317   ::protozero::ConstChars parent_comm() const { return at<1>().as_string(); }
35318   bool has_parent_pid() const { return at<2>().valid(); }
35319   int32_t parent_pid() const { return at<2>().as_int32(); }
35320   bool has_child_comm() const { return at<3>().valid(); }
35321   ::protozero::ConstChars child_comm() const { return at<3>().as_string(); }
35322   bool has_child_pid() const { return at<4>().valid(); }
35323   int32_t child_pid() const { return at<4>().as_int32(); }
35324 };
35325 
35326 class SchedProcessForkFtraceEvent : public ::protozero::Message {
35327  public:
35328   using Decoder = SchedProcessForkFtraceEvent_Decoder;
35329   enum : int32_t {
35330     kParentCommFieldNumber = 1,
35331     kParentPidFieldNumber = 2,
35332     kChildCommFieldNumber = 3,
35333     kChildPidFieldNumber = 4,
35334   };
35335   void set_parent_comm(const std::string& value) {
35336     AppendBytes(1, value.data(), value.size());
35337   }
35338   void set_parent_comm(const char* data, size_t size) {
35339     AppendBytes(1, data, size);
35340   }
35341   void set_parent_pid(int32_t value) {
35342     AppendVarInt(2, value);
35343   }
35344   void set_child_comm(const std::string& value) {
35345     AppendBytes(3, value.data(), value.size());
35346   }
35347   void set_child_comm(const char* data, size_t size) {
35348     AppendBytes(3, data, size);
35349   }
35350   void set_child_pid(int32_t value) {
35351     AppendVarInt(4, value);
35352   }
35353 };
35354 
35355 class SchedProcessExitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
35356  public:
35357   SchedProcessExitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
35358   explicit SchedProcessExitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
35359   explicit SchedProcessExitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
35360   bool has_comm() const { return at<1>().valid(); }
35361   ::protozero::ConstChars comm() const { return at<1>().as_string(); }
35362   bool has_pid() const { return at<2>().valid(); }
35363   int32_t pid() const { return at<2>().as_int32(); }
35364   bool has_tgid() const { return at<3>().valid(); }
35365   int32_t tgid() const { return at<3>().as_int32(); }
35366   bool has_prio() const { return at<4>().valid(); }
35367   int32_t prio() const { return at<4>().as_int32(); }
35368 };
35369 
35370 class SchedProcessExitFtraceEvent : public ::protozero::Message {
35371  public:
35372   using Decoder = SchedProcessExitFtraceEvent_Decoder;
35373   enum : int32_t {
35374     kCommFieldNumber = 1,
35375     kPidFieldNumber = 2,
35376     kTgidFieldNumber = 3,
35377     kPrioFieldNumber = 4,
35378   };
35379   void set_comm(const std::string& value) {
35380     AppendBytes(1, value.data(), value.size());
35381   }
35382   void set_comm(const char* data, size_t size) {
35383     AppendBytes(1, data, size);
35384   }
35385   void set_pid(int32_t value) {
35386     AppendVarInt(2, value);
35387   }
35388   void set_tgid(int32_t value) {
35389     AppendVarInt(3, value);
35390   }
35391   void set_prio(int32_t value) {
35392     AppendVarInt(4, value);
35393   }
35394 };
35395 
35396 class SchedProcessExecFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
35397  public:
35398   SchedProcessExecFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
35399   explicit SchedProcessExecFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
35400   explicit SchedProcessExecFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
35401   bool has_filename() const { return at<1>().valid(); }
35402   ::protozero::ConstChars filename() const { return at<1>().as_string(); }
35403   bool has_pid() const { return at<2>().valid(); }
35404   int32_t pid() const { return at<2>().as_int32(); }
35405   bool has_old_pid() const { return at<3>().valid(); }
35406   int32_t old_pid() const { return at<3>().as_int32(); }
35407 };
35408 
35409 class SchedProcessExecFtraceEvent : public ::protozero::Message {
35410  public:
35411   using Decoder = SchedProcessExecFtraceEvent_Decoder;
35412   enum : int32_t {
35413     kFilenameFieldNumber = 1,
35414     kPidFieldNumber = 2,
35415     kOldPidFieldNumber = 3,
35416   };
35417   void set_filename(const std::string& value) {
35418     AppendBytes(1, value.data(), value.size());
35419   }
35420   void set_filename(const char* data, size_t size) {
35421     AppendBytes(1, data, size);
35422   }
35423   void set_pid(int32_t value) {
35424     AppendVarInt(2, value);
35425   }
35426   void set_old_pid(int32_t value) {
35427     AppendVarInt(3, value);
35428   }
35429 };
35430 
35431 class SchedWakeupNewFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
35432  public:
35433   SchedWakeupNewFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
35434   explicit SchedWakeupNewFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
35435   explicit SchedWakeupNewFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
35436   bool has_comm() const { return at<1>().valid(); }
35437   ::protozero::ConstChars comm() const { return at<1>().as_string(); }
35438   bool has_pid() const { return at<2>().valid(); }
35439   int32_t pid() const { return at<2>().as_int32(); }
35440   bool has_prio() const { return at<3>().valid(); }
35441   int32_t prio() const { return at<3>().as_int32(); }
35442   bool has_success() const { return at<4>().valid(); }
35443   int32_t success() const { return at<4>().as_int32(); }
35444   bool has_target_cpu() const { return at<5>().valid(); }
35445   int32_t target_cpu() const { return at<5>().as_int32(); }
35446 };
35447 
35448 class SchedWakeupNewFtraceEvent : public ::protozero::Message {
35449  public:
35450   using Decoder = SchedWakeupNewFtraceEvent_Decoder;
35451   enum : int32_t {
35452     kCommFieldNumber = 1,
35453     kPidFieldNumber = 2,
35454     kPrioFieldNumber = 3,
35455     kSuccessFieldNumber = 4,
35456     kTargetCpuFieldNumber = 5,
35457   };
35458   void set_comm(const std::string& value) {
35459     AppendBytes(1, value.data(), value.size());
35460   }
35461   void set_comm(const char* data, size_t size) {
35462     AppendBytes(1, data, size);
35463   }
35464   void set_pid(int32_t value) {
35465     AppendVarInt(2, value);
35466   }
35467   void set_prio(int32_t value) {
35468     AppendVarInt(3, value);
35469   }
35470   void set_success(int32_t value) {
35471     AppendVarInt(4, value);
35472   }
35473   void set_target_cpu(int32_t value) {
35474     AppendVarInt(5, value);
35475   }
35476 };
35477 
35478 class SchedWakingFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
35479  public:
35480   SchedWakingFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
35481   explicit SchedWakingFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
35482   explicit SchedWakingFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
35483   bool has_comm() const { return at<1>().valid(); }
35484   ::protozero::ConstChars comm() const { return at<1>().as_string(); }
35485   bool has_pid() const { return at<2>().valid(); }
35486   int32_t pid() const { return at<2>().as_int32(); }
35487   bool has_prio() const { return at<3>().valid(); }
35488   int32_t prio() const { return at<3>().as_int32(); }
35489   bool has_success() const { return at<4>().valid(); }
35490   int32_t success() const { return at<4>().as_int32(); }
35491   bool has_target_cpu() const { return at<5>().valid(); }
35492   int32_t target_cpu() const { return at<5>().as_int32(); }
35493 };
35494 
35495 class SchedWakingFtraceEvent : public ::protozero::Message {
35496  public:
35497   using Decoder = SchedWakingFtraceEvent_Decoder;
35498   enum : int32_t {
35499     kCommFieldNumber = 1,
35500     kPidFieldNumber = 2,
35501     kPrioFieldNumber = 3,
35502     kSuccessFieldNumber = 4,
35503     kTargetCpuFieldNumber = 5,
35504   };
35505   void set_comm(const std::string& value) {
35506     AppendBytes(1, value.data(), value.size());
35507   }
35508   void set_comm(const char* data, size_t size) {
35509     AppendBytes(1, data, size);
35510   }
35511   void set_pid(int32_t value) {
35512     AppendVarInt(2, value);
35513   }
35514   void set_prio(int32_t value) {
35515     AppendVarInt(3, value);
35516   }
35517   void set_success(int32_t value) {
35518     AppendVarInt(4, value);
35519   }
35520   void set_target_cpu(int32_t value) {
35521     AppendVarInt(5, value);
35522   }
35523 };
35524 
35525 class SchedCpuHotplugFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
35526  public:
35527   SchedCpuHotplugFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
35528   explicit SchedCpuHotplugFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
35529   explicit SchedCpuHotplugFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
35530   bool has_affected_cpu() const { return at<1>().valid(); }
35531   int32_t affected_cpu() const { return at<1>().as_int32(); }
35532   bool has_error() const { return at<2>().valid(); }
35533   int32_t error() const { return at<2>().as_int32(); }
35534   bool has_status() const { return at<3>().valid(); }
35535   int32_t status() const { return at<3>().as_int32(); }
35536 };
35537 
35538 class SchedCpuHotplugFtraceEvent : public ::protozero::Message {
35539  public:
35540   using Decoder = SchedCpuHotplugFtraceEvent_Decoder;
35541   enum : int32_t {
35542     kAffectedCpuFieldNumber = 1,
35543     kErrorFieldNumber = 2,
35544     kStatusFieldNumber = 3,
35545   };
35546   void set_affected_cpu(int32_t value) {
35547     AppendVarInt(1, value);
35548   }
35549   void set_error(int32_t value) {
35550     AppendVarInt(2, value);
35551   }
35552   void set_status(int32_t value) {
35553     AppendVarInt(3, value);
35554   }
35555 };
35556 
35557 class SchedBlockedReasonFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
35558  public:
35559   SchedBlockedReasonFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
35560   explicit SchedBlockedReasonFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
35561   explicit SchedBlockedReasonFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
35562   bool has_pid() const { return at<1>().valid(); }
35563   int32_t pid() const { return at<1>().as_int32(); }
35564   bool has_caller() const { return at<2>().valid(); }
35565   uint64_t caller() const { return at<2>().as_uint64(); }
35566   bool has_io_wait() const { return at<3>().valid(); }
35567   uint32_t io_wait() const { return at<3>().as_uint32(); }
35568 };
35569 
35570 class SchedBlockedReasonFtraceEvent : public ::protozero::Message {
35571  public:
35572   using Decoder = SchedBlockedReasonFtraceEvent_Decoder;
35573   enum : int32_t {
35574     kPidFieldNumber = 1,
35575     kCallerFieldNumber = 2,
35576     kIoWaitFieldNumber = 3,
35577   };
35578   void set_pid(int32_t value) {
35579     AppendVarInt(1, value);
35580   }
35581   void set_caller(uint64_t value) {
35582     AppendVarInt(2, value);
35583   }
35584   void set_io_wait(uint32_t value) {
35585     AppendVarInt(3, value);
35586   }
35587 };
35588 
35589 class SchedWakeupFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
35590  public:
35591   SchedWakeupFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
35592   explicit SchedWakeupFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
35593   explicit SchedWakeupFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
35594   bool has_comm() const { return at<1>().valid(); }
35595   ::protozero::ConstChars comm() const { return at<1>().as_string(); }
35596   bool has_pid() const { return at<2>().valid(); }
35597   int32_t pid() const { return at<2>().as_int32(); }
35598   bool has_prio() const { return at<3>().valid(); }
35599   int32_t prio() const { return at<3>().as_int32(); }
35600   bool has_success() const { return at<4>().valid(); }
35601   int32_t success() const { return at<4>().as_int32(); }
35602   bool has_target_cpu() const { return at<5>().valid(); }
35603   int32_t target_cpu() const { return at<5>().as_int32(); }
35604 };
35605 
35606 class SchedWakeupFtraceEvent : public ::protozero::Message {
35607  public:
35608   using Decoder = SchedWakeupFtraceEvent_Decoder;
35609   enum : int32_t {
35610     kCommFieldNumber = 1,
35611     kPidFieldNumber = 2,
35612     kPrioFieldNumber = 3,
35613     kSuccessFieldNumber = 4,
35614     kTargetCpuFieldNumber = 5,
35615   };
35616   void set_comm(const std::string& value) {
35617     AppendBytes(1, value.data(), value.size());
35618   }
35619   void set_comm(const char* data, size_t size) {
35620     AppendBytes(1, data, size);
35621   }
35622   void set_pid(int32_t value) {
35623     AppendVarInt(2, value);
35624   }
35625   void set_prio(int32_t value) {
35626     AppendVarInt(3, value);
35627   }
35628   void set_success(int32_t value) {
35629     AppendVarInt(4, value);
35630   }
35631   void set_target_cpu(int32_t value) {
35632     AppendVarInt(5, value);
35633   }
35634 };
35635 
35636 class SchedSwitchFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
35637  public:
35638   SchedSwitchFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
35639   explicit SchedSwitchFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
35640   explicit SchedSwitchFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
35641   bool has_prev_comm() const { return at<1>().valid(); }
35642   ::protozero::ConstChars prev_comm() const { return at<1>().as_string(); }
35643   bool has_prev_pid() const { return at<2>().valid(); }
35644   int32_t prev_pid() const { return at<2>().as_int32(); }
35645   bool has_prev_prio() const { return at<3>().valid(); }
35646   int32_t prev_prio() const { return at<3>().as_int32(); }
35647   bool has_prev_state() const { return at<4>().valid(); }
35648   int64_t prev_state() const { return at<4>().as_int64(); }
35649   bool has_next_comm() const { return at<5>().valid(); }
35650   ::protozero::ConstChars next_comm() const { return at<5>().as_string(); }
35651   bool has_next_pid() const { return at<6>().valid(); }
35652   int32_t next_pid() const { return at<6>().as_int32(); }
35653   bool has_next_prio() const { return at<7>().valid(); }
35654   int32_t next_prio() const { return at<7>().as_int32(); }
35655 };
35656 
35657 class SchedSwitchFtraceEvent : public ::protozero::Message {
35658  public:
35659   using Decoder = SchedSwitchFtraceEvent_Decoder;
35660   enum : int32_t {
35661     kPrevCommFieldNumber = 1,
35662     kPrevPidFieldNumber = 2,
35663     kPrevPrioFieldNumber = 3,
35664     kPrevStateFieldNumber = 4,
35665     kNextCommFieldNumber = 5,
35666     kNextPidFieldNumber = 6,
35667     kNextPrioFieldNumber = 7,
35668   };
35669   void set_prev_comm(const std::string& value) {
35670     AppendBytes(1, value.data(), value.size());
35671   }
35672   void set_prev_comm(const char* data, size_t size) {
35673     AppendBytes(1, data, size);
35674   }
35675   void set_prev_pid(int32_t value) {
35676     AppendVarInt(2, value);
35677   }
35678   void set_prev_prio(int32_t value) {
35679     AppendVarInt(3, value);
35680   }
35681   void set_prev_state(int64_t value) {
35682     AppendVarInt(4, value);
35683   }
35684   void set_next_comm(const std::string& value) {
35685     AppendBytes(5, value.data(), value.size());
35686   }
35687   void set_next_comm(const char* data, size_t size) {
35688     AppendBytes(5, data, size);
35689   }
35690   void set_next_pid(int32_t value) {
35691     AppendVarInt(6, value);
35692   }
35693   void set_next_prio(int32_t value) {
35694     AppendVarInt(7, value);
35695   }
35696 };
35697 
35698 } // Namespace.
35699 } // Namespace.
35700 } // Namespace.
35701 #endif  // Include guard.
35702 // gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/scm.pbzero.h
35703 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
35704 
35705 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_SCM_PROTO_H_
35706 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_SCM_PROTO_H_
35707 
35708 #include <stddef.h>
35709 #include <stdint.h>
35710 
35711 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
35712 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
35713 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
35714 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
35715 
35716 namespace perfetto {
35717 namespace protos {
35718 namespace pbzero {
35719 
35720 
35721 class ScmCallEndFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/0, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
35722  public:
35723   ScmCallEndFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
35724   explicit ScmCallEndFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
35725   explicit ScmCallEndFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
35726 };
35727 
35728 class ScmCallEndFtraceEvent : public ::protozero::Message {
35729  public:
35730   using Decoder = ScmCallEndFtraceEvent_Decoder;
35731 };
35732 
35733 class ScmCallStartFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
35734  public:
35735   ScmCallStartFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
35736   explicit ScmCallStartFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
35737   explicit ScmCallStartFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
35738   bool has_arginfo() const { return at<1>().valid(); }
35739   uint32_t arginfo() const { return at<1>().as_uint32(); }
35740   bool has_x0() const { return at<2>().valid(); }
35741   uint64_t x0() const { return at<2>().as_uint64(); }
35742   bool has_x5() const { return at<3>().valid(); }
35743   uint64_t x5() const { return at<3>().as_uint64(); }
35744 };
35745 
35746 class ScmCallStartFtraceEvent : public ::protozero::Message {
35747  public:
35748   using Decoder = ScmCallStartFtraceEvent_Decoder;
35749   enum : int32_t {
35750     kArginfoFieldNumber = 1,
35751     kX0FieldNumber = 2,
35752     kX5FieldNumber = 3,
35753   };
35754   void set_arginfo(uint32_t value) {
35755     AppendVarInt(1, value);
35756   }
35757   void set_x0(uint64_t value) {
35758     AppendVarInt(2, value);
35759   }
35760   void set_x5(uint64_t value) {
35761     AppendVarInt(3, value);
35762   }
35763 };
35764 
35765 } // Namespace.
35766 } // Namespace.
35767 } // Namespace.
35768 #endif  // Include guard.
35769 // gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/sde.pbzero.h
35770 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
35771 
35772 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_SDE_PROTO_H_
35773 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_SDE_PROTO_H_
35774 
35775 #include <stddef.h>
35776 #include <stdint.h>
35777 
35778 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
35779 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
35780 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
35781 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
35782 
35783 namespace perfetto {
35784 namespace protos {
35785 namespace pbzero {
35786 
35787 
35788 class SdeTracingMarkWriteFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
35789  public:
35790   SdeTracingMarkWriteFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
35791   explicit SdeTracingMarkWriteFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
35792   explicit SdeTracingMarkWriteFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
35793   bool has_pid() const { return at<1>().valid(); }
35794   int32_t pid() const { return at<1>().as_int32(); }
35795   bool has_trace_name() const { return at<2>().valid(); }
35796   ::protozero::ConstChars trace_name() const { return at<2>().as_string(); }
35797   bool has_trace_type() const { return at<3>().valid(); }
35798   uint32_t trace_type() const { return at<3>().as_uint32(); }
35799   bool has_value() const { return at<4>().valid(); }
35800   int32_t value() const { return at<4>().as_int32(); }
35801   bool has_trace_begin() const { return at<5>().valid(); }
35802   uint32_t trace_begin() const { return at<5>().as_uint32(); }
35803 };
35804 
35805 class SdeTracingMarkWriteFtraceEvent : public ::protozero::Message {
35806  public:
35807   using Decoder = SdeTracingMarkWriteFtraceEvent_Decoder;
35808   enum : int32_t {
35809     kPidFieldNumber = 1,
35810     kTraceNameFieldNumber = 2,
35811     kTraceTypeFieldNumber = 3,
35812     kValueFieldNumber = 4,
35813     kTraceBeginFieldNumber = 5,
35814   };
35815   void set_pid(int32_t value) {
35816     AppendVarInt(1, value);
35817   }
35818   void set_trace_name(const std::string& value) {
35819     AppendBytes(2, value.data(), value.size());
35820   }
35821   void set_trace_name(const char* data, size_t size) {
35822     AppendBytes(2, data, size);
35823   }
35824   void set_trace_type(uint32_t value) {
35825     AppendVarInt(3, value);
35826   }
35827   void set_value(int32_t value) {
35828     AppendVarInt(4, value);
35829   }
35830   void set_trace_begin(uint32_t value) {
35831     AppendVarInt(5, value);
35832   }
35833 };
35834 
35835 } // Namespace.
35836 } // Namespace.
35837 } // Namespace.
35838 #endif  // Include guard.
35839 // gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/signal.pbzero.h
35840 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
35841 
35842 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_SIGNAL_PROTO_H_
35843 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_SIGNAL_PROTO_H_
35844 
35845 #include <stddef.h>
35846 #include <stdint.h>
35847 
35848 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
35849 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
35850 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
35851 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
35852 
35853 namespace perfetto {
35854 namespace protos {
35855 namespace pbzero {
35856 
35857 
35858 class SignalGenerateFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
35859  public:
35860   SignalGenerateFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
35861   explicit SignalGenerateFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
35862   explicit SignalGenerateFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
35863   bool has_code() const { return at<1>().valid(); }
35864   int32_t code() const { return at<1>().as_int32(); }
35865   bool has_comm() const { return at<2>().valid(); }
35866   ::protozero::ConstChars comm() const { return at<2>().as_string(); }
35867   bool has_group() const { return at<3>().valid(); }
35868   int32_t group() const { return at<3>().as_int32(); }
35869   bool has_pid() const { return at<4>().valid(); }
35870   int32_t pid() const { return at<4>().as_int32(); }
35871   bool has_result() const { return at<5>().valid(); }
35872   int32_t result() const { return at<5>().as_int32(); }
35873   bool has_sig() const { return at<6>().valid(); }
35874   int32_t sig() const { return at<6>().as_int32(); }
35875 };
35876 
35877 class SignalGenerateFtraceEvent : public ::protozero::Message {
35878  public:
35879   using Decoder = SignalGenerateFtraceEvent_Decoder;
35880   enum : int32_t {
35881     kCodeFieldNumber = 1,
35882     kCommFieldNumber = 2,
35883     kGroupFieldNumber = 3,
35884     kPidFieldNumber = 4,
35885     kResultFieldNumber = 5,
35886     kSigFieldNumber = 6,
35887   };
35888   void set_code(int32_t value) {
35889     AppendVarInt(1, value);
35890   }
35891   void set_comm(const std::string& value) {
35892     AppendBytes(2, value.data(), value.size());
35893   }
35894   void set_comm(const char* data, size_t size) {
35895     AppendBytes(2, data, size);
35896   }
35897   void set_group(int32_t value) {
35898     AppendVarInt(3, value);
35899   }
35900   void set_pid(int32_t value) {
35901     AppendVarInt(4, value);
35902   }
35903   void set_result(int32_t value) {
35904     AppendVarInt(5, value);
35905   }
35906   void set_sig(int32_t value) {
35907     AppendVarInt(6, value);
35908   }
35909 };
35910 
35911 class SignalDeliverFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
35912  public:
35913   SignalDeliverFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
35914   explicit SignalDeliverFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
35915   explicit SignalDeliverFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
35916   bool has_code() const { return at<1>().valid(); }
35917   int32_t code() const { return at<1>().as_int32(); }
35918   bool has_sa_flags() const { return at<2>().valid(); }
35919   uint64_t sa_flags() const { return at<2>().as_uint64(); }
35920   bool has_sig() const { return at<3>().valid(); }
35921   int32_t sig() const { return at<3>().as_int32(); }
35922 };
35923 
35924 class SignalDeliverFtraceEvent : public ::protozero::Message {
35925  public:
35926   using Decoder = SignalDeliverFtraceEvent_Decoder;
35927   enum : int32_t {
35928     kCodeFieldNumber = 1,
35929     kSaFlagsFieldNumber = 2,
35930     kSigFieldNumber = 3,
35931   };
35932   void set_code(int32_t value) {
35933     AppendVarInt(1, value);
35934   }
35935   void set_sa_flags(uint64_t value) {
35936     AppendVarInt(2, value);
35937   }
35938   void set_sig(int32_t value) {
35939     AppendVarInt(3, value);
35940   }
35941 };
35942 
35943 } // Namespace.
35944 } // Namespace.
35945 } // Namespace.
35946 #endif  // Include guard.
35947 // gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/sync.pbzero.h
35948 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
35949 
35950 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_SYNC_PROTO_H_
35951 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_SYNC_PROTO_H_
35952 
35953 #include <stddef.h>
35954 #include <stdint.h>
35955 
35956 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
35957 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
35958 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
35959 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
35960 
35961 namespace perfetto {
35962 namespace protos {
35963 namespace pbzero {
35964 
35965 
35966 class SyncWaitFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
35967  public:
35968   SyncWaitFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
35969   explicit SyncWaitFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
35970   explicit SyncWaitFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
35971   bool has_name() const { return at<1>().valid(); }
35972   ::protozero::ConstChars name() const { return at<1>().as_string(); }
35973   bool has_status() const { return at<2>().valid(); }
35974   int32_t status() const { return at<2>().as_int32(); }
35975   bool has_begin() const { return at<3>().valid(); }
35976   uint32_t begin() const { return at<3>().as_uint32(); }
35977 };
35978 
35979 class SyncWaitFtraceEvent : public ::protozero::Message {
35980  public:
35981   using Decoder = SyncWaitFtraceEvent_Decoder;
35982   enum : int32_t {
35983     kNameFieldNumber = 1,
35984     kStatusFieldNumber = 2,
35985     kBeginFieldNumber = 3,
35986   };
35987   void set_name(const std::string& value) {
35988     AppendBytes(1, value.data(), value.size());
35989   }
35990   void set_name(const char* data, size_t size) {
35991     AppendBytes(1, data, size);
35992   }
35993   void set_status(int32_t value) {
35994     AppendVarInt(2, value);
35995   }
35996   void set_begin(uint32_t value) {
35997     AppendVarInt(3, value);
35998   }
35999 };
36000 
36001 class SyncTimelineFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
36002  public:
36003   SyncTimelineFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
36004   explicit SyncTimelineFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
36005   explicit SyncTimelineFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
36006   bool has_name() const { return at<1>().valid(); }
36007   ::protozero::ConstChars name() const { return at<1>().as_string(); }
36008   bool has_value() const { return at<2>().valid(); }
36009   ::protozero::ConstChars value() const { return at<2>().as_string(); }
36010 };
36011 
36012 class SyncTimelineFtraceEvent : public ::protozero::Message {
36013  public:
36014   using Decoder = SyncTimelineFtraceEvent_Decoder;
36015   enum : int32_t {
36016     kNameFieldNumber = 1,
36017     kValueFieldNumber = 2,
36018   };
36019   void set_name(const std::string& value) {
36020     AppendBytes(1, value.data(), value.size());
36021   }
36022   void set_name(const char* data, size_t size) {
36023     AppendBytes(1, data, size);
36024   }
36025   void set_value(const std::string& value) {
36026     AppendBytes(2, value.data(), value.size());
36027   }
36028   void set_value(const char* data, size_t size) {
36029     AppendBytes(2, data, size);
36030   }
36031 };
36032 
36033 class SyncPtFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
36034  public:
36035   SyncPtFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
36036   explicit SyncPtFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
36037   explicit SyncPtFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
36038   bool has_timeline() const { return at<1>().valid(); }
36039   ::protozero::ConstChars timeline() const { return at<1>().as_string(); }
36040   bool has_value() const { return at<2>().valid(); }
36041   ::protozero::ConstChars value() const { return at<2>().as_string(); }
36042 };
36043 
36044 class SyncPtFtraceEvent : public ::protozero::Message {
36045  public:
36046   using Decoder = SyncPtFtraceEvent_Decoder;
36047   enum : int32_t {
36048     kTimelineFieldNumber = 1,
36049     kValueFieldNumber = 2,
36050   };
36051   void set_timeline(const std::string& value) {
36052     AppendBytes(1, value.data(), value.size());
36053   }
36054   void set_timeline(const char* data, size_t size) {
36055     AppendBytes(1, data, size);
36056   }
36057   void set_value(const std::string& value) {
36058     AppendBytes(2, value.data(), value.size());
36059   }
36060   void set_value(const char* data, size_t size) {
36061     AppendBytes(2, data, size);
36062   }
36063 };
36064 
36065 } // Namespace.
36066 } // Namespace.
36067 } // Namespace.
36068 #endif  // Include guard.
36069 // gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/systrace.pbzero.h
36070 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
36071 
36072 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_SYSTRACE_PROTO_H_
36073 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_SYSTRACE_PROTO_H_
36074 
36075 #include <stddef.h>
36076 #include <stdint.h>
36077 
36078 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
36079 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
36080 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
36081 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
36082 
36083 namespace perfetto {
36084 namespace protos {
36085 namespace pbzero {
36086 
36087 
36088 class ZeroFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
36089  public:
36090   ZeroFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
36091   explicit ZeroFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
36092   explicit ZeroFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
36093   bool has_flag() const { return at<1>().valid(); }
36094   int32_t flag() const { return at<1>().as_int32(); }
36095   bool has_name() const { return at<2>().valid(); }
36096   ::protozero::ConstChars name() const { return at<2>().as_string(); }
36097   bool has_pid() const { return at<3>().valid(); }
36098   int32_t pid() const { return at<3>().as_int32(); }
36099   bool has_value() const { return at<4>().valid(); }
36100   int64_t value() const { return at<4>().as_int64(); }
36101 };
36102 
36103 class ZeroFtraceEvent : public ::protozero::Message {
36104  public:
36105   using Decoder = ZeroFtraceEvent_Decoder;
36106   enum : int32_t {
36107     kFlagFieldNumber = 1,
36108     kNameFieldNumber = 2,
36109     kPidFieldNumber = 3,
36110     kValueFieldNumber = 4,
36111   };
36112   void set_flag(int32_t value) {
36113     AppendVarInt(1, value);
36114   }
36115   void set_name(const std::string& value) {
36116     AppendBytes(2, value.data(), value.size());
36117   }
36118   void set_name(const char* data, size_t size) {
36119     AppendBytes(2, data, size);
36120   }
36121   void set_pid(int32_t value) {
36122     AppendVarInt(3, value);
36123   }
36124   void set_value(int64_t value) {
36125     AppendVarInt(4, value);
36126   }
36127 };
36128 
36129 } // Namespace.
36130 } // Namespace.
36131 } // Namespace.
36132 #endif  // Include guard.
36133 // gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/task.pbzero.h
36134 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
36135 
36136 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_TASK_PROTO_H_
36137 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_TASK_PROTO_H_
36138 
36139 #include <stddef.h>
36140 #include <stdint.h>
36141 
36142 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
36143 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
36144 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
36145 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
36146 
36147 namespace perfetto {
36148 namespace protos {
36149 namespace pbzero {
36150 
36151 
36152 class TaskRenameFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
36153  public:
36154   TaskRenameFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
36155   explicit TaskRenameFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
36156   explicit TaskRenameFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
36157   bool has_pid() const { return at<1>().valid(); }
36158   int32_t pid() const { return at<1>().as_int32(); }
36159   bool has_oldcomm() const { return at<2>().valid(); }
36160   ::protozero::ConstChars oldcomm() const { return at<2>().as_string(); }
36161   bool has_newcomm() const { return at<3>().valid(); }
36162   ::protozero::ConstChars newcomm() const { return at<3>().as_string(); }
36163   bool has_oom_score_adj() const { return at<4>().valid(); }
36164   int32_t oom_score_adj() const { return at<4>().as_int32(); }
36165 };
36166 
36167 class TaskRenameFtraceEvent : public ::protozero::Message {
36168  public:
36169   using Decoder = TaskRenameFtraceEvent_Decoder;
36170   enum : int32_t {
36171     kPidFieldNumber = 1,
36172     kOldcommFieldNumber = 2,
36173     kNewcommFieldNumber = 3,
36174     kOomScoreAdjFieldNumber = 4,
36175   };
36176   void set_pid(int32_t value) {
36177     AppendVarInt(1, value);
36178   }
36179   void set_oldcomm(const std::string& value) {
36180     AppendBytes(2, value.data(), value.size());
36181   }
36182   void set_oldcomm(const char* data, size_t size) {
36183     AppendBytes(2, data, size);
36184   }
36185   void set_newcomm(const std::string& value) {
36186     AppendBytes(3, value.data(), value.size());
36187   }
36188   void set_newcomm(const char* data, size_t size) {
36189     AppendBytes(3, data, size);
36190   }
36191   void set_oom_score_adj(int32_t value) {
36192     AppendVarInt(4, value);
36193   }
36194 };
36195 
36196 class TaskNewtaskFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
36197  public:
36198   TaskNewtaskFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
36199   explicit TaskNewtaskFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
36200   explicit TaskNewtaskFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
36201   bool has_pid() const { return at<1>().valid(); }
36202   int32_t pid() const { return at<1>().as_int32(); }
36203   bool has_comm() const { return at<2>().valid(); }
36204   ::protozero::ConstChars comm() const { return at<2>().as_string(); }
36205   bool has_clone_flags() const { return at<3>().valid(); }
36206   uint64_t clone_flags() const { return at<3>().as_uint64(); }
36207   bool has_oom_score_adj() const { return at<4>().valid(); }
36208   int32_t oom_score_adj() const { return at<4>().as_int32(); }
36209 };
36210 
36211 class TaskNewtaskFtraceEvent : public ::protozero::Message {
36212  public:
36213   using Decoder = TaskNewtaskFtraceEvent_Decoder;
36214   enum : int32_t {
36215     kPidFieldNumber = 1,
36216     kCommFieldNumber = 2,
36217     kCloneFlagsFieldNumber = 3,
36218     kOomScoreAdjFieldNumber = 4,
36219   };
36220   void set_pid(int32_t value) {
36221     AppendVarInt(1, value);
36222   }
36223   void set_comm(const std::string& value) {
36224     AppendBytes(2, value.data(), value.size());
36225   }
36226   void set_comm(const char* data, size_t size) {
36227     AppendBytes(2, data, size);
36228   }
36229   void set_clone_flags(uint64_t value) {
36230     AppendVarInt(3, value);
36231   }
36232   void set_oom_score_adj(int32_t value) {
36233     AppendVarInt(4, value);
36234   }
36235 };
36236 
36237 } // Namespace.
36238 } // Namespace.
36239 } // Namespace.
36240 #endif  // Include guard.
36241 // gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/thermal.pbzero.h
36242 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
36243 
36244 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_THERMAL_PROTO_H_
36245 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_THERMAL_PROTO_H_
36246 
36247 #include <stddef.h>
36248 #include <stdint.h>
36249 
36250 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
36251 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
36252 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
36253 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
36254 
36255 namespace perfetto {
36256 namespace protos {
36257 namespace pbzero {
36258 
36259 
36260 class CdevUpdateFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
36261  public:
36262   CdevUpdateFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
36263   explicit CdevUpdateFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
36264   explicit CdevUpdateFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
36265   bool has_target() const { return at<1>().valid(); }
36266   uint64_t target() const { return at<1>().as_uint64(); }
36267   bool has_type() const { return at<2>().valid(); }
36268   ::protozero::ConstChars type() const { return at<2>().as_string(); }
36269 };
36270 
36271 class CdevUpdateFtraceEvent : public ::protozero::Message {
36272  public:
36273   using Decoder = CdevUpdateFtraceEvent_Decoder;
36274   enum : int32_t {
36275     kTargetFieldNumber = 1,
36276     kTypeFieldNumber = 2,
36277   };
36278   void set_target(uint64_t value) {
36279     AppendVarInt(1, value);
36280   }
36281   void set_type(const std::string& value) {
36282     AppendBytes(2, value.data(), value.size());
36283   }
36284   void set_type(const char* data, size_t size) {
36285     AppendBytes(2, data, size);
36286   }
36287 };
36288 
36289 class ThermalTemperatureFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
36290  public:
36291   ThermalTemperatureFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
36292   explicit ThermalTemperatureFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
36293   explicit ThermalTemperatureFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
36294   bool has_id() const { return at<1>().valid(); }
36295   int32_t id() const { return at<1>().as_int32(); }
36296   bool has_temp() const { return at<2>().valid(); }
36297   int32_t temp() const { return at<2>().as_int32(); }
36298   bool has_temp_prev() const { return at<3>().valid(); }
36299   int32_t temp_prev() const { return at<3>().as_int32(); }
36300   bool has_thermal_zone() const { return at<4>().valid(); }
36301   ::protozero::ConstChars thermal_zone() const { return at<4>().as_string(); }
36302 };
36303 
36304 class ThermalTemperatureFtraceEvent : public ::protozero::Message {
36305  public:
36306   using Decoder = ThermalTemperatureFtraceEvent_Decoder;
36307   enum : int32_t {
36308     kIdFieldNumber = 1,
36309     kTempFieldNumber = 2,
36310     kTempPrevFieldNumber = 3,
36311     kThermalZoneFieldNumber = 4,
36312   };
36313   void set_id(int32_t value) {
36314     AppendVarInt(1, value);
36315   }
36316   void set_temp(int32_t value) {
36317     AppendVarInt(2, value);
36318   }
36319   void set_temp_prev(int32_t value) {
36320     AppendVarInt(3, value);
36321   }
36322   void set_thermal_zone(const std::string& value) {
36323     AppendBytes(4, value.data(), value.size());
36324   }
36325   void set_thermal_zone(const char* data, size_t size) {
36326     AppendBytes(4, data, size);
36327   }
36328 };
36329 
36330 } // Namespace.
36331 } // Namespace.
36332 } // Namespace.
36333 #endif  // Include guard.
36334 // gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/vmscan.pbzero.h
36335 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
36336 
36337 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_VMSCAN_PROTO_H_
36338 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_VMSCAN_PROTO_H_
36339 
36340 #include <stddef.h>
36341 #include <stdint.h>
36342 
36343 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
36344 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
36345 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
36346 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
36347 
36348 namespace perfetto {
36349 namespace protos {
36350 namespace pbzero {
36351 
36352 
36353 class MmVmscanKswapdSleepFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
36354  public:
36355   MmVmscanKswapdSleepFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
36356   explicit MmVmscanKswapdSleepFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
36357   explicit MmVmscanKswapdSleepFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
36358   bool has_nid() const { return at<1>().valid(); }
36359   int32_t nid() const { return at<1>().as_int32(); }
36360 };
36361 
36362 class MmVmscanKswapdSleepFtraceEvent : public ::protozero::Message {
36363  public:
36364   using Decoder = MmVmscanKswapdSleepFtraceEvent_Decoder;
36365   enum : int32_t {
36366     kNidFieldNumber = 1,
36367   };
36368   void set_nid(int32_t value) {
36369     AppendVarInt(1, value);
36370   }
36371 };
36372 
36373 class MmVmscanKswapdWakeFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
36374  public:
36375   MmVmscanKswapdWakeFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
36376   explicit MmVmscanKswapdWakeFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
36377   explicit MmVmscanKswapdWakeFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
36378   bool has_nid() const { return at<1>().valid(); }
36379   int32_t nid() const { return at<1>().as_int32(); }
36380   bool has_order() const { return at<2>().valid(); }
36381   int32_t order() const { return at<2>().as_int32(); }
36382 };
36383 
36384 class MmVmscanKswapdWakeFtraceEvent : public ::protozero::Message {
36385  public:
36386   using Decoder = MmVmscanKswapdWakeFtraceEvent_Decoder;
36387   enum : int32_t {
36388     kNidFieldNumber = 1,
36389     kOrderFieldNumber = 2,
36390   };
36391   void set_nid(int32_t value) {
36392     AppendVarInt(1, value);
36393   }
36394   void set_order(int32_t value) {
36395     AppendVarInt(2, value);
36396   }
36397 };
36398 
36399 class MmVmscanDirectReclaimEndFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
36400  public:
36401   MmVmscanDirectReclaimEndFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
36402   explicit MmVmscanDirectReclaimEndFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
36403   explicit MmVmscanDirectReclaimEndFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
36404   bool has_nr_reclaimed() const { return at<1>().valid(); }
36405   uint64_t nr_reclaimed() const { return at<1>().as_uint64(); }
36406 };
36407 
36408 class MmVmscanDirectReclaimEndFtraceEvent : public ::protozero::Message {
36409  public:
36410   using Decoder = MmVmscanDirectReclaimEndFtraceEvent_Decoder;
36411   enum : int32_t {
36412     kNrReclaimedFieldNumber = 1,
36413   };
36414   void set_nr_reclaimed(uint64_t value) {
36415     AppendVarInt(1, value);
36416   }
36417 };
36418 
36419 class MmVmscanDirectReclaimBeginFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
36420  public:
36421   MmVmscanDirectReclaimBeginFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
36422   explicit MmVmscanDirectReclaimBeginFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
36423   explicit MmVmscanDirectReclaimBeginFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
36424   bool has_order() const { return at<1>().valid(); }
36425   int32_t order() const { return at<1>().as_int32(); }
36426   bool has_may_writepage() const { return at<2>().valid(); }
36427   int32_t may_writepage() const { return at<2>().as_int32(); }
36428   bool has_gfp_flags() const { return at<3>().valid(); }
36429   uint32_t gfp_flags() const { return at<3>().as_uint32(); }
36430 };
36431 
36432 class MmVmscanDirectReclaimBeginFtraceEvent : public ::protozero::Message {
36433  public:
36434   using Decoder = MmVmscanDirectReclaimBeginFtraceEvent_Decoder;
36435   enum : int32_t {
36436     kOrderFieldNumber = 1,
36437     kMayWritepageFieldNumber = 2,
36438     kGfpFlagsFieldNumber = 3,
36439   };
36440   void set_order(int32_t value) {
36441     AppendVarInt(1, value);
36442   }
36443   void set_may_writepage(int32_t value) {
36444     AppendVarInt(2, value);
36445   }
36446   void set_gfp_flags(uint32_t value) {
36447     AppendVarInt(3, value);
36448   }
36449 };
36450 
36451 } // Namespace.
36452 } // Namespace.
36453 } // Namespace.
36454 #endif  // Include guard.
36455 // gen_amalgamated begin header: gen/protos/perfetto/trace/ftrace/workqueue.pbzero.h
36456 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
36457 
36458 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_WORKQUEUE_PROTO_H_
36459 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_WORKQUEUE_PROTO_H_
36460 
36461 #include <stddef.h>
36462 #include <stdint.h>
36463 
36464 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
36465 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
36466 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
36467 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
36468 
36469 namespace perfetto {
36470 namespace protos {
36471 namespace pbzero {
36472 
36473 
36474 class WorkqueueQueueWorkFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
36475  public:
36476   WorkqueueQueueWorkFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
36477   explicit WorkqueueQueueWorkFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
36478   explicit WorkqueueQueueWorkFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
36479   bool has_work() const { return at<1>().valid(); }
36480   uint64_t work() const { return at<1>().as_uint64(); }
36481   bool has_function() const { return at<2>().valid(); }
36482   uint64_t function() const { return at<2>().as_uint64(); }
36483   bool has_workqueue() const { return at<3>().valid(); }
36484   uint64_t workqueue() const { return at<3>().as_uint64(); }
36485   bool has_req_cpu() const { return at<4>().valid(); }
36486   uint32_t req_cpu() const { return at<4>().as_uint32(); }
36487   bool has_cpu() const { return at<5>().valid(); }
36488   uint32_t cpu() const { return at<5>().as_uint32(); }
36489 };
36490 
36491 class WorkqueueQueueWorkFtraceEvent : public ::protozero::Message {
36492  public:
36493   using Decoder = WorkqueueQueueWorkFtraceEvent_Decoder;
36494   enum : int32_t {
36495     kWorkFieldNumber = 1,
36496     kFunctionFieldNumber = 2,
36497     kWorkqueueFieldNumber = 3,
36498     kReqCpuFieldNumber = 4,
36499     kCpuFieldNumber = 5,
36500   };
36501   void set_work(uint64_t value) {
36502     AppendVarInt(1, value);
36503   }
36504   void set_function(uint64_t value) {
36505     AppendVarInt(2, value);
36506   }
36507   void set_workqueue(uint64_t value) {
36508     AppendVarInt(3, value);
36509   }
36510   void set_req_cpu(uint32_t value) {
36511     AppendVarInt(4, value);
36512   }
36513   void set_cpu(uint32_t value) {
36514     AppendVarInt(5, value);
36515   }
36516 };
36517 
36518 class WorkqueueExecuteStartFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
36519  public:
36520   WorkqueueExecuteStartFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
36521   explicit WorkqueueExecuteStartFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
36522   explicit WorkqueueExecuteStartFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
36523   bool has_work() const { return at<1>().valid(); }
36524   uint64_t work() const { return at<1>().as_uint64(); }
36525   bool has_function() const { return at<2>().valid(); }
36526   uint64_t function() const { return at<2>().as_uint64(); }
36527 };
36528 
36529 class WorkqueueExecuteStartFtraceEvent : public ::protozero::Message {
36530  public:
36531   using Decoder = WorkqueueExecuteStartFtraceEvent_Decoder;
36532   enum : int32_t {
36533     kWorkFieldNumber = 1,
36534     kFunctionFieldNumber = 2,
36535   };
36536   void set_work(uint64_t value) {
36537     AppendVarInt(1, value);
36538   }
36539   void set_function(uint64_t value) {
36540     AppendVarInt(2, value);
36541   }
36542 };
36543 
36544 class WorkqueueExecuteEndFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
36545  public:
36546   WorkqueueExecuteEndFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
36547   explicit WorkqueueExecuteEndFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
36548   explicit WorkqueueExecuteEndFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
36549   bool has_work() const { return at<1>().valid(); }
36550   uint64_t work() const { return at<1>().as_uint64(); }
36551 };
36552 
36553 class WorkqueueExecuteEndFtraceEvent : public ::protozero::Message {
36554  public:
36555   using Decoder = WorkqueueExecuteEndFtraceEvent_Decoder;
36556   enum : int32_t {
36557     kWorkFieldNumber = 1,
36558   };
36559   void set_work(uint64_t value) {
36560     AppendVarInt(1, value);
36561   }
36562 };
36563 
36564 class WorkqueueActivateWorkFtraceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
36565  public:
36566   WorkqueueActivateWorkFtraceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
36567   explicit WorkqueueActivateWorkFtraceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
36568   explicit WorkqueueActivateWorkFtraceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
36569   bool has_work() const { return at<1>().valid(); }
36570   uint64_t work() const { return at<1>().as_uint64(); }
36571 };
36572 
36573 class WorkqueueActivateWorkFtraceEvent : public ::protozero::Message {
36574  public:
36575   using Decoder = WorkqueueActivateWorkFtraceEvent_Decoder;
36576   enum : int32_t {
36577     kWorkFieldNumber = 1,
36578   };
36579   void set_work(uint64_t value) {
36580     AppendVarInt(1, value);
36581   }
36582 };
36583 
36584 } // Namespace.
36585 } // Namespace.
36586 } // Namespace.
36587 #endif  // Include guard.
36588 // gen_amalgamated begin header: gen/protos/perfetto/trace/gpu/gpu_counter_event.pbzero.h
36589 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
36590 
36591 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_GPU_GPU_COUNTER_EVENT_PROTO_H_
36592 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_GPU_GPU_COUNTER_EVENT_PROTO_H_
36593 
36594 #include <stddef.h>
36595 #include <stdint.h>
36596 
36597 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
36598 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
36599 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
36600 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
36601 
36602 namespace perfetto {
36603 namespace protos {
36604 namespace pbzero {
36605 
36606 class GpuCounterDescriptor;
36607 class GpuCounterEvent_GpuCounter;
36608 
36609 class GpuCounterEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
36610  public:
36611   GpuCounterEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
36612   explicit GpuCounterEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
36613   explicit GpuCounterEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
36614   bool has_counter_descriptor() const { return at<1>().valid(); }
36615   ::protozero::ConstBytes counter_descriptor() const { return at<1>().as_bytes(); }
36616   bool has_counters() const { return at<2>().valid(); }
36617   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> counters() const { return GetRepeated<::protozero::ConstBytes>(2); }
36618   bool has_gpu_id() const { return at<3>().valid(); }
36619   int32_t gpu_id() const { return at<3>().as_int32(); }
36620 };
36621 
36622 class GpuCounterEvent : public ::protozero::Message {
36623  public:
36624   using Decoder = GpuCounterEvent_Decoder;
36625   enum : int32_t {
36626     kCounterDescriptorFieldNumber = 1,
36627     kCountersFieldNumber = 2,
36628     kGpuIdFieldNumber = 3,
36629   };
36630   using GpuCounter = ::perfetto::protos::pbzero::GpuCounterEvent_GpuCounter;
36631   template <typename T = GpuCounterDescriptor> T* set_counter_descriptor() {
36632     return BeginNestedMessage<T>(1);
36633   }
36634 
36635   template <typename T = GpuCounterEvent_GpuCounter> T* add_counters() {
36636     return BeginNestedMessage<T>(2);
36637   }
36638 
36639   void set_gpu_id(int32_t value) {
36640     AppendVarInt(3, value);
36641   }
36642 };
36643 
36644 class GpuCounterEvent_GpuCounter_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
36645  public:
36646   GpuCounterEvent_GpuCounter_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
36647   explicit GpuCounterEvent_GpuCounter_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
36648   explicit GpuCounterEvent_GpuCounter_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
36649   bool has_counter_id() const { return at<1>().valid(); }
36650   uint32_t counter_id() const { return at<1>().as_uint32(); }
36651   bool has_int_value() const { return at<2>().valid(); }
36652   int64_t int_value() const { return at<2>().as_int64(); }
36653   bool has_double_value() const { return at<3>().valid(); }
36654   double double_value() const { return at<3>().as_double(); }
36655 };
36656 
36657 class GpuCounterEvent_GpuCounter : public ::protozero::Message {
36658  public:
36659   using Decoder = GpuCounterEvent_GpuCounter_Decoder;
36660   enum : int32_t {
36661     kCounterIdFieldNumber = 1,
36662     kIntValueFieldNumber = 2,
36663     kDoubleValueFieldNumber = 3,
36664   };
36665   void set_counter_id(uint32_t value) {
36666     AppendVarInt(1, value);
36667   }
36668   void set_int_value(int64_t value) {
36669     AppendVarInt(2, value);
36670   }
36671   void set_double_value(double value) {
36672     AppendFixed(3, value);
36673   }
36674 };
36675 
36676 } // Namespace.
36677 } // Namespace.
36678 } // Namespace.
36679 #endif  // Include guard.
36680 // gen_amalgamated begin header: gen/protos/perfetto/trace/gpu/gpu_log.pbzero.h
36681 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
36682 
36683 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_GPU_GPU_LOG_PROTO_H_
36684 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_GPU_GPU_LOG_PROTO_H_
36685 
36686 #include <stddef.h>
36687 #include <stdint.h>
36688 
36689 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
36690 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
36691 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
36692 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
36693 
36694 namespace perfetto {
36695 namespace protos {
36696 namespace pbzero {
36697 
36698 enum GpuLog_Severity : int32_t;
36699 
36700 enum GpuLog_Severity : int32_t {
36701   GpuLog_Severity_LOG_SEVERITY_UNSPECIFIED = 0,
36702   GpuLog_Severity_LOG_SEVERITY_VERBOSE = 1,
36703   GpuLog_Severity_LOG_SEVERITY_DEBUG = 2,
36704   GpuLog_Severity_LOG_SEVERITY_INFO = 3,
36705   GpuLog_Severity_LOG_SEVERITY_WARNING = 4,
36706   GpuLog_Severity_LOG_SEVERITY_ERROR = 5,
36707 };
36708 
36709 const GpuLog_Severity GpuLog_Severity_MIN = GpuLog_Severity_LOG_SEVERITY_UNSPECIFIED;
36710 const GpuLog_Severity GpuLog_Severity_MAX = GpuLog_Severity_LOG_SEVERITY_ERROR;
36711 
36712 class GpuLog_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
36713  public:
36714   GpuLog_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
36715   explicit GpuLog_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
36716   explicit GpuLog_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
36717   bool has_severity() const { return at<1>().valid(); }
36718   int32_t severity() const { return at<1>().as_int32(); }
36719   bool has_tag() const { return at<2>().valid(); }
36720   ::protozero::ConstChars tag() const { return at<2>().as_string(); }
36721   bool has_log_message() const { return at<3>().valid(); }
36722   ::protozero::ConstChars log_message() const { return at<3>().as_string(); }
36723 };
36724 
36725 class GpuLog : public ::protozero::Message {
36726  public:
36727   using Decoder = GpuLog_Decoder;
36728   enum : int32_t {
36729     kSeverityFieldNumber = 1,
36730     kTagFieldNumber = 2,
36731     kLogMessageFieldNumber = 3,
36732   };
36733   using Severity = ::perfetto::protos::pbzero::GpuLog_Severity;
36734   static const Severity LOG_SEVERITY_UNSPECIFIED = GpuLog_Severity_LOG_SEVERITY_UNSPECIFIED;
36735   static const Severity LOG_SEVERITY_VERBOSE = GpuLog_Severity_LOG_SEVERITY_VERBOSE;
36736   static const Severity LOG_SEVERITY_DEBUG = GpuLog_Severity_LOG_SEVERITY_DEBUG;
36737   static const Severity LOG_SEVERITY_INFO = GpuLog_Severity_LOG_SEVERITY_INFO;
36738   static const Severity LOG_SEVERITY_WARNING = GpuLog_Severity_LOG_SEVERITY_WARNING;
36739   static const Severity LOG_SEVERITY_ERROR = GpuLog_Severity_LOG_SEVERITY_ERROR;
36740   void set_severity(::perfetto::protos::pbzero::GpuLog_Severity value) {
36741     AppendTinyVarInt(1, value);
36742   }
36743   void set_tag(const std::string& value) {
36744     AppendBytes(2, value.data(), value.size());
36745   }
36746   void set_tag(const char* data, size_t size) {
36747     AppendBytes(2, data, size);
36748   }
36749   void set_log_message(const std::string& value) {
36750     AppendBytes(3, value.data(), value.size());
36751   }
36752   void set_log_message(const char* data, size_t size) {
36753     AppendBytes(3, data, size);
36754   }
36755 };
36756 
36757 } // Namespace.
36758 } // Namespace.
36759 } // Namespace.
36760 #endif  // Include guard.
36761 // gen_amalgamated begin header: gen/protos/perfetto/trace/gpu/gpu_render_stage_event.pbzero.h
36762 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
36763 
36764 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_GPU_GPU_RENDER_STAGE_EVENT_PROTO_H_
36765 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_GPU_GPU_RENDER_STAGE_EVENT_PROTO_H_
36766 
36767 #include <stddef.h>
36768 #include <stdint.h>
36769 
36770 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
36771 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
36772 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
36773 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
36774 
36775 namespace perfetto {
36776 namespace protos {
36777 namespace pbzero {
36778 
36779 class GpuRenderStageEvent_ExtraData;
36780 class GpuRenderStageEvent_Specifications;
36781 class GpuRenderStageEvent_Specifications_ContextSpec;
36782 class GpuRenderStageEvent_Specifications_Description;
36783 enum InternedGpuRenderStageSpecification_RenderStageCategory : int32_t;
36784 enum InternedGraphicsContext_Api : int32_t;
36785 
36786 enum InternedGpuRenderStageSpecification_RenderStageCategory : int32_t {
36787   InternedGpuRenderStageSpecification_RenderStageCategory_OTHER = 0,
36788   InternedGpuRenderStageSpecification_RenderStageCategory_GRAPHICS = 1,
36789   InternedGpuRenderStageSpecification_RenderStageCategory_COMPUTE = 2,
36790 };
36791 
36792 const InternedGpuRenderStageSpecification_RenderStageCategory InternedGpuRenderStageSpecification_RenderStageCategory_MIN = InternedGpuRenderStageSpecification_RenderStageCategory_OTHER;
36793 const InternedGpuRenderStageSpecification_RenderStageCategory InternedGpuRenderStageSpecification_RenderStageCategory_MAX = InternedGpuRenderStageSpecification_RenderStageCategory_COMPUTE;
36794 
36795 enum InternedGraphicsContext_Api : int32_t {
36796   InternedGraphicsContext_Api_UNDEFINED = 0,
36797   InternedGraphicsContext_Api_OPEN_GL = 1,
36798   InternedGraphicsContext_Api_VULKAN = 2,
36799   InternedGraphicsContext_Api_OPEN_CL = 3,
36800 };
36801 
36802 const InternedGraphicsContext_Api InternedGraphicsContext_Api_MIN = InternedGraphicsContext_Api_UNDEFINED;
36803 const InternedGraphicsContext_Api InternedGraphicsContext_Api_MAX = InternedGraphicsContext_Api_OPEN_CL;
36804 
36805 class InternedGpuRenderStageSpecification_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
36806  public:
36807   InternedGpuRenderStageSpecification_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
36808   explicit InternedGpuRenderStageSpecification_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
36809   explicit InternedGpuRenderStageSpecification_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
36810   bool has_iid() const { return at<1>().valid(); }
36811   uint64_t iid() const { return at<1>().as_uint64(); }
36812   bool has_name() const { return at<2>().valid(); }
36813   ::protozero::ConstChars name() const { return at<2>().as_string(); }
36814   bool has_description() const { return at<3>().valid(); }
36815   ::protozero::ConstChars description() const { return at<3>().as_string(); }
36816   bool has_category() const { return at<4>().valid(); }
36817   int32_t category() const { return at<4>().as_int32(); }
36818 };
36819 
36820 class InternedGpuRenderStageSpecification : public ::protozero::Message {
36821  public:
36822   using Decoder = InternedGpuRenderStageSpecification_Decoder;
36823   enum : int32_t {
36824     kIidFieldNumber = 1,
36825     kNameFieldNumber = 2,
36826     kDescriptionFieldNumber = 3,
36827     kCategoryFieldNumber = 4,
36828   };
36829   using RenderStageCategory = ::perfetto::protos::pbzero::InternedGpuRenderStageSpecification_RenderStageCategory;
36830   static const RenderStageCategory OTHER = InternedGpuRenderStageSpecification_RenderStageCategory_OTHER;
36831   static const RenderStageCategory GRAPHICS = InternedGpuRenderStageSpecification_RenderStageCategory_GRAPHICS;
36832   static const RenderStageCategory COMPUTE = InternedGpuRenderStageSpecification_RenderStageCategory_COMPUTE;
36833   void set_iid(uint64_t value) {
36834     AppendVarInt(1, value);
36835   }
36836   void set_name(const std::string& value) {
36837     AppendBytes(2, value.data(), value.size());
36838   }
36839   void set_name(const char* data, size_t size) {
36840     AppendBytes(2, data, size);
36841   }
36842   void set_description(const std::string& value) {
36843     AppendBytes(3, value.data(), value.size());
36844   }
36845   void set_description(const char* data, size_t size) {
36846     AppendBytes(3, data, size);
36847   }
36848   void set_category(::perfetto::protos::pbzero::InternedGpuRenderStageSpecification_RenderStageCategory value) {
36849     AppendTinyVarInt(4, value);
36850   }
36851 };
36852 
36853 class InternedGraphicsContext_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
36854  public:
36855   InternedGraphicsContext_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
36856   explicit InternedGraphicsContext_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
36857   explicit InternedGraphicsContext_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
36858   bool has_iid() const { return at<1>().valid(); }
36859   uint64_t iid() const { return at<1>().as_uint64(); }
36860   bool has_pid() const { return at<2>().valid(); }
36861   int32_t pid() const { return at<2>().as_int32(); }
36862   bool has_api() const { return at<3>().valid(); }
36863   int32_t api() const { return at<3>().as_int32(); }
36864 };
36865 
36866 class InternedGraphicsContext : public ::protozero::Message {
36867  public:
36868   using Decoder = InternedGraphicsContext_Decoder;
36869   enum : int32_t {
36870     kIidFieldNumber = 1,
36871     kPidFieldNumber = 2,
36872     kApiFieldNumber = 3,
36873   };
36874   using Api = ::perfetto::protos::pbzero::InternedGraphicsContext_Api;
36875   static const Api UNDEFINED = InternedGraphicsContext_Api_UNDEFINED;
36876   static const Api OPEN_GL = InternedGraphicsContext_Api_OPEN_GL;
36877   static const Api VULKAN = InternedGraphicsContext_Api_VULKAN;
36878   static const Api OPEN_CL = InternedGraphicsContext_Api_OPEN_CL;
36879   void set_iid(uint64_t value) {
36880     AppendVarInt(1, value);
36881   }
36882   void set_pid(int32_t value) {
36883     AppendVarInt(2, value);
36884   }
36885   void set_api(::perfetto::protos::pbzero::InternedGraphicsContext_Api value) {
36886     AppendTinyVarInt(3, value);
36887   }
36888 };
36889 
36890 class GpuRenderStageEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/15, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
36891  public:
36892   GpuRenderStageEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
36893   explicit GpuRenderStageEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
36894   explicit GpuRenderStageEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
36895   bool has_event_id() const { return at<1>().valid(); }
36896   uint64_t event_id() const { return at<1>().as_uint64(); }
36897   bool has_duration() const { return at<2>().valid(); }
36898   uint64_t duration() const { return at<2>().as_uint64(); }
36899   bool has_hw_queue_iid() const { return at<13>().valid(); }
36900   uint64_t hw_queue_iid() const { return at<13>().as_uint64(); }
36901   bool has_stage_iid() const { return at<14>().valid(); }
36902   uint64_t stage_iid() const { return at<14>().as_uint64(); }
36903   bool has_gpu_id() const { return at<11>().valid(); }
36904   int32_t gpu_id() const { return at<11>().as_int32(); }
36905   bool has_context() const { return at<5>().valid(); }
36906   uint64_t context() const { return at<5>().as_uint64(); }
36907   bool has_render_target_handle() const { return at<8>().valid(); }
36908   uint64_t render_target_handle() const { return at<8>().as_uint64(); }
36909   bool has_submission_id() const { return at<10>().valid(); }
36910   uint32_t submission_id() const { return at<10>().as_uint32(); }
36911   bool has_extra_data() const { return at<6>().valid(); }
36912   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> extra_data() const { return GetRepeated<::protozero::ConstBytes>(6); }
36913   bool has_render_pass_handle() const { return at<9>().valid(); }
36914   uint64_t render_pass_handle() const { return at<9>().as_uint64(); }
36915   bool has_render_subpass_index_mask() const { return at<15>().valid(); }
36916   ::protozero::RepeatedFieldIterator<uint64_t> render_subpass_index_mask() const { return GetRepeated<uint64_t>(15); }
36917   bool has_command_buffer_handle() const { return at<12>().valid(); }
36918   uint64_t command_buffer_handle() const { return at<12>().as_uint64(); }
36919   bool has_specifications() const { return at<7>().valid(); }
36920   ::protozero::ConstBytes specifications() const { return at<7>().as_bytes(); }
36921   bool has_hw_queue_id() const { return at<3>().valid(); }
36922   int32_t hw_queue_id() const { return at<3>().as_int32(); }
36923   bool has_stage_id() const { return at<4>().valid(); }
36924   int32_t stage_id() const { return at<4>().as_int32(); }
36925 };
36926 
36927 class GpuRenderStageEvent : public ::protozero::Message {
36928  public:
36929   using Decoder = GpuRenderStageEvent_Decoder;
36930   enum : int32_t {
36931     kEventIdFieldNumber = 1,
36932     kDurationFieldNumber = 2,
36933     kHwQueueIidFieldNumber = 13,
36934     kStageIidFieldNumber = 14,
36935     kGpuIdFieldNumber = 11,
36936     kContextFieldNumber = 5,
36937     kRenderTargetHandleFieldNumber = 8,
36938     kSubmissionIdFieldNumber = 10,
36939     kExtraDataFieldNumber = 6,
36940     kRenderPassHandleFieldNumber = 9,
36941     kRenderSubpassIndexMaskFieldNumber = 15,
36942     kCommandBufferHandleFieldNumber = 12,
36943     kSpecificationsFieldNumber = 7,
36944     kHwQueueIdFieldNumber = 3,
36945     kStageIdFieldNumber = 4,
36946   };
36947   using ExtraData = ::perfetto::protos::pbzero::GpuRenderStageEvent_ExtraData;
36948   using Specifications = ::perfetto::protos::pbzero::GpuRenderStageEvent_Specifications;
36949   void set_event_id(uint64_t value) {
36950     AppendVarInt(1, value);
36951   }
36952   void set_duration(uint64_t value) {
36953     AppendVarInt(2, value);
36954   }
36955   void set_hw_queue_iid(uint64_t value) {
36956     AppendVarInt(13, value);
36957   }
36958   void set_stage_iid(uint64_t value) {
36959     AppendVarInt(14, value);
36960   }
36961   void set_gpu_id(int32_t value) {
36962     AppendVarInt(11, value);
36963   }
36964   void set_context(uint64_t value) {
36965     AppendVarInt(5, value);
36966   }
36967   void set_render_target_handle(uint64_t value) {
36968     AppendVarInt(8, value);
36969   }
36970   void set_submission_id(uint32_t value) {
36971     AppendVarInt(10, value);
36972   }
36973   template <typename T = GpuRenderStageEvent_ExtraData> T* add_extra_data() {
36974     return BeginNestedMessage<T>(6);
36975   }
36976 
36977   void set_render_pass_handle(uint64_t value) {
36978     AppendVarInt(9, value);
36979   }
36980   void add_render_subpass_index_mask(uint64_t value) {
36981     AppendVarInt(15, value);
36982   }
36983   void set_command_buffer_handle(uint64_t value) {
36984     AppendVarInt(12, value);
36985   }
36986   template <typename T = GpuRenderStageEvent_Specifications> T* set_specifications() {
36987     return BeginNestedMessage<T>(7);
36988   }
36989 
36990   void set_hw_queue_id(int32_t value) {
36991     AppendVarInt(3, value);
36992   }
36993   void set_stage_id(int32_t value) {
36994     AppendVarInt(4, value);
36995   }
36996 };
36997 
36998 class GpuRenderStageEvent_Specifications_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
36999  public:
37000   GpuRenderStageEvent_Specifications_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
37001   explicit GpuRenderStageEvent_Specifications_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
37002   explicit GpuRenderStageEvent_Specifications_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
37003   bool has_context_spec() const { return at<1>().valid(); }
37004   ::protozero::ConstBytes context_spec() const { return at<1>().as_bytes(); }
37005   bool has_hw_queue() const { return at<2>().valid(); }
37006   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> hw_queue() const { return GetRepeated<::protozero::ConstBytes>(2); }
37007   bool has_stage() const { return at<3>().valid(); }
37008   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> stage() const { return GetRepeated<::protozero::ConstBytes>(3); }
37009 };
37010 
37011 class GpuRenderStageEvent_Specifications : public ::protozero::Message {
37012  public:
37013   using Decoder = GpuRenderStageEvent_Specifications_Decoder;
37014   enum : int32_t {
37015     kContextSpecFieldNumber = 1,
37016     kHwQueueFieldNumber = 2,
37017     kStageFieldNumber = 3,
37018   };
37019   using ContextSpec = ::perfetto::protos::pbzero::GpuRenderStageEvent_Specifications_ContextSpec;
37020   using Description = ::perfetto::protos::pbzero::GpuRenderStageEvent_Specifications_Description;
37021   template <typename T = GpuRenderStageEvent_Specifications_ContextSpec> T* set_context_spec() {
37022     return BeginNestedMessage<T>(1);
37023   }
37024 
37025   template <typename T = GpuRenderStageEvent_Specifications_Description> T* add_hw_queue() {
37026     return BeginNestedMessage<T>(2);
37027   }
37028 
37029   template <typename T = GpuRenderStageEvent_Specifications_Description> T* add_stage() {
37030     return BeginNestedMessage<T>(3);
37031   }
37032 
37033 };
37034 
37035 class GpuRenderStageEvent_Specifications_Description_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
37036  public:
37037   GpuRenderStageEvent_Specifications_Description_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
37038   explicit GpuRenderStageEvent_Specifications_Description_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
37039   explicit GpuRenderStageEvent_Specifications_Description_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
37040   bool has_name() const { return at<1>().valid(); }
37041   ::protozero::ConstChars name() const { return at<1>().as_string(); }
37042   bool has_description() const { return at<2>().valid(); }
37043   ::protozero::ConstChars description() const { return at<2>().as_string(); }
37044 };
37045 
37046 class GpuRenderStageEvent_Specifications_Description : public ::protozero::Message {
37047  public:
37048   using Decoder = GpuRenderStageEvent_Specifications_Description_Decoder;
37049   enum : int32_t {
37050     kNameFieldNumber = 1,
37051     kDescriptionFieldNumber = 2,
37052   };
37053   void set_name(const std::string& value) {
37054     AppendBytes(1, value.data(), value.size());
37055   }
37056   void set_name(const char* data, size_t size) {
37057     AppendBytes(1, data, size);
37058   }
37059   void set_description(const std::string& value) {
37060     AppendBytes(2, value.data(), value.size());
37061   }
37062   void set_description(const char* data, size_t size) {
37063     AppendBytes(2, data, size);
37064   }
37065 };
37066 
37067 class GpuRenderStageEvent_Specifications_ContextSpec_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
37068  public:
37069   GpuRenderStageEvent_Specifications_ContextSpec_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
37070   explicit GpuRenderStageEvent_Specifications_ContextSpec_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
37071   explicit GpuRenderStageEvent_Specifications_ContextSpec_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
37072   bool has_context() const { return at<1>().valid(); }
37073   uint64_t context() const { return at<1>().as_uint64(); }
37074   bool has_pid() const { return at<2>().valid(); }
37075   int32_t pid() const { return at<2>().as_int32(); }
37076 };
37077 
37078 class GpuRenderStageEvent_Specifications_ContextSpec : public ::protozero::Message {
37079  public:
37080   using Decoder = GpuRenderStageEvent_Specifications_ContextSpec_Decoder;
37081   enum : int32_t {
37082     kContextFieldNumber = 1,
37083     kPidFieldNumber = 2,
37084   };
37085   void set_context(uint64_t value) {
37086     AppendVarInt(1, value);
37087   }
37088   void set_pid(int32_t value) {
37089     AppendVarInt(2, value);
37090   }
37091 };
37092 
37093 class GpuRenderStageEvent_ExtraData_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
37094  public:
37095   GpuRenderStageEvent_ExtraData_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
37096   explicit GpuRenderStageEvent_ExtraData_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
37097   explicit GpuRenderStageEvent_ExtraData_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
37098   bool has_name() const { return at<1>().valid(); }
37099   ::protozero::ConstChars name() const { return at<1>().as_string(); }
37100   bool has_value() const { return at<2>().valid(); }
37101   ::protozero::ConstChars value() const { return at<2>().as_string(); }
37102 };
37103 
37104 class GpuRenderStageEvent_ExtraData : public ::protozero::Message {
37105  public:
37106   using Decoder = GpuRenderStageEvent_ExtraData_Decoder;
37107   enum : int32_t {
37108     kNameFieldNumber = 1,
37109     kValueFieldNumber = 2,
37110   };
37111   void set_name(const std::string& value) {
37112     AppendBytes(1, value.data(), value.size());
37113   }
37114   void set_name(const char* data, size_t size) {
37115     AppendBytes(1, data, size);
37116   }
37117   void set_value(const std::string& value) {
37118     AppendBytes(2, value.data(), value.size());
37119   }
37120   void set_value(const char* data, size_t size) {
37121     AppendBytes(2, data, size);
37122   }
37123 };
37124 
37125 } // Namespace.
37126 } // Namespace.
37127 } // Namespace.
37128 #endif  // Include guard.
37129 // gen_amalgamated begin header: gen/protos/perfetto/trace/gpu/vulkan_api_event.pbzero.h
37130 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
37131 
37132 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_GPU_VULKAN_API_EVENT_PROTO_H_
37133 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_GPU_VULKAN_API_EVENT_PROTO_H_
37134 
37135 #include <stddef.h>
37136 #include <stdint.h>
37137 
37138 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
37139 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
37140 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
37141 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
37142 
37143 namespace perfetto {
37144 namespace protos {
37145 namespace pbzero {
37146 
37147 class VulkanApiEvent_VkDebugUtilsObjectName;
37148 class VulkanApiEvent_VkQueueSubmit;
37149 
37150 class VulkanApiEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
37151  public:
37152   VulkanApiEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
37153   explicit VulkanApiEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
37154   explicit VulkanApiEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
37155   bool has_vk_debug_utils_object_name() const { return at<1>().valid(); }
37156   ::protozero::ConstBytes vk_debug_utils_object_name() const { return at<1>().as_bytes(); }
37157   bool has_vk_queue_submit() const { return at<2>().valid(); }
37158   ::protozero::ConstBytes vk_queue_submit() const { return at<2>().as_bytes(); }
37159 };
37160 
37161 class VulkanApiEvent : public ::protozero::Message {
37162  public:
37163   using Decoder = VulkanApiEvent_Decoder;
37164   enum : int32_t {
37165     kVkDebugUtilsObjectNameFieldNumber = 1,
37166     kVkQueueSubmitFieldNumber = 2,
37167   };
37168   using VkDebugUtilsObjectName = ::perfetto::protos::pbzero::VulkanApiEvent_VkDebugUtilsObjectName;
37169   using VkQueueSubmit = ::perfetto::protos::pbzero::VulkanApiEvent_VkQueueSubmit;
37170   template <typename T = VulkanApiEvent_VkDebugUtilsObjectName> T* set_vk_debug_utils_object_name() {
37171     return BeginNestedMessage<T>(1);
37172   }
37173 
37174   template <typename T = VulkanApiEvent_VkQueueSubmit> T* set_vk_queue_submit() {
37175     return BeginNestedMessage<T>(2);
37176   }
37177 
37178 };
37179 
37180 class VulkanApiEvent_VkQueueSubmit_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
37181  public:
37182   VulkanApiEvent_VkQueueSubmit_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
37183   explicit VulkanApiEvent_VkQueueSubmit_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
37184   explicit VulkanApiEvent_VkQueueSubmit_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
37185   bool has_duration_ns() const { return at<1>().valid(); }
37186   uint64_t duration_ns() const { return at<1>().as_uint64(); }
37187   bool has_pid() const { return at<2>().valid(); }
37188   uint32_t pid() const { return at<2>().as_uint32(); }
37189   bool has_tid() const { return at<3>().valid(); }
37190   uint32_t tid() const { return at<3>().as_uint32(); }
37191   bool has_vk_queue() const { return at<4>().valid(); }
37192   uint64_t vk_queue() const { return at<4>().as_uint64(); }
37193   bool has_vk_command_buffers() const { return at<5>().valid(); }
37194   ::protozero::RepeatedFieldIterator<uint64_t> vk_command_buffers() const { return GetRepeated<uint64_t>(5); }
37195   bool has_submission_id() const { return at<6>().valid(); }
37196   uint32_t submission_id() const { return at<6>().as_uint32(); }
37197 };
37198 
37199 class VulkanApiEvent_VkQueueSubmit : public ::protozero::Message {
37200  public:
37201   using Decoder = VulkanApiEvent_VkQueueSubmit_Decoder;
37202   enum : int32_t {
37203     kDurationNsFieldNumber = 1,
37204     kPidFieldNumber = 2,
37205     kTidFieldNumber = 3,
37206     kVkQueueFieldNumber = 4,
37207     kVkCommandBuffersFieldNumber = 5,
37208     kSubmissionIdFieldNumber = 6,
37209   };
37210   void set_duration_ns(uint64_t value) {
37211     AppendVarInt(1, value);
37212   }
37213   void set_pid(uint32_t value) {
37214     AppendVarInt(2, value);
37215   }
37216   void set_tid(uint32_t value) {
37217     AppendVarInt(3, value);
37218   }
37219   void set_vk_queue(uint64_t value) {
37220     AppendVarInt(4, value);
37221   }
37222   void add_vk_command_buffers(uint64_t value) {
37223     AppendVarInt(5, value);
37224   }
37225   void set_submission_id(uint32_t value) {
37226     AppendVarInt(6, value);
37227   }
37228 };
37229 
37230 class VulkanApiEvent_VkDebugUtilsObjectName_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
37231  public:
37232   VulkanApiEvent_VkDebugUtilsObjectName_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
37233   explicit VulkanApiEvent_VkDebugUtilsObjectName_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
37234   explicit VulkanApiEvent_VkDebugUtilsObjectName_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
37235   bool has_pid() const { return at<1>().valid(); }
37236   uint32_t pid() const { return at<1>().as_uint32(); }
37237   bool has_vk_device() const { return at<2>().valid(); }
37238   uint64_t vk_device() const { return at<2>().as_uint64(); }
37239   bool has_object_type() const { return at<3>().valid(); }
37240   int32_t object_type() const { return at<3>().as_int32(); }
37241   bool has_object() const { return at<4>().valid(); }
37242   uint64_t object() const { return at<4>().as_uint64(); }
37243   bool has_object_name() const { return at<5>().valid(); }
37244   ::protozero::ConstChars object_name() const { return at<5>().as_string(); }
37245 };
37246 
37247 class VulkanApiEvent_VkDebugUtilsObjectName : public ::protozero::Message {
37248  public:
37249   using Decoder = VulkanApiEvent_VkDebugUtilsObjectName_Decoder;
37250   enum : int32_t {
37251     kPidFieldNumber = 1,
37252     kVkDeviceFieldNumber = 2,
37253     kObjectTypeFieldNumber = 3,
37254     kObjectFieldNumber = 4,
37255     kObjectNameFieldNumber = 5,
37256   };
37257   void set_pid(uint32_t value) {
37258     AppendVarInt(1, value);
37259   }
37260   void set_vk_device(uint64_t value) {
37261     AppendVarInt(2, value);
37262   }
37263   void set_object_type(int32_t value) {
37264     AppendVarInt(3, value);
37265   }
37266   void set_object(uint64_t value) {
37267     AppendVarInt(4, value);
37268   }
37269   void set_object_name(const std::string& value) {
37270     AppendBytes(5, value.data(), value.size());
37271   }
37272   void set_object_name(const char* data, size_t size) {
37273     AppendBytes(5, data, size);
37274   }
37275 };
37276 
37277 } // Namespace.
37278 } // Namespace.
37279 } // Namespace.
37280 #endif  // Include guard.
37281 // gen_amalgamated begin header: gen/protos/perfetto/trace/gpu/vulkan_memory_event.pbzero.h
37282 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
37283 
37284 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_GPU_VULKAN_MEMORY_EVENT_PROTO_H_
37285 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_GPU_VULKAN_MEMORY_EVENT_PROTO_H_
37286 
37287 #include <stddef.h>
37288 #include <stdint.h>
37289 
37290 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
37291 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
37292 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
37293 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
37294 
37295 namespace perfetto {
37296 namespace protos {
37297 namespace pbzero {
37298 
37299 class VulkanMemoryEventAnnotation;
37300 enum VulkanMemoryEvent_AllocationScope : int32_t;
37301 enum VulkanMemoryEvent_Operation : int32_t;
37302 enum VulkanMemoryEvent_Source : int32_t;
37303 
37304 enum VulkanMemoryEvent_Source : int32_t {
37305   VulkanMemoryEvent_Source_SOURCE_UNSPECIFIED = 0,
37306   VulkanMemoryEvent_Source_SOURCE_DRIVER = 1,
37307   VulkanMemoryEvent_Source_SOURCE_DEVICE = 2,
37308   VulkanMemoryEvent_Source_SOURCE_DEVICE_MEMORY = 3,
37309   VulkanMemoryEvent_Source_SOURCE_BUFFER = 4,
37310   VulkanMemoryEvent_Source_SOURCE_IMAGE = 5,
37311 };
37312 
37313 const VulkanMemoryEvent_Source VulkanMemoryEvent_Source_MIN = VulkanMemoryEvent_Source_SOURCE_UNSPECIFIED;
37314 const VulkanMemoryEvent_Source VulkanMemoryEvent_Source_MAX = VulkanMemoryEvent_Source_SOURCE_IMAGE;
37315 
37316 enum VulkanMemoryEvent_Operation : int32_t {
37317   VulkanMemoryEvent_Operation_OP_UNSPECIFIED = 0,
37318   VulkanMemoryEvent_Operation_OP_CREATE = 1,
37319   VulkanMemoryEvent_Operation_OP_DESTROY = 2,
37320   VulkanMemoryEvent_Operation_OP_BIND = 3,
37321   VulkanMemoryEvent_Operation_OP_DESTROY_BOUND = 4,
37322   VulkanMemoryEvent_Operation_OP_ANNOTATIONS = 5,
37323 };
37324 
37325 const VulkanMemoryEvent_Operation VulkanMemoryEvent_Operation_MIN = VulkanMemoryEvent_Operation_OP_UNSPECIFIED;
37326 const VulkanMemoryEvent_Operation VulkanMemoryEvent_Operation_MAX = VulkanMemoryEvent_Operation_OP_ANNOTATIONS;
37327 
37328 enum VulkanMemoryEvent_AllocationScope : int32_t {
37329   VulkanMemoryEvent_AllocationScope_SCOPE_UNSPECIFIED = 0,
37330   VulkanMemoryEvent_AllocationScope_SCOPE_COMMAND = 1,
37331   VulkanMemoryEvent_AllocationScope_SCOPE_OBJECT = 2,
37332   VulkanMemoryEvent_AllocationScope_SCOPE_CACHE = 3,
37333   VulkanMemoryEvent_AllocationScope_SCOPE_DEVICE = 4,
37334   VulkanMemoryEvent_AllocationScope_SCOPE_INSTANCE = 5,
37335 };
37336 
37337 const VulkanMemoryEvent_AllocationScope VulkanMemoryEvent_AllocationScope_MIN = VulkanMemoryEvent_AllocationScope_SCOPE_UNSPECIFIED;
37338 const VulkanMemoryEvent_AllocationScope VulkanMemoryEvent_AllocationScope_MAX = VulkanMemoryEvent_AllocationScope_SCOPE_INSTANCE;
37339 
37340 class VulkanMemoryEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/20, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
37341  public:
37342   VulkanMemoryEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
37343   explicit VulkanMemoryEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
37344   explicit VulkanMemoryEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
37345   bool has_source() const { return at<1>().valid(); }
37346   int32_t source() const { return at<1>().as_int32(); }
37347   bool has_operation() const { return at<2>().valid(); }
37348   int32_t operation() const { return at<2>().as_int32(); }
37349   bool has_timestamp() const { return at<3>().valid(); }
37350   int64_t timestamp() const { return at<3>().as_int64(); }
37351   bool has_pid() const { return at<4>().valid(); }
37352   uint32_t pid() const { return at<4>().as_uint32(); }
37353   bool has_memory_address() const { return at<5>().valid(); }
37354   uint64_t memory_address() const { return at<5>().as_uint64(); }
37355   bool has_memory_size() const { return at<6>().valid(); }
37356   uint64_t memory_size() const { return at<6>().as_uint64(); }
37357   bool has_caller_iid() const { return at<7>().valid(); }
37358   uint64_t caller_iid() const { return at<7>().as_uint64(); }
37359   bool has_allocation_scope() const { return at<8>().valid(); }
37360   int32_t allocation_scope() const { return at<8>().as_int32(); }
37361   bool has_annotations() const { return at<9>().valid(); }
37362   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> annotations() const { return GetRepeated<::protozero::ConstBytes>(9); }
37363   bool has_device() const { return at<16>().valid(); }
37364   uint64_t device() const { return at<16>().as_uint64(); }
37365   bool has_device_memory() const { return at<17>().valid(); }
37366   uint64_t device_memory() const { return at<17>().as_uint64(); }
37367   bool has_memory_type() const { return at<18>().valid(); }
37368   uint32_t memory_type() const { return at<18>().as_uint32(); }
37369   bool has_heap() const { return at<19>().valid(); }
37370   uint32_t heap() const { return at<19>().as_uint32(); }
37371   bool has_object_handle() const { return at<20>().valid(); }
37372   uint64_t object_handle() const { return at<20>().as_uint64(); }
37373 };
37374 
37375 class VulkanMemoryEvent : public ::protozero::Message {
37376  public:
37377   using Decoder = VulkanMemoryEvent_Decoder;
37378   enum : int32_t {
37379     kSourceFieldNumber = 1,
37380     kOperationFieldNumber = 2,
37381     kTimestampFieldNumber = 3,
37382     kPidFieldNumber = 4,
37383     kMemoryAddressFieldNumber = 5,
37384     kMemorySizeFieldNumber = 6,
37385     kCallerIidFieldNumber = 7,
37386     kAllocationScopeFieldNumber = 8,
37387     kAnnotationsFieldNumber = 9,
37388     kDeviceFieldNumber = 16,
37389     kDeviceMemoryFieldNumber = 17,
37390     kMemoryTypeFieldNumber = 18,
37391     kHeapFieldNumber = 19,
37392     kObjectHandleFieldNumber = 20,
37393   };
37394   using Source = ::perfetto::protos::pbzero::VulkanMemoryEvent_Source;
37395   using Operation = ::perfetto::protos::pbzero::VulkanMemoryEvent_Operation;
37396   using AllocationScope = ::perfetto::protos::pbzero::VulkanMemoryEvent_AllocationScope;
37397   static const Source SOURCE_UNSPECIFIED = VulkanMemoryEvent_Source_SOURCE_UNSPECIFIED;
37398   static const Source SOURCE_DRIVER = VulkanMemoryEvent_Source_SOURCE_DRIVER;
37399   static const Source SOURCE_DEVICE = VulkanMemoryEvent_Source_SOURCE_DEVICE;
37400   static const Source SOURCE_DEVICE_MEMORY = VulkanMemoryEvent_Source_SOURCE_DEVICE_MEMORY;
37401   static const Source SOURCE_BUFFER = VulkanMemoryEvent_Source_SOURCE_BUFFER;
37402   static const Source SOURCE_IMAGE = VulkanMemoryEvent_Source_SOURCE_IMAGE;
37403   static const Operation OP_UNSPECIFIED = VulkanMemoryEvent_Operation_OP_UNSPECIFIED;
37404   static const Operation OP_CREATE = VulkanMemoryEvent_Operation_OP_CREATE;
37405   static const Operation OP_DESTROY = VulkanMemoryEvent_Operation_OP_DESTROY;
37406   static const Operation OP_BIND = VulkanMemoryEvent_Operation_OP_BIND;
37407   static const Operation OP_DESTROY_BOUND = VulkanMemoryEvent_Operation_OP_DESTROY_BOUND;
37408   static const Operation OP_ANNOTATIONS = VulkanMemoryEvent_Operation_OP_ANNOTATIONS;
37409   static const AllocationScope SCOPE_UNSPECIFIED = VulkanMemoryEvent_AllocationScope_SCOPE_UNSPECIFIED;
37410   static const AllocationScope SCOPE_COMMAND = VulkanMemoryEvent_AllocationScope_SCOPE_COMMAND;
37411   static const AllocationScope SCOPE_OBJECT = VulkanMemoryEvent_AllocationScope_SCOPE_OBJECT;
37412   static const AllocationScope SCOPE_CACHE = VulkanMemoryEvent_AllocationScope_SCOPE_CACHE;
37413   static const AllocationScope SCOPE_DEVICE = VulkanMemoryEvent_AllocationScope_SCOPE_DEVICE;
37414   static const AllocationScope SCOPE_INSTANCE = VulkanMemoryEvent_AllocationScope_SCOPE_INSTANCE;
37415   void set_source(::perfetto::protos::pbzero::VulkanMemoryEvent_Source value) {
37416     AppendTinyVarInt(1, value);
37417   }
37418   void set_operation(::perfetto::protos::pbzero::VulkanMemoryEvent_Operation value) {
37419     AppendTinyVarInt(2, value);
37420   }
37421   void set_timestamp(int64_t value) {
37422     AppendVarInt(3, value);
37423   }
37424   void set_pid(uint32_t value) {
37425     AppendVarInt(4, value);
37426   }
37427   void set_memory_address(uint64_t value) {
37428     AppendFixed(5, value);
37429   }
37430   void set_memory_size(uint64_t value) {
37431     AppendVarInt(6, value);
37432   }
37433   void set_caller_iid(uint64_t value) {
37434     AppendVarInt(7, value);
37435   }
37436   void set_allocation_scope(::perfetto::protos::pbzero::VulkanMemoryEvent_AllocationScope value) {
37437     AppendTinyVarInt(8, value);
37438   }
37439   template <typename T = VulkanMemoryEventAnnotation> T* add_annotations() {
37440     return BeginNestedMessage<T>(9);
37441   }
37442 
37443   void set_device(uint64_t value) {
37444     AppendFixed(16, value);
37445   }
37446   void set_device_memory(uint64_t value) {
37447     AppendFixed(17, value);
37448   }
37449   void set_memory_type(uint32_t value) {
37450     AppendVarInt(18, value);
37451   }
37452   void set_heap(uint32_t value) {
37453     AppendVarInt(19, value);
37454   }
37455   void set_object_handle(uint64_t value) {
37456     AppendFixed(20, value);
37457   }
37458 };
37459 
37460 class VulkanMemoryEventAnnotation_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
37461  public:
37462   VulkanMemoryEventAnnotation_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
37463   explicit VulkanMemoryEventAnnotation_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
37464   explicit VulkanMemoryEventAnnotation_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
37465   bool has_key_iid() const { return at<1>().valid(); }
37466   uint64_t key_iid() const { return at<1>().as_uint64(); }
37467   bool has_int_value() const { return at<2>().valid(); }
37468   int64_t int_value() const { return at<2>().as_int64(); }
37469   bool has_double_value() const { return at<3>().valid(); }
37470   double double_value() const { return at<3>().as_double(); }
37471   bool has_string_iid() const { return at<4>().valid(); }
37472   uint64_t string_iid() const { return at<4>().as_uint64(); }
37473 };
37474 
37475 class VulkanMemoryEventAnnotation : public ::protozero::Message {
37476  public:
37477   using Decoder = VulkanMemoryEventAnnotation_Decoder;
37478   enum : int32_t {
37479     kKeyIidFieldNumber = 1,
37480     kIntValueFieldNumber = 2,
37481     kDoubleValueFieldNumber = 3,
37482     kStringIidFieldNumber = 4,
37483   };
37484   void set_key_iid(uint64_t value) {
37485     AppendVarInt(1, value);
37486   }
37487   void set_int_value(int64_t value) {
37488     AppendVarInt(2, value);
37489   }
37490   void set_double_value(double value) {
37491     AppendFixed(3, value);
37492   }
37493   void set_string_iid(uint64_t value) {
37494     AppendVarInt(4, value);
37495   }
37496 };
37497 
37498 } // Namespace.
37499 } // Namespace.
37500 } // Namespace.
37501 #endif  // Include guard.
37502 // gen_amalgamated begin header: gen/protos/perfetto/trace/profiling/deobfuscation.pbzero.h
37503 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
37504 
37505 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PROFILING_DEOBFUSCATION_PROTO_H_
37506 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PROFILING_DEOBFUSCATION_PROTO_H_
37507 
37508 #include <stddef.h>
37509 #include <stdint.h>
37510 
37511 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
37512 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
37513 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
37514 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
37515 
37516 namespace perfetto {
37517 namespace protos {
37518 namespace pbzero {
37519 
37520 class ObfuscatedClass;
37521 class ObfuscatedMember;
37522 
37523 class DeobfuscationMapping_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
37524  public:
37525   DeobfuscationMapping_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
37526   explicit DeobfuscationMapping_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
37527   explicit DeobfuscationMapping_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
37528   bool has_package_name() const { return at<1>().valid(); }
37529   ::protozero::ConstChars package_name() const { return at<1>().as_string(); }
37530   bool has_version_code() const { return at<2>().valid(); }
37531   int64_t version_code() const { return at<2>().as_int64(); }
37532   bool has_obfuscated_classes() const { return at<3>().valid(); }
37533   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> obfuscated_classes() const { return GetRepeated<::protozero::ConstBytes>(3); }
37534 };
37535 
37536 class DeobfuscationMapping : public ::protozero::Message {
37537  public:
37538   using Decoder = DeobfuscationMapping_Decoder;
37539   enum : int32_t {
37540     kPackageNameFieldNumber = 1,
37541     kVersionCodeFieldNumber = 2,
37542     kObfuscatedClassesFieldNumber = 3,
37543   };
37544   void set_package_name(const std::string& value) {
37545     AppendBytes(1, value.data(), value.size());
37546   }
37547   void set_package_name(const char* data, size_t size) {
37548     AppendBytes(1, data, size);
37549   }
37550   void set_version_code(int64_t value) {
37551     AppendVarInt(2, value);
37552   }
37553   template <typename T = ObfuscatedClass> T* add_obfuscated_classes() {
37554     return BeginNestedMessage<T>(3);
37555   }
37556 
37557 };
37558 
37559 class ObfuscatedClass_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
37560  public:
37561   ObfuscatedClass_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
37562   explicit ObfuscatedClass_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
37563   explicit ObfuscatedClass_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
37564   bool has_obfuscated_name() const { return at<1>().valid(); }
37565   ::protozero::ConstChars obfuscated_name() const { return at<1>().as_string(); }
37566   bool has_deobfuscated_name() const { return at<2>().valid(); }
37567   ::protozero::ConstChars deobfuscated_name() const { return at<2>().as_string(); }
37568   bool has_obfuscated_members() const { return at<3>().valid(); }
37569   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> obfuscated_members() const { return GetRepeated<::protozero::ConstBytes>(3); }
37570   bool has_obfuscated_methods() const { return at<4>().valid(); }
37571   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> obfuscated_methods() const { return GetRepeated<::protozero::ConstBytes>(4); }
37572 };
37573 
37574 class ObfuscatedClass : public ::protozero::Message {
37575  public:
37576   using Decoder = ObfuscatedClass_Decoder;
37577   enum : int32_t {
37578     kObfuscatedNameFieldNumber = 1,
37579     kDeobfuscatedNameFieldNumber = 2,
37580     kObfuscatedMembersFieldNumber = 3,
37581     kObfuscatedMethodsFieldNumber = 4,
37582   };
37583   void set_obfuscated_name(const std::string& value) {
37584     AppendBytes(1, value.data(), value.size());
37585   }
37586   void set_obfuscated_name(const char* data, size_t size) {
37587     AppendBytes(1, data, size);
37588   }
37589   void set_deobfuscated_name(const std::string& value) {
37590     AppendBytes(2, value.data(), value.size());
37591   }
37592   void set_deobfuscated_name(const char* data, size_t size) {
37593     AppendBytes(2, data, size);
37594   }
37595   template <typename T = ObfuscatedMember> T* add_obfuscated_members() {
37596     return BeginNestedMessage<T>(3);
37597   }
37598 
37599   template <typename T = ObfuscatedMember> T* add_obfuscated_methods() {
37600     return BeginNestedMessage<T>(4);
37601   }
37602 
37603 };
37604 
37605 class ObfuscatedMember_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
37606  public:
37607   ObfuscatedMember_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
37608   explicit ObfuscatedMember_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
37609   explicit ObfuscatedMember_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
37610   bool has_obfuscated_name() const { return at<1>().valid(); }
37611   ::protozero::ConstChars obfuscated_name() const { return at<1>().as_string(); }
37612   bool has_deobfuscated_name() const { return at<2>().valid(); }
37613   ::protozero::ConstChars deobfuscated_name() const { return at<2>().as_string(); }
37614 };
37615 
37616 class ObfuscatedMember : public ::protozero::Message {
37617  public:
37618   using Decoder = ObfuscatedMember_Decoder;
37619   enum : int32_t {
37620     kObfuscatedNameFieldNumber = 1,
37621     kDeobfuscatedNameFieldNumber = 2,
37622   };
37623   void set_obfuscated_name(const std::string& value) {
37624     AppendBytes(1, value.data(), value.size());
37625   }
37626   void set_obfuscated_name(const char* data, size_t size) {
37627     AppendBytes(1, data, size);
37628   }
37629   void set_deobfuscated_name(const std::string& value) {
37630     AppendBytes(2, value.data(), value.size());
37631   }
37632   void set_deobfuscated_name(const char* data, size_t size) {
37633     AppendBytes(2, data, size);
37634   }
37635 };
37636 
37637 } // Namespace.
37638 } // Namespace.
37639 } // Namespace.
37640 #endif  // Include guard.
37641 // gen_amalgamated begin header: gen/protos/perfetto/trace/profiling/heap_graph.pbzero.h
37642 // gen_amalgamated begin header: gen/protos/perfetto/trace/profiling/deobfuscation.pbzero.h
37643 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
37644 
37645 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PROFILING_DEOBFUSCATION_PROTO_H_
37646 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PROFILING_DEOBFUSCATION_PROTO_H_
37647 
37648 #include <stddef.h>
37649 #include <stdint.h>
37650 
37651 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
37652 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
37653 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
37654 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
37655 
37656 namespace perfetto {
37657 namespace protos {
37658 namespace pbzero {
37659 
37660 class ObfuscatedClass;
37661 class ObfuscatedMember;
37662 
37663 class DeobfuscationMapping_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
37664  public:
37665   DeobfuscationMapping_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
37666   explicit DeobfuscationMapping_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
37667   explicit DeobfuscationMapping_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
37668   bool has_package_name() const { return at<1>().valid(); }
37669   ::protozero::ConstChars package_name() const { return at<1>().as_string(); }
37670   bool has_version_code() const { return at<2>().valid(); }
37671   int64_t version_code() const { return at<2>().as_int64(); }
37672   bool has_obfuscated_classes() const { return at<3>().valid(); }
37673   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> obfuscated_classes() const { return GetRepeated<::protozero::ConstBytes>(3); }
37674 };
37675 
37676 class DeobfuscationMapping : public ::protozero::Message {
37677  public:
37678   using Decoder = DeobfuscationMapping_Decoder;
37679   enum : int32_t {
37680     kPackageNameFieldNumber = 1,
37681     kVersionCodeFieldNumber = 2,
37682     kObfuscatedClassesFieldNumber = 3,
37683   };
37684   void set_package_name(const std::string& value) {
37685     AppendBytes(1, value.data(), value.size());
37686   }
37687   void set_package_name(const char* data, size_t size) {
37688     AppendBytes(1, data, size);
37689   }
37690   void set_version_code(int64_t value) {
37691     AppendVarInt(2, value);
37692   }
37693   template <typename T = ObfuscatedClass> T* add_obfuscated_classes() {
37694     return BeginNestedMessage<T>(3);
37695   }
37696 
37697 };
37698 
37699 class ObfuscatedClass_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
37700  public:
37701   ObfuscatedClass_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
37702   explicit ObfuscatedClass_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
37703   explicit ObfuscatedClass_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
37704   bool has_obfuscated_name() const { return at<1>().valid(); }
37705   ::protozero::ConstChars obfuscated_name() const { return at<1>().as_string(); }
37706   bool has_deobfuscated_name() const { return at<2>().valid(); }
37707   ::protozero::ConstChars deobfuscated_name() const { return at<2>().as_string(); }
37708   bool has_obfuscated_members() const { return at<3>().valid(); }
37709   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> obfuscated_members() const { return GetRepeated<::protozero::ConstBytes>(3); }
37710   bool has_obfuscated_methods() const { return at<4>().valid(); }
37711   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> obfuscated_methods() const { return GetRepeated<::protozero::ConstBytes>(4); }
37712 };
37713 
37714 class ObfuscatedClass : public ::protozero::Message {
37715  public:
37716   using Decoder = ObfuscatedClass_Decoder;
37717   enum : int32_t {
37718     kObfuscatedNameFieldNumber = 1,
37719     kDeobfuscatedNameFieldNumber = 2,
37720     kObfuscatedMembersFieldNumber = 3,
37721     kObfuscatedMethodsFieldNumber = 4,
37722   };
37723   void set_obfuscated_name(const std::string& value) {
37724     AppendBytes(1, value.data(), value.size());
37725   }
37726   void set_obfuscated_name(const char* data, size_t size) {
37727     AppendBytes(1, data, size);
37728   }
37729   void set_deobfuscated_name(const std::string& value) {
37730     AppendBytes(2, value.data(), value.size());
37731   }
37732   void set_deobfuscated_name(const char* data, size_t size) {
37733     AppendBytes(2, data, size);
37734   }
37735   template <typename T = ObfuscatedMember> T* add_obfuscated_members() {
37736     return BeginNestedMessage<T>(3);
37737   }
37738 
37739   template <typename T = ObfuscatedMember> T* add_obfuscated_methods() {
37740     return BeginNestedMessage<T>(4);
37741   }
37742 
37743 };
37744 
37745 class ObfuscatedMember_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
37746  public:
37747   ObfuscatedMember_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
37748   explicit ObfuscatedMember_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
37749   explicit ObfuscatedMember_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
37750   bool has_obfuscated_name() const { return at<1>().valid(); }
37751   ::protozero::ConstChars obfuscated_name() const { return at<1>().as_string(); }
37752   bool has_deobfuscated_name() const { return at<2>().valid(); }
37753   ::protozero::ConstChars deobfuscated_name() const { return at<2>().as_string(); }
37754 };
37755 
37756 class ObfuscatedMember : public ::protozero::Message {
37757  public:
37758   using Decoder = ObfuscatedMember_Decoder;
37759   enum : int32_t {
37760     kObfuscatedNameFieldNumber = 1,
37761     kDeobfuscatedNameFieldNumber = 2,
37762   };
37763   void set_obfuscated_name(const std::string& value) {
37764     AppendBytes(1, value.data(), value.size());
37765   }
37766   void set_obfuscated_name(const char* data, size_t size) {
37767     AppendBytes(1, data, size);
37768   }
37769   void set_deobfuscated_name(const std::string& value) {
37770     AppendBytes(2, value.data(), value.size());
37771   }
37772   void set_deobfuscated_name(const char* data, size_t size) {
37773     AppendBytes(2, data, size);
37774   }
37775 };
37776 
37777 } // Namespace.
37778 } // Namespace.
37779 } // Namespace.
37780 #endif  // Include guard.
37781 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
37782 
37783 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PROFILING_HEAP_GRAPH_PROTO_H_
37784 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PROFILING_HEAP_GRAPH_PROTO_H_
37785 
37786 #include <stddef.h>
37787 #include <stdint.h>
37788 
37789 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
37790 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
37791 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
37792 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
37793 // gen_amalgamated expanded: #include "protos/perfetto/trace/profiling/deobfuscation.pbzero.h"
37794 
37795 namespace perfetto {
37796 namespace protos {
37797 namespace pbzero {
37798 
37799 class HeapGraphObject;
37800 class HeapGraphRoot;
37801 class HeapGraphType;
37802 class InternedString;
37803 enum HeapGraphRoot_Type : int32_t;
37804 enum HeapGraphType_Kind : int32_t;
37805 
37806 enum HeapGraphType_Kind : int32_t {
37807   HeapGraphType_Kind_KIND_UNKNOWN = 0,
37808   HeapGraphType_Kind_KIND_NORMAL = 1,
37809   HeapGraphType_Kind_KIND_NOREFERENCES = 2,
37810   HeapGraphType_Kind_KIND_STRING = 3,
37811   HeapGraphType_Kind_KIND_ARRAY = 4,
37812   HeapGraphType_Kind_KIND_CLASS = 5,
37813   HeapGraphType_Kind_KIND_CLASSLOADER = 6,
37814   HeapGraphType_Kind_KIND_DEXCACHE = 7,
37815   HeapGraphType_Kind_KIND_SOFT_REFERENCE = 8,
37816   HeapGraphType_Kind_KIND_WEAK_REFERENCE = 9,
37817   HeapGraphType_Kind_KIND_FINALIZER_REFERENCE = 10,
37818   HeapGraphType_Kind_KIND_PHANTOM_REFERENCE = 11,
37819 };
37820 
37821 const HeapGraphType_Kind HeapGraphType_Kind_MIN = HeapGraphType_Kind_KIND_UNKNOWN;
37822 const HeapGraphType_Kind HeapGraphType_Kind_MAX = HeapGraphType_Kind_KIND_PHANTOM_REFERENCE;
37823 
37824 enum HeapGraphRoot_Type : int32_t {
37825   HeapGraphRoot_Type_ROOT_UNKNOWN = 0,
37826   HeapGraphRoot_Type_ROOT_JNI_GLOBAL = 1,
37827   HeapGraphRoot_Type_ROOT_JNI_LOCAL = 2,
37828   HeapGraphRoot_Type_ROOT_JAVA_FRAME = 3,
37829   HeapGraphRoot_Type_ROOT_NATIVE_STACK = 4,
37830   HeapGraphRoot_Type_ROOT_STICKY_CLASS = 5,
37831   HeapGraphRoot_Type_ROOT_THREAD_BLOCK = 6,
37832   HeapGraphRoot_Type_ROOT_MONITOR_USED = 7,
37833   HeapGraphRoot_Type_ROOT_THREAD_OBJECT = 8,
37834   HeapGraphRoot_Type_ROOT_INTERNED_STRING = 9,
37835   HeapGraphRoot_Type_ROOT_FINALIZING = 10,
37836   HeapGraphRoot_Type_ROOT_DEBUGGER = 11,
37837   HeapGraphRoot_Type_ROOT_REFERENCE_CLEANUP = 12,
37838   HeapGraphRoot_Type_ROOT_VM_INTERNAL = 13,
37839   HeapGraphRoot_Type_ROOT_JNI_MONITOR = 14,
37840 };
37841 
37842 const HeapGraphRoot_Type HeapGraphRoot_Type_MIN = HeapGraphRoot_Type_ROOT_UNKNOWN;
37843 const HeapGraphRoot_Type HeapGraphRoot_Type_MAX = HeapGraphRoot_Type_ROOT_JNI_MONITOR;
37844 
37845 class HeapGraph_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/9, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
37846  public:
37847   HeapGraph_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
37848   explicit HeapGraph_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
37849   explicit HeapGraph_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
37850   bool has_pid() const { return at<1>().valid(); }
37851   int32_t pid() const { return at<1>().as_int32(); }
37852   bool has_objects() const { return at<2>().valid(); }
37853   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> objects() const { return GetRepeated<::protozero::ConstBytes>(2); }
37854   bool has_roots() const { return at<7>().valid(); }
37855   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> roots() const { return GetRepeated<::protozero::ConstBytes>(7); }
37856   bool has_types() const { return at<9>().valid(); }
37857   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> types() const { return GetRepeated<::protozero::ConstBytes>(9); }
37858   bool has_field_names() const { return at<4>().valid(); }
37859   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> field_names() const { return GetRepeated<::protozero::ConstBytes>(4); }
37860   bool has_location_names() const { return at<8>().valid(); }
37861   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> location_names() const { return GetRepeated<::protozero::ConstBytes>(8); }
37862   bool has_continued() const { return at<5>().valid(); }
37863   bool continued() const { return at<5>().as_bool(); }
37864   bool has_index() const { return at<6>().valid(); }
37865   uint64_t index() const { return at<6>().as_uint64(); }
37866 };
37867 
37868 class HeapGraph : public ::protozero::Message {
37869  public:
37870   using Decoder = HeapGraph_Decoder;
37871   enum : int32_t {
37872     kPidFieldNumber = 1,
37873     kObjectsFieldNumber = 2,
37874     kRootsFieldNumber = 7,
37875     kTypesFieldNumber = 9,
37876     kFieldNamesFieldNumber = 4,
37877     kLocationNamesFieldNumber = 8,
37878     kContinuedFieldNumber = 5,
37879     kIndexFieldNumber = 6,
37880   };
37881   void set_pid(int32_t value) {
37882     AppendVarInt(1, value);
37883   }
37884   template <typename T = HeapGraphObject> T* add_objects() {
37885     return BeginNestedMessage<T>(2);
37886   }
37887 
37888   template <typename T = HeapGraphRoot> T* add_roots() {
37889     return BeginNestedMessage<T>(7);
37890   }
37891 
37892   template <typename T = HeapGraphType> T* add_types() {
37893     return BeginNestedMessage<T>(9);
37894   }
37895 
37896   template <typename T = InternedString> T* add_field_names() {
37897     return BeginNestedMessage<T>(4);
37898   }
37899 
37900   template <typename T = InternedString> T* add_location_names() {
37901     return BeginNestedMessage<T>(8);
37902   }
37903 
37904   void set_continued(bool value) {
37905     AppendTinyVarInt(5, value);
37906   }
37907   void set_index(uint64_t value) {
37908     AppendVarInt(6, value);
37909   }
37910 };
37911 
37912 class HeapGraphObject_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
37913  public:
37914   HeapGraphObject_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
37915   explicit HeapGraphObject_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
37916   explicit HeapGraphObject_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
37917   bool has_id() const { return at<1>().valid(); }
37918   uint64_t id() const { return at<1>().as_uint64(); }
37919   bool has_type_id() const { return at<2>().valid(); }
37920   uint64_t type_id() const { return at<2>().as_uint64(); }
37921   bool has_self_size() const { return at<3>().valid(); }
37922   uint64_t self_size() const { return at<3>().as_uint64(); }
37923   bool has_reference_field_id() const { return at<4>().valid(); }
37924   ::protozero::PackedRepeatedFieldIterator<::protozero::proto_utils::ProtoWireType::kVarInt, uint64_t> reference_field_id(bool* parse_error_ptr) const { return GetPackedRepeated<::protozero::proto_utils::ProtoWireType::kVarInt, uint64_t>(4, parse_error_ptr); }
37925   bool has_reference_object_id() const { return at<5>().valid(); }
37926   ::protozero::PackedRepeatedFieldIterator<::protozero::proto_utils::ProtoWireType::kVarInt, uint64_t> reference_object_id(bool* parse_error_ptr) const { return GetPackedRepeated<::protozero::proto_utils::ProtoWireType::kVarInt, uint64_t>(5, parse_error_ptr); }
37927 };
37928 
37929 class HeapGraphObject : public ::protozero::Message {
37930  public:
37931   using Decoder = HeapGraphObject_Decoder;
37932   enum : int32_t {
37933     kIdFieldNumber = 1,
37934     kTypeIdFieldNumber = 2,
37935     kSelfSizeFieldNumber = 3,
37936     kReferenceFieldIdFieldNumber = 4,
37937     kReferenceObjectIdFieldNumber = 5,
37938   };
37939   void set_id(uint64_t value) {
37940     AppendVarInt(1, value);
37941   }
37942   void set_type_id(uint64_t value) {
37943     AppendVarInt(2, value);
37944   }
37945   void set_self_size(uint64_t value) {
37946     AppendVarInt(3, value);
37947   }
37948   void set_reference_field_id(const ::protozero::PackedVarInt& packed_buffer) {
37949     AppendBytes(4, packed_buffer.data(), packed_buffer.size());
37950   }
37951   void set_reference_object_id(const ::protozero::PackedVarInt& packed_buffer) {
37952     AppendBytes(5, packed_buffer.data(), packed_buffer.size());
37953   }
37954 };
37955 
37956 class HeapGraphType_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
37957  public:
37958   HeapGraphType_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
37959   explicit HeapGraphType_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
37960   explicit HeapGraphType_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
37961   bool has_id() const { return at<1>().valid(); }
37962   uint64_t id() const { return at<1>().as_uint64(); }
37963   bool has_location_id() const { return at<2>().valid(); }
37964   uint64_t location_id() const { return at<2>().as_uint64(); }
37965   bool has_class_name() const { return at<3>().valid(); }
37966   ::protozero::ConstChars class_name() const { return at<3>().as_string(); }
37967   bool has_object_size() const { return at<4>().valid(); }
37968   uint64_t object_size() const { return at<4>().as_uint64(); }
37969   bool has_superclass_id() const { return at<5>().valid(); }
37970   uint64_t superclass_id() const { return at<5>().as_uint64(); }
37971   bool has_reference_field_id() const { return at<6>().valid(); }
37972   ::protozero::PackedRepeatedFieldIterator<::protozero::proto_utils::ProtoWireType::kVarInt, uint64_t> reference_field_id(bool* parse_error_ptr) const { return GetPackedRepeated<::protozero::proto_utils::ProtoWireType::kVarInt, uint64_t>(6, parse_error_ptr); }
37973   bool has_kind() const { return at<7>().valid(); }
37974   int32_t kind() const { return at<7>().as_int32(); }
37975 };
37976 
37977 class HeapGraphType : public ::protozero::Message {
37978  public:
37979   using Decoder = HeapGraphType_Decoder;
37980   enum : int32_t {
37981     kIdFieldNumber = 1,
37982     kLocationIdFieldNumber = 2,
37983     kClassNameFieldNumber = 3,
37984     kObjectSizeFieldNumber = 4,
37985     kSuperclassIdFieldNumber = 5,
37986     kReferenceFieldIdFieldNumber = 6,
37987     kKindFieldNumber = 7,
37988   };
37989   using Kind = ::perfetto::protos::pbzero::HeapGraphType_Kind;
37990   static const Kind KIND_UNKNOWN = HeapGraphType_Kind_KIND_UNKNOWN;
37991   static const Kind KIND_NORMAL = HeapGraphType_Kind_KIND_NORMAL;
37992   static const Kind KIND_NOREFERENCES = HeapGraphType_Kind_KIND_NOREFERENCES;
37993   static const Kind KIND_STRING = HeapGraphType_Kind_KIND_STRING;
37994   static const Kind KIND_ARRAY = HeapGraphType_Kind_KIND_ARRAY;
37995   static const Kind KIND_CLASS = HeapGraphType_Kind_KIND_CLASS;
37996   static const Kind KIND_CLASSLOADER = HeapGraphType_Kind_KIND_CLASSLOADER;
37997   static const Kind KIND_DEXCACHE = HeapGraphType_Kind_KIND_DEXCACHE;
37998   static const Kind KIND_SOFT_REFERENCE = HeapGraphType_Kind_KIND_SOFT_REFERENCE;
37999   static const Kind KIND_WEAK_REFERENCE = HeapGraphType_Kind_KIND_WEAK_REFERENCE;
38000   static const Kind KIND_FINALIZER_REFERENCE = HeapGraphType_Kind_KIND_FINALIZER_REFERENCE;
38001   static const Kind KIND_PHANTOM_REFERENCE = HeapGraphType_Kind_KIND_PHANTOM_REFERENCE;
38002   void set_id(uint64_t value) {
38003     AppendVarInt(1, value);
38004   }
38005   void set_location_id(uint64_t value) {
38006     AppendVarInt(2, value);
38007   }
38008   void set_class_name(const std::string& value) {
38009     AppendBytes(3, value.data(), value.size());
38010   }
38011   void set_class_name(const char* data, size_t size) {
38012     AppendBytes(3, data, size);
38013   }
38014   void set_object_size(uint64_t value) {
38015     AppendVarInt(4, value);
38016   }
38017   void set_superclass_id(uint64_t value) {
38018     AppendVarInt(5, value);
38019   }
38020   void set_reference_field_id(const ::protozero::PackedVarInt& packed_buffer) {
38021     AppendBytes(6, packed_buffer.data(), packed_buffer.size());
38022   }
38023   void set_kind(::perfetto::protos::pbzero::HeapGraphType_Kind value) {
38024     AppendTinyVarInt(7, value);
38025   }
38026 };
38027 
38028 class HeapGraphRoot_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
38029  public:
38030   HeapGraphRoot_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
38031   explicit HeapGraphRoot_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
38032   explicit HeapGraphRoot_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
38033   bool has_object_ids() const { return at<1>().valid(); }
38034   ::protozero::PackedRepeatedFieldIterator<::protozero::proto_utils::ProtoWireType::kVarInt, uint64_t> object_ids(bool* parse_error_ptr) const { return GetPackedRepeated<::protozero::proto_utils::ProtoWireType::kVarInt, uint64_t>(1, parse_error_ptr); }
38035   bool has_root_type() const { return at<2>().valid(); }
38036   int32_t root_type() const { return at<2>().as_int32(); }
38037 };
38038 
38039 class HeapGraphRoot : public ::protozero::Message {
38040  public:
38041   using Decoder = HeapGraphRoot_Decoder;
38042   enum : int32_t {
38043     kObjectIdsFieldNumber = 1,
38044     kRootTypeFieldNumber = 2,
38045   };
38046   using Type = ::perfetto::protos::pbzero::HeapGraphRoot_Type;
38047   static const Type ROOT_UNKNOWN = HeapGraphRoot_Type_ROOT_UNKNOWN;
38048   static const Type ROOT_JNI_GLOBAL = HeapGraphRoot_Type_ROOT_JNI_GLOBAL;
38049   static const Type ROOT_JNI_LOCAL = HeapGraphRoot_Type_ROOT_JNI_LOCAL;
38050   static const Type ROOT_JAVA_FRAME = HeapGraphRoot_Type_ROOT_JAVA_FRAME;
38051   static const Type ROOT_NATIVE_STACK = HeapGraphRoot_Type_ROOT_NATIVE_STACK;
38052   static const Type ROOT_STICKY_CLASS = HeapGraphRoot_Type_ROOT_STICKY_CLASS;
38053   static const Type ROOT_THREAD_BLOCK = HeapGraphRoot_Type_ROOT_THREAD_BLOCK;
38054   static const Type ROOT_MONITOR_USED = HeapGraphRoot_Type_ROOT_MONITOR_USED;
38055   static const Type ROOT_THREAD_OBJECT = HeapGraphRoot_Type_ROOT_THREAD_OBJECT;
38056   static const Type ROOT_INTERNED_STRING = HeapGraphRoot_Type_ROOT_INTERNED_STRING;
38057   static const Type ROOT_FINALIZING = HeapGraphRoot_Type_ROOT_FINALIZING;
38058   static const Type ROOT_DEBUGGER = HeapGraphRoot_Type_ROOT_DEBUGGER;
38059   static const Type ROOT_REFERENCE_CLEANUP = HeapGraphRoot_Type_ROOT_REFERENCE_CLEANUP;
38060   static const Type ROOT_VM_INTERNAL = HeapGraphRoot_Type_ROOT_VM_INTERNAL;
38061   static const Type ROOT_JNI_MONITOR = HeapGraphRoot_Type_ROOT_JNI_MONITOR;
38062   void set_object_ids(const ::protozero::PackedVarInt& packed_buffer) {
38063     AppendBytes(1, packed_buffer.data(), packed_buffer.size());
38064   }
38065   void set_root_type(::perfetto::protos::pbzero::HeapGraphRoot_Type value) {
38066     AppendTinyVarInt(2, value);
38067   }
38068 };
38069 
38070 } // Namespace.
38071 } // Namespace.
38072 } // Namespace.
38073 #endif  // Include guard.
38074 // gen_amalgamated begin header: gen/protos/perfetto/trace/profiling/profile_common.pbzero.h
38075 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
38076 
38077 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PROFILING_PROFILE_COMMON_PROTO_H_
38078 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PROFILING_PROFILE_COMMON_PROTO_H_
38079 
38080 #include <stddef.h>
38081 #include <stdint.h>
38082 
38083 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
38084 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
38085 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
38086 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
38087 
38088 namespace perfetto {
38089 namespace protos {
38090 namespace pbzero {
38091 
38092 class AddressSymbols;
38093 class Line;
38094 
38095 class Callstack_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
38096  public:
38097   Callstack_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
38098   explicit Callstack_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
38099   explicit Callstack_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
38100   bool has_iid() const { return at<1>().valid(); }
38101   uint64_t iid() const { return at<1>().as_uint64(); }
38102   bool has_frame_ids() const { return at<2>().valid(); }
38103   ::protozero::RepeatedFieldIterator<uint64_t> frame_ids() const { return GetRepeated<uint64_t>(2); }
38104 };
38105 
38106 class Callstack : public ::protozero::Message {
38107  public:
38108   using Decoder = Callstack_Decoder;
38109   enum : int32_t {
38110     kIidFieldNumber = 1,
38111     kFrameIdsFieldNumber = 2,
38112   };
38113   void set_iid(uint64_t value) {
38114     AppendVarInt(1, value);
38115   }
38116   void add_frame_ids(uint64_t value) {
38117     AppendVarInt(2, value);
38118   }
38119 };
38120 
38121 class Frame_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
38122  public:
38123   Frame_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
38124   explicit Frame_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
38125   explicit Frame_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
38126   bool has_iid() const { return at<1>().valid(); }
38127   uint64_t iid() const { return at<1>().as_uint64(); }
38128   bool has_function_name_id() const { return at<2>().valid(); }
38129   uint64_t function_name_id() const { return at<2>().as_uint64(); }
38130   bool has_mapping_id() const { return at<3>().valid(); }
38131   uint64_t mapping_id() const { return at<3>().as_uint64(); }
38132   bool has_rel_pc() const { return at<4>().valid(); }
38133   uint64_t rel_pc() const { return at<4>().as_uint64(); }
38134 };
38135 
38136 class Frame : public ::protozero::Message {
38137  public:
38138   using Decoder = Frame_Decoder;
38139   enum : int32_t {
38140     kIidFieldNumber = 1,
38141     kFunctionNameIdFieldNumber = 2,
38142     kMappingIdFieldNumber = 3,
38143     kRelPcFieldNumber = 4,
38144   };
38145   void set_iid(uint64_t value) {
38146     AppendVarInt(1, value);
38147   }
38148   void set_function_name_id(uint64_t value) {
38149     AppendVarInt(2, value);
38150   }
38151   void set_mapping_id(uint64_t value) {
38152     AppendVarInt(3, value);
38153   }
38154   void set_rel_pc(uint64_t value) {
38155     AppendVarInt(4, value);
38156   }
38157 };
38158 
38159 class Mapping_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
38160  public:
38161   Mapping_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
38162   explicit Mapping_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
38163   explicit Mapping_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
38164   bool has_iid() const { return at<1>().valid(); }
38165   uint64_t iid() const { return at<1>().as_uint64(); }
38166   bool has_build_id() const { return at<2>().valid(); }
38167   uint64_t build_id() const { return at<2>().as_uint64(); }
38168   bool has_exact_offset() const { return at<8>().valid(); }
38169   uint64_t exact_offset() const { return at<8>().as_uint64(); }
38170   bool has_start_offset() const { return at<3>().valid(); }
38171   uint64_t start_offset() const { return at<3>().as_uint64(); }
38172   bool has_start() const { return at<4>().valid(); }
38173   uint64_t start() const { return at<4>().as_uint64(); }
38174   bool has_end() const { return at<5>().valid(); }
38175   uint64_t end() const { return at<5>().as_uint64(); }
38176   bool has_load_bias() const { return at<6>().valid(); }
38177   uint64_t load_bias() const { return at<6>().as_uint64(); }
38178   bool has_path_string_ids() const { return at<7>().valid(); }
38179   ::protozero::RepeatedFieldIterator<uint64_t> path_string_ids() const { return GetRepeated<uint64_t>(7); }
38180 };
38181 
38182 class Mapping : public ::protozero::Message {
38183  public:
38184   using Decoder = Mapping_Decoder;
38185   enum : int32_t {
38186     kIidFieldNumber = 1,
38187     kBuildIdFieldNumber = 2,
38188     kExactOffsetFieldNumber = 8,
38189     kStartOffsetFieldNumber = 3,
38190     kStartFieldNumber = 4,
38191     kEndFieldNumber = 5,
38192     kLoadBiasFieldNumber = 6,
38193     kPathStringIdsFieldNumber = 7,
38194   };
38195   void set_iid(uint64_t value) {
38196     AppendVarInt(1, value);
38197   }
38198   void set_build_id(uint64_t value) {
38199     AppendVarInt(2, value);
38200   }
38201   void set_exact_offset(uint64_t value) {
38202     AppendVarInt(8, value);
38203   }
38204   void set_start_offset(uint64_t value) {
38205     AppendVarInt(3, value);
38206   }
38207   void set_start(uint64_t value) {
38208     AppendVarInt(4, value);
38209   }
38210   void set_end(uint64_t value) {
38211     AppendVarInt(5, value);
38212   }
38213   void set_load_bias(uint64_t value) {
38214     AppendVarInt(6, value);
38215   }
38216   void add_path_string_ids(uint64_t value) {
38217     AppendVarInt(7, value);
38218   }
38219 };
38220 
38221 class ModuleSymbols_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
38222  public:
38223   ModuleSymbols_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
38224   explicit ModuleSymbols_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
38225   explicit ModuleSymbols_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
38226   bool has_path() const { return at<1>().valid(); }
38227   ::protozero::ConstChars path() const { return at<1>().as_string(); }
38228   bool has_build_id() const { return at<2>().valid(); }
38229   ::protozero::ConstChars build_id() const { return at<2>().as_string(); }
38230   bool has_address_symbols() const { return at<3>().valid(); }
38231   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> address_symbols() const { return GetRepeated<::protozero::ConstBytes>(3); }
38232 };
38233 
38234 class ModuleSymbols : public ::protozero::Message {
38235  public:
38236   using Decoder = ModuleSymbols_Decoder;
38237   enum : int32_t {
38238     kPathFieldNumber = 1,
38239     kBuildIdFieldNumber = 2,
38240     kAddressSymbolsFieldNumber = 3,
38241   };
38242   void set_path(const std::string& value) {
38243     AppendBytes(1, value.data(), value.size());
38244   }
38245   void set_path(const char* data, size_t size) {
38246     AppendBytes(1, data, size);
38247   }
38248   void set_build_id(const std::string& value) {
38249     AppendBytes(2, value.data(), value.size());
38250   }
38251   void set_build_id(const char* data, size_t size) {
38252     AppendBytes(2, data, size);
38253   }
38254   template <typename T = AddressSymbols> T* add_address_symbols() {
38255     return BeginNestedMessage<T>(3);
38256   }
38257 
38258 };
38259 
38260 class AddressSymbols_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
38261  public:
38262   AddressSymbols_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
38263   explicit AddressSymbols_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
38264   explicit AddressSymbols_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
38265   bool has_address() const { return at<1>().valid(); }
38266   uint64_t address() const { return at<1>().as_uint64(); }
38267   bool has_lines() const { return at<2>().valid(); }
38268   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> lines() const { return GetRepeated<::protozero::ConstBytes>(2); }
38269 };
38270 
38271 class AddressSymbols : public ::protozero::Message {
38272  public:
38273   using Decoder = AddressSymbols_Decoder;
38274   enum : int32_t {
38275     kAddressFieldNumber = 1,
38276     kLinesFieldNumber = 2,
38277   };
38278   void set_address(uint64_t value) {
38279     AppendVarInt(1, value);
38280   }
38281   template <typename T = Line> T* add_lines() {
38282     return BeginNestedMessage<T>(2);
38283   }
38284 
38285 };
38286 
38287 class Line_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
38288  public:
38289   Line_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
38290   explicit Line_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
38291   explicit Line_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
38292   bool has_function_name() const { return at<1>().valid(); }
38293   ::protozero::ConstChars function_name() const { return at<1>().as_string(); }
38294   bool has_source_file_name() const { return at<2>().valid(); }
38295   ::protozero::ConstChars source_file_name() const { return at<2>().as_string(); }
38296   bool has_line_number() const { return at<3>().valid(); }
38297   uint32_t line_number() const { return at<3>().as_uint32(); }
38298 };
38299 
38300 class Line : public ::protozero::Message {
38301  public:
38302   using Decoder = Line_Decoder;
38303   enum : int32_t {
38304     kFunctionNameFieldNumber = 1,
38305     kSourceFileNameFieldNumber = 2,
38306     kLineNumberFieldNumber = 3,
38307   };
38308   void set_function_name(const std::string& value) {
38309     AppendBytes(1, value.data(), value.size());
38310   }
38311   void set_function_name(const char* data, size_t size) {
38312     AppendBytes(1, data, size);
38313   }
38314   void set_source_file_name(const std::string& value) {
38315     AppendBytes(2, value.data(), value.size());
38316   }
38317   void set_source_file_name(const char* data, size_t size) {
38318     AppendBytes(2, data, size);
38319   }
38320   void set_line_number(uint32_t value) {
38321     AppendVarInt(3, value);
38322   }
38323 };
38324 
38325 class ProfiledFrameSymbols_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
38326  public:
38327   ProfiledFrameSymbols_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
38328   explicit ProfiledFrameSymbols_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
38329   explicit ProfiledFrameSymbols_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
38330   bool has_frame_iid() const { return at<1>().valid(); }
38331   uint64_t frame_iid() const { return at<1>().as_uint64(); }
38332   bool has_function_name_id() const { return at<2>().valid(); }
38333   ::protozero::RepeatedFieldIterator<uint64_t> function_name_id() const { return GetRepeated<uint64_t>(2); }
38334   bool has_file_name_id() const { return at<3>().valid(); }
38335   ::protozero::RepeatedFieldIterator<uint64_t> file_name_id() const { return GetRepeated<uint64_t>(3); }
38336   bool has_line_number() const { return at<4>().valid(); }
38337   ::protozero::RepeatedFieldIterator<uint32_t> line_number() const { return GetRepeated<uint32_t>(4); }
38338 };
38339 
38340 class ProfiledFrameSymbols : public ::protozero::Message {
38341  public:
38342   using Decoder = ProfiledFrameSymbols_Decoder;
38343   enum : int32_t {
38344     kFrameIidFieldNumber = 1,
38345     kFunctionNameIdFieldNumber = 2,
38346     kFileNameIdFieldNumber = 3,
38347     kLineNumberFieldNumber = 4,
38348   };
38349   void set_frame_iid(uint64_t value) {
38350     AppendVarInt(1, value);
38351   }
38352   void add_function_name_id(uint64_t value) {
38353     AppendVarInt(2, value);
38354   }
38355   void add_file_name_id(uint64_t value) {
38356     AppendVarInt(3, value);
38357   }
38358   void add_line_number(uint32_t value) {
38359     AppendVarInt(4, value);
38360   }
38361 };
38362 
38363 class InternedString_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
38364  public:
38365   InternedString_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
38366   explicit InternedString_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
38367   explicit InternedString_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
38368   bool has_iid() const { return at<1>().valid(); }
38369   uint64_t iid() const { return at<1>().as_uint64(); }
38370   bool has_str() const { return at<2>().valid(); }
38371   ::protozero::ConstBytes str() const { return at<2>().as_bytes(); }
38372 };
38373 
38374 class InternedString : public ::protozero::Message {
38375  public:
38376   using Decoder = InternedString_Decoder;
38377   enum : int32_t {
38378     kIidFieldNumber = 1,
38379     kStrFieldNumber = 2,
38380   };
38381   void set_iid(uint64_t value) {
38382     AppendVarInt(1, value);
38383   }
38384   void set_str(const std::string& value) {
38385     AppendBytes(2, value.data(), value.size());
38386   }
38387   void set_str(const uint8_t* data, size_t size) {
38388     AppendBytes(2, data, size);
38389   }
38390 };
38391 
38392 } // Namespace.
38393 } // Namespace.
38394 } // Namespace.
38395 #endif  // Include guard.
38396 // gen_amalgamated begin header: gen/protos/perfetto/trace/profiling/profile_packet.pbzero.h
38397 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
38398 
38399 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PROFILING_PROFILE_PACKET_PROTO_H_
38400 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PROFILING_PROFILE_PACKET_PROTO_H_
38401 
38402 #include <stddef.h>
38403 #include <stdint.h>
38404 
38405 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
38406 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
38407 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
38408 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
38409 
38410 namespace perfetto {
38411 namespace protos {
38412 namespace pbzero {
38413 
38414 class Callstack;
38415 class Frame;
38416 class InternedString;
38417 class Mapping;
38418 class ProfilePacket_HeapSample;
38419 class ProfilePacket_Histogram;
38420 class ProfilePacket_Histogram_Bucket;
38421 class ProfilePacket_ProcessHeapSamples;
38422 class ProfilePacket_ProcessStats;
38423 enum PerfSample_SampleSkipReason : int32_t;
38424 enum Profiling_CpuMode : int32_t;
38425 enum Profiling_StackUnwindError : int32_t;
38426 
38427 enum PerfSample_SampleSkipReason : int32_t {
38428   PerfSample_SampleSkipReason_PROFILER_SKIP_UNKNOWN = 0,
38429   PerfSample_SampleSkipReason_PROFILER_SKIP_READ_STAGE = 1,
38430   PerfSample_SampleSkipReason_PROFILER_SKIP_UNWIND_STAGE = 2,
38431   PerfSample_SampleSkipReason_PROFILER_SKIP_UNWIND_ENQUEUE = 3,
38432 };
38433 
38434 const PerfSample_SampleSkipReason PerfSample_SampleSkipReason_MIN = PerfSample_SampleSkipReason_PROFILER_SKIP_UNKNOWN;
38435 const PerfSample_SampleSkipReason PerfSample_SampleSkipReason_MAX = PerfSample_SampleSkipReason_PROFILER_SKIP_UNWIND_ENQUEUE;
38436 
38437 enum Profiling_CpuMode : int32_t {
38438   Profiling_CpuMode_MODE_UNKNOWN = 0,
38439   Profiling_CpuMode_MODE_KERNEL = 1,
38440   Profiling_CpuMode_MODE_USER = 2,
38441   Profiling_CpuMode_MODE_HYPERVISOR = 3,
38442   Profiling_CpuMode_MODE_GUEST_KERNEL = 4,
38443   Profiling_CpuMode_MODE_GUEST_USER = 5,
38444 };
38445 
38446 const Profiling_CpuMode Profiling_CpuMode_MIN = Profiling_CpuMode_MODE_UNKNOWN;
38447 const Profiling_CpuMode Profiling_CpuMode_MAX = Profiling_CpuMode_MODE_GUEST_USER;
38448 
38449 enum Profiling_StackUnwindError : int32_t {
38450   Profiling_StackUnwindError_UNWIND_ERROR_UNKNOWN = 0,
38451   Profiling_StackUnwindError_UNWIND_ERROR_NONE = 1,
38452   Profiling_StackUnwindError_UNWIND_ERROR_MEMORY_INVALID = 2,
38453   Profiling_StackUnwindError_UNWIND_ERROR_UNWIND_INFO = 3,
38454   Profiling_StackUnwindError_UNWIND_ERROR_UNSUPPORTED = 4,
38455   Profiling_StackUnwindError_UNWIND_ERROR_INVALID_MAP = 5,
38456   Profiling_StackUnwindError_UNWIND_ERROR_MAX_FRAMES_EXCEEDED = 6,
38457   Profiling_StackUnwindError_UNWIND_ERROR_REPEATED_FRAME = 7,
38458   Profiling_StackUnwindError_UNWIND_ERROR_INVALID_ELF = 8,
38459 };
38460 
38461 const Profiling_StackUnwindError Profiling_StackUnwindError_MIN = Profiling_StackUnwindError_UNWIND_ERROR_UNKNOWN;
38462 const Profiling_StackUnwindError Profiling_StackUnwindError_MAX = Profiling_StackUnwindError_UNWIND_ERROR_INVALID_ELF;
38463 
38464 class PerfSample_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/18, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
38465  public:
38466   PerfSample_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
38467   explicit PerfSample_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
38468   explicit PerfSample_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
38469   bool has_cpu() const { return at<1>().valid(); }
38470   uint32_t cpu() const { return at<1>().as_uint32(); }
38471   bool has_pid() const { return at<2>().valid(); }
38472   uint32_t pid() const { return at<2>().as_uint32(); }
38473   bool has_tid() const { return at<3>().valid(); }
38474   uint32_t tid() const { return at<3>().as_uint32(); }
38475   bool has_cpu_mode() const { return at<5>().valid(); }
38476   int32_t cpu_mode() const { return at<5>().as_int32(); }
38477   bool has_callstack_iid() const { return at<4>().valid(); }
38478   uint64_t callstack_iid() const { return at<4>().as_uint64(); }
38479   bool has_unwind_error() const { return at<16>().valid(); }
38480   int32_t unwind_error() const { return at<16>().as_int32(); }
38481   bool has_kernel_records_lost() const { return at<17>().valid(); }
38482   uint64_t kernel_records_lost() const { return at<17>().as_uint64(); }
38483   bool has_sample_skipped_reason() const { return at<18>().valid(); }
38484   int32_t sample_skipped_reason() const { return at<18>().as_int32(); }
38485 };
38486 
38487 class PerfSample : public ::protozero::Message {
38488  public:
38489   using Decoder = PerfSample_Decoder;
38490   enum : int32_t {
38491     kCpuFieldNumber = 1,
38492     kPidFieldNumber = 2,
38493     kTidFieldNumber = 3,
38494     kCpuModeFieldNumber = 5,
38495     kCallstackIidFieldNumber = 4,
38496     kUnwindErrorFieldNumber = 16,
38497     kKernelRecordsLostFieldNumber = 17,
38498     kSampleSkippedReasonFieldNumber = 18,
38499   };
38500   using SampleSkipReason = ::perfetto::protos::pbzero::PerfSample_SampleSkipReason;
38501   static const SampleSkipReason PROFILER_SKIP_UNKNOWN = PerfSample_SampleSkipReason_PROFILER_SKIP_UNKNOWN;
38502   static const SampleSkipReason PROFILER_SKIP_READ_STAGE = PerfSample_SampleSkipReason_PROFILER_SKIP_READ_STAGE;
38503   static const SampleSkipReason PROFILER_SKIP_UNWIND_STAGE = PerfSample_SampleSkipReason_PROFILER_SKIP_UNWIND_STAGE;
38504   static const SampleSkipReason PROFILER_SKIP_UNWIND_ENQUEUE = PerfSample_SampleSkipReason_PROFILER_SKIP_UNWIND_ENQUEUE;
38505   void set_cpu(uint32_t value) {
38506     AppendVarInt(1, value);
38507   }
38508   void set_pid(uint32_t value) {
38509     AppendVarInt(2, value);
38510   }
38511   void set_tid(uint32_t value) {
38512     AppendVarInt(3, value);
38513   }
38514   void set_cpu_mode(::perfetto::protos::pbzero::Profiling_CpuMode value) {
38515     AppendTinyVarInt(5, value);
38516   }
38517   void set_callstack_iid(uint64_t value) {
38518     AppendVarInt(4, value);
38519   }
38520   void set_unwind_error(::perfetto::protos::pbzero::Profiling_StackUnwindError value) {
38521     AppendTinyVarInt(16, value);
38522   }
38523   void set_kernel_records_lost(uint64_t value) {
38524     AppendVarInt(17, value);
38525   }
38526   void set_sample_skipped_reason(::perfetto::protos::pbzero::PerfSample_SampleSkipReason value) {
38527     AppendTinyVarInt(18, value);
38528   }
38529 };
38530 
38531 class Profiling_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/0, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
38532  public:
38533   Profiling_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
38534   explicit Profiling_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
38535   explicit Profiling_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
38536 };
38537 
38538 class Profiling : public ::protozero::Message {
38539  public:
38540   using Decoder = Profiling_Decoder;
38541   using CpuMode = ::perfetto::protos::pbzero::Profiling_CpuMode;
38542   using StackUnwindError = ::perfetto::protos::pbzero::Profiling_StackUnwindError;
38543   static const CpuMode MODE_UNKNOWN = Profiling_CpuMode_MODE_UNKNOWN;
38544   static const CpuMode MODE_KERNEL = Profiling_CpuMode_MODE_KERNEL;
38545   static const CpuMode MODE_USER = Profiling_CpuMode_MODE_USER;
38546   static const CpuMode MODE_HYPERVISOR = Profiling_CpuMode_MODE_HYPERVISOR;
38547   static const CpuMode MODE_GUEST_KERNEL = Profiling_CpuMode_MODE_GUEST_KERNEL;
38548   static const CpuMode MODE_GUEST_USER = Profiling_CpuMode_MODE_GUEST_USER;
38549   static const StackUnwindError UNWIND_ERROR_UNKNOWN = Profiling_StackUnwindError_UNWIND_ERROR_UNKNOWN;
38550   static const StackUnwindError UNWIND_ERROR_NONE = Profiling_StackUnwindError_UNWIND_ERROR_NONE;
38551   static const StackUnwindError UNWIND_ERROR_MEMORY_INVALID = Profiling_StackUnwindError_UNWIND_ERROR_MEMORY_INVALID;
38552   static const StackUnwindError UNWIND_ERROR_UNWIND_INFO = Profiling_StackUnwindError_UNWIND_ERROR_UNWIND_INFO;
38553   static const StackUnwindError UNWIND_ERROR_UNSUPPORTED = Profiling_StackUnwindError_UNWIND_ERROR_UNSUPPORTED;
38554   static const StackUnwindError UNWIND_ERROR_INVALID_MAP = Profiling_StackUnwindError_UNWIND_ERROR_INVALID_MAP;
38555   static const StackUnwindError UNWIND_ERROR_MAX_FRAMES_EXCEEDED = Profiling_StackUnwindError_UNWIND_ERROR_MAX_FRAMES_EXCEEDED;
38556   static const StackUnwindError UNWIND_ERROR_REPEATED_FRAME = Profiling_StackUnwindError_UNWIND_ERROR_REPEATED_FRAME;
38557   static const StackUnwindError UNWIND_ERROR_INVALID_ELF = Profiling_StackUnwindError_UNWIND_ERROR_INVALID_ELF;
38558 };
38559 
38560 class StreamingProfilePacket_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
38561  public:
38562   StreamingProfilePacket_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
38563   explicit StreamingProfilePacket_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
38564   explicit StreamingProfilePacket_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
38565   bool has_callstack_iid() const { return at<1>().valid(); }
38566   ::protozero::RepeatedFieldIterator<uint64_t> callstack_iid() const { return GetRepeated<uint64_t>(1); }
38567   bool has_timestamp_delta_us() const { return at<2>().valid(); }
38568   ::protozero::RepeatedFieldIterator<int64_t> timestamp_delta_us() const { return GetRepeated<int64_t>(2); }
38569   bool has_process_priority() const { return at<3>().valid(); }
38570   int32_t process_priority() const { return at<3>().as_int32(); }
38571 };
38572 
38573 class StreamingProfilePacket : public ::protozero::Message {
38574  public:
38575   using Decoder = StreamingProfilePacket_Decoder;
38576   enum : int32_t {
38577     kCallstackIidFieldNumber = 1,
38578     kTimestampDeltaUsFieldNumber = 2,
38579     kProcessPriorityFieldNumber = 3,
38580   };
38581   void add_callstack_iid(uint64_t value) {
38582     AppendVarInt(1, value);
38583   }
38584   void add_timestamp_delta_us(int64_t value) {
38585     AppendVarInt(2, value);
38586   }
38587   void set_process_priority(int32_t value) {
38588     AppendVarInt(3, value);
38589   }
38590 };
38591 
38592 class ProfilePacket_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
38593  public:
38594   ProfilePacket_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
38595   explicit ProfilePacket_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
38596   explicit ProfilePacket_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
38597   bool has_strings() const { return at<1>().valid(); }
38598   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> strings() const { return GetRepeated<::protozero::ConstBytes>(1); }
38599   bool has_mappings() const { return at<4>().valid(); }
38600   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> mappings() const { return GetRepeated<::protozero::ConstBytes>(4); }
38601   bool has_frames() const { return at<2>().valid(); }
38602   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> frames() const { return GetRepeated<::protozero::ConstBytes>(2); }
38603   bool has_callstacks() const { return at<3>().valid(); }
38604   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> callstacks() const { return GetRepeated<::protozero::ConstBytes>(3); }
38605   bool has_process_dumps() const { return at<5>().valid(); }
38606   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> process_dumps() const { return GetRepeated<::protozero::ConstBytes>(5); }
38607   bool has_continued() const { return at<6>().valid(); }
38608   bool continued() const { return at<6>().as_bool(); }
38609   bool has_index() const { return at<7>().valid(); }
38610   uint64_t index() const { return at<7>().as_uint64(); }
38611 };
38612 
38613 class ProfilePacket : public ::protozero::Message {
38614  public:
38615   using Decoder = ProfilePacket_Decoder;
38616   enum : int32_t {
38617     kStringsFieldNumber = 1,
38618     kMappingsFieldNumber = 4,
38619     kFramesFieldNumber = 2,
38620     kCallstacksFieldNumber = 3,
38621     kProcessDumpsFieldNumber = 5,
38622     kContinuedFieldNumber = 6,
38623     kIndexFieldNumber = 7,
38624   };
38625   using HeapSample = ::perfetto::protos::pbzero::ProfilePacket_HeapSample;
38626   using Histogram = ::perfetto::protos::pbzero::ProfilePacket_Histogram;
38627   using ProcessStats = ::perfetto::protos::pbzero::ProfilePacket_ProcessStats;
38628   using ProcessHeapSamples = ::perfetto::protos::pbzero::ProfilePacket_ProcessHeapSamples;
38629   template <typename T = InternedString> T* add_strings() {
38630     return BeginNestedMessage<T>(1);
38631   }
38632 
38633   template <typename T = Mapping> T* add_mappings() {
38634     return BeginNestedMessage<T>(4);
38635   }
38636 
38637   template <typename T = Frame> T* add_frames() {
38638     return BeginNestedMessage<T>(2);
38639   }
38640 
38641   template <typename T = Callstack> T* add_callstacks() {
38642     return BeginNestedMessage<T>(3);
38643   }
38644 
38645   template <typename T = ProfilePacket_ProcessHeapSamples> T* add_process_dumps() {
38646     return BeginNestedMessage<T>(5);
38647   }
38648 
38649   void set_continued(bool value) {
38650     AppendTinyVarInt(6, value);
38651   }
38652   void set_index(uint64_t value) {
38653     AppendVarInt(7, value);
38654   }
38655 };
38656 
38657 class ProfilePacket_ProcessHeapSamples_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/11, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
38658  public:
38659   ProfilePacket_ProcessHeapSamples_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
38660   explicit ProfilePacket_ProcessHeapSamples_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
38661   explicit ProfilePacket_ProcessHeapSamples_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
38662   bool has_pid() const { return at<1>().valid(); }
38663   uint64_t pid() const { return at<1>().as_uint64(); }
38664   bool has_from_startup() const { return at<3>().valid(); }
38665   bool from_startup() const { return at<3>().as_bool(); }
38666   bool has_rejected_concurrent() const { return at<4>().valid(); }
38667   bool rejected_concurrent() const { return at<4>().as_bool(); }
38668   bool has_disconnected() const { return at<6>().valid(); }
38669   bool disconnected() const { return at<6>().as_bool(); }
38670   bool has_buffer_overran() const { return at<7>().valid(); }
38671   bool buffer_overran() const { return at<7>().as_bool(); }
38672   bool has_buffer_corrupted() const { return at<8>().valid(); }
38673   bool buffer_corrupted() const { return at<8>().as_bool(); }
38674   bool has_hit_guardrail() const { return at<10>().valid(); }
38675   bool hit_guardrail() const { return at<10>().as_bool(); }
38676   bool has_heap_name() const { return at<11>().valid(); }
38677   ::protozero::ConstChars heap_name() const { return at<11>().as_string(); }
38678   bool has_timestamp() const { return at<9>().valid(); }
38679   uint64_t timestamp() const { return at<9>().as_uint64(); }
38680   bool has_stats() const { return at<5>().valid(); }
38681   ::protozero::ConstBytes stats() const { return at<5>().as_bytes(); }
38682   bool has_samples() const { return at<2>().valid(); }
38683   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> samples() const { return GetRepeated<::protozero::ConstBytes>(2); }
38684 };
38685 
38686 class ProfilePacket_ProcessHeapSamples : public ::protozero::Message {
38687  public:
38688   using Decoder = ProfilePacket_ProcessHeapSamples_Decoder;
38689   enum : int32_t {
38690     kPidFieldNumber = 1,
38691     kFromStartupFieldNumber = 3,
38692     kRejectedConcurrentFieldNumber = 4,
38693     kDisconnectedFieldNumber = 6,
38694     kBufferOverranFieldNumber = 7,
38695     kBufferCorruptedFieldNumber = 8,
38696     kHitGuardrailFieldNumber = 10,
38697     kHeapNameFieldNumber = 11,
38698     kTimestampFieldNumber = 9,
38699     kStatsFieldNumber = 5,
38700     kSamplesFieldNumber = 2,
38701   };
38702   void set_pid(uint64_t value) {
38703     AppendVarInt(1, value);
38704   }
38705   void set_from_startup(bool value) {
38706     AppendTinyVarInt(3, value);
38707   }
38708   void set_rejected_concurrent(bool value) {
38709     AppendTinyVarInt(4, value);
38710   }
38711   void set_disconnected(bool value) {
38712     AppendTinyVarInt(6, value);
38713   }
38714   void set_buffer_overran(bool value) {
38715     AppendTinyVarInt(7, value);
38716   }
38717   void set_buffer_corrupted(bool value) {
38718     AppendTinyVarInt(8, value);
38719   }
38720   void set_hit_guardrail(bool value) {
38721     AppendTinyVarInt(10, value);
38722   }
38723   void set_heap_name(const std::string& value) {
38724     AppendBytes(11, value.data(), value.size());
38725   }
38726   void set_heap_name(const char* data, size_t size) {
38727     AppendBytes(11, data, size);
38728   }
38729   void set_timestamp(uint64_t value) {
38730     AppendVarInt(9, value);
38731   }
38732   template <typename T = ProfilePacket_ProcessStats> T* set_stats() {
38733     return BeginNestedMessage<T>(5);
38734   }
38735 
38736   template <typename T = ProfilePacket_HeapSample> T* add_samples() {
38737     return BeginNestedMessage<T>(2);
38738   }
38739 
38740 };
38741 
38742 class ProfilePacket_ProcessStats_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
38743  public:
38744   ProfilePacket_ProcessStats_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
38745   explicit ProfilePacket_ProcessStats_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
38746   explicit ProfilePacket_ProcessStats_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
38747   bool has_unwinding_errors() const { return at<1>().valid(); }
38748   uint64_t unwinding_errors() const { return at<1>().as_uint64(); }
38749   bool has_heap_samples() const { return at<2>().valid(); }
38750   uint64_t heap_samples() const { return at<2>().as_uint64(); }
38751   bool has_map_reparses() const { return at<3>().valid(); }
38752   uint64_t map_reparses() const { return at<3>().as_uint64(); }
38753   bool has_unwinding_time_us() const { return at<4>().valid(); }
38754   ::protozero::ConstBytes unwinding_time_us() const { return at<4>().as_bytes(); }
38755   bool has_total_unwinding_time_us() const { return at<5>().valid(); }
38756   uint64_t total_unwinding_time_us() const { return at<5>().as_uint64(); }
38757 };
38758 
38759 class ProfilePacket_ProcessStats : public ::protozero::Message {
38760  public:
38761   using Decoder = ProfilePacket_ProcessStats_Decoder;
38762   enum : int32_t {
38763     kUnwindingErrorsFieldNumber = 1,
38764     kHeapSamplesFieldNumber = 2,
38765     kMapReparsesFieldNumber = 3,
38766     kUnwindingTimeUsFieldNumber = 4,
38767     kTotalUnwindingTimeUsFieldNumber = 5,
38768   };
38769   void set_unwinding_errors(uint64_t value) {
38770     AppendVarInt(1, value);
38771   }
38772   void set_heap_samples(uint64_t value) {
38773     AppendVarInt(2, value);
38774   }
38775   void set_map_reparses(uint64_t value) {
38776     AppendVarInt(3, value);
38777   }
38778   template <typename T = ProfilePacket_Histogram> T* set_unwinding_time_us() {
38779     return BeginNestedMessage<T>(4);
38780   }
38781 
38782   void set_total_unwinding_time_us(uint64_t value) {
38783     AppendVarInt(5, value);
38784   }
38785 };
38786 
38787 class ProfilePacket_Histogram_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
38788  public:
38789   ProfilePacket_Histogram_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
38790   explicit ProfilePacket_Histogram_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
38791   explicit ProfilePacket_Histogram_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
38792   bool has_buckets() const { return at<1>().valid(); }
38793   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> buckets() const { return GetRepeated<::protozero::ConstBytes>(1); }
38794 };
38795 
38796 class ProfilePacket_Histogram : public ::protozero::Message {
38797  public:
38798   using Decoder = ProfilePacket_Histogram_Decoder;
38799   enum : int32_t {
38800     kBucketsFieldNumber = 1,
38801   };
38802   using Bucket = ::perfetto::protos::pbzero::ProfilePacket_Histogram_Bucket;
38803   template <typename T = ProfilePacket_Histogram_Bucket> T* add_buckets() {
38804     return BeginNestedMessage<T>(1);
38805   }
38806 
38807 };
38808 
38809 class ProfilePacket_Histogram_Bucket_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
38810  public:
38811   ProfilePacket_Histogram_Bucket_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
38812   explicit ProfilePacket_Histogram_Bucket_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
38813   explicit ProfilePacket_Histogram_Bucket_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
38814   bool has_upper_limit() const { return at<1>().valid(); }
38815   uint64_t upper_limit() const { return at<1>().as_uint64(); }
38816   bool has_max_bucket() const { return at<2>().valid(); }
38817   bool max_bucket() const { return at<2>().as_bool(); }
38818   bool has_count() const { return at<3>().valid(); }
38819   uint64_t count() const { return at<3>().as_uint64(); }
38820 };
38821 
38822 class ProfilePacket_Histogram_Bucket : public ::protozero::Message {
38823  public:
38824   using Decoder = ProfilePacket_Histogram_Bucket_Decoder;
38825   enum : int32_t {
38826     kUpperLimitFieldNumber = 1,
38827     kMaxBucketFieldNumber = 2,
38828     kCountFieldNumber = 3,
38829   };
38830   void set_upper_limit(uint64_t value) {
38831     AppendVarInt(1, value);
38832   }
38833   void set_max_bucket(bool value) {
38834     AppendTinyVarInt(2, value);
38835   }
38836   void set_count(uint64_t value) {
38837     AppendVarInt(3, value);
38838   }
38839 };
38840 
38841 class ProfilePacket_HeapSample_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/9, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
38842  public:
38843   ProfilePacket_HeapSample_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
38844   explicit ProfilePacket_HeapSample_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
38845   explicit ProfilePacket_HeapSample_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
38846   bool has_callstack_id() const { return at<1>().valid(); }
38847   uint64_t callstack_id() const { return at<1>().as_uint64(); }
38848   bool has_self_allocated() const { return at<2>().valid(); }
38849   uint64_t self_allocated() const { return at<2>().as_uint64(); }
38850   bool has_self_freed() const { return at<3>().valid(); }
38851   uint64_t self_freed() const { return at<3>().as_uint64(); }
38852   bool has_self_idle() const { return at<7>().valid(); }
38853   uint64_t self_idle() const { return at<7>().as_uint64(); }
38854   bool has_self_max() const { return at<8>().valid(); }
38855   uint64_t self_max() const { return at<8>().as_uint64(); }
38856   bool has_self_max_count() const { return at<9>().valid(); }
38857   uint64_t self_max_count() const { return at<9>().as_uint64(); }
38858   bool has_timestamp() const { return at<4>().valid(); }
38859   uint64_t timestamp() const { return at<4>().as_uint64(); }
38860   bool has_alloc_count() const { return at<5>().valid(); }
38861   uint64_t alloc_count() const { return at<5>().as_uint64(); }
38862   bool has_free_count() const { return at<6>().valid(); }
38863   uint64_t free_count() const { return at<6>().as_uint64(); }
38864 };
38865 
38866 class ProfilePacket_HeapSample : public ::protozero::Message {
38867  public:
38868   using Decoder = ProfilePacket_HeapSample_Decoder;
38869   enum : int32_t {
38870     kCallstackIdFieldNumber = 1,
38871     kSelfAllocatedFieldNumber = 2,
38872     kSelfFreedFieldNumber = 3,
38873     kSelfIdleFieldNumber = 7,
38874     kSelfMaxFieldNumber = 8,
38875     kSelfMaxCountFieldNumber = 9,
38876     kTimestampFieldNumber = 4,
38877     kAllocCountFieldNumber = 5,
38878     kFreeCountFieldNumber = 6,
38879   };
38880   void set_callstack_id(uint64_t value) {
38881     AppendVarInt(1, value);
38882   }
38883   void set_self_allocated(uint64_t value) {
38884     AppendVarInt(2, value);
38885   }
38886   void set_self_freed(uint64_t value) {
38887     AppendVarInt(3, value);
38888   }
38889   void set_self_idle(uint64_t value) {
38890     AppendVarInt(7, value);
38891   }
38892   void set_self_max(uint64_t value) {
38893     AppendVarInt(8, value);
38894   }
38895   void set_self_max_count(uint64_t value) {
38896     AppendVarInt(9, value);
38897   }
38898   void set_timestamp(uint64_t value) {
38899     AppendVarInt(4, value);
38900   }
38901   void set_alloc_count(uint64_t value) {
38902     AppendVarInt(5, value);
38903   }
38904   void set_free_count(uint64_t value) {
38905     AppendVarInt(6, value);
38906   }
38907 };
38908 
38909 } // Namespace.
38910 } // Namespace.
38911 } // Namespace.
38912 #endif  // Include guard.
38913 // gen_amalgamated begin header: gen/protos/perfetto/trace/profiling/smaps.pbzero.h
38914 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
38915 
38916 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PROFILING_SMAPS_PROTO_H_
38917 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PROFILING_SMAPS_PROTO_H_
38918 
38919 #include <stddef.h>
38920 #include <stdint.h>
38921 
38922 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
38923 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
38924 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
38925 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
38926 
38927 namespace perfetto {
38928 namespace protos {
38929 namespace pbzero {
38930 
38931 class SmapsEntry;
38932 
38933 class SmapsPacket_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
38934  public:
38935   SmapsPacket_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
38936   explicit SmapsPacket_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
38937   explicit SmapsPacket_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
38938   bool has_pid() const { return at<1>().valid(); }
38939   uint32_t pid() const { return at<1>().as_uint32(); }
38940   bool has_entries() const { return at<2>().valid(); }
38941   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> entries() const { return GetRepeated<::protozero::ConstBytes>(2); }
38942 };
38943 
38944 class SmapsPacket : public ::protozero::Message {
38945  public:
38946   using Decoder = SmapsPacket_Decoder;
38947   enum : int32_t {
38948     kPidFieldNumber = 1,
38949     kEntriesFieldNumber = 2,
38950   };
38951   void set_pid(uint32_t value) {
38952     AppendVarInt(1, value);
38953   }
38954   template <typename T = SmapsEntry> T* add_entries() {
38955     return BeginNestedMessage<T>(2);
38956   }
38957 
38958 };
38959 
38960 class SmapsEntry_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/15, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
38961  public:
38962   SmapsEntry_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
38963   explicit SmapsEntry_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
38964   explicit SmapsEntry_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
38965   bool has_path() const { return at<1>().valid(); }
38966   ::protozero::ConstChars path() const { return at<1>().as_string(); }
38967   bool has_size_kb() const { return at<2>().valid(); }
38968   uint64_t size_kb() const { return at<2>().as_uint64(); }
38969   bool has_private_dirty_kb() const { return at<3>().valid(); }
38970   uint64_t private_dirty_kb() const { return at<3>().as_uint64(); }
38971   bool has_swap_kb() const { return at<4>().valid(); }
38972   uint64_t swap_kb() const { return at<4>().as_uint64(); }
38973   bool has_file_name() const { return at<5>().valid(); }
38974   ::protozero::ConstChars file_name() const { return at<5>().as_string(); }
38975   bool has_start_address() const { return at<6>().valid(); }
38976   uint64_t start_address() const { return at<6>().as_uint64(); }
38977   bool has_module_timestamp() const { return at<7>().valid(); }
38978   uint64_t module_timestamp() const { return at<7>().as_uint64(); }
38979   bool has_module_debugid() const { return at<8>().valid(); }
38980   ::protozero::ConstChars module_debugid() const { return at<8>().as_string(); }
38981   bool has_module_debug_path() const { return at<9>().valid(); }
38982   ::protozero::ConstChars module_debug_path() const { return at<9>().as_string(); }
38983   bool has_protection_flags() const { return at<10>().valid(); }
38984   uint32_t protection_flags() const { return at<10>().as_uint32(); }
38985   bool has_private_clean_resident_kb() const { return at<11>().valid(); }
38986   uint64_t private_clean_resident_kb() const { return at<11>().as_uint64(); }
38987   bool has_shared_dirty_resident_kb() const { return at<12>().valid(); }
38988   uint64_t shared_dirty_resident_kb() const { return at<12>().as_uint64(); }
38989   bool has_shared_clean_resident_kb() const { return at<13>().valid(); }
38990   uint64_t shared_clean_resident_kb() const { return at<13>().as_uint64(); }
38991   bool has_locked_kb() const { return at<14>().valid(); }
38992   uint64_t locked_kb() const { return at<14>().as_uint64(); }
38993   bool has_proportional_resident_kb() const { return at<15>().valid(); }
38994   uint64_t proportional_resident_kb() const { return at<15>().as_uint64(); }
38995 };
38996 
38997 class SmapsEntry : public ::protozero::Message {
38998  public:
38999   using Decoder = SmapsEntry_Decoder;
39000   enum : int32_t {
39001     kPathFieldNumber = 1,
39002     kSizeKbFieldNumber = 2,
39003     kPrivateDirtyKbFieldNumber = 3,
39004     kSwapKbFieldNumber = 4,
39005     kFileNameFieldNumber = 5,
39006     kStartAddressFieldNumber = 6,
39007     kModuleTimestampFieldNumber = 7,
39008     kModuleDebugidFieldNumber = 8,
39009     kModuleDebugPathFieldNumber = 9,
39010     kProtectionFlagsFieldNumber = 10,
39011     kPrivateCleanResidentKbFieldNumber = 11,
39012     kSharedDirtyResidentKbFieldNumber = 12,
39013     kSharedCleanResidentKbFieldNumber = 13,
39014     kLockedKbFieldNumber = 14,
39015     kProportionalResidentKbFieldNumber = 15,
39016   };
39017   void set_path(const std::string& value) {
39018     AppendBytes(1, value.data(), value.size());
39019   }
39020   void set_path(const char* data, size_t size) {
39021     AppendBytes(1, data, size);
39022   }
39023   void set_size_kb(uint64_t value) {
39024     AppendVarInt(2, value);
39025   }
39026   void set_private_dirty_kb(uint64_t value) {
39027     AppendVarInt(3, value);
39028   }
39029   void set_swap_kb(uint64_t value) {
39030     AppendVarInt(4, value);
39031   }
39032   void set_file_name(const std::string& value) {
39033     AppendBytes(5, value.data(), value.size());
39034   }
39035   void set_file_name(const char* data, size_t size) {
39036     AppendBytes(5, data, size);
39037   }
39038   void set_start_address(uint64_t value) {
39039     AppendVarInt(6, value);
39040   }
39041   void set_module_timestamp(uint64_t value) {
39042     AppendVarInt(7, value);
39043   }
39044   void set_module_debugid(const std::string& value) {
39045     AppendBytes(8, value.data(), value.size());
39046   }
39047   void set_module_debugid(const char* data, size_t size) {
39048     AppendBytes(8, data, size);
39049   }
39050   void set_module_debug_path(const std::string& value) {
39051     AppendBytes(9, value.data(), value.size());
39052   }
39053   void set_module_debug_path(const char* data, size_t size) {
39054     AppendBytes(9, data, size);
39055   }
39056   void set_protection_flags(uint32_t value) {
39057     AppendVarInt(10, value);
39058   }
39059   void set_private_clean_resident_kb(uint64_t value) {
39060     AppendVarInt(11, value);
39061   }
39062   void set_shared_dirty_resident_kb(uint64_t value) {
39063     AppendVarInt(12, value);
39064   }
39065   void set_shared_clean_resident_kb(uint64_t value) {
39066     AppendVarInt(13, value);
39067   }
39068   void set_locked_kb(uint64_t value) {
39069     AppendVarInt(14, value);
39070   }
39071   void set_proportional_resident_kb(uint64_t value) {
39072     AppendVarInt(15, value);
39073   }
39074 };
39075 
39076 } // Namespace.
39077 } // Namespace.
39078 } // Namespace.
39079 #endif  // Include guard.
39080 // gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_compositor_scheduler_state.pbzero.h
39081 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
39082 
39083 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_COMPOSITOR_SCHEDULER_STATE_PROTO_H_
39084 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_COMPOSITOR_SCHEDULER_STATE_PROTO_H_
39085 
39086 #include <stddef.h>
39087 #include <stdint.h>
39088 
39089 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
39090 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
39091 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
39092 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
39093 
39094 namespace perfetto {
39095 namespace protos {
39096 namespace pbzero {
39097 
39098 class BeginFrameArgs;
39099 class BeginFrameObserverState;
39100 class BeginFrameSourceState;
39101 class BeginImplFrameArgs;
39102 class BeginImplFrameArgs_TimestampsInUs;
39103 class ChromeCompositorStateMachine;
39104 class ChromeCompositorStateMachine_MajorState;
39105 class ChromeCompositorStateMachine_MinorState;
39106 class CompositorTimingHistory;
39107 class SourceLocation;
39108 enum BeginFrameArgs_BeginFrameArgsType : int32_t;
39109 enum BeginImplFrameArgs_State : int32_t;
39110 enum ChromeCompositorSchedulerAction : int32_t;
39111 enum ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode : int32_t;
39112 enum ChromeCompositorStateMachine_MajorState_BeginImplFrameState : int32_t;
39113 enum ChromeCompositorStateMachine_MajorState_BeginMainFrameState : int32_t;
39114 enum ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState : int32_t;
39115 enum ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState : int32_t;
39116 enum ChromeCompositorStateMachine_MinorState_ScrollHandlerState : int32_t;
39117 enum ChromeCompositorStateMachine_MinorState_TreePriority : int32_t;
39118 
39119 enum ChromeCompositorSchedulerAction : int32_t {
39120   CC_SCHEDULER_ACTION_UNSPECIFIED = 0,
39121   CC_SCHEDULER_ACTION_NONE = 1,
39122   CC_SCHEDULER_ACTION_SEND_BEGIN_MAIN_FRAME = 2,
39123   CC_SCHEDULER_ACTION_COMMIT = 3,
39124   CC_SCHEDULER_ACTION_ACTIVATE_SYNC_TREE = 4,
39125   CC_SCHEDULER_ACTION_DRAW_IF_POSSIBLE = 5,
39126   CC_SCHEDULER_ACTION_DRAW_FORCED = 6,
39127   CC_SCHEDULER_ACTION_DRAW_ABORT = 7,
39128   CC_SCHEDULER_ACTION_BEGIN_LAYER_TREE_FRAME_SINK_CREATION = 8,
39129   CC_SCHEDULER_ACTION_PREPARE_TILES = 9,
39130   CC_SCHEDULER_ACTION_INVALIDATE_LAYER_TREE_FRAME_SINK = 10,
39131   CC_SCHEDULER_ACTION_PERFORM_IMPL_SIDE_INVALIDATION = 11,
39132   CC_SCHEDULER_ACTION_NOTIFY_BEGIN_MAIN_FRAME_NOT_EXPECTED_UNTIL = 12,
39133   CC_SCHEDULER_ACTION_NOTIFY_BEGIN_MAIN_FRAME_NOT_EXPECTED_SOON = 13,
39134 };
39135 
39136 const ChromeCompositorSchedulerAction ChromeCompositorSchedulerAction_MIN = CC_SCHEDULER_ACTION_UNSPECIFIED;
39137 const ChromeCompositorSchedulerAction ChromeCompositorSchedulerAction_MAX = CC_SCHEDULER_ACTION_NOTIFY_BEGIN_MAIN_FRAME_NOT_EXPECTED_SOON;
39138 
39139 enum BeginImplFrameArgs_State : int32_t {
39140   BeginImplFrameArgs_State_BEGIN_FRAME_FINISHED = 0,
39141   BeginImplFrameArgs_State_BEGIN_FRAME_USING = 1,
39142 };
39143 
39144 const BeginImplFrameArgs_State BeginImplFrameArgs_State_MIN = BeginImplFrameArgs_State_BEGIN_FRAME_FINISHED;
39145 const BeginImplFrameArgs_State BeginImplFrameArgs_State_MAX = BeginImplFrameArgs_State_BEGIN_FRAME_USING;
39146 
39147 enum BeginFrameArgs_BeginFrameArgsType : int32_t {
39148   BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_UNSPECIFIED = 0,
39149   BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_INVALID = 1,
39150   BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_NORMAL = 2,
39151   BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_MISSED = 3,
39152 };
39153 
39154 const BeginFrameArgs_BeginFrameArgsType BeginFrameArgs_BeginFrameArgsType_MIN = BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_UNSPECIFIED;
39155 const BeginFrameArgs_BeginFrameArgsType BeginFrameArgs_BeginFrameArgsType_MAX = BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_MISSED;
39156 
39157 enum ChromeCompositorStateMachine_MinorState_TreePriority : int32_t {
39158   ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_UNSPECIFIED = 0,
39159   ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_SAME_PRIORITY_FOR_BOTH_TREES = 1,
39160   ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_SMOOTHNESS_TAKES_PRIORITY = 2,
39161   ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_NEW_CONTENT_TAKES_PRIORITY = 3,
39162 };
39163 
39164 const ChromeCompositorStateMachine_MinorState_TreePriority ChromeCompositorStateMachine_MinorState_TreePriority_MIN = ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_UNSPECIFIED;
39165 const ChromeCompositorStateMachine_MinorState_TreePriority ChromeCompositorStateMachine_MinorState_TreePriority_MAX = ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_NEW_CONTENT_TAKES_PRIORITY;
39166 
39167 enum ChromeCompositorStateMachine_MinorState_ScrollHandlerState : int32_t {
39168   ChromeCompositorStateMachine_MinorState_ScrollHandlerState_SCROLL_HANDLER_UNSPECIFIED = 0,
39169   ChromeCompositorStateMachine_MinorState_ScrollHandlerState_SCROLL_AFFECTS_SCROLL_HANDLER = 1,
39170   ChromeCompositorStateMachine_MinorState_ScrollHandlerState_SCROLL_DOES_NOT_AFFECT_SCROLL_HANDLER = 2,
39171 };
39172 
39173 const ChromeCompositorStateMachine_MinorState_ScrollHandlerState ChromeCompositorStateMachine_MinorState_ScrollHandlerState_MIN = ChromeCompositorStateMachine_MinorState_ScrollHandlerState_SCROLL_HANDLER_UNSPECIFIED;
39174 const ChromeCompositorStateMachine_MinorState_ScrollHandlerState ChromeCompositorStateMachine_MinorState_ScrollHandlerState_MAX = ChromeCompositorStateMachine_MinorState_ScrollHandlerState_SCROLL_DOES_NOT_AFFECT_SCROLL_HANDLER;
39175 
39176 enum ChromeCompositorStateMachine_MajorState_BeginImplFrameState : int32_t {
39177   ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_UNSPECIFIED = 0,
39178   ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_IDLE = 1,
39179   ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_INSIDE_BEGIN_FRAME = 2,
39180   ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_INSIDE_DEADLINE = 3,
39181 };
39182 
39183 const ChromeCompositorStateMachine_MajorState_BeginImplFrameState ChromeCompositorStateMachine_MajorState_BeginImplFrameState_MIN = ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_UNSPECIFIED;
39184 const ChromeCompositorStateMachine_MajorState_BeginImplFrameState ChromeCompositorStateMachine_MajorState_BeginImplFrameState_MAX = ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_INSIDE_DEADLINE;
39185 
39186 enum ChromeCompositorStateMachine_MajorState_BeginMainFrameState : int32_t {
39187   ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_UNSPECIFIED = 0,
39188   ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_IDLE = 1,
39189   ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_SENT = 2,
39190   ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_READY_TO_COMMIT = 3,
39191 };
39192 
39193 const ChromeCompositorStateMachine_MajorState_BeginMainFrameState ChromeCompositorStateMachine_MajorState_BeginMainFrameState_MIN = ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_UNSPECIFIED;
39194 const ChromeCompositorStateMachine_MajorState_BeginMainFrameState ChromeCompositorStateMachine_MajorState_BeginMainFrameState_MAX = ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_READY_TO_COMMIT;
39195 
39196 enum ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState : int32_t {
39197   ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_UNSPECIFIED = 0,
39198   ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_NONE = 1,
39199   ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_ACTIVE = 2,
39200   ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_CREATING = 3,
39201   ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_WAITING_FOR_FIRST_COMMIT = 4,
39202   ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_WAITING_FOR_FIRST_ACTIVATION = 5,
39203 };
39204 
39205 const ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_MIN = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_UNSPECIFIED;
39206 const ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_MAX = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_WAITING_FOR_FIRST_ACTIVATION;
39207 
39208 enum ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState : int32_t {
39209   ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_UNSPECIFIED = 0,
39210   ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_IDLE = 1,
39211   ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_WAITING_FOR_COMMIT = 2,
39212   ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_WAITING_FOR_ACTIVATION = 3,
39213   ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_WAITING_FOR_DRAW = 4,
39214 };
39215 
39216 const ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_MIN = ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_UNSPECIFIED;
39217 const ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_MAX = ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_WAITING_FOR_DRAW;
39218 
39219 enum ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode : int32_t {
39220   ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_UNSPECIFIED = 0,
39221   ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_NONE = 1,
39222   ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_IMMEDIATE = 2,
39223   ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_REGULAR = 3,
39224   ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_LATE = 4,
39225   ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_BLOCKED = 5,
39226 };
39227 
39228 const ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_MIN = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_UNSPECIFIED;
39229 const ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_MAX = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_BLOCKED;
39230 
39231 class CompositorTimingHistory_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
39232  public:
39233   CompositorTimingHistory_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
39234   explicit CompositorTimingHistory_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
39235   explicit CompositorTimingHistory_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
39236   bool has_begin_main_frame_queue_critical_estimate_delta_us() const { return at<1>().valid(); }
39237   int64_t begin_main_frame_queue_critical_estimate_delta_us() const { return at<1>().as_int64(); }
39238   bool has_begin_main_frame_queue_not_critical_estimate_delta_us() const { return at<2>().valid(); }
39239   int64_t begin_main_frame_queue_not_critical_estimate_delta_us() const { return at<2>().as_int64(); }
39240   bool has_begin_main_frame_start_to_ready_to_commit_estimate_delta_us() const { return at<3>().valid(); }
39241   int64_t begin_main_frame_start_to_ready_to_commit_estimate_delta_us() const { return at<3>().as_int64(); }
39242   bool has_commit_to_ready_to_activate_estimate_delta_us() const { return at<4>().valid(); }
39243   int64_t commit_to_ready_to_activate_estimate_delta_us() const { return at<4>().as_int64(); }
39244   bool has_prepare_tiles_estimate_delta_us() const { return at<5>().valid(); }
39245   int64_t prepare_tiles_estimate_delta_us() const { return at<5>().as_int64(); }
39246   bool has_activate_estimate_delta_us() const { return at<6>().valid(); }
39247   int64_t activate_estimate_delta_us() const { return at<6>().as_int64(); }
39248   bool has_draw_estimate_delta_us() const { return at<7>().valid(); }
39249   int64_t draw_estimate_delta_us() const { return at<7>().as_int64(); }
39250 };
39251 
39252 class CompositorTimingHistory : public ::protozero::Message {
39253  public:
39254   using Decoder = CompositorTimingHistory_Decoder;
39255   enum : int32_t {
39256     kBeginMainFrameQueueCriticalEstimateDeltaUsFieldNumber = 1,
39257     kBeginMainFrameQueueNotCriticalEstimateDeltaUsFieldNumber = 2,
39258     kBeginMainFrameStartToReadyToCommitEstimateDeltaUsFieldNumber = 3,
39259     kCommitToReadyToActivateEstimateDeltaUsFieldNumber = 4,
39260     kPrepareTilesEstimateDeltaUsFieldNumber = 5,
39261     kActivateEstimateDeltaUsFieldNumber = 6,
39262     kDrawEstimateDeltaUsFieldNumber = 7,
39263   };
39264   void set_begin_main_frame_queue_critical_estimate_delta_us(int64_t value) {
39265     AppendVarInt(1, value);
39266   }
39267   void set_begin_main_frame_queue_not_critical_estimate_delta_us(int64_t value) {
39268     AppendVarInt(2, value);
39269   }
39270   void set_begin_main_frame_start_to_ready_to_commit_estimate_delta_us(int64_t value) {
39271     AppendVarInt(3, value);
39272   }
39273   void set_commit_to_ready_to_activate_estimate_delta_us(int64_t value) {
39274     AppendVarInt(4, value);
39275   }
39276   void set_prepare_tiles_estimate_delta_us(int64_t value) {
39277     AppendVarInt(5, value);
39278   }
39279   void set_activate_estimate_delta_us(int64_t value) {
39280     AppendVarInt(6, value);
39281   }
39282   void set_draw_estimate_delta_us(int64_t value) {
39283     AppendVarInt(7, value);
39284   }
39285 };
39286 
39287 class BeginFrameSourceState_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
39288  public:
39289   BeginFrameSourceState_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
39290   explicit BeginFrameSourceState_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
39291   explicit BeginFrameSourceState_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
39292   bool has_source_id() const { return at<1>().valid(); }
39293   uint32_t source_id() const { return at<1>().as_uint32(); }
39294   bool has_paused() const { return at<2>().valid(); }
39295   bool paused() const { return at<2>().as_bool(); }
39296   bool has_num_observers() const { return at<3>().valid(); }
39297   uint32_t num_observers() const { return at<3>().as_uint32(); }
39298   bool has_last_begin_frame_args() const { return at<4>().valid(); }
39299   ::protozero::ConstBytes last_begin_frame_args() const { return at<4>().as_bytes(); }
39300 };
39301 
39302 class BeginFrameSourceState : public ::protozero::Message {
39303  public:
39304   using Decoder = BeginFrameSourceState_Decoder;
39305   enum : int32_t {
39306     kSourceIdFieldNumber = 1,
39307     kPausedFieldNumber = 2,
39308     kNumObserversFieldNumber = 3,
39309     kLastBeginFrameArgsFieldNumber = 4,
39310   };
39311   void set_source_id(uint32_t value) {
39312     AppendVarInt(1, value);
39313   }
39314   void set_paused(bool value) {
39315     AppendTinyVarInt(2, value);
39316   }
39317   void set_num_observers(uint32_t value) {
39318     AppendVarInt(3, value);
39319   }
39320   template <typename T = BeginFrameArgs> T* set_last_begin_frame_args() {
39321     return BeginNestedMessage<T>(4);
39322   }
39323 
39324 };
39325 
39326 class BeginFrameObserverState_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
39327  public:
39328   BeginFrameObserverState_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
39329   explicit BeginFrameObserverState_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
39330   explicit BeginFrameObserverState_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
39331   bool has_dropped_begin_frame_args() const { return at<1>().valid(); }
39332   int64_t dropped_begin_frame_args() const { return at<1>().as_int64(); }
39333   bool has_last_begin_frame_args() const { return at<2>().valid(); }
39334   ::protozero::ConstBytes last_begin_frame_args() const { return at<2>().as_bytes(); }
39335 };
39336 
39337 class BeginFrameObserverState : public ::protozero::Message {
39338  public:
39339   using Decoder = BeginFrameObserverState_Decoder;
39340   enum : int32_t {
39341     kDroppedBeginFrameArgsFieldNumber = 1,
39342     kLastBeginFrameArgsFieldNumber = 2,
39343   };
39344   void set_dropped_begin_frame_args(int64_t value) {
39345     AppendVarInt(1, value);
39346   }
39347   template <typename T = BeginFrameArgs> T* set_last_begin_frame_args() {
39348     return BeginNestedMessage<T>(2);
39349   }
39350 
39351 };
39352 
39353 class BeginImplFrameArgs_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
39354  public:
39355   BeginImplFrameArgs_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
39356   explicit BeginImplFrameArgs_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
39357   explicit BeginImplFrameArgs_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
39358   bool has_updated_at_us() const { return at<1>().valid(); }
39359   int64_t updated_at_us() const { return at<1>().as_int64(); }
39360   bool has_finished_at_us() const { return at<2>().valid(); }
39361   int64_t finished_at_us() const { return at<2>().as_int64(); }
39362   bool has_state() const { return at<3>().valid(); }
39363   int32_t state() const { return at<3>().as_int32(); }
39364   bool has_current_args() const { return at<4>().valid(); }
39365   ::protozero::ConstBytes current_args() const { return at<4>().as_bytes(); }
39366   bool has_last_args() const { return at<5>().valid(); }
39367   ::protozero::ConstBytes last_args() const { return at<5>().as_bytes(); }
39368   bool has_timestamps_in_us() const { return at<6>().valid(); }
39369   ::protozero::ConstBytes timestamps_in_us() const { return at<6>().as_bytes(); }
39370 };
39371 
39372 class BeginImplFrameArgs : public ::protozero::Message {
39373  public:
39374   using Decoder = BeginImplFrameArgs_Decoder;
39375   enum : int32_t {
39376     kUpdatedAtUsFieldNumber = 1,
39377     kFinishedAtUsFieldNumber = 2,
39378     kStateFieldNumber = 3,
39379     kCurrentArgsFieldNumber = 4,
39380     kLastArgsFieldNumber = 5,
39381     kTimestampsInUsFieldNumber = 6,
39382   };
39383   using TimestampsInUs = ::perfetto::protos::pbzero::BeginImplFrameArgs_TimestampsInUs;
39384   using State = ::perfetto::protos::pbzero::BeginImplFrameArgs_State;
39385   static const State BEGIN_FRAME_FINISHED = BeginImplFrameArgs_State_BEGIN_FRAME_FINISHED;
39386   static const State BEGIN_FRAME_USING = BeginImplFrameArgs_State_BEGIN_FRAME_USING;
39387   void set_updated_at_us(int64_t value) {
39388     AppendVarInt(1, value);
39389   }
39390   void set_finished_at_us(int64_t value) {
39391     AppendVarInt(2, value);
39392   }
39393   void set_state(::perfetto::protos::pbzero::BeginImplFrameArgs_State value) {
39394     AppendTinyVarInt(3, value);
39395   }
39396   template <typename T = BeginFrameArgs> T* set_current_args() {
39397     return BeginNestedMessage<T>(4);
39398   }
39399 
39400   template <typename T = BeginFrameArgs> T* set_last_args() {
39401     return BeginNestedMessage<T>(5);
39402   }
39403 
39404   template <typename T = BeginImplFrameArgs_TimestampsInUs> T* set_timestamps_in_us() {
39405     return BeginNestedMessage<T>(6);
39406   }
39407 
39408 };
39409 
39410 class BeginImplFrameArgs_TimestampsInUs_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
39411  public:
39412   BeginImplFrameArgs_TimestampsInUs_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
39413   explicit BeginImplFrameArgs_TimestampsInUs_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
39414   explicit BeginImplFrameArgs_TimestampsInUs_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
39415   bool has_interval_delta() const { return at<1>().valid(); }
39416   int64_t interval_delta() const { return at<1>().as_int64(); }
39417   bool has_now_to_deadline_delta() const { return at<2>().valid(); }
39418   int64_t now_to_deadline_delta() const { return at<2>().as_int64(); }
39419   bool has_frame_time_to_now_delta() const { return at<3>().valid(); }
39420   int64_t frame_time_to_now_delta() const { return at<3>().as_int64(); }
39421   bool has_frame_time_to_deadline_delta() const { return at<4>().valid(); }
39422   int64_t frame_time_to_deadline_delta() const { return at<4>().as_int64(); }
39423   bool has_now() const { return at<5>().valid(); }
39424   int64_t now() const { return at<5>().as_int64(); }
39425   bool has_frame_time() const { return at<6>().valid(); }
39426   int64_t frame_time() const { return at<6>().as_int64(); }
39427   bool has_deadline() const { return at<7>().valid(); }
39428   int64_t deadline() const { return at<7>().as_int64(); }
39429 };
39430 
39431 class BeginImplFrameArgs_TimestampsInUs : public ::protozero::Message {
39432  public:
39433   using Decoder = BeginImplFrameArgs_TimestampsInUs_Decoder;
39434   enum : int32_t {
39435     kIntervalDeltaFieldNumber = 1,
39436     kNowToDeadlineDeltaFieldNumber = 2,
39437     kFrameTimeToNowDeltaFieldNumber = 3,
39438     kFrameTimeToDeadlineDeltaFieldNumber = 4,
39439     kNowFieldNumber = 5,
39440     kFrameTimeFieldNumber = 6,
39441     kDeadlineFieldNumber = 7,
39442   };
39443   void set_interval_delta(int64_t value) {
39444     AppendVarInt(1, value);
39445   }
39446   void set_now_to_deadline_delta(int64_t value) {
39447     AppendVarInt(2, value);
39448   }
39449   void set_frame_time_to_now_delta(int64_t value) {
39450     AppendVarInt(3, value);
39451   }
39452   void set_frame_time_to_deadline_delta(int64_t value) {
39453     AppendVarInt(4, value);
39454   }
39455   void set_now(int64_t value) {
39456     AppendVarInt(5, value);
39457   }
39458   void set_frame_time(int64_t value) {
39459     AppendVarInt(6, value);
39460   }
39461   void set_deadline(int64_t value) {
39462     AppendVarInt(7, value);
39463   }
39464 };
39465 
39466 class BeginFrameArgs_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/10, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
39467  public:
39468   BeginFrameArgs_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
39469   explicit BeginFrameArgs_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
39470   explicit BeginFrameArgs_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
39471   bool has_type() const { return at<1>().valid(); }
39472   int32_t type() const { return at<1>().as_int32(); }
39473   bool has_source_id() const { return at<2>().valid(); }
39474   uint64_t source_id() const { return at<2>().as_uint64(); }
39475   bool has_sequence_number() const { return at<3>().valid(); }
39476   uint64_t sequence_number() const { return at<3>().as_uint64(); }
39477   bool has_frame_time_us() const { return at<4>().valid(); }
39478   int64_t frame_time_us() const { return at<4>().as_int64(); }
39479   bool has_deadline_us() const { return at<5>().valid(); }
39480   int64_t deadline_us() const { return at<5>().as_int64(); }
39481   bool has_interval_delta_us() const { return at<6>().valid(); }
39482   int64_t interval_delta_us() const { return at<6>().as_int64(); }
39483   bool has_on_critical_path() const { return at<7>().valid(); }
39484   bool on_critical_path() const { return at<7>().as_bool(); }
39485   bool has_animate_only() const { return at<8>().valid(); }
39486   bool animate_only() const { return at<8>().as_bool(); }
39487   bool has_source_location_iid() const { return at<9>().valid(); }
39488   uint64_t source_location_iid() const { return at<9>().as_uint64(); }
39489   bool has_source_location() const { return at<10>().valid(); }
39490   ::protozero::ConstBytes source_location() const { return at<10>().as_bytes(); }
39491 };
39492 
39493 class BeginFrameArgs : public ::protozero::Message {
39494  public:
39495   using Decoder = BeginFrameArgs_Decoder;
39496   enum : int32_t {
39497     kTypeFieldNumber = 1,
39498     kSourceIdFieldNumber = 2,
39499     kSequenceNumberFieldNumber = 3,
39500     kFrameTimeUsFieldNumber = 4,
39501     kDeadlineUsFieldNumber = 5,
39502     kIntervalDeltaUsFieldNumber = 6,
39503     kOnCriticalPathFieldNumber = 7,
39504     kAnimateOnlyFieldNumber = 8,
39505     kSourceLocationIidFieldNumber = 9,
39506     kSourceLocationFieldNumber = 10,
39507   };
39508   using BeginFrameArgsType = ::perfetto::protos::pbzero::BeginFrameArgs_BeginFrameArgsType;
39509   static const BeginFrameArgsType BEGIN_FRAME_ARGS_TYPE_UNSPECIFIED = BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_UNSPECIFIED;
39510   static const BeginFrameArgsType BEGIN_FRAME_ARGS_TYPE_INVALID = BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_INVALID;
39511   static const BeginFrameArgsType BEGIN_FRAME_ARGS_TYPE_NORMAL = BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_NORMAL;
39512   static const BeginFrameArgsType BEGIN_FRAME_ARGS_TYPE_MISSED = BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_MISSED;
39513   void set_type(::perfetto::protos::pbzero::BeginFrameArgs_BeginFrameArgsType value) {
39514     AppendTinyVarInt(1, value);
39515   }
39516   void set_source_id(uint64_t value) {
39517     AppendVarInt(2, value);
39518   }
39519   void set_sequence_number(uint64_t value) {
39520     AppendVarInt(3, value);
39521   }
39522   void set_frame_time_us(int64_t value) {
39523     AppendVarInt(4, value);
39524   }
39525   void set_deadline_us(int64_t value) {
39526     AppendVarInt(5, value);
39527   }
39528   void set_interval_delta_us(int64_t value) {
39529     AppendVarInt(6, value);
39530   }
39531   void set_on_critical_path(bool value) {
39532     AppendTinyVarInt(7, value);
39533   }
39534   void set_animate_only(bool value) {
39535     AppendTinyVarInt(8, value);
39536   }
39537   void set_source_location_iid(uint64_t value) {
39538     AppendVarInt(9, value);
39539   }
39540   template <typename T = SourceLocation> T* set_source_location() {
39541     return BeginNestedMessage<T>(10);
39542   }
39543 
39544 };
39545 
39546 class ChromeCompositorStateMachine_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
39547  public:
39548   ChromeCompositorStateMachine_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
39549   explicit ChromeCompositorStateMachine_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
39550   explicit ChromeCompositorStateMachine_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
39551   bool has_major_state() const { return at<1>().valid(); }
39552   ::protozero::ConstBytes major_state() const { return at<1>().as_bytes(); }
39553   bool has_minor_state() const { return at<2>().valid(); }
39554   ::protozero::ConstBytes minor_state() const { return at<2>().as_bytes(); }
39555 };
39556 
39557 class ChromeCompositorStateMachine : public ::protozero::Message {
39558  public:
39559   using Decoder = ChromeCompositorStateMachine_Decoder;
39560   enum : int32_t {
39561     kMajorStateFieldNumber = 1,
39562     kMinorStateFieldNumber = 2,
39563   };
39564   using MajorState = ::perfetto::protos::pbzero::ChromeCompositorStateMachine_MajorState;
39565   using MinorState = ::perfetto::protos::pbzero::ChromeCompositorStateMachine_MinorState;
39566   template <typename T = ChromeCompositorStateMachine_MajorState> T* set_major_state() {
39567     return BeginNestedMessage<T>(1);
39568   }
39569 
39570   template <typename T = ChromeCompositorStateMachine_MinorState> T* set_minor_state() {
39571     return BeginNestedMessage<T>(2);
39572   }
39573 
39574 };
39575 
39576 class ChromeCompositorStateMachine_MinorState_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/46, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
39577  public:
39578   ChromeCompositorStateMachine_MinorState_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
39579   explicit ChromeCompositorStateMachine_MinorState_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
39580   explicit ChromeCompositorStateMachine_MinorState_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
39581   bool has_commit_count() const { return at<1>().valid(); }
39582   int32_t commit_count() const { return at<1>().as_int32(); }
39583   bool has_current_frame_number() const { return at<2>().valid(); }
39584   int32_t current_frame_number() const { return at<2>().as_int32(); }
39585   bool has_last_frame_number_submit_performed() const { return at<3>().valid(); }
39586   int32_t last_frame_number_submit_performed() const { return at<3>().as_int32(); }
39587   bool has_last_frame_number_draw_performed() const { return at<4>().valid(); }
39588   int32_t last_frame_number_draw_performed() const { return at<4>().as_int32(); }
39589   bool has_last_frame_number_begin_main_frame_sent() const { return at<5>().valid(); }
39590   int32_t last_frame_number_begin_main_frame_sent() const { return at<5>().as_int32(); }
39591   bool has_did_draw() const { return at<6>().valid(); }
39592   bool did_draw() const { return at<6>().as_bool(); }
39593   bool has_did_send_begin_main_frame_for_current_frame() const { return at<7>().valid(); }
39594   bool did_send_begin_main_frame_for_current_frame() const { return at<7>().as_bool(); }
39595   bool has_did_notify_begin_main_frame_not_expected_until() const { return at<8>().valid(); }
39596   bool did_notify_begin_main_frame_not_expected_until() const { return at<8>().as_bool(); }
39597   bool has_did_notify_begin_main_frame_not_expected_soon() const { return at<9>().valid(); }
39598   bool did_notify_begin_main_frame_not_expected_soon() const { return at<9>().as_bool(); }
39599   bool has_wants_begin_main_frame_not_expected() const { return at<10>().valid(); }
39600   bool wants_begin_main_frame_not_expected() const { return at<10>().as_bool(); }
39601   bool has_did_commit_during_frame() const { return at<11>().valid(); }
39602   bool did_commit_during_frame() const { return at<11>().as_bool(); }
39603   bool has_did_invalidate_layer_tree_frame_sink() const { return at<12>().valid(); }
39604   bool did_invalidate_layer_tree_frame_sink() const { return at<12>().as_bool(); }
39605   bool has_did_perform_impl_side_invalidaion() const { return at<13>().valid(); }
39606   bool did_perform_impl_side_invalidaion() const { return at<13>().as_bool(); }
39607   bool has_did_prepare_tiles() const { return at<14>().valid(); }
39608   bool did_prepare_tiles() const { return at<14>().as_bool(); }
39609   bool has_consecutive_checkerboard_animations() const { return at<15>().valid(); }
39610   int32_t consecutive_checkerboard_animations() const { return at<15>().as_int32(); }
39611   bool has_pending_submit_frames() const { return at<16>().valid(); }
39612   int32_t pending_submit_frames() const { return at<16>().as_int32(); }
39613   bool has_submit_frames_with_current_layer_tree_frame_sink() const { return at<17>().valid(); }
39614   int32_t submit_frames_with_current_layer_tree_frame_sink() const { return at<17>().as_int32(); }
39615   bool has_needs_redraw() const { return at<18>().valid(); }
39616   bool needs_redraw() const { return at<18>().as_bool(); }
39617   bool has_needs_prepare_tiles() const { return at<19>().valid(); }
39618   bool needs_prepare_tiles() const { return at<19>().as_bool(); }
39619   bool has_needs_begin_main_frame() const { return at<20>().valid(); }
39620   bool needs_begin_main_frame() const { return at<20>().as_bool(); }
39621   bool has_needs_one_begin_impl_frame() const { return at<21>().valid(); }
39622   bool needs_one_begin_impl_frame() const { return at<21>().as_bool(); }
39623   bool has_visible() const { return at<22>().valid(); }
39624   bool visible() const { return at<22>().as_bool(); }
39625   bool has_begin_frame_source_paused() const { return at<23>().valid(); }
39626   bool begin_frame_source_paused() const { return at<23>().as_bool(); }
39627   bool has_can_draw() const { return at<24>().valid(); }
39628   bool can_draw() const { return at<24>().as_bool(); }
39629   bool has_resourceless_draw() const { return at<25>().valid(); }
39630   bool resourceless_draw() const { return at<25>().as_bool(); }
39631   bool has_has_pending_tree() const { return at<26>().valid(); }
39632   bool has_pending_tree() const { return at<26>().as_bool(); }
39633   bool has_pending_tree_is_ready_for_activation() const { return at<27>().valid(); }
39634   bool pending_tree_is_ready_for_activation() const { return at<27>().as_bool(); }
39635   bool has_active_tree_needs_first_draw() const { return at<28>().valid(); }
39636   bool active_tree_needs_first_draw() const { return at<28>().as_bool(); }
39637   bool has_active_tree_is_ready_to_draw() const { return at<29>().valid(); }
39638   bool active_tree_is_ready_to_draw() const { return at<29>().as_bool(); }
39639   bool has_did_create_and_initialize_first_layer_tree_frame_sink() const { return at<30>().valid(); }
39640   bool did_create_and_initialize_first_layer_tree_frame_sink() const { return at<30>().as_bool(); }
39641   bool has_tree_priority() const { return at<31>().valid(); }
39642   int32_t tree_priority() const { return at<31>().as_int32(); }
39643   bool has_scroll_handler_state() const { return at<32>().valid(); }
39644   int32_t scroll_handler_state() const { return at<32>().as_int32(); }
39645   bool has_critical_begin_main_frame_to_activate_is_fast() const { return at<33>().valid(); }
39646   bool critical_begin_main_frame_to_activate_is_fast() const { return at<33>().as_bool(); }
39647   bool has_main_thread_missed_last_deadline() const { return at<34>().valid(); }
39648   bool main_thread_missed_last_deadline() const { return at<34>().as_bool(); }
39649   bool has_skip_next_begin_main_frame_to_reduce_latency() const { return at<35>().valid(); }
39650   bool skip_next_begin_main_frame_to_reduce_latency() const { return at<35>().as_bool(); }
39651   bool has_video_needs_begin_frames() const { return at<36>().valid(); }
39652   bool video_needs_begin_frames() const { return at<36>().as_bool(); }
39653   bool has_defer_begin_main_frame() const { return at<37>().valid(); }
39654   bool defer_begin_main_frame() const { return at<37>().as_bool(); }
39655   bool has_last_commit_had_no_updates() const { return at<38>().valid(); }
39656   bool last_commit_had_no_updates() const { return at<38>().as_bool(); }
39657   bool has_did_draw_in_last_frame() const { return at<39>().valid(); }
39658   bool did_draw_in_last_frame() const { return at<39>().as_bool(); }
39659   bool has_did_submit_in_last_frame() const { return at<40>().valid(); }
39660   bool did_submit_in_last_frame() const { return at<40>().as_bool(); }
39661   bool has_needs_impl_side_invalidation() const { return at<41>().valid(); }
39662   bool needs_impl_side_invalidation() const { return at<41>().as_bool(); }
39663   bool has_current_pending_tree_is_impl_side() const { return at<42>().valid(); }
39664   bool current_pending_tree_is_impl_side() const { return at<42>().as_bool(); }
39665   bool has_previous_pending_tree_was_impl_side() const { return at<43>().valid(); }
39666   bool previous_pending_tree_was_impl_side() const { return at<43>().as_bool(); }
39667   bool has_processing_animation_worklets_for_active_tree() const { return at<44>().valid(); }
39668   bool processing_animation_worklets_for_active_tree() const { return at<44>().as_bool(); }
39669   bool has_processing_animation_worklets_for_pending_tree() const { return at<45>().valid(); }
39670   bool processing_animation_worklets_for_pending_tree() const { return at<45>().as_bool(); }
39671   bool has_processing_paint_worklets_for_pending_tree() const { return at<46>().valid(); }
39672   bool processing_paint_worklets_for_pending_tree() const { return at<46>().as_bool(); }
39673 };
39674 
39675 class ChromeCompositorStateMachine_MinorState : public ::protozero::Message {
39676  public:
39677   using Decoder = ChromeCompositorStateMachine_MinorState_Decoder;
39678   enum : int32_t {
39679     kCommitCountFieldNumber = 1,
39680     kCurrentFrameNumberFieldNumber = 2,
39681     kLastFrameNumberSubmitPerformedFieldNumber = 3,
39682     kLastFrameNumberDrawPerformedFieldNumber = 4,
39683     kLastFrameNumberBeginMainFrameSentFieldNumber = 5,
39684     kDidDrawFieldNumber = 6,
39685     kDidSendBeginMainFrameForCurrentFrameFieldNumber = 7,
39686     kDidNotifyBeginMainFrameNotExpectedUntilFieldNumber = 8,
39687     kDidNotifyBeginMainFrameNotExpectedSoonFieldNumber = 9,
39688     kWantsBeginMainFrameNotExpectedFieldNumber = 10,
39689     kDidCommitDuringFrameFieldNumber = 11,
39690     kDidInvalidateLayerTreeFrameSinkFieldNumber = 12,
39691     kDidPerformImplSideInvalidaionFieldNumber = 13,
39692     kDidPrepareTilesFieldNumber = 14,
39693     kConsecutiveCheckerboardAnimationsFieldNumber = 15,
39694     kPendingSubmitFramesFieldNumber = 16,
39695     kSubmitFramesWithCurrentLayerTreeFrameSinkFieldNumber = 17,
39696     kNeedsRedrawFieldNumber = 18,
39697     kNeedsPrepareTilesFieldNumber = 19,
39698     kNeedsBeginMainFrameFieldNumber = 20,
39699     kNeedsOneBeginImplFrameFieldNumber = 21,
39700     kVisibleFieldNumber = 22,
39701     kBeginFrameSourcePausedFieldNumber = 23,
39702     kCanDrawFieldNumber = 24,
39703     kResourcelessDrawFieldNumber = 25,
39704     kHasPendingTreeFieldNumber = 26,
39705     kPendingTreeIsReadyForActivationFieldNumber = 27,
39706     kActiveTreeNeedsFirstDrawFieldNumber = 28,
39707     kActiveTreeIsReadyToDrawFieldNumber = 29,
39708     kDidCreateAndInitializeFirstLayerTreeFrameSinkFieldNumber = 30,
39709     kTreePriorityFieldNumber = 31,
39710     kScrollHandlerStateFieldNumber = 32,
39711     kCriticalBeginMainFrameToActivateIsFastFieldNumber = 33,
39712     kMainThreadMissedLastDeadlineFieldNumber = 34,
39713     kSkipNextBeginMainFrameToReduceLatencyFieldNumber = 35,
39714     kVideoNeedsBeginFramesFieldNumber = 36,
39715     kDeferBeginMainFrameFieldNumber = 37,
39716     kLastCommitHadNoUpdatesFieldNumber = 38,
39717     kDidDrawInLastFrameFieldNumber = 39,
39718     kDidSubmitInLastFrameFieldNumber = 40,
39719     kNeedsImplSideInvalidationFieldNumber = 41,
39720     kCurrentPendingTreeIsImplSideFieldNumber = 42,
39721     kPreviousPendingTreeWasImplSideFieldNumber = 43,
39722     kProcessingAnimationWorkletsForActiveTreeFieldNumber = 44,
39723     kProcessingAnimationWorkletsForPendingTreeFieldNumber = 45,
39724     kProcessingPaintWorkletsForPendingTreeFieldNumber = 46,
39725   };
39726   using TreePriority = ::perfetto::protos::pbzero::ChromeCompositorStateMachine_MinorState_TreePriority;
39727   using ScrollHandlerState = ::perfetto::protos::pbzero::ChromeCompositorStateMachine_MinorState_ScrollHandlerState;
39728   static const TreePriority TREE_PRIORITY_UNSPECIFIED = ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_UNSPECIFIED;
39729   static const TreePriority TREE_PRIORITY_SAME_PRIORITY_FOR_BOTH_TREES = ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_SAME_PRIORITY_FOR_BOTH_TREES;
39730   static const TreePriority TREE_PRIORITY_SMOOTHNESS_TAKES_PRIORITY = ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_SMOOTHNESS_TAKES_PRIORITY;
39731   static const TreePriority TREE_PRIORITY_NEW_CONTENT_TAKES_PRIORITY = ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_NEW_CONTENT_TAKES_PRIORITY;
39732   static const ScrollHandlerState SCROLL_HANDLER_UNSPECIFIED = ChromeCompositorStateMachine_MinorState_ScrollHandlerState_SCROLL_HANDLER_UNSPECIFIED;
39733   static const ScrollHandlerState SCROLL_AFFECTS_SCROLL_HANDLER = ChromeCompositorStateMachine_MinorState_ScrollHandlerState_SCROLL_AFFECTS_SCROLL_HANDLER;
39734   static const ScrollHandlerState SCROLL_DOES_NOT_AFFECT_SCROLL_HANDLER = ChromeCompositorStateMachine_MinorState_ScrollHandlerState_SCROLL_DOES_NOT_AFFECT_SCROLL_HANDLER;
39735   void set_commit_count(int32_t value) {
39736     AppendVarInt(1, value);
39737   }
39738   void set_current_frame_number(int32_t value) {
39739     AppendVarInt(2, value);
39740   }
39741   void set_last_frame_number_submit_performed(int32_t value) {
39742     AppendVarInt(3, value);
39743   }
39744   void set_last_frame_number_draw_performed(int32_t value) {
39745     AppendVarInt(4, value);
39746   }
39747   void set_last_frame_number_begin_main_frame_sent(int32_t value) {
39748     AppendVarInt(5, value);
39749   }
39750   void set_did_draw(bool value) {
39751     AppendTinyVarInt(6, value);
39752   }
39753   void set_did_send_begin_main_frame_for_current_frame(bool value) {
39754     AppendTinyVarInt(7, value);
39755   }
39756   void set_did_notify_begin_main_frame_not_expected_until(bool value) {
39757     AppendTinyVarInt(8, value);
39758   }
39759   void set_did_notify_begin_main_frame_not_expected_soon(bool value) {
39760     AppendTinyVarInt(9, value);
39761   }
39762   void set_wants_begin_main_frame_not_expected(bool value) {
39763     AppendTinyVarInt(10, value);
39764   }
39765   void set_did_commit_during_frame(bool value) {
39766     AppendTinyVarInt(11, value);
39767   }
39768   void set_did_invalidate_layer_tree_frame_sink(bool value) {
39769     AppendTinyVarInt(12, value);
39770   }
39771   void set_did_perform_impl_side_invalidaion(bool value) {
39772     AppendTinyVarInt(13, value);
39773   }
39774   void set_did_prepare_tiles(bool value) {
39775     AppendTinyVarInt(14, value);
39776   }
39777   void set_consecutive_checkerboard_animations(int32_t value) {
39778     AppendVarInt(15, value);
39779   }
39780   void set_pending_submit_frames(int32_t value) {
39781     AppendVarInt(16, value);
39782   }
39783   void set_submit_frames_with_current_layer_tree_frame_sink(int32_t value) {
39784     AppendVarInt(17, value);
39785   }
39786   void set_needs_redraw(bool value) {
39787     AppendTinyVarInt(18, value);
39788   }
39789   void set_needs_prepare_tiles(bool value) {
39790     AppendTinyVarInt(19, value);
39791   }
39792   void set_needs_begin_main_frame(bool value) {
39793     AppendTinyVarInt(20, value);
39794   }
39795   void set_needs_one_begin_impl_frame(bool value) {
39796     AppendTinyVarInt(21, value);
39797   }
39798   void set_visible(bool value) {
39799     AppendTinyVarInt(22, value);
39800   }
39801   void set_begin_frame_source_paused(bool value) {
39802     AppendTinyVarInt(23, value);
39803   }
39804   void set_can_draw(bool value) {
39805     AppendTinyVarInt(24, value);
39806   }
39807   void set_resourceless_draw(bool value) {
39808     AppendTinyVarInt(25, value);
39809   }
39810   void set_has_pending_tree(bool value) {
39811     AppendTinyVarInt(26, value);
39812   }
39813   void set_pending_tree_is_ready_for_activation(bool value) {
39814     AppendTinyVarInt(27, value);
39815   }
39816   void set_active_tree_needs_first_draw(bool value) {
39817     AppendTinyVarInt(28, value);
39818   }
39819   void set_active_tree_is_ready_to_draw(bool value) {
39820     AppendTinyVarInt(29, value);
39821   }
39822   void set_did_create_and_initialize_first_layer_tree_frame_sink(bool value) {
39823     AppendTinyVarInt(30, value);
39824   }
39825   void set_tree_priority(::perfetto::protos::pbzero::ChromeCompositorStateMachine_MinorState_TreePriority value) {
39826     AppendTinyVarInt(31, value);
39827   }
39828   void set_scroll_handler_state(::perfetto::protos::pbzero::ChromeCompositorStateMachine_MinorState_ScrollHandlerState value) {
39829     AppendTinyVarInt(32, value);
39830   }
39831   void set_critical_begin_main_frame_to_activate_is_fast(bool value) {
39832     AppendTinyVarInt(33, value);
39833   }
39834   void set_main_thread_missed_last_deadline(bool value) {
39835     AppendTinyVarInt(34, value);
39836   }
39837   void set_skip_next_begin_main_frame_to_reduce_latency(bool value) {
39838     AppendTinyVarInt(35, value);
39839   }
39840   void set_video_needs_begin_frames(bool value) {
39841     AppendTinyVarInt(36, value);
39842   }
39843   void set_defer_begin_main_frame(bool value) {
39844     AppendTinyVarInt(37, value);
39845   }
39846   void set_last_commit_had_no_updates(bool value) {
39847     AppendTinyVarInt(38, value);
39848   }
39849   void set_did_draw_in_last_frame(bool value) {
39850     AppendTinyVarInt(39, value);
39851   }
39852   void set_did_submit_in_last_frame(bool value) {
39853     AppendTinyVarInt(40, value);
39854   }
39855   void set_needs_impl_side_invalidation(bool value) {
39856     AppendTinyVarInt(41, value);
39857   }
39858   void set_current_pending_tree_is_impl_side(bool value) {
39859     AppendTinyVarInt(42, value);
39860   }
39861   void set_previous_pending_tree_was_impl_side(bool value) {
39862     AppendTinyVarInt(43, value);
39863   }
39864   void set_processing_animation_worklets_for_active_tree(bool value) {
39865     AppendTinyVarInt(44, value);
39866   }
39867   void set_processing_animation_worklets_for_pending_tree(bool value) {
39868     AppendTinyVarInt(45, value);
39869   }
39870   void set_processing_paint_worklets_for_pending_tree(bool value) {
39871     AppendTinyVarInt(46, value);
39872   }
39873 };
39874 
39875 class ChromeCompositorStateMachine_MajorState_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
39876  public:
39877   ChromeCompositorStateMachine_MajorState_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
39878   explicit ChromeCompositorStateMachine_MajorState_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
39879   explicit ChromeCompositorStateMachine_MajorState_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
39880   bool has_next_action() const { return at<1>().valid(); }
39881   int32_t next_action() const { return at<1>().as_int32(); }
39882   bool has_begin_impl_frame_state() const { return at<2>().valid(); }
39883   int32_t begin_impl_frame_state() const { return at<2>().as_int32(); }
39884   bool has_begin_main_frame_state() const { return at<3>().valid(); }
39885   int32_t begin_main_frame_state() const { return at<3>().as_int32(); }
39886   bool has_layer_tree_frame_sink_state() const { return at<4>().valid(); }
39887   int32_t layer_tree_frame_sink_state() const { return at<4>().as_int32(); }
39888   bool has_forced_redraw_state() const { return at<5>().valid(); }
39889   int32_t forced_redraw_state() const { return at<5>().as_int32(); }
39890 };
39891 
39892 class ChromeCompositorStateMachine_MajorState : public ::protozero::Message {
39893  public:
39894   using Decoder = ChromeCompositorStateMachine_MajorState_Decoder;
39895   enum : int32_t {
39896     kNextActionFieldNumber = 1,
39897     kBeginImplFrameStateFieldNumber = 2,
39898     kBeginMainFrameStateFieldNumber = 3,
39899     kLayerTreeFrameSinkStateFieldNumber = 4,
39900     kForcedRedrawStateFieldNumber = 5,
39901   };
39902   using BeginImplFrameState = ::perfetto::protos::pbzero::ChromeCompositorStateMachine_MajorState_BeginImplFrameState;
39903   using BeginMainFrameState = ::perfetto::protos::pbzero::ChromeCompositorStateMachine_MajorState_BeginMainFrameState;
39904   using LayerTreeFrameSinkState = ::perfetto::protos::pbzero::ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState;
39905   using ForcedRedrawOnTimeoutState = ::perfetto::protos::pbzero::ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState;
39906   static const BeginImplFrameState BEGIN_IMPL_FRAME_UNSPECIFIED = ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_UNSPECIFIED;
39907   static const BeginImplFrameState BEGIN_IMPL_FRAME_IDLE = ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_IDLE;
39908   static const BeginImplFrameState BEGIN_IMPL_FRAME_INSIDE_BEGIN_FRAME = ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_INSIDE_BEGIN_FRAME;
39909   static const BeginImplFrameState BEGIN_IMPL_FRAME_INSIDE_DEADLINE = ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_INSIDE_DEADLINE;
39910   static const BeginMainFrameState BEGIN_MAIN_FRAME_UNSPECIFIED = ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_UNSPECIFIED;
39911   static const BeginMainFrameState BEGIN_MAIN_FRAME_IDLE = ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_IDLE;
39912   static const BeginMainFrameState BEGIN_MAIN_FRAME_SENT = ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_SENT;
39913   static const BeginMainFrameState BEGIN_MAIN_FRAME_READY_TO_COMMIT = ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_READY_TO_COMMIT;
39914   static const LayerTreeFrameSinkState LAYER_TREE_FRAME_UNSPECIFIED = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_UNSPECIFIED;
39915   static const LayerTreeFrameSinkState LAYER_TREE_FRAME_NONE = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_NONE;
39916   static const LayerTreeFrameSinkState LAYER_TREE_FRAME_ACTIVE = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_ACTIVE;
39917   static const LayerTreeFrameSinkState LAYER_TREE_FRAME_CREATING = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_CREATING;
39918   static const LayerTreeFrameSinkState LAYER_TREE_FRAME_WAITING_FOR_FIRST_COMMIT = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_WAITING_FOR_FIRST_COMMIT;
39919   static const LayerTreeFrameSinkState LAYER_TREE_FRAME_WAITING_FOR_FIRST_ACTIVATION = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_WAITING_FOR_FIRST_ACTIVATION;
39920   static const ForcedRedrawOnTimeoutState FORCED_REDRAW_UNSPECIFIED = ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_UNSPECIFIED;
39921   static const ForcedRedrawOnTimeoutState FORCED_REDRAW_IDLE = ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_IDLE;
39922   static const ForcedRedrawOnTimeoutState FORCED_REDRAW_WAITING_FOR_COMMIT = ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_WAITING_FOR_COMMIT;
39923   static const ForcedRedrawOnTimeoutState FORCED_REDRAW_WAITING_FOR_ACTIVATION = ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_WAITING_FOR_ACTIVATION;
39924   static const ForcedRedrawOnTimeoutState FORCED_REDRAW_WAITING_FOR_DRAW = ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_WAITING_FOR_DRAW;
39925   void set_next_action(::perfetto::protos::pbzero::ChromeCompositorSchedulerAction value) {
39926     AppendTinyVarInt(1, value);
39927   }
39928   void set_begin_impl_frame_state(::perfetto::protos::pbzero::ChromeCompositorStateMachine_MajorState_BeginImplFrameState value) {
39929     AppendTinyVarInt(2, value);
39930   }
39931   void set_begin_main_frame_state(::perfetto::protos::pbzero::ChromeCompositorStateMachine_MajorState_BeginMainFrameState value) {
39932     AppendTinyVarInt(3, value);
39933   }
39934   void set_layer_tree_frame_sink_state(::perfetto::protos::pbzero::ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState value) {
39935     AppendTinyVarInt(4, value);
39936   }
39937   void set_forced_redraw_state(::perfetto::protos::pbzero::ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState value) {
39938     AppendTinyVarInt(5, value);
39939   }
39940 };
39941 
39942 class ChromeCompositorSchedulerState_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/17, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
39943  public:
39944   ChromeCompositorSchedulerState_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
39945   explicit ChromeCompositorSchedulerState_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
39946   explicit ChromeCompositorSchedulerState_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
39947   bool has_state_machine() const { return at<1>().valid(); }
39948   ::protozero::ConstBytes state_machine() const { return at<1>().as_bytes(); }
39949   bool has_observing_begin_frame_source() const { return at<2>().valid(); }
39950   bool observing_begin_frame_source() const { return at<2>().as_bool(); }
39951   bool has_begin_impl_frame_deadline_task() const { return at<3>().valid(); }
39952   bool begin_impl_frame_deadline_task() const { return at<3>().as_bool(); }
39953   bool has_pending_begin_frame_task() const { return at<4>().valid(); }
39954   bool pending_begin_frame_task() const { return at<4>().as_bool(); }
39955   bool has_skipped_last_frame_missed_exceeded_deadline() const { return at<5>().valid(); }
39956   bool skipped_last_frame_missed_exceeded_deadline() const { return at<5>().as_bool(); }
39957   bool has_skipped_last_frame_to_reduce_latency() const { return at<6>().valid(); }
39958   bool skipped_last_frame_to_reduce_latency() const { return at<6>().as_bool(); }
39959   bool has_inside_action() const { return at<7>().valid(); }
39960   int32_t inside_action() const { return at<7>().as_int32(); }
39961   bool has_deadline_mode() const { return at<8>().valid(); }
39962   int32_t deadline_mode() const { return at<8>().as_int32(); }
39963   bool has_deadline_us() const { return at<9>().valid(); }
39964   int64_t deadline_us() const { return at<9>().as_int64(); }
39965   bool has_deadline_scheduled_at_us() const { return at<10>().valid(); }
39966   int64_t deadline_scheduled_at_us() const { return at<10>().as_int64(); }
39967   bool has_now_us() const { return at<11>().valid(); }
39968   int64_t now_us() const { return at<11>().as_int64(); }
39969   bool has_now_to_deadline_delta_us() const { return at<12>().valid(); }
39970   int64_t now_to_deadline_delta_us() const { return at<12>().as_int64(); }
39971   bool has_now_to_deadline_scheduled_at_delta_us() const { return at<13>().valid(); }
39972   int64_t now_to_deadline_scheduled_at_delta_us() const { return at<13>().as_int64(); }
39973   bool has_begin_impl_frame_args() const { return at<14>().valid(); }
39974   ::protozero::ConstBytes begin_impl_frame_args() const { return at<14>().as_bytes(); }
39975   bool has_begin_frame_observer_state() const { return at<15>().valid(); }
39976   ::protozero::ConstBytes begin_frame_observer_state() const { return at<15>().as_bytes(); }
39977   bool has_begin_frame_source_state() const { return at<16>().valid(); }
39978   ::protozero::ConstBytes begin_frame_source_state() const { return at<16>().as_bytes(); }
39979   bool has_compositor_timing_history() const { return at<17>().valid(); }
39980   ::protozero::ConstBytes compositor_timing_history() const { return at<17>().as_bytes(); }
39981 };
39982 
39983 class ChromeCompositorSchedulerState : public ::protozero::Message {
39984  public:
39985   using Decoder = ChromeCompositorSchedulerState_Decoder;
39986   enum : int32_t {
39987     kStateMachineFieldNumber = 1,
39988     kObservingBeginFrameSourceFieldNumber = 2,
39989     kBeginImplFrameDeadlineTaskFieldNumber = 3,
39990     kPendingBeginFrameTaskFieldNumber = 4,
39991     kSkippedLastFrameMissedExceededDeadlineFieldNumber = 5,
39992     kSkippedLastFrameToReduceLatencyFieldNumber = 6,
39993     kInsideActionFieldNumber = 7,
39994     kDeadlineModeFieldNumber = 8,
39995     kDeadlineUsFieldNumber = 9,
39996     kDeadlineScheduledAtUsFieldNumber = 10,
39997     kNowUsFieldNumber = 11,
39998     kNowToDeadlineDeltaUsFieldNumber = 12,
39999     kNowToDeadlineScheduledAtDeltaUsFieldNumber = 13,
40000     kBeginImplFrameArgsFieldNumber = 14,
40001     kBeginFrameObserverStateFieldNumber = 15,
40002     kBeginFrameSourceStateFieldNumber = 16,
40003     kCompositorTimingHistoryFieldNumber = 17,
40004   };
40005   using BeginImplFrameDeadlineMode = ::perfetto::protos::pbzero::ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode;
40006   static const BeginImplFrameDeadlineMode DEADLINE_MODE_UNSPECIFIED = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_UNSPECIFIED;
40007   static const BeginImplFrameDeadlineMode DEADLINE_MODE_NONE = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_NONE;
40008   static const BeginImplFrameDeadlineMode DEADLINE_MODE_IMMEDIATE = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_IMMEDIATE;
40009   static const BeginImplFrameDeadlineMode DEADLINE_MODE_REGULAR = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_REGULAR;
40010   static const BeginImplFrameDeadlineMode DEADLINE_MODE_LATE = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_LATE;
40011   static const BeginImplFrameDeadlineMode DEADLINE_MODE_BLOCKED = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_BLOCKED;
40012   template <typename T = ChromeCompositorStateMachine> T* set_state_machine() {
40013     return BeginNestedMessage<T>(1);
40014   }
40015 
40016   void set_observing_begin_frame_source(bool value) {
40017     AppendTinyVarInt(2, value);
40018   }
40019   void set_begin_impl_frame_deadline_task(bool value) {
40020     AppendTinyVarInt(3, value);
40021   }
40022   void set_pending_begin_frame_task(bool value) {
40023     AppendTinyVarInt(4, value);
40024   }
40025   void set_skipped_last_frame_missed_exceeded_deadline(bool value) {
40026     AppendTinyVarInt(5, value);
40027   }
40028   void set_skipped_last_frame_to_reduce_latency(bool value) {
40029     AppendTinyVarInt(6, value);
40030   }
40031   void set_inside_action(::perfetto::protos::pbzero::ChromeCompositorSchedulerAction value) {
40032     AppendTinyVarInt(7, value);
40033   }
40034   void set_deadline_mode(::perfetto::protos::pbzero::ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode value) {
40035     AppendTinyVarInt(8, value);
40036   }
40037   void set_deadline_us(int64_t value) {
40038     AppendVarInt(9, value);
40039   }
40040   void set_deadline_scheduled_at_us(int64_t value) {
40041     AppendVarInt(10, value);
40042   }
40043   void set_now_us(int64_t value) {
40044     AppendVarInt(11, value);
40045   }
40046   void set_now_to_deadline_delta_us(int64_t value) {
40047     AppendVarInt(12, value);
40048   }
40049   void set_now_to_deadline_scheduled_at_delta_us(int64_t value) {
40050     AppendVarInt(13, value);
40051   }
40052   template <typename T = BeginImplFrameArgs> T* set_begin_impl_frame_args() {
40053     return BeginNestedMessage<T>(14);
40054   }
40055 
40056   template <typename T = BeginFrameObserverState> T* set_begin_frame_observer_state() {
40057     return BeginNestedMessage<T>(15);
40058   }
40059 
40060   template <typename T = BeginFrameSourceState> T* set_begin_frame_source_state() {
40061     return BeginNestedMessage<T>(16);
40062   }
40063 
40064   template <typename T = CompositorTimingHistory> T* set_compositor_timing_history() {
40065     return BeginNestedMessage<T>(17);
40066   }
40067 
40068 };
40069 
40070 } // Namespace.
40071 } // Namespace.
40072 } // Namespace.
40073 #endif  // Include guard.
40074 // gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_frame_reporter.pbzero.h
40075 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
40076 
40077 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_FRAME_REPORTER_PROTO_H_
40078 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_FRAME_REPORTER_PROTO_H_
40079 
40080 #include <stddef.h>
40081 #include <stdint.h>
40082 
40083 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
40084 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
40085 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
40086 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
40087 
40088 namespace perfetto {
40089 namespace protos {
40090 namespace pbzero {
40091 
40092 enum ChromeFrameReporter_FrameDropReason : int32_t;
40093 enum ChromeFrameReporter_State : int32_t;
40094 
40095 enum ChromeFrameReporter_State : int32_t {
40096   ChromeFrameReporter_State_STATE_NO_UPDATE_DESIRED = 0,
40097   ChromeFrameReporter_State_STATE_PRESENTED_ALL = 1,
40098   ChromeFrameReporter_State_STATE_PRESENTED_PARTIAL = 2,
40099   ChromeFrameReporter_State_STATE_DROPPED = 3,
40100 };
40101 
40102 const ChromeFrameReporter_State ChromeFrameReporter_State_MIN = ChromeFrameReporter_State_STATE_NO_UPDATE_DESIRED;
40103 const ChromeFrameReporter_State ChromeFrameReporter_State_MAX = ChromeFrameReporter_State_STATE_DROPPED;
40104 
40105 enum ChromeFrameReporter_FrameDropReason : int32_t {
40106   ChromeFrameReporter_FrameDropReason_REASON_UNSPECIFIED = 0,
40107   ChromeFrameReporter_FrameDropReason_REASON_DISPLAY_COMPOSITOR = 1,
40108   ChromeFrameReporter_FrameDropReason_REASON_MAIN_THREAD = 2,
40109   ChromeFrameReporter_FrameDropReason_REASON_CLIENT_COMPOSITOR = 3,
40110 };
40111 
40112 const ChromeFrameReporter_FrameDropReason ChromeFrameReporter_FrameDropReason_MIN = ChromeFrameReporter_FrameDropReason_REASON_UNSPECIFIED;
40113 const ChromeFrameReporter_FrameDropReason ChromeFrameReporter_FrameDropReason_MAX = ChromeFrameReporter_FrameDropReason_REASON_CLIENT_COMPOSITOR;
40114 
40115 class ChromeFrameReporter_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
40116  public:
40117   ChromeFrameReporter_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
40118   explicit ChromeFrameReporter_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
40119   explicit ChromeFrameReporter_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
40120   bool has_state() const { return at<1>().valid(); }
40121   int32_t state() const { return at<1>().as_int32(); }
40122   bool has_reason() const { return at<2>().valid(); }
40123   int32_t reason() const { return at<2>().as_int32(); }
40124   bool has_frame_source() const { return at<3>().valid(); }
40125   uint64_t frame_source() const { return at<3>().as_uint64(); }
40126   bool has_frame_sequence() const { return at<4>().valid(); }
40127   uint64_t frame_sequence() const { return at<4>().as_uint64(); }
40128 };
40129 
40130 class ChromeFrameReporter : public ::protozero::Message {
40131  public:
40132   using Decoder = ChromeFrameReporter_Decoder;
40133   enum : int32_t {
40134     kStateFieldNumber = 1,
40135     kReasonFieldNumber = 2,
40136     kFrameSourceFieldNumber = 3,
40137     kFrameSequenceFieldNumber = 4,
40138   };
40139   using State = ::perfetto::protos::pbzero::ChromeFrameReporter_State;
40140   using FrameDropReason = ::perfetto::protos::pbzero::ChromeFrameReporter_FrameDropReason;
40141   static const State STATE_NO_UPDATE_DESIRED = ChromeFrameReporter_State_STATE_NO_UPDATE_DESIRED;
40142   static const State STATE_PRESENTED_ALL = ChromeFrameReporter_State_STATE_PRESENTED_ALL;
40143   static const State STATE_PRESENTED_PARTIAL = ChromeFrameReporter_State_STATE_PRESENTED_PARTIAL;
40144   static const State STATE_DROPPED = ChromeFrameReporter_State_STATE_DROPPED;
40145   static const FrameDropReason REASON_UNSPECIFIED = ChromeFrameReporter_FrameDropReason_REASON_UNSPECIFIED;
40146   static const FrameDropReason REASON_DISPLAY_COMPOSITOR = ChromeFrameReporter_FrameDropReason_REASON_DISPLAY_COMPOSITOR;
40147   static const FrameDropReason REASON_MAIN_THREAD = ChromeFrameReporter_FrameDropReason_REASON_MAIN_THREAD;
40148   static const FrameDropReason REASON_CLIENT_COMPOSITOR = ChromeFrameReporter_FrameDropReason_REASON_CLIENT_COMPOSITOR;
40149   void set_state(::perfetto::protos::pbzero::ChromeFrameReporter_State value) {
40150     AppendTinyVarInt(1, value);
40151   }
40152   void set_reason(::perfetto::protos::pbzero::ChromeFrameReporter_FrameDropReason value) {
40153     AppendTinyVarInt(2, value);
40154   }
40155   void set_frame_source(uint64_t value) {
40156     AppendVarInt(3, value);
40157   }
40158   void set_frame_sequence(uint64_t value) {
40159     AppendVarInt(4, value);
40160   }
40161 };
40162 
40163 } // Namespace.
40164 } // Namespace.
40165 } // Namespace.
40166 #endif  // Include guard.
40167 // gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_histogram_sample.pbzero.h
40168 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
40169 
40170 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_HISTOGRAM_SAMPLE_PROTO_H_
40171 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_HISTOGRAM_SAMPLE_PROTO_H_
40172 
40173 #include <stddef.h>
40174 #include <stdint.h>
40175 
40176 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
40177 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
40178 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
40179 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
40180 
40181 namespace perfetto {
40182 namespace protos {
40183 namespace pbzero {
40184 
40185 
40186 class ChromeHistogramSample_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
40187  public:
40188   ChromeHistogramSample_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
40189   explicit ChromeHistogramSample_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
40190   explicit ChromeHistogramSample_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
40191   bool has_name_hash() const { return at<1>().valid(); }
40192   uint64_t name_hash() const { return at<1>().as_uint64(); }
40193   bool has_name() const { return at<2>().valid(); }
40194   ::protozero::ConstChars name() const { return at<2>().as_string(); }
40195   bool has_sample() const { return at<3>().valid(); }
40196   int64_t sample() const { return at<3>().as_int64(); }
40197 };
40198 
40199 class ChromeHistogramSample : public ::protozero::Message {
40200  public:
40201   using Decoder = ChromeHistogramSample_Decoder;
40202   enum : int32_t {
40203     kNameHashFieldNumber = 1,
40204     kNameFieldNumber = 2,
40205     kSampleFieldNumber = 3,
40206   };
40207   void set_name_hash(uint64_t value) {
40208     AppendVarInt(1, value);
40209   }
40210   void set_name(const std::string& value) {
40211     AppendBytes(2, value.data(), value.size());
40212   }
40213   void set_name(const char* data, size_t size) {
40214     AppendBytes(2, data, size);
40215   }
40216   void set_sample(int64_t value) {
40217     AppendVarInt(3, value);
40218   }
40219 };
40220 
40221 } // Namespace.
40222 } // Namespace.
40223 } // Namespace.
40224 #endif  // Include guard.
40225 // gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_keyed_service.pbzero.h
40226 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
40227 
40228 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_KEYED_SERVICE_PROTO_H_
40229 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_KEYED_SERVICE_PROTO_H_
40230 
40231 #include <stddef.h>
40232 #include <stdint.h>
40233 
40234 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
40235 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
40236 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
40237 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
40238 
40239 namespace perfetto {
40240 namespace protos {
40241 namespace pbzero {
40242 
40243 
40244 class ChromeKeyedService_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
40245  public:
40246   ChromeKeyedService_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
40247   explicit ChromeKeyedService_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
40248   explicit ChromeKeyedService_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
40249   bool has_name() const { return at<1>().valid(); }
40250   ::protozero::ConstChars name() const { return at<1>().as_string(); }
40251 };
40252 
40253 class ChromeKeyedService : public ::protozero::Message {
40254  public:
40255   using Decoder = ChromeKeyedService_Decoder;
40256   enum : int32_t {
40257     kNameFieldNumber = 1,
40258   };
40259   void set_name(const std::string& value) {
40260     AppendBytes(1, value.data(), value.size());
40261   }
40262   void set_name(const char* data, size_t size) {
40263     AppendBytes(1, data, size);
40264   }
40265 };
40266 
40267 } // Namespace.
40268 } // Namespace.
40269 } // Namespace.
40270 #endif  // Include guard.
40271 // gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_latency_info.pbzero.h
40272 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
40273 
40274 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_LATENCY_INFO_PROTO_H_
40275 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_LATENCY_INFO_PROTO_H_
40276 
40277 #include <stddef.h>
40278 #include <stdint.h>
40279 
40280 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
40281 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
40282 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
40283 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
40284 
40285 namespace perfetto {
40286 namespace protos {
40287 namespace pbzero {
40288 
40289 class ChromeLatencyInfo_ComponentInfo;
40290 enum ChromeLatencyInfo_LatencyComponentType : int32_t;
40291 enum ChromeLatencyInfo_Step : int32_t;
40292 
40293 enum ChromeLatencyInfo_Step : int32_t {
40294   ChromeLatencyInfo_Step_STEP_UNSPECIFIED = 0,
40295   ChromeLatencyInfo_Step_STEP_SEND_INPUT_EVENT_UI = 3,
40296   ChromeLatencyInfo_Step_STEP_HANDLE_INPUT_EVENT_IMPL = 5,
40297   ChromeLatencyInfo_Step_STEP_DID_HANDLE_INPUT_AND_OVERSCROLL = 8,
40298   ChromeLatencyInfo_Step_STEP_HANDLE_INPUT_EVENT_MAIN = 4,
40299   ChromeLatencyInfo_Step_STEP_MAIN_THREAD_SCROLL_UPDATE = 2,
40300   ChromeLatencyInfo_Step_STEP_HANDLE_INPUT_EVENT_MAIN_COMMIT = 1,
40301   ChromeLatencyInfo_Step_STEP_HANDLED_INPUT_EVENT_MAIN_OR_IMPL = 9,
40302   ChromeLatencyInfo_Step_STEP_HANDLED_INPUT_EVENT_IMPL = 10,
40303   ChromeLatencyInfo_Step_STEP_SWAP_BUFFERS = 6,
40304   ChromeLatencyInfo_Step_STEP_DRAW_AND_SWAP = 7,
40305 };
40306 
40307 const ChromeLatencyInfo_Step ChromeLatencyInfo_Step_MIN = ChromeLatencyInfo_Step_STEP_UNSPECIFIED;
40308 const ChromeLatencyInfo_Step ChromeLatencyInfo_Step_MAX = ChromeLatencyInfo_Step_STEP_HANDLED_INPUT_EVENT_IMPL;
40309 
40310 enum ChromeLatencyInfo_LatencyComponentType : int32_t {
40311   ChromeLatencyInfo_LatencyComponentType_COMPONENT_UNSPECIFIED = 0,
40312   ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_BEGIN_RWH = 1,
40313   ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL = 2,
40314   ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL = 3,
40315   ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_ORIGINAL = 4,
40316   ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_UI = 5,
40317   ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_RENDERER_MAIN = 6,
40318   ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_MAIN = 7,
40319   ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_IMPL = 8,
40320   ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_SCROLL_UPDATE_LAST_EVENT = 9,
40321   ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_ACK_RWH = 10,
40322   ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_RENDERER_SWAP = 11,
40323   ChromeLatencyInfo_LatencyComponentType_COMPONENT_DISPLAY_COMPOSITOR_RECEIVED_FRAME = 12,
40324   ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_GPU_SWAP_BUFFER = 13,
40325   ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_FRAME_SWAP = 14,
40326 };
40327 
40328 const ChromeLatencyInfo_LatencyComponentType ChromeLatencyInfo_LatencyComponentType_MIN = ChromeLatencyInfo_LatencyComponentType_COMPONENT_UNSPECIFIED;
40329 const ChromeLatencyInfo_LatencyComponentType ChromeLatencyInfo_LatencyComponentType_MAX = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_FRAME_SWAP;
40330 
40331 class ChromeLatencyInfo_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
40332  public:
40333   ChromeLatencyInfo_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
40334   explicit ChromeLatencyInfo_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
40335   explicit ChromeLatencyInfo_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
40336   bool has_trace_id() const { return at<1>().valid(); }
40337   int64_t trace_id() const { return at<1>().as_int64(); }
40338   bool has_step() const { return at<2>().valid(); }
40339   int32_t step() const { return at<2>().as_int32(); }
40340   bool has_frame_tree_node_id() const { return at<3>().valid(); }
40341   int32_t frame_tree_node_id() const { return at<3>().as_int32(); }
40342   bool has_component_info() const { return at<4>().valid(); }
40343   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> component_info() const { return GetRepeated<::protozero::ConstBytes>(4); }
40344   bool has_is_coalesced() const { return at<5>().valid(); }
40345   bool is_coalesced() const { return at<5>().as_bool(); }
40346   bool has_gesture_scroll_id() const { return at<6>().valid(); }
40347   int64_t gesture_scroll_id() const { return at<6>().as_int64(); }
40348 };
40349 
40350 class ChromeLatencyInfo : public ::protozero::Message {
40351  public:
40352   using Decoder = ChromeLatencyInfo_Decoder;
40353   enum : int32_t {
40354     kTraceIdFieldNumber = 1,
40355     kStepFieldNumber = 2,
40356     kFrameTreeNodeIdFieldNumber = 3,
40357     kComponentInfoFieldNumber = 4,
40358     kIsCoalescedFieldNumber = 5,
40359     kGestureScrollIdFieldNumber = 6,
40360   };
40361   using ComponentInfo = ::perfetto::protos::pbzero::ChromeLatencyInfo_ComponentInfo;
40362   using Step = ::perfetto::protos::pbzero::ChromeLatencyInfo_Step;
40363   using LatencyComponentType = ::perfetto::protos::pbzero::ChromeLatencyInfo_LatencyComponentType;
40364   static const Step STEP_UNSPECIFIED = ChromeLatencyInfo_Step_STEP_UNSPECIFIED;
40365   static const Step STEP_SEND_INPUT_EVENT_UI = ChromeLatencyInfo_Step_STEP_SEND_INPUT_EVENT_UI;
40366   static const Step STEP_HANDLE_INPUT_EVENT_IMPL = ChromeLatencyInfo_Step_STEP_HANDLE_INPUT_EVENT_IMPL;
40367   static const Step STEP_DID_HANDLE_INPUT_AND_OVERSCROLL = ChromeLatencyInfo_Step_STEP_DID_HANDLE_INPUT_AND_OVERSCROLL;
40368   static const Step STEP_HANDLE_INPUT_EVENT_MAIN = ChromeLatencyInfo_Step_STEP_HANDLE_INPUT_EVENT_MAIN;
40369   static const Step STEP_MAIN_THREAD_SCROLL_UPDATE = ChromeLatencyInfo_Step_STEP_MAIN_THREAD_SCROLL_UPDATE;
40370   static const Step STEP_HANDLE_INPUT_EVENT_MAIN_COMMIT = ChromeLatencyInfo_Step_STEP_HANDLE_INPUT_EVENT_MAIN_COMMIT;
40371   static const Step STEP_HANDLED_INPUT_EVENT_MAIN_OR_IMPL = ChromeLatencyInfo_Step_STEP_HANDLED_INPUT_EVENT_MAIN_OR_IMPL;
40372   static const Step STEP_HANDLED_INPUT_EVENT_IMPL = ChromeLatencyInfo_Step_STEP_HANDLED_INPUT_EVENT_IMPL;
40373   static const Step STEP_SWAP_BUFFERS = ChromeLatencyInfo_Step_STEP_SWAP_BUFFERS;
40374   static const Step STEP_DRAW_AND_SWAP = ChromeLatencyInfo_Step_STEP_DRAW_AND_SWAP;
40375   static const LatencyComponentType COMPONENT_UNSPECIFIED = ChromeLatencyInfo_LatencyComponentType_COMPONENT_UNSPECIFIED;
40376   static const LatencyComponentType COMPONENT_INPUT_EVENT_LATENCY_BEGIN_RWH = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_BEGIN_RWH;
40377   static const LatencyComponentType COMPONENT_INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL;
40378   static const LatencyComponentType COMPONENT_INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL;
40379   static const LatencyComponentType COMPONENT_INPUT_EVENT_LATENCY_ORIGINAL = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_ORIGINAL;
40380   static const LatencyComponentType COMPONENT_INPUT_EVENT_LATENCY_UI = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_UI;
40381   static const LatencyComponentType COMPONENT_INPUT_EVENT_LATENCY_RENDERER_MAIN = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_RENDERER_MAIN;
40382   static const LatencyComponentType COMPONENT_INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_MAIN = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_MAIN;
40383   static const LatencyComponentType COMPONENT_INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_IMPL = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_IMPL;
40384   static const LatencyComponentType COMPONENT_INPUT_EVENT_LATENCY_SCROLL_UPDATE_LAST_EVENT = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_SCROLL_UPDATE_LAST_EVENT;
40385   static const LatencyComponentType COMPONENT_INPUT_EVENT_LATENCY_ACK_RWH = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_ACK_RWH;
40386   static const LatencyComponentType COMPONENT_INPUT_EVENT_LATENCY_RENDERER_SWAP = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_RENDERER_SWAP;
40387   static const LatencyComponentType COMPONENT_DISPLAY_COMPOSITOR_RECEIVED_FRAME = ChromeLatencyInfo_LatencyComponentType_COMPONENT_DISPLAY_COMPOSITOR_RECEIVED_FRAME;
40388   static const LatencyComponentType COMPONENT_INPUT_EVENT_GPU_SWAP_BUFFER = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_GPU_SWAP_BUFFER;
40389   static const LatencyComponentType COMPONENT_INPUT_EVENT_LATENCY_FRAME_SWAP = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_FRAME_SWAP;
40390   void set_trace_id(int64_t value) {
40391     AppendVarInt(1, value);
40392   }
40393   void set_step(::perfetto::protos::pbzero::ChromeLatencyInfo_Step value) {
40394     AppendTinyVarInt(2, value);
40395   }
40396   void set_frame_tree_node_id(int32_t value) {
40397     AppendVarInt(3, value);
40398   }
40399   template <typename T = ChromeLatencyInfo_ComponentInfo> T* add_component_info() {
40400     return BeginNestedMessage<T>(4);
40401   }
40402 
40403   void set_is_coalesced(bool value) {
40404     AppendTinyVarInt(5, value);
40405   }
40406   void set_gesture_scroll_id(int64_t value) {
40407     AppendVarInt(6, value);
40408   }
40409 };
40410 
40411 class ChromeLatencyInfo_ComponentInfo_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
40412  public:
40413   ChromeLatencyInfo_ComponentInfo_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
40414   explicit ChromeLatencyInfo_ComponentInfo_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
40415   explicit ChromeLatencyInfo_ComponentInfo_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
40416   bool has_component_type() const { return at<1>().valid(); }
40417   int32_t component_type() const { return at<1>().as_int32(); }
40418   bool has_time_us() const { return at<2>().valid(); }
40419   uint64_t time_us() const { return at<2>().as_uint64(); }
40420 };
40421 
40422 class ChromeLatencyInfo_ComponentInfo : public ::protozero::Message {
40423  public:
40424   using Decoder = ChromeLatencyInfo_ComponentInfo_Decoder;
40425   enum : int32_t {
40426     kComponentTypeFieldNumber = 1,
40427     kTimeUsFieldNumber = 2,
40428   };
40429   void set_component_type(::perfetto::protos::pbzero::ChromeLatencyInfo_LatencyComponentType value) {
40430     AppendTinyVarInt(1, value);
40431   }
40432   void set_time_us(uint64_t value) {
40433     AppendVarInt(2, value);
40434   }
40435 };
40436 
40437 } // Namespace.
40438 } // Namespace.
40439 } // Namespace.
40440 #endif  // Include guard.
40441 // gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_legacy_ipc.pbzero.h
40442 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
40443 
40444 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_LEGACY_IPC_PROTO_H_
40445 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_LEGACY_IPC_PROTO_H_
40446 
40447 #include <stddef.h>
40448 #include <stdint.h>
40449 
40450 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
40451 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
40452 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
40453 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
40454 
40455 namespace perfetto {
40456 namespace protos {
40457 namespace pbzero {
40458 
40459 enum ChromeLegacyIpc_MessageClass : int32_t;
40460 
40461 enum ChromeLegacyIpc_MessageClass : int32_t {
40462   ChromeLegacyIpc_MessageClass_CLASS_UNSPECIFIED = 0,
40463   ChromeLegacyIpc_MessageClass_CLASS_AUTOMATION = 1,
40464   ChromeLegacyIpc_MessageClass_CLASS_FRAME = 2,
40465   ChromeLegacyIpc_MessageClass_CLASS_PAGE = 3,
40466   ChromeLegacyIpc_MessageClass_CLASS_VIEW = 4,
40467   ChromeLegacyIpc_MessageClass_CLASS_WIDGET = 5,
40468   ChromeLegacyIpc_MessageClass_CLASS_INPUT = 6,
40469   ChromeLegacyIpc_MessageClass_CLASS_TEST = 7,
40470   ChromeLegacyIpc_MessageClass_CLASS_WORKER = 8,
40471   ChromeLegacyIpc_MessageClass_CLASS_NACL = 9,
40472   ChromeLegacyIpc_MessageClass_CLASS_GPU_CHANNEL = 10,
40473   ChromeLegacyIpc_MessageClass_CLASS_MEDIA = 11,
40474   ChromeLegacyIpc_MessageClass_CLASS_PPAPI = 12,
40475   ChromeLegacyIpc_MessageClass_CLASS_CHROME = 13,
40476   ChromeLegacyIpc_MessageClass_CLASS_DRAG = 14,
40477   ChromeLegacyIpc_MessageClass_CLASS_PRINT = 15,
40478   ChromeLegacyIpc_MessageClass_CLASS_EXTENSION = 16,
40479   ChromeLegacyIpc_MessageClass_CLASS_TEXT_INPUT_CLIENT = 17,
40480   ChromeLegacyIpc_MessageClass_CLASS_BLINK_TEST = 18,
40481   ChromeLegacyIpc_MessageClass_CLASS_ACCESSIBILITY = 19,
40482   ChromeLegacyIpc_MessageClass_CLASS_PRERENDER = 20,
40483   ChromeLegacyIpc_MessageClass_CLASS_CHROMOTING = 21,
40484   ChromeLegacyIpc_MessageClass_CLASS_BROWSER_PLUGIN = 22,
40485   ChromeLegacyIpc_MessageClass_CLASS_ANDROID_WEB_VIEW = 23,
40486   ChromeLegacyIpc_MessageClass_CLASS_NACL_HOST = 24,
40487   ChromeLegacyIpc_MessageClass_CLASS_ENCRYPTED_MEDIA = 25,
40488   ChromeLegacyIpc_MessageClass_CLASS_CAST = 26,
40489   ChromeLegacyIpc_MessageClass_CLASS_GIN_JAVA_BRIDGE = 27,
40490   ChromeLegacyIpc_MessageClass_CLASS_CHROME_UTILITY_PRINTING = 28,
40491   ChromeLegacyIpc_MessageClass_CLASS_OZONE_GPU = 29,
40492   ChromeLegacyIpc_MessageClass_CLASS_WEB_TEST = 30,
40493   ChromeLegacyIpc_MessageClass_CLASS_NETWORK_HINTS = 31,
40494   ChromeLegacyIpc_MessageClass_CLASS_EXTENSIONS_GUEST_VIEW = 32,
40495   ChromeLegacyIpc_MessageClass_CLASS_GUEST_VIEW = 33,
40496   ChromeLegacyIpc_MessageClass_CLASS_MEDIA_PLAYER_DELEGATE = 34,
40497   ChromeLegacyIpc_MessageClass_CLASS_EXTENSION_WORKER = 35,
40498   ChromeLegacyIpc_MessageClass_CLASS_SUBRESOURCE_FILTER = 36,
40499   ChromeLegacyIpc_MessageClass_CLASS_UNFREEZABLE_FRAME = 37,
40500 };
40501 
40502 const ChromeLegacyIpc_MessageClass ChromeLegacyIpc_MessageClass_MIN = ChromeLegacyIpc_MessageClass_CLASS_UNSPECIFIED;
40503 const ChromeLegacyIpc_MessageClass ChromeLegacyIpc_MessageClass_MAX = ChromeLegacyIpc_MessageClass_CLASS_UNFREEZABLE_FRAME;
40504 
40505 class ChromeLegacyIpc_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
40506  public:
40507   ChromeLegacyIpc_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
40508   explicit ChromeLegacyIpc_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
40509   explicit ChromeLegacyIpc_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
40510   bool has_message_class() const { return at<1>().valid(); }
40511   int32_t message_class() const { return at<1>().as_int32(); }
40512   bool has_message_line() const { return at<2>().valid(); }
40513   uint32_t message_line() const { return at<2>().as_uint32(); }
40514 };
40515 
40516 class ChromeLegacyIpc : public ::protozero::Message {
40517  public:
40518   using Decoder = ChromeLegacyIpc_Decoder;
40519   enum : int32_t {
40520     kMessageClassFieldNumber = 1,
40521     kMessageLineFieldNumber = 2,
40522   };
40523   using MessageClass = ::perfetto::protos::pbzero::ChromeLegacyIpc_MessageClass;
40524   static const MessageClass CLASS_UNSPECIFIED = ChromeLegacyIpc_MessageClass_CLASS_UNSPECIFIED;
40525   static const MessageClass CLASS_AUTOMATION = ChromeLegacyIpc_MessageClass_CLASS_AUTOMATION;
40526   static const MessageClass CLASS_FRAME = ChromeLegacyIpc_MessageClass_CLASS_FRAME;
40527   static const MessageClass CLASS_PAGE = ChromeLegacyIpc_MessageClass_CLASS_PAGE;
40528   static const MessageClass CLASS_VIEW = ChromeLegacyIpc_MessageClass_CLASS_VIEW;
40529   static const MessageClass CLASS_WIDGET = ChromeLegacyIpc_MessageClass_CLASS_WIDGET;
40530   static const MessageClass CLASS_INPUT = ChromeLegacyIpc_MessageClass_CLASS_INPUT;
40531   static const MessageClass CLASS_TEST = ChromeLegacyIpc_MessageClass_CLASS_TEST;
40532   static const MessageClass CLASS_WORKER = ChromeLegacyIpc_MessageClass_CLASS_WORKER;
40533   static const MessageClass CLASS_NACL = ChromeLegacyIpc_MessageClass_CLASS_NACL;
40534   static const MessageClass CLASS_GPU_CHANNEL = ChromeLegacyIpc_MessageClass_CLASS_GPU_CHANNEL;
40535   static const MessageClass CLASS_MEDIA = ChromeLegacyIpc_MessageClass_CLASS_MEDIA;
40536   static const MessageClass CLASS_PPAPI = ChromeLegacyIpc_MessageClass_CLASS_PPAPI;
40537   static const MessageClass CLASS_CHROME = ChromeLegacyIpc_MessageClass_CLASS_CHROME;
40538   static const MessageClass CLASS_DRAG = ChromeLegacyIpc_MessageClass_CLASS_DRAG;
40539   static const MessageClass CLASS_PRINT = ChromeLegacyIpc_MessageClass_CLASS_PRINT;
40540   static const MessageClass CLASS_EXTENSION = ChromeLegacyIpc_MessageClass_CLASS_EXTENSION;
40541   static const MessageClass CLASS_TEXT_INPUT_CLIENT = ChromeLegacyIpc_MessageClass_CLASS_TEXT_INPUT_CLIENT;
40542   static const MessageClass CLASS_BLINK_TEST = ChromeLegacyIpc_MessageClass_CLASS_BLINK_TEST;
40543   static const MessageClass CLASS_ACCESSIBILITY = ChromeLegacyIpc_MessageClass_CLASS_ACCESSIBILITY;
40544   static const MessageClass CLASS_PRERENDER = ChromeLegacyIpc_MessageClass_CLASS_PRERENDER;
40545   static const MessageClass CLASS_CHROMOTING = ChromeLegacyIpc_MessageClass_CLASS_CHROMOTING;
40546   static const MessageClass CLASS_BROWSER_PLUGIN = ChromeLegacyIpc_MessageClass_CLASS_BROWSER_PLUGIN;
40547   static const MessageClass CLASS_ANDROID_WEB_VIEW = ChromeLegacyIpc_MessageClass_CLASS_ANDROID_WEB_VIEW;
40548   static const MessageClass CLASS_NACL_HOST = ChromeLegacyIpc_MessageClass_CLASS_NACL_HOST;
40549   static const MessageClass CLASS_ENCRYPTED_MEDIA = ChromeLegacyIpc_MessageClass_CLASS_ENCRYPTED_MEDIA;
40550   static const MessageClass CLASS_CAST = ChromeLegacyIpc_MessageClass_CLASS_CAST;
40551   static const MessageClass CLASS_GIN_JAVA_BRIDGE = ChromeLegacyIpc_MessageClass_CLASS_GIN_JAVA_BRIDGE;
40552   static const MessageClass CLASS_CHROME_UTILITY_PRINTING = ChromeLegacyIpc_MessageClass_CLASS_CHROME_UTILITY_PRINTING;
40553   static const MessageClass CLASS_OZONE_GPU = ChromeLegacyIpc_MessageClass_CLASS_OZONE_GPU;
40554   static const MessageClass CLASS_WEB_TEST = ChromeLegacyIpc_MessageClass_CLASS_WEB_TEST;
40555   static const MessageClass CLASS_NETWORK_HINTS = ChromeLegacyIpc_MessageClass_CLASS_NETWORK_HINTS;
40556   static const MessageClass CLASS_EXTENSIONS_GUEST_VIEW = ChromeLegacyIpc_MessageClass_CLASS_EXTENSIONS_GUEST_VIEW;
40557   static const MessageClass CLASS_GUEST_VIEW = ChromeLegacyIpc_MessageClass_CLASS_GUEST_VIEW;
40558   static const MessageClass CLASS_MEDIA_PLAYER_DELEGATE = ChromeLegacyIpc_MessageClass_CLASS_MEDIA_PLAYER_DELEGATE;
40559   static const MessageClass CLASS_EXTENSION_WORKER = ChromeLegacyIpc_MessageClass_CLASS_EXTENSION_WORKER;
40560   static const MessageClass CLASS_SUBRESOURCE_FILTER = ChromeLegacyIpc_MessageClass_CLASS_SUBRESOURCE_FILTER;
40561   static const MessageClass CLASS_UNFREEZABLE_FRAME = ChromeLegacyIpc_MessageClass_CLASS_UNFREEZABLE_FRAME;
40562   void set_message_class(::perfetto::protos::pbzero::ChromeLegacyIpc_MessageClass value) {
40563     AppendTinyVarInt(1, value);
40564   }
40565   void set_message_line(uint32_t value) {
40566     AppendVarInt(2, value);
40567   }
40568 };
40569 
40570 } // Namespace.
40571 } // Namespace.
40572 } // Namespace.
40573 #endif  // Include guard.
40574 // gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_process_descriptor.pbzero.h
40575 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
40576 
40577 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_PROCESS_DESCRIPTOR_PROTO_H_
40578 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_PROCESS_DESCRIPTOR_PROTO_H_
40579 
40580 #include <stddef.h>
40581 #include <stdint.h>
40582 
40583 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
40584 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
40585 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
40586 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
40587 
40588 namespace perfetto {
40589 namespace protos {
40590 namespace pbzero {
40591 
40592 enum ChromeProcessDescriptor_ProcessType : int32_t;
40593 
40594 enum ChromeProcessDescriptor_ProcessType : int32_t {
40595   ChromeProcessDescriptor_ProcessType_PROCESS_UNSPECIFIED = 0,
40596   ChromeProcessDescriptor_ProcessType_PROCESS_BROWSER = 1,
40597   ChromeProcessDescriptor_ProcessType_PROCESS_RENDERER = 2,
40598   ChromeProcessDescriptor_ProcessType_PROCESS_UTILITY = 3,
40599   ChromeProcessDescriptor_ProcessType_PROCESS_ZYGOTE = 4,
40600   ChromeProcessDescriptor_ProcessType_PROCESS_SANDBOX_HELPER = 5,
40601   ChromeProcessDescriptor_ProcessType_PROCESS_GPU = 6,
40602   ChromeProcessDescriptor_ProcessType_PROCESS_PPAPI_PLUGIN = 7,
40603   ChromeProcessDescriptor_ProcessType_PROCESS_PPAPI_BROKER = 8,
40604 };
40605 
40606 const ChromeProcessDescriptor_ProcessType ChromeProcessDescriptor_ProcessType_MIN = ChromeProcessDescriptor_ProcessType_PROCESS_UNSPECIFIED;
40607 const ChromeProcessDescriptor_ProcessType ChromeProcessDescriptor_ProcessType_MAX = ChromeProcessDescriptor_ProcessType_PROCESS_PPAPI_BROKER;
40608 
40609 class ChromeProcessDescriptor_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
40610  public:
40611   ChromeProcessDescriptor_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
40612   explicit ChromeProcessDescriptor_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
40613   explicit ChromeProcessDescriptor_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
40614   bool has_process_type() const { return at<1>().valid(); }
40615   int32_t process_type() const { return at<1>().as_int32(); }
40616   bool has_process_priority() const { return at<2>().valid(); }
40617   int32_t process_priority() const { return at<2>().as_int32(); }
40618   bool has_legacy_sort_index() const { return at<3>().valid(); }
40619   int32_t legacy_sort_index() const { return at<3>().as_int32(); }
40620   bool has_host_app_package_name() const { return at<4>().valid(); }
40621   ::protozero::ConstChars host_app_package_name() const { return at<4>().as_string(); }
40622 };
40623 
40624 class ChromeProcessDescriptor : public ::protozero::Message {
40625  public:
40626   using Decoder = ChromeProcessDescriptor_Decoder;
40627   enum : int32_t {
40628     kProcessTypeFieldNumber = 1,
40629     kProcessPriorityFieldNumber = 2,
40630     kLegacySortIndexFieldNumber = 3,
40631     kHostAppPackageNameFieldNumber = 4,
40632   };
40633   using ProcessType = ::perfetto::protos::pbzero::ChromeProcessDescriptor_ProcessType;
40634   static const ProcessType PROCESS_UNSPECIFIED = ChromeProcessDescriptor_ProcessType_PROCESS_UNSPECIFIED;
40635   static const ProcessType PROCESS_BROWSER = ChromeProcessDescriptor_ProcessType_PROCESS_BROWSER;
40636   static const ProcessType PROCESS_RENDERER = ChromeProcessDescriptor_ProcessType_PROCESS_RENDERER;
40637   static const ProcessType PROCESS_UTILITY = ChromeProcessDescriptor_ProcessType_PROCESS_UTILITY;
40638   static const ProcessType PROCESS_ZYGOTE = ChromeProcessDescriptor_ProcessType_PROCESS_ZYGOTE;
40639   static const ProcessType PROCESS_SANDBOX_HELPER = ChromeProcessDescriptor_ProcessType_PROCESS_SANDBOX_HELPER;
40640   static const ProcessType PROCESS_GPU = ChromeProcessDescriptor_ProcessType_PROCESS_GPU;
40641   static const ProcessType PROCESS_PPAPI_PLUGIN = ChromeProcessDescriptor_ProcessType_PROCESS_PPAPI_PLUGIN;
40642   static const ProcessType PROCESS_PPAPI_BROKER = ChromeProcessDescriptor_ProcessType_PROCESS_PPAPI_BROKER;
40643   void set_process_type(::perfetto::protos::pbzero::ChromeProcessDescriptor_ProcessType value) {
40644     AppendTinyVarInt(1, value);
40645   }
40646   void set_process_priority(int32_t value) {
40647     AppendVarInt(2, value);
40648   }
40649   void set_legacy_sort_index(int32_t value) {
40650     AppendVarInt(3, value);
40651   }
40652   void set_host_app_package_name(const std::string& value) {
40653     AppendBytes(4, value.data(), value.size());
40654   }
40655   void set_host_app_package_name(const char* data, size_t size) {
40656     AppendBytes(4, data, size);
40657   }
40658 };
40659 
40660 } // Namespace.
40661 } // Namespace.
40662 } // Namespace.
40663 #endif  // Include guard.
40664 // gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_thread_descriptor.pbzero.h
40665 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
40666 
40667 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_THREAD_DESCRIPTOR_PROTO_H_
40668 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_THREAD_DESCRIPTOR_PROTO_H_
40669 
40670 #include <stddef.h>
40671 #include <stdint.h>
40672 
40673 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
40674 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
40675 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
40676 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
40677 
40678 namespace perfetto {
40679 namespace protos {
40680 namespace pbzero {
40681 
40682 enum ChromeThreadDescriptor_ThreadType : int32_t;
40683 
40684 enum ChromeThreadDescriptor_ThreadType : int32_t {
40685   ChromeThreadDescriptor_ThreadType_THREAD_UNSPECIFIED = 0,
40686   ChromeThreadDescriptor_ThreadType_THREAD_MAIN = 1,
40687   ChromeThreadDescriptor_ThreadType_THREAD_IO = 2,
40688   ChromeThreadDescriptor_ThreadType_THREAD_POOL_BG_WORKER = 3,
40689   ChromeThreadDescriptor_ThreadType_THREAD_POOL_FG_WORKER = 4,
40690   ChromeThreadDescriptor_ThreadType_THREAD_POOL_BG_BLOCKING = 6,
40691   ChromeThreadDescriptor_ThreadType_THREAD_POOL_FG_BLOCKING = 5,
40692   ChromeThreadDescriptor_ThreadType_THREAD_POOL_SERVICE = 7,
40693   ChromeThreadDescriptor_ThreadType_THREAD_COMPOSITOR = 8,
40694   ChromeThreadDescriptor_ThreadType_THREAD_VIZ_COMPOSITOR = 9,
40695   ChromeThreadDescriptor_ThreadType_THREAD_COMPOSITOR_WORKER = 10,
40696   ChromeThreadDescriptor_ThreadType_THREAD_SERVICE_WORKER = 11,
40697   ChromeThreadDescriptor_ThreadType_THREAD_MEMORY_INFRA = 50,
40698   ChromeThreadDescriptor_ThreadType_THREAD_SAMPLING_PROFILER = 51,
40699 };
40700 
40701 const ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor_ThreadType_MIN = ChromeThreadDescriptor_ThreadType_THREAD_UNSPECIFIED;
40702 const ChromeThreadDescriptor_ThreadType ChromeThreadDescriptor_ThreadType_MAX = ChromeThreadDescriptor_ThreadType_THREAD_SAMPLING_PROFILER;
40703 
40704 class ChromeThreadDescriptor_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
40705  public:
40706   ChromeThreadDescriptor_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
40707   explicit ChromeThreadDescriptor_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
40708   explicit ChromeThreadDescriptor_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
40709   bool has_thread_type() const { return at<1>().valid(); }
40710   int32_t thread_type() const { return at<1>().as_int32(); }
40711   bool has_legacy_sort_index() const { return at<2>().valid(); }
40712   int32_t legacy_sort_index() const { return at<2>().as_int32(); }
40713 };
40714 
40715 class ChromeThreadDescriptor : public ::protozero::Message {
40716  public:
40717   using Decoder = ChromeThreadDescriptor_Decoder;
40718   enum : int32_t {
40719     kThreadTypeFieldNumber = 1,
40720     kLegacySortIndexFieldNumber = 2,
40721   };
40722   using ThreadType = ::perfetto::protos::pbzero::ChromeThreadDescriptor_ThreadType;
40723   static const ThreadType THREAD_UNSPECIFIED = ChromeThreadDescriptor_ThreadType_THREAD_UNSPECIFIED;
40724   static const ThreadType THREAD_MAIN = ChromeThreadDescriptor_ThreadType_THREAD_MAIN;
40725   static const ThreadType THREAD_IO = ChromeThreadDescriptor_ThreadType_THREAD_IO;
40726   static const ThreadType THREAD_POOL_BG_WORKER = ChromeThreadDescriptor_ThreadType_THREAD_POOL_BG_WORKER;
40727   static const ThreadType THREAD_POOL_FG_WORKER = ChromeThreadDescriptor_ThreadType_THREAD_POOL_FG_WORKER;
40728   static const ThreadType THREAD_POOL_BG_BLOCKING = ChromeThreadDescriptor_ThreadType_THREAD_POOL_BG_BLOCKING;
40729   static const ThreadType THREAD_POOL_FG_BLOCKING = ChromeThreadDescriptor_ThreadType_THREAD_POOL_FG_BLOCKING;
40730   static const ThreadType THREAD_POOL_SERVICE = ChromeThreadDescriptor_ThreadType_THREAD_POOL_SERVICE;
40731   static const ThreadType THREAD_COMPOSITOR = ChromeThreadDescriptor_ThreadType_THREAD_COMPOSITOR;
40732   static const ThreadType THREAD_VIZ_COMPOSITOR = ChromeThreadDescriptor_ThreadType_THREAD_VIZ_COMPOSITOR;
40733   static const ThreadType THREAD_COMPOSITOR_WORKER = ChromeThreadDescriptor_ThreadType_THREAD_COMPOSITOR_WORKER;
40734   static const ThreadType THREAD_SERVICE_WORKER = ChromeThreadDescriptor_ThreadType_THREAD_SERVICE_WORKER;
40735   static const ThreadType THREAD_MEMORY_INFRA = ChromeThreadDescriptor_ThreadType_THREAD_MEMORY_INFRA;
40736   static const ThreadType THREAD_SAMPLING_PROFILER = ChromeThreadDescriptor_ThreadType_THREAD_SAMPLING_PROFILER;
40737   void set_thread_type(::perfetto::protos::pbzero::ChromeThreadDescriptor_ThreadType value) {
40738     AppendTinyVarInt(1, value);
40739   }
40740   void set_legacy_sort_index(int32_t value) {
40741     AppendVarInt(2, value);
40742   }
40743 };
40744 
40745 } // Namespace.
40746 } // Namespace.
40747 } // Namespace.
40748 #endif  // Include guard.
40749 // gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_user_event.pbzero.h
40750 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
40751 
40752 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_USER_EVENT_PROTO_H_
40753 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_USER_EVENT_PROTO_H_
40754 
40755 #include <stddef.h>
40756 #include <stdint.h>
40757 
40758 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
40759 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
40760 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
40761 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
40762 
40763 namespace perfetto {
40764 namespace protos {
40765 namespace pbzero {
40766 
40767 
40768 class ChromeUserEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
40769  public:
40770   ChromeUserEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
40771   explicit ChromeUserEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
40772   explicit ChromeUserEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
40773   bool has_action() const { return at<1>().valid(); }
40774   ::protozero::ConstChars action() const { return at<1>().as_string(); }
40775   bool has_action_hash() const { return at<2>().valid(); }
40776   uint64_t action_hash() const { return at<2>().as_uint64(); }
40777 };
40778 
40779 class ChromeUserEvent : public ::protozero::Message {
40780  public:
40781   using Decoder = ChromeUserEvent_Decoder;
40782   enum : int32_t {
40783     kActionFieldNumber = 1,
40784     kActionHashFieldNumber = 2,
40785   };
40786   void set_action(const std::string& value) {
40787     AppendBytes(1, value.data(), value.size());
40788   }
40789   void set_action(const char* data, size_t size) {
40790     AppendBytes(1, data, size);
40791   }
40792   void set_action_hash(uint64_t value) {
40793     AppendVarInt(2, value);
40794   }
40795 };
40796 
40797 } // Namespace.
40798 } // Namespace.
40799 } // Namespace.
40800 #endif  // Include guard.
40801 // gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/counter_descriptor.pbzero.h
40802 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
40803 
40804 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_COUNTER_DESCRIPTOR_PROTO_H_
40805 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_COUNTER_DESCRIPTOR_PROTO_H_
40806 
40807 #include <stddef.h>
40808 #include <stdint.h>
40809 
40810 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
40811 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
40812 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
40813 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
40814 
40815 namespace perfetto {
40816 namespace protos {
40817 namespace pbzero {
40818 
40819 enum CounterDescriptor_BuiltinCounterType : int32_t;
40820 enum CounterDescriptor_Unit : int32_t;
40821 
40822 enum CounterDescriptor_BuiltinCounterType : int32_t {
40823   CounterDescriptor_BuiltinCounterType_COUNTER_UNSPECIFIED = 0,
40824   CounterDescriptor_BuiltinCounterType_COUNTER_THREAD_TIME_NS = 1,
40825   CounterDescriptor_BuiltinCounterType_COUNTER_THREAD_INSTRUCTION_COUNT = 2,
40826 };
40827 
40828 const CounterDescriptor_BuiltinCounterType CounterDescriptor_BuiltinCounterType_MIN = CounterDescriptor_BuiltinCounterType_COUNTER_UNSPECIFIED;
40829 const CounterDescriptor_BuiltinCounterType CounterDescriptor_BuiltinCounterType_MAX = CounterDescriptor_BuiltinCounterType_COUNTER_THREAD_INSTRUCTION_COUNT;
40830 
40831 enum CounterDescriptor_Unit : int32_t {
40832   CounterDescriptor_Unit_UNIT_UNSPECIFIED = 0,
40833   CounterDescriptor_Unit_UNIT_TIME_NS = 1,
40834   CounterDescriptor_Unit_UNIT_COUNT = 2,
40835   CounterDescriptor_Unit_UNIT_SIZE_BYTES = 3,
40836 };
40837 
40838 const CounterDescriptor_Unit CounterDescriptor_Unit_MIN = CounterDescriptor_Unit_UNIT_UNSPECIFIED;
40839 const CounterDescriptor_Unit CounterDescriptor_Unit_MAX = CounterDescriptor_Unit_UNIT_SIZE_BYTES;
40840 
40841 class CounterDescriptor_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
40842  public:
40843   CounterDescriptor_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
40844   explicit CounterDescriptor_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
40845   explicit CounterDescriptor_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
40846   bool has_type() const { return at<1>().valid(); }
40847   int32_t type() const { return at<1>().as_int32(); }
40848   bool has_categories() const { return at<2>().valid(); }
40849   ::protozero::RepeatedFieldIterator<::protozero::ConstChars> categories() const { return GetRepeated<::protozero::ConstChars>(2); }
40850   bool has_unit() const { return at<3>().valid(); }
40851   int32_t unit() const { return at<3>().as_int32(); }
40852   bool has_unit_multiplier() const { return at<4>().valid(); }
40853   int64_t unit_multiplier() const { return at<4>().as_int64(); }
40854   bool has_is_incremental() const { return at<5>().valid(); }
40855   bool is_incremental() const { return at<5>().as_bool(); }
40856 };
40857 
40858 class CounterDescriptor : public ::protozero::Message {
40859  public:
40860   using Decoder = CounterDescriptor_Decoder;
40861   enum : int32_t {
40862     kTypeFieldNumber = 1,
40863     kCategoriesFieldNumber = 2,
40864     kUnitFieldNumber = 3,
40865     kUnitMultiplierFieldNumber = 4,
40866     kIsIncrementalFieldNumber = 5,
40867   };
40868   using BuiltinCounterType = ::perfetto::protos::pbzero::CounterDescriptor_BuiltinCounterType;
40869   using Unit = ::perfetto::protos::pbzero::CounterDescriptor_Unit;
40870   static const BuiltinCounterType COUNTER_UNSPECIFIED = CounterDescriptor_BuiltinCounterType_COUNTER_UNSPECIFIED;
40871   static const BuiltinCounterType COUNTER_THREAD_TIME_NS = CounterDescriptor_BuiltinCounterType_COUNTER_THREAD_TIME_NS;
40872   static const BuiltinCounterType COUNTER_THREAD_INSTRUCTION_COUNT = CounterDescriptor_BuiltinCounterType_COUNTER_THREAD_INSTRUCTION_COUNT;
40873   static const Unit UNIT_UNSPECIFIED = CounterDescriptor_Unit_UNIT_UNSPECIFIED;
40874   static const Unit UNIT_TIME_NS = CounterDescriptor_Unit_UNIT_TIME_NS;
40875   static const Unit UNIT_COUNT = CounterDescriptor_Unit_UNIT_COUNT;
40876   static const Unit UNIT_SIZE_BYTES = CounterDescriptor_Unit_UNIT_SIZE_BYTES;
40877   void set_type(::perfetto::protos::pbzero::CounterDescriptor_BuiltinCounterType value) {
40878     AppendTinyVarInt(1, value);
40879   }
40880   void add_categories(const std::string& value) {
40881     AppendBytes(2, value.data(), value.size());
40882   }
40883   void add_categories(const char* data, size_t size) {
40884     AppendBytes(2, data, size);
40885   }
40886   void set_unit(::perfetto::protos::pbzero::CounterDescriptor_Unit value) {
40887     AppendTinyVarInt(3, value);
40888   }
40889   void set_unit_multiplier(int64_t value) {
40890     AppendVarInt(4, value);
40891   }
40892   void set_is_incremental(bool value) {
40893     AppendTinyVarInt(5, value);
40894   }
40895 };
40896 
40897 } // Namespace.
40898 } // Namespace.
40899 } // Namespace.
40900 #endif  // Include guard.
40901 // gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/debug_annotation.pbzero.h
40902 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
40903 
40904 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_DEBUG_ANNOTATION_PROTO_H_
40905 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_DEBUG_ANNOTATION_PROTO_H_
40906 
40907 #include <stddef.h>
40908 #include <stdint.h>
40909 
40910 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
40911 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
40912 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
40913 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
40914 
40915 namespace perfetto {
40916 namespace protos {
40917 namespace pbzero {
40918 
40919 class DebugAnnotation_NestedValue;
40920 enum DebugAnnotation_NestedValue_NestedType : int32_t;
40921 
40922 enum DebugAnnotation_NestedValue_NestedType : int32_t {
40923   DebugAnnotation_NestedValue_NestedType_UNSPECIFIED = 0,
40924   DebugAnnotation_NestedValue_NestedType_DICT = 1,
40925   DebugAnnotation_NestedValue_NestedType_ARRAY = 2,
40926 };
40927 
40928 const DebugAnnotation_NestedValue_NestedType DebugAnnotation_NestedValue_NestedType_MIN = DebugAnnotation_NestedValue_NestedType_UNSPECIFIED;
40929 const DebugAnnotation_NestedValue_NestedType DebugAnnotation_NestedValue_NestedType_MAX = DebugAnnotation_NestedValue_NestedType_ARRAY;
40930 
40931 class DebugAnnotationName_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
40932  public:
40933   DebugAnnotationName_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
40934   explicit DebugAnnotationName_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
40935   explicit DebugAnnotationName_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
40936   bool has_iid() const { return at<1>().valid(); }
40937   uint64_t iid() const { return at<1>().as_uint64(); }
40938   bool has_name() const { return at<2>().valid(); }
40939   ::protozero::ConstChars name() const { return at<2>().as_string(); }
40940 };
40941 
40942 class DebugAnnotationName : public ::protozero::Message {
40943  public:
40944   using Decoder = DebugAnnotationName_Decoder;
40945   enum : int32_t {
40946     kIidFieldNumber = 1,
40947     kNameFieldNumber = 2,
40948   };
40949   void set_iid(uint64_t value) {
40950     AppendVarInt(1, value);
40951   }
40952   void set_name(const std::string& value) {
40953     AppendBytes(2, value.data(), value.size());
40954   }
40955   void set_name(const char* data, size_t size) {
40956     AppendBytes(2, data, size);
40957   }
40958 };
40959 
40960 class DebugAnnotation_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/10, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
40961  public:
40962   DebugAnnotation_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
40963   explicit DebugAnnotation_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
40964   explicit DebugAnnotation_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
40965   bool has_name_iid() const { return at<1>().valid(); }
40966   uint64_t name_iid() const { return at<1>().as_uint64(); }
40967   bool has_name() const { return at<10>().valid(); }
40968   ::protozero::ConstChars name() const { return at<10>().as_string(); }
40969   bool has_bool_value() const { return at<2>().valid(); }
40970   bool bool_value() const { return at<2>().as_bool(); }
40971   bool has_uint_value() const { return at<3>().valid(); }
40972   uint64_t uint_value() const { return at<3>().as_uint64(); }
40973   bool has_int_value() const { return at<4>().valid(); }
40974   int64_t int_value() const { return at<4>().as_int64(); }
40975   bool has_double_value() const { return at<5>().valid(); }
40976   double double_value() const { return at<5>().as_double(); }
40977   bool has_string_value() const { return at<6>().valid(); }
40978   ::protozero::ConstChars string_value() const { return at<6>().as_string(); }
40979   bool has_pointer_value() const { return at<7>().valid(); }
40980   uint64_t pointer_value() const { return at<7>().as_uint64(); }
40981   bool has_nested_value() const { return at<8>().valid(); }
40982   ::protozero::ConstBytes nested_value() const { return at<8>().as_bytes(); }
40983   bool has_legacy_json_value() const { return at<9>().valid(); }
40984   ::protozero::ConstChars legacy_json_value() const { return at<9>().as_string(); }
40985 };
40986 
40987 class DebugAnnotation : public ::protozero::Message {
40988  public:
40989   using Decoder = DebugAnnotation_Decoder;
40990   enum : int32_t {
40991     kNameIidFieldNumber = 1,
40992     kNameFieldNumber = 10,
40993     kBoolValueFieldNumber = 2,
40994     kUintValueFieldNumber = 3,
40995     kIntValueFieldNumber = 4,
40996     kDoubleValueFieldNumber = 5,
40997     kStringValueFieldNumber = 6,
40998     kPointerValueFieldNumber = 7,
40999     kNestedValueFieldNumber = 8,
41000     kLegacyJsonValueFieldNumber = 9,
41001   };
41002   using NestedValue = ::perfetto::protos::pbzero::DebugAnnotation_NestedValue;
41003   void set_name_iid(uint64_t value) {
41004     AppendVarInt(1, value);
41005   }
41006   void set_name(const std::string& value) {
41007     AppendBytes(10, value.data(), value.size());
41008   }
41009   void set_name(const char* data, size_t size) {
41010     AppendBytes(10, data, size);
41011   }
41012   void set_bool_value(bool value) {
41013     AppendTinyVarInt(2, value);
41014   }
41015   void set_uint_value(uint64_t value) {
41016     AppendVarInt(3, value);
41017   }
41018   void set_int_value(int64_t value) {
41019     AppendVarInt(4, value);
41020   }
41021   void set_double_value(double value) {
41022     AppendFixed(5, value);
41023   }
41024   void set_string_value(const std::string& value) {
41025     AppendBytes(6, value.data(), value.size());
41026   }
41027   void set_string_value(const char* data, size_t size) {
41028     AppendBytes(6, data, size);
41029   }
41030   void set_pointer_value(uint64_t value) {
41031     AppendVarInt(7, value);
41032   }
41033   template <typename T = DebugAnnotation_NestedValue> T* set_nested_value() {
41034     return BeginNestedMessage<T>(8);
41035   }
41036 
41037   void set_legacy_json_value(const std::string& value) {
41038     AppendBytes(9, value.data(), value.size());
41039   }
41040   void set_legacy_json_value(const char* data, size_t size) {
41041     AppendBytes(9, data, size);
41042   }
41043 };
41044 
41045 class DebugAnnotation_NestedValue_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
41046  public:
41047   DebugAnnotation_NestedValue_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
41048   explicit DebugAnnotation_NestedValue_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
41049   explicit DebugAnnotation_NestedValue_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
41050   bool has_nested_type() const { return at<1>().valid(); }
41051   int32_t nested_type() const { return at<1>().as_int32(); }
41052   bool has_dict_keys() const { return at<2>().valid(); }
41053   ::protozero::RepeatedFieldIterator<::protozero::ConstChars> dict_keys() const { return GetRepeated<::protozero::ConstChars>(2); }
41054   bool has_dict_values() const { return at<3>().valid(); }
41055   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> dict_values() const { return GetRepeated<::protozero::ConstBytes>(3); }
41056   bool has_array_values() const { return at<4>().valid(); }
41057   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> array_values() const { return GetRepeated<::protozero::ConstBytes>(4); }
41058   bool has_int_value() const { return at<5>().valid(); }
41059   int64_t int_value() const { return at<5>().as_int64(); }
41060   bool has_double_value() const { return at<6>().valid(); }
41061   double double_value() const { return at<6>().as_double(); }
41062   bool has_bool_value() const { return at<7>().valid(); }
41063   bool bool_value() const { return at<7>().as_bool(); }
41064   bool has_string_value() const { return at<8>().valid(); }
41065   ::protozero::ConstChars string_value() const { return at<8>().as_string(); }
41066 };
41067 
41068 class DebugAnnotation_NestedValue : public ::protozero::Message {
41069  public:
41070   using Decoder = DebugAnnotation_NestedValue_Decoder;
41071   enum : int32_t {
41072     kNestedTypeFieldNumber = 1,
41073     kDictKeysFieldNumber = 2,
41074     kDictValuesFieldNumber = 3,
41075     kArrayValuesFieldNumber = 4,
41076     kIntValueFieldNumber = 5,
41077     kDoubleValueFieldNumber = 6,
41078     kBoolValueFieldNumber = 7,
41079     kStringValueFieldNumber = 8,
41080   };
41081   using NestedType = ::perfetto::protos::pbzero::DebugAnnotation_NestedValue_NestedType;
41082   static const NestedType UNSPECIFIED = DebugAnnotation_NestedValue_NestedType_UNSPECIFIED;
41083   static const NestedType DICT = DebugAnnotation_NestedValue_NestedType_DICT;
41084   static const NestedType ARRAY = DebugAnnotation_NestedValue_NestedType_ARRAY;
41085   void set_nested_type(::perfetto::protos::pbzero::DebugAnnotation_NestedValue_NestedType value) {
41086     AppendTinyVarInt(1, value);
41087   }
41088   void add_dict_keys(const std::string& value) {
41089     AppendBytes(2, value.data(), value.size());
41090   }
41091   void add_dict_keys(const char* data, size_t size) {
41092     AppendBytes(2, data, size);
41093   }
41094   template <typename T = DebugAnnotation_NestedValue> T* add_dict_values() {
41095     return BeginNestedMessage<T>(3);
41096   }
41097 
41098   template <typename T = DebugAnnotation_NestedValue> T* add_array_values() {
41099     return BeginNestedMessage<T>(4);
41100   }
41101 
41102   void set_int_value(int64_t value) {
41103     AppendVarInt(5, value);
41104   }
41105   void set_double_value(double value) {
41106     AppendFixed(6, value);
41107   }
41108   void set_bool_value(bool value) {
41109     AppendTinyVarInt(7, value);
41110   }
41111   void set_string_value(const std::string& value) {
41112     AppendBytes(8, value.data(), value.size());
41113   }
41114   void set_string_value(const char* data, size_t size) {
41115     AppendBytes(8, data, size);
41116   }
41117 };
41118 
41119 } // Namespace.
41120 } // Namespace.
41121 } // Namespace.
41122 #endif  // Include guard.
41123 // gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/log_message.pbzero.h
41124 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
41125 
41126 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_LOG_MESSAGE_PROTO_H_
41127 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_LOG_MESSAGE_PROTO_H_
41128 
41129 #include <stddef.h>
41130 #include <stdint.h>
41131 
41132 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
41133 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
41134 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
41135 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
41136 
41137 namespace perfetto {
41138 namespace protos {
41139 namespace pbzero {
41140 
41141 
41142 class LogMessageBody_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
41143  public:
41144   LogMessageBody_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
41145   explicit LogMessageBody_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
41146   explicit LogMessageBody_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
41147   bool has_iid() const { return at<1>().valid(); }
41148   uint64_t iid() const { return at<1>().as_uint64(); }
41149   bool has_body() const { return at<2>().valid(); }
41150   ::protozero::ConstChars body() const { return at<2>().as_string(); }
41151 };
41152 
41153 class LogMessageBody : public ::protozero::Message {
41154  public:
41155   using Decoder = LogMessageBody_Decoder;
41156   enum : int32_t {
41157     kIidFieldNumber = 1,
41158     kBodyFieldNumber = 2,
41159   };
41160   void set_iid(uint64_t value) {
41161     AppendVarInt(1, value);
41162   }
41163   void set_body(const std::string& value) {
41164     AppendBytes(2, value.data(), value.size());
41165   }
41166   void set_body(const char* data, size_t size) {
41167     AppendBytes(2, data, size);
41168   }
41169 };
41170 
41171 class LogMessage_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
41172  public:
41173   LogMessage_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
41174   explicit LogMessage_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
41175   explicit LogMessage_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
41176   bool has_source_location_iid() const { return at<1>().valid(); }
41177   uint64_t source_location_iid() const { return at<1>().as_uint64(); }
41178   bool has_body_iid() const { return at<2>().valid(); }
41179   uint64_t body_iid() const { return at<2>().as_uint64(); }
41180 };
41181 
41182 class LogMessage : public ::protozero::Message {
41183  public:
41184   using Decoder = LogMessage_Decoder;
41185   enum : int32_t {
41186     kSourceLocationIidFieldNumber = 1,
41187     kBodyIidFieldNumber = 2,
41188   };
41189   void set_source_location_iid(uint64_t value) {
41190     AppendVarInt(1, value);
41191   }
41192   void set_body_iid(uint64_t value) {
41193     AppendVarInt(2, value);
41194   }
41195 };
41196 
41197 } // Namespace.
41198 } // Namespace.
41199 } // Namespace.
41200 #endif  // Include guard.
41201 // gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/process_descriptor.pbzero.h
41202 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
41203 
41204 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_PROCESS_DESCRIPTOR_PROTO_H_
41205 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_PROCESS_DESCRIPTOR_PROTO_H_
41206 
41207 #include <stddef.h>
41208 #include <stdint.h>
41209 
41210 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
41211 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
41212 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
41213 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
41214 
41215 namespace perfetto {
41216 namespace protos {
41217 namespace pbzero {
41218 
41219 enum ProcessDescriptor_ChromeProcessType : int32_t;
41220 
41221 enum ProcessDescriptor_ChromeProcessType : int32_t {
41222   ProcessDescriptor_ChromeProcessType_PROCESS_UNSPECIFIED = 0,
41223   ProcessDescriptor_ChromeProcessType_PROCESS_BROWSER = 1,
41224   ProcessDescriptor_ChromeProcessType_PROCESS_RENDERER = 2,
41225   ProcessDescriptor_ChromeProcessType_PROCESS_UTILITY = 3,
41226   ProcessDescriptor_ChromeProcessType_PROCESS_ZYGOTE = 4,
41227   ProcessDescriptor_ChromeProcessType_PROCESS_SANDBOX_HELPER = 5,
41228   ProcessDescriptor_ChromeProcessType_PROCESS_GPU = 6,
41229   ProcessDescriptor_ChromeProcessType_PROCESS_PPAPI_PLUGIN = 7,
41230   ProcessDescriptor_ChromeProcessType_PROCESS_PPAPI_BROKER = 8,
41231 };
41232 
41233 const ProcessDescriptor_ChromeProcessType ProcessDescriptor_ChromeProcessType_MIN = ProcessDescriptor_ChromeProcessType_PROCESS_UNSPECIFIED;
41234 const ProcessDescriptor_ChromeProcessType ProcessDescriptor_ChromeProcessType_MAX = ProcessDescriptor_ChromeProcessType_PROCESS_PPAPI_BROKER;
41235 
41236 class ProcessDescriptor_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
41237  public:
41238   ProcessDescriptor_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
41239   explicit ProcessDescriptor_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
41240   explicit ProcessDescriptor_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
41241   bool has_pid() const { return at<1>().valid(); }
41242   int32_t pid() const { return at<1>().as_int32(); }
41243   bool has_cmdline() const { return at<2>().valid(); }
41244   ::protozero::RepeatedFieldIterator<::protozero::ConstChars> cmdline() const { return GetRepeated<::protozero::ConstChars>(2); }
41245   bool has_process_name() const { return at<6>().valid(); }
41246   ::protozero::ConstChars process_name() const { return at<6>().as_string(); }
41247   bool has_process_priority() const { return at<5>().valid(); }
41248   int32_t process_priority() const { return at<5>().as_int32(); }
41249   bool has_chrome_process_type() const { return at<4>().valid(); }
41250   int32_t chrome_process_type() const { return at<4>().as_int32(); }
41251   bool has_legacy_sort_index() const { return at<3>().valid(); }
41252   int32_t legacy_sort_index() const { return at<3>().as_int32(); }
41253 };
41254 
41255 class ProcessDescriptor : public ::protozero::Message {
41256  public:
41257   using Decoder = ProcessDescriptor_Decoder;
41258   enum : int32_t {
41259     kPidFieldNumber = 1,
41260     kCmdlineFieldNumber = 2,
41261     kProcessNameFieldNumber = 6,
41262     kProcessPriorityFieldNumber = 5,
41263     kChromeProcessTypeFieldNumber = 4,
41264     kLegacySortIndexFieldNumber = 3,
41265   };
41266   using ChromeProcessType = ::perfetto::protos::pbzero::ProcessDescriptor_ChromeProcessType;
41267   static const ChromeProcessType PROCESS_UNSPECIFIED = ProcessDescriptor_ChromeProcessType_PROCESS_UNSPECIFIED;
41268   static const ChromeProcessType PROCESS_BROWSER = ProcessDescriptor_ChromeProcessType_PROCESS_BROWSER;
41269   static const ChromeProcessType PROCESS_RENDERER = ProcessDescriptor_ChromeProcessType_PROCESS_RENDERER;
41270   static const ChromeProcessType PROCESS_UTILITY = ProcessDescriptor_ChromeProcessType_PROCESS_UTILITY;
41271   static const ChromeProcessType PROCESS_ZYGOTE = ProcessDescriptor_ChromeProcessType_PROCESS_ZYGOTE;
41272   static const ChromeProcessType PROCESS_SANDBOX_HELPER = ProcessDescriptor_ChromeProcessType_PROCESS_SANDBOX_HELPER;
41273   static const ChromeProcessType PROCESS_GPU = ProcessDescriptor_ChromeProcessType_PROCESS_GPU;
41274   static const ChromeProcessType PROCESS_PPAPI_PLUGIN = ProcessDescriptor_ChromeProcessType_PROCESS_PPAPI_PLUGIN;
41275   static const ChromeProcessType PROCESS_PPAPI_BROKER = ProcessDescriptor_ChromeProcessType_PROCESS_PPAPI_BROKER;
41276   void set_pid(int32_t value) {
41277     AppendVarInt(1, value);
41278   }
41279   void add_cmdline(const std::string& value) {
41280     AppendBytes(2, value.data(), value.size());
41281   }
41282   void add_cmdline(const char* data, size_t size) {
41283     AppendBytes(2, data, size);
41284   }
41285   void set_process_name(const std::string& value) {
41286     AppendBytes(6, value.data(), value.size());
41287   }
41288   void set_process_name(const char* data, size_t size) {
41289     AppendBytes(6, data, size);
41290   }
41291   void set_process_priority(int32_t value) {
41292     AppendVarInt(5, value);
41293   }
41294   void set_chrome_process_type(::perfetto::protos::pbzero::ProcessDescriptor_ChromeProcessType value) {
41295     AppendTinyVarInt(4, value);
41296   }
41297   void set_legacy_sort_index(int32_t value) {
41298     AppendVarInt(3, value);
41299   }
41300 };
41301 
41302 } // Namespace.
41303 } // Namespace.
41304 } // Namespace.
41305 #endif  // Include guard.
41306 // gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/source_location.pbzero.h
41307 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
41308 
41309 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_SOURCE_LOCATION_PROTO_H_
41310 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_SOURCE_LOCATION_PROTO_H_
41311 
41312 #include <stddef.h>
41313 #include <stdint.h>
41314 
41315 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
41316 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
41317 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
41318 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
41319 
41320 namespace perfetto {
41321 namespace protos {
41322 namespace pbzero {
41323 
41324 
41325 class SourceLocation_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
41326  public:
41327   SourceLocation_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
41328   explicit SourceLocation_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
41329   explicit SourceLocation_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
41330   bool has_iid() const { return at<1>().valid(); }
41331   uint64_t iid() const { return at<1>().as_uint64(); }
41332   bool has_file_name() const { return at<2>().valid(); }
41333   ::protozero::ConstChars file_name() const { return at<2>().as_string(); }
41334   bool has_function_name() const { return at<3>().valid(); }
41335   ::protozero::ConstChars function_name() const { return at<3>().as_string(); }
41336   bool has_line_number() const { return at<4>().valid(); }
41337   uint32_t line_number() const { return at<4>().as_uint32(); }
41338 };
41339 
41340 class SourceLocation : public ::protozero::Message {
41341  public:
41342   using Decoder = SourceLocation_Decoder;
41343   enum : int32_t {
41344     kIidFieldNumber = 1,
41345     kFileNameFieldNumber = 2,
41346     kFunctionNameFieldNumber = 3,
41347     kLineNumberFieldNumber = 4,
41348   };
41349   void set_iid(uint64_t value) {
41350     AppendVarInt(1, value);
41351   }
41352   void set_file_name(const std::string& value) {
41353     AppendBytes(2, value.data(), value.size());
41354   }
41355   void set_file_name(const char* data, size_t size) {
41356     AppendBytes(2, data, size);
41357   }
41358   void set_function_name(const std::string& value) {
41359     AppendBytes(3, value.data(), value.size());
41360   }
41361   void set_function_name(const char* data, size_t size) {
41362     AppendBytes(3, data, size);
41363   }
41364   void set_line_number(uint32_t value) {
41365     AppendVarInt(4, value);
41366   }
41367 };
41368 
41369 } // Namespace.
41370 } // Namespace.
41371 } // Namespace.
41372 #endif  // Include guard.
41373 // gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/task_execution.pbzero.h
41374 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
41375 
41376 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TASK_EXECUTION_PROTO_H_
41377 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TASK_EXECUTION_PROTO_H_
41378 
41379 #include <stddef.h>
41380 #include <stdint.h>
41381 
41382 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
41383 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
41384 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
41385 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
41386 
41387 namespace perfetto {
41388 namespace protos {
41389 namespace pbzero {
41390 
41391 
41392 class TaskExecution_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
41393  public:
41394   TaskExecution_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
41395   explicit TaskExecution_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
41396   explicit TaskExecution_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
41397   bool has_posted_from_iid() const { return at<1>().valid(); }
41398   uint64_t posted_from_iid() const { return at<1>().as_uint64(); }
41399 };
41400 
41401 class TaskExecution : public ::protozero::Message {
41402  public:
41403   using Decoder = TaskExecution_Decoder;
41404   enum : int32_t {
41405     kPostedFromIidFieldNumber = 1,
41406   };
41407   void set_posted_from_iid(uint64_t value) {
41408     AppendVarInt(1, value);
41409   }
41410 };
41411 
41412 } // Namespace.
41413 } // Namespace.
41414 } // Namespace.
41415 #endif  // Include guard.
41416 // gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/thread_descriptor.pbzero.h
41417 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
41418 
41419 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_THREAD_DESCRIPTOR_PROTO_H_
41420 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_THREAD_DESCRIPTOR_PROTO_H_
41421 
41422 #include <stddef.h>
41423 #include <stdint.h>
41424 
41425 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
41426 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
41427 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
41428 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
41429 
41430 namespace perfetto {
41431 namespace protos {
41432 namespace pbzero {
41433 
41434 enum ThreadDescriptor_ChromeThreadType : int32_t;
41435 
41436 enum ThreadDescriptor_ChromeThreadType : int32_t {
41437   ThreadDescriptor_ChromeThreadType_CHROME_THREAD_UNSPECIFIED = 0,
41438   ThreadDescriptor_ChromeThreadType_CHROME_THREAD_MAIN = 1,
41439   ThreadDescriptor_ChromeThreadType_CHROME_THREAD_IO = 2,
41440   ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_BG_WORKER = 3,
41441   ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_FG_WORKER = 4,
41442   ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_FB_BLOCKING = 5,
41443   ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_BG_BLOCKING = 6,
41444   ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_SERVICE = 7,
41445   ThreadDescriptor_ChromeThreadType_CHROME_THREAD_COMPOSITOR = 8,
41446   ThreadDescriptor_ChromeThreadType_CHROME_THREAD_VIZ_COMPOSITOR = 9,
41447   ThreadDescriptor_ChromeThreadType_CHROME_THREAD_COMPOSITOR_WORKER = 10,
41448   ThreadDescriptor_ChromeThreadType_CHROME_THREAD_SERVICE_WORKER = 11,
41449   ThreadDescriptor_ChromeThreadType_CHROME_THREAD_MEMORY_INFRA = 50,
41450   ThreadDescriptor_ChromeThreadType_CHROME_THREAD_SAMPLING_PROFILER = 51,
41451 };
41452 
41453 const ThreadDescriptor_ChromeThreadType ThreadDescriptor_ChromeThreadType_MIN = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_UNSPECIFIED;
41454 const ThreadDescriptor_ChromeThreadType ThreadDescriptor_ChromeThreadType_MAX = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_SAMPLING_PROFILER;
41455 
41456 class ThreadDescriptor_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
41457  public:
41458   ThreadDescriptor_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
41459   explicit ThreadDescriptor_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
41460   explicit ThreadDescriptor_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
41461   bool has_pid() const { return at<1>().valid(); }
41462   int32_t pid() const { return at<1>().as_int32(); }
41463   bool has_tid() const { return at<2>().valid(); }
41464   int32_t tid() const { return at<2>().as_int32(); }
41465   bool has_thread_name() const { return at<5>().valid(); }
41466   ::protozero::ConstChars thread_name() const { return at<5>().as_string(); }
41467   bool has_chrome_thread_type() const { return at<4>().valid(); }
41468   int32_t chrome_thread_type() const { return at<4>().as_int32(); }
41469   bool has_reference_timestamp_us() const { return at<6>().valid(); }
41470   int64_t reference_timestamp_us() const { return at<6>().as_int64(); }
41471   bool has_reference_thread_time_us() const { return at<7>().valid(); }
41472   int64_t reference_thread_time_us() const { return at<7>().as_int64(); }
41473   bool has_reference_thread_instruction_count() const { return at<8>().valid(); }
41474   int64_t reference_thread_instruction_count() const { return at<8>().as_int64(); }
41475   bool has_legacy_sort_index() const { return at<3>().valid(); }
41476   int32_t legacy_sort_index() const { return at<3>().as_int32(); }
41477 };
41478 
41479 class ThreadDescriptor : public ::protozero::Message {
41480  public:
41481   using Decoder = ThreadDescriptor_Decoder;
41482   enum : int32_t {
41483     kPidFieldNumber = 1,
41484     kTidFieldNumber = 2,
41485     kThreadNameFieldNumber = 5,
41486     kChromeThreadTypeFieldNumber = 4,
41487     kReferenceTimestampUsFieldNumber = 6,
41488     kReferenceThreadTimeUsFieldNumber = 7,
41489     kReferenceThreadInstructionCountFieldNumber = 8,
41490     kLegacySortIndexFieldNumber = 3,
41491   };
41492   using ChromeThreadType = ::perfetto::protos::pbzero::ThreadDescriptor_ChromeThreadType;
41493   static const ChromeThreadType CHROME_THREAD_UNSPECIFIED = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_UNSPECIFIED;
41494   static const ChromeThreadType CHROME_THREAD_MAIN = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_MAIN;
41495   static const ChromeThreadType CHROME_THREAD_IO = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_IO;
41496   static const ChromeThreadType CHROME_THREAD_POOL_BG_WORKER = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_BG_WORKER;
41497   static const ChromeThreadType CHROME_THREAD_POOL_FG_WORKER = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_FG_WORKER;
41498   static const ChromeThreadType CHROME_THREAD_POOL_FB_BLOCKING = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_FB_BLOCKING;
41499   static const ChromeThreadType CHROME_THREAD_POOL_BG_BLOCKING = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_BG_BLOCKING;
41500   static const ChromeThreadType CHROME_THREAD_POOL_SERVICE = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_SERVICE;
41501   static const ChromeThreadType CHROME_THREAD_COMPOSITOR = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_COMPOSITOR;
41502   static const ChromeThreadType CHROME_THREAD_VIZ_COMPOSITOR = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_VIZ_COMPOSITOR;
41503   static const ChromeThreadType CHROME_THREAD_COMPOSITOR_WORKER = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_COMPOSITOR_WORKER;
41504   static const ChromeThreadType CHROME_THREAD_SERVICE_WORKER = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_SERVICE_WORKER;
41505   static const ChromeThreadType CHROME_THREAD_MEMORY_INFRA = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_MEMORY_INFRA;
41506   static const ChromeThreadType CHROME_THREAD_SAMPLING_PROFILER = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_SAMPLING_PROFILER;
41507   void set_pid(int32_t value) {
41508     AppendVarInt(1, value);
41509   }
41510   void set_tid(int32_t value) {
41511     AppendVarInt(2, value);
41512   }
41513   void set_thread_name(const std::string& value) {
41514     AppendBytes(5, value.data(), value.size());
41515   }
41516   void set_thread_name(const char* data, size_t size) {
41517     AppendBytes(5, data, size);
41518   }
41519   void set_chrome_thread_type(::perfetto::protos::pbzero::ThreadDescriptor_ChromeThreadType value) {
41520     AppendTinyVarInt(4, value);
41521   }
41522   void set_reference_timestamp_us(int64_t value) {
41523     AppendVarInt(6, value);
41524   }
41525   void set_reference_thread_time_us(int64_t value) {
41526     AppendVarInt(7, value);
41527   }
41528   void set_reference_thread_instruction_count(int64_t value) {
41529     AppendVarInt(8, value);
41530   }
41531   void set_legacy_sort_index(int32_t value) {
41532     AppendVarInt(3, value);
41533   }
41534 };
41535 
41536 } // Namespace.
41537 } // Namespace.
41538 } // Namespace.
41539 #endif  // Include guard.
41540 // gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/track_descriptor.pbzero.h
41541 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
41542 
41543 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TRACK_DESCRIPTOR_PROTO_H_
41544 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TRACK_DESCRIPTOR_PROTO_H_
41545 
41546 #include <stddef.h>
41547 #include <stdint.h>
41548 
41549 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
41550 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
41551 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
41552 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
41553 
41554 namespace perfetto {
41555 namespace protos {
41556 namespace pbzero {
41557 
41558 class ChromeProcessDescriptor;
41559 class ChromeThreadDescriptor;
41560 class CounterDescriptor;
41561 class ProcessDescriptor;
41562 class ThreadDescriptor;
41563 
41564 class TrackDescriptor_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
41565  public:
41566   TrackDescriptor_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
41567   explicit TrackDescriptor_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
41568   explicit TrackDescriptor_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
41569   bool has_uuid() const { return at<1>().valid(); }
41570   uint64_t uuid() const { return at<1>().as_uint64(); }
41571   bool has_parent_uuid() const { return at<5>().valid(); }
41572   uint64_t parent_uuid() const { return at<5>().as_uint64(); }
41573   bool has_name() const { return at<2>().valid(); }
41574   ::protozero::ConstChars name() const { return at<2>().as_string(); }
41575   bool has_process() const { return at<3>().valid(); }
41576   ::protozero::ConstBytes process() const { return at<3>().as_bytes(); }
41577   bool has_chrome_process() const { return at<6>().valid(); }
41578   ::protozero::ConstBytes chrome_process() const { return at<6>().as_bytes(); }
41579   bool has_thread() const { return at<4>().valid(); }
41580   ::protozero::ConstBytes thread() const { return at<4>().as_bytes(); }
41581   bool has_chrome_thread() const { return at<7>().valid(); }
41582   ::protozero::ConstBytes chrome_thread() const { return at<7>().as_bytes(); }
41583   bool has_counter() const { return at<8>().valid(); }
41584   ::protozero::ConstBytes counter() const { return at<8>().as_bytes(); }
41585 };
41586 
41587 class TrackDescriptor : public ::protozero::Message {
41588  public:
41589   using Decoder = TrackDescriptor_Decoder;
41590   enum : int32_t {
41591     kUuidFieldNumber = 1,
41592     kParentUuidFieldNumber = 5,
41593     kNameFieldNumber = 2,
41594     kProcessFieldNumber = 3,
41595     kChromeProcessFieldNumber = 6,
41596     kThreadFieldNumber = 4,
41597     kChromeThreadFieldNumber = 7,
41598     kCounterFieldNumber = 8,
41599   };
41600   void set_uuid(uint64_t value) {
41601     AppendVarInt(1, value);
41602   }
41603   void set_parent_uuid(uint64_t value) {
41604     AppendVarInt(5, value);
41605   }
41606   void set_name(const std::string& value) {
41607     AppendBytes(2, value.data(), value.size());
41608   }
41609   void set_name(const char* data, size_t size) {
41610     AppendBytes(2, data, size);
41611   }
41612   template <typename T = ProcessDescriptor> T* set_process() {
41613     return BeginNestedMessage<T>(3);
41614   }
41615 
41616   template <typename T = ChromeProcessDescriptor> T* set_chrome_process() {
41617     return BeginNestedMessage<T>(6);
41618   }
41619 
41620   template <typename T = ThreadDescriptor> T* set_thread() {
41621     return BeginNestedMessage<T>(4);
41622   }
41623 
41624   template <typename T = ChromeThreadDescriptor> T* set_chrome_thread() {
41625     return BeginNestedMessage<T>(7);
41626   }
41627 
41628   template <typename T = CounterDescriptor> T* set_counter() {
41629     return BeginNestedMessage<T>(8);
41630   }
41631 
41632 };
41633 
41634 } // Namespace.
41635 } // Namespace.
41636 } // Namespace.
41637 #endif  // Include guard.
41638 // gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/track_event.pbzero.h
41639 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
41640 
41641 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TRACK_EVENT_PROTO_H_
41642 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TRACK_EVENT_PROTO_H_
41643 
41644 #include <stddef.h>
41645 #include <stdint.h>
41646 
41647 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
41648 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
41649 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
41650 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
41651 
41652 namespace perfetto {
41653 namespace protos {
41654 namespace pbzero {
41655 
41656 class ChromeCompositorSchedulerState;
41657 class ChromeFrameReporter;
41658 class ChromeHistogramSample;
41659 class ChromeKeyedService;
41660 class ChromeLatencyInfo;
41661 class ChromeLegacyIpc;
41662 class ChromeUserEvent;
41663 class DebugAnnotation;
41664 class LogMessage;
41665 class TaskExecution;
41666 class TrackEvent_LegacyEvent;
41667 enum TrackEvent_LegacyEvent_FlowDirection : int32_t;
41668 enum TrackEvent_LegacyEvent_InstantEventScope : int32_t;
41669 enum TrackEvent_Type : int32_t;
41670 
41671 enum TrackEvent_Type : int32_t {
41672   TrackEvent_Type_TYPE_UNSPECIFIED = 0,
41673   TrackEvent_Type_TYPE_SLICE_BEGIN = 1,
41674   TrackEvent_Type_TYPE_SLICE_END = 2,
41675   TrackEvent_Type_TYPE_INSTANT = 3,
41676   TrackEvent_Type_TYPE_COUNTER = 4,
41677 };
41678 
41679 const TrackEvent_Type TrackEvent_Type_MIN = TrackEvent_Type_TYPE_UNSPECIFIED;
41680 const TrackEvent_Type TrackEvent_Type_MAX = TrackEvent_Type_TYPE_COUNTER;
41681 
41682 enum TrackEvent_LegacyEvent_FlowDirection : int32_t {
41683   TrackEvent_LegacyEvent_FlowDirection_FLOW_UNSPECIFIED = 0,
41684   TrackEvent_LegacyEvent_FlowDirection_FLOW_IN = 1,
41685   TrackEvent_LegacyEvent_FlowDirection_FLOW_OUT = 2,
41686   TrackEvent_LegacyEvent_FlowDirection_FLOW_INOUT = 3,
41687 };
41688 
41689 const TrackEvent_LegacyEvent_FlowDirection TrackEvent_LegacyEvent_FlowDirection_MIN = TrackEvent_LegacyEvent_FlowDirection_FLOW_UNSPECIFIED;
41690 const TrackEvent_LegacyEvent_FlowDirection TrackEvent_LegacyEvent_FlowDirection_MAX = TrackEvent_LegacyEvent_FlowDirection_FLOW_INOUT;
41691 
41692 enum TrackEvent_LegacyEvent_InstantEventScope : int32_t {
41693   TrackEvent_LegacyEvent_InstantEventScope_SCOPE_UNSPECIFIED = 0,
41694   TrackEvent_LegacyEvent_InstantEventScope_SCOPE_GLOBAL = 1,
41695   TrackEvent_LegacyEvent_InstantEventScope_SCOPE_PROCESS = 2,
41696   TrackEvent_LegacyEvent_InstantEventScope_SCOPE_THREAD = 3,
41697 };
41698 
41699 const TrackEvent_LegacyEvent_InstantEventScope TrackEvent_LegacyEvent_InstantEventScope_MIN = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_UNSPECIFIED;
41700 const TrackEvent_LegacyEvent_InstantEventScope TrackEvent_LegacyEvent_InstantEventScope_MAX = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_THREAD;
41701 
41702 class EventName_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
41703  public:
41704   EventName_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
41705   explicit EventName_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
41706   explicit EventName_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
41707   bool has_iid() const { return at<1>().valid(); }
41708   uint64_t iid() const { return at<1>().as_uint64(); }
41709   bool has_name() const { return at<2>().valid(); }
41710   ::protozero::ConstChars name() const { return at<2>().as_string(); }
41711 };
41712 
41713 class EventName : public ::protozero::Message {
41714  public:
41715   using Decoder = EventName_Decoder;
41716   enum : int32_t {
41717     kIidFieldNumber = 1,
41718     kNameFieldNumber = 2,
41719   };
41720   void set_iid(uint64_t value) {
41721     AppendVarInt(1, value);
41722   }
41723   void set_name(const std::string& value) {
41724     AppendBytes(2, value.data(), value.size());
41725   }
41726   void set_name(const char* data, size_t size) {
41727     AppendBytes(2, data, size);
41728   }
41729 };
41730 
41731 class EventCategory_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
41732  public:
41733   EventCategory_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
41734   explicit EventCategory_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
41735   explicit EventCategory_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
41736   bool has_iid() const { return at<1>().valid(); }
41737   uint64_t iid() const { return at<1>().as_uint64(); }
41738   bool has_name() const { return at<2>().valid(); }
41739   ::protozero::ConstChars name() const { return at<2>().as_string(); }
41740 };
41741 
41742 class EventCategory : public ::protozero::Message {
41743  public:
41744   using Decoder = EventCategory_Decoder;
41745   enum : int32_t {
41746     kIidFieldNumber = 1,
41747     kNameFieldNumber = 2,
41748   };
41749   void set_iid(uint64_t value) {
41750     AppendVarInt(1, value);
41751   }
41752   void set_name(const std::string& value) {
41753     AppendBytes(2, value.data(), value.size());
41754   }
41755   void set_name(const char* data, size_t size) {
41756     AppendBytes(2, data, size);
41757   }
41758 };
41759 
41760 class TrackEventDefaults_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/31, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
41761  public:
41762   TrackEventDefaults_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
41763   explicit TrackEventDefaults_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
41764   explicit TrackEventDefaults_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
41765   bool has_track_uuid() const { return at<11>().valid(); }
41766   uint64_t track_uuid() const { return at<11>().as_uint64(); }
41767   bool has_extra_counter_track_uuids() const { return at<31>().valid(); }
41768   ::protozero::RepeatedFieldIterator<uint64_t> extra_counter_track_uuids() const { return GetRepeated<uint64_t>(31); }
41769 };
41770 
41771 class TrackEventDefaults : public ::protozero::Message {
41772  public:
41773   using Decoder = TrackEventDefaults_Decoder;
41774   enum : int32_t {
41775     kTrackUuidFieldNumber = 11,
41776     kExtraCounterTrackUuidsFieldNumber = 31,
41777   };
41778   void set_track_uuid(uint64_t value) {
41779     AppendVarInt(11, value);
41780   }
41781   void add_extra_counter_track_uuids(uint64_t value) {
41782     AppendVarInt(31, value);
41783   }
41784 };
41785 
41786 class TrackEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/32, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
41787  public:
41788   TrackEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
41789   explicit TrackEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
41790   explicit TrackEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
41791   bool has_category_iids() const { return at<3>().valid(); }
41792   ::protozero::RepeatedFieldIterator<uint64_t> category_iids() const { return GetRepeated<uint64_t>(3); }
41793   bool has_categories() const { return at<22>().valid(); }
41794   ::protozero::RepeatedFieldIterator<::protozero::ConstChars> categories() const { return GetRepeated<::protozero::ConstChars>(22); }
41795   bool has_name_iid() const { return at<10>().valid(); }
41796   uint64_t name_iid() const { return at<10>().as_uint64(); }
41797   bool has_name() const { return at<23>().valid(); }
41798   ::protozero::ConstChars name() const { return at<23>().as_string(); }
41799   bool has_type() const { return at<9>().valid(); }
41800   int32_t type() const { return at<9>().as_int32(); }
41801   bool has_track_uuid() const { return at<11>().valid(); }
41802   uint64_t track_uuid() const { return at<11>().as_uint64(); }
41803   bool has_counter_value() const { return at<30>().valid(); }
41804   int64_t counter_value() const { return at<30>().as_int64(); }
41805   bool has_extra_counter_track_uuids() const { return at<31>().valid(); }
41806   ::protozero::RepeatedFieldIterator<uint64_t> extra_counter_track_uuids() const { return GetRepeated<uint64_t>(31); }
41807   bool has_extra_counter_values() const { return at<12>().valid(); }
41808   ::protozero::RepeatedFieldIterator<int64_t> extra_counter_values() const { return GetRepeated<int64_t>(12); }
41809   bool has_debug_annotations() const { return at<4>().valid(); }
41810   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> debug_annotations() const { return GetRepeated<::protozero::ConstBytes>(4); }
41811   bool has_task_execution() const { return at<5>().valid(); }
41812   ::protozero::ConstBytes task_execution() const { return at<5>().as_bytes(); }
41813   bool has_log_message() const { return at<21>().valid(); }
41814   ::protozero::ConstBytes log_message() const { return at<21>().as_bytes(); }
41815   bool has_cc_scheduler_state() const { return at<24>().valid(); }
41816   ::protozero::ConstBytes cc_scheduler_state() const { return at<24>().as_bytes(); }
41817   bool has_chrome_user_event() const { return at<25>().valid(); }
41818   ::protozero::ConstBytes chrome_user_event() const { return at<25>().as_bytes(); }
41819   bool has_chrome_keyed_service() const { return at<26>().valid(); }
41820   ::protozero::ConstBytes chrome_keyed_service() const { return at<26>().as_bytes(); }
41821   bool has_chrome_legacy_ipc() const { return at<27>().valid(); }
41822   ::protozero::ConstBytes chrome_legacy_ipc() const { return at<27>().as_bytes(); }
41823   bool has_chrome_histogram_sample() const { return at<28>().valid(); }
41824   ::protozero::ConstBytes chrome_histogram_sample() const { return at<28>().as_bytes(); }
41825   bool has_chrome_latency_info() const { return at<29>().valid(); }
41826   ::protozero::ConstBytes chrome_latency_info() const { return at<29>().as_bytes(); }
41827   bool has_chrome_frame_reporter() const { return at<32>().valid(); }
41828   ::protozero::ConstBytes chrome_frame_reporter() const { return at<32>().as_bytes(); }
41829   bool has_timestamp_delta_us() const { return at<1>().valid(); }
41830   int64_t timestamp_delta_us() const { return at<1>().as_int64(); }
41831   bool has_timestamp_absolute_us() const { return at<16>().valid(); }
41832   int64_t timestamp_absolute_us() const { return at<16>().as_int64(); }
41833   bool has_thread_time_delta_us() const { return at<2>().valid(); }
41834   int64_t thread_time_delta_us() const { return at<2>().as_int64(); }
41835   bool has_thread_time_absolute_us() const { return at<17>().valid(); }
41836   int64_t thread_time_absolute_us() const { return at<17>().as_int64(); }
41837   bool has_thread_instruction_count_delta() const { return at<8>().valid(); }
41838   int64_t thread_instruction_count_delta() const { return at<8>().as_int64(); }
41839   bool has_thread_instruction_count_absolute() const { return at<20>().valid(); }
41840   int64_t thread_instruction_count_absolute() const { return at<20>().as_int64(); }
41841   bool has_legacy_event() const { return at<6>().valid(); }
41842   ::protozero::ConstBytes legacy_event() const { return at<6>().as_bytes(); }
41843 };
41844 
41845 class TrackEvent : public ::protozero::Message {
41846  public:
41847   using Decoder = TrackEvent_Decoder;
41848   enum : int32_t {
41849     kCategoryIidsFieldNumber = 3,
41850     kCategoriesFieldNumber = 22,
41851     kNameIidFieldNumber = 10,
41852     kNameFieldNumber = 23,
41853     kTypeFieldNumber = 9,
41854     kTrackUuidFieldNumber = 11,
41855     kCounterValueFieldNumber = 30,
41856     kExtraCounterTrackUuidsFieldNumber = 31,
41857     kExtraCounterValuesFieldNumber = 12,
41858     kDebugAnnotationsFieldNumber = 4,
41859     kTaskExecutionFieldNumber = 5,
41860     kLogMessageFieldNumber = 21,
41861     kCcSchedulerStateFieldNumber = 24,
41862     kChromeUserEventFieldNumber = 25,
41863     kChromeKeyedServiceFieldNumber = 26,
41864     kChromeLegacyIpcFieldNumber = 27,
41865     kChromeHistogramSampleFieldNumber = 28,
41866     kChromeLatencyInfoFieldNumber = 29,
41867     kChromeFrameReporterFieldNumber = 32,
41868     kTimestampDeltaUsFieldNumber = 1,
41869     kTimestampAbsoluteUsFieldNumber = 16,
41870     kThreadTimeDeltaUsFieldNumber = 2,
41871     kThreadTimeAbsoluteUsFieldNumber = 17,
41872     kThreadInstructionCountDeltaFieldNumber = 8,
41873     kThreadInstructionCountAbsoluteFieldNumber = 20,
41874     kLegacyEventFieldNumber = 6,
41875   };
41876   using LegacyEvent = ::perfetto::protos::pbzero::TrackEvent_LegacyEvent;
41877   using Type = ::perfetto::protos::pbzero::TrackEvent_Type;
41878   static const Type TYPE_UNSPECIFIED = TrackEvent_Type_TYPE_UNSPECIFIED;
41879   static const Type TYPE_SLICE_BEGIN = TrackEvent_Type_TYPE_SLICE_BEGIN;
41880   static const Type TYPE_SLICE_END = TrackEvent_Type_TYPE_SLICE_END;
41881   static const Type TYPE_INSTANT = TrackEvent_Type_TYPE_INSTANT;
41882   static const Type TYPE_COUNTER = TrackEvent_Type_TYPE_COUNTER;
41883   void add_category_iids(uint64_t value) {
41884     AppendVarInt(3, value);
41885   }
41886   void add_categories(const std::string& value) {
41887     AppendBytes(22, value.data(), value.size());
41888   }
41889   void add_categories(const char* data, size_t size) {
41890     AppendBytes(22, data, size);
41891   }
41892   void set_name_iid(uint64_t value) {
41893     AppendVarInt(10, value);
41894   }
41895   void set_name(const std::string& value) {
41896     AppendBytes(23, value.data(), value.size());
41897   }
41898   void set_name(const char* data, size_t size) {
41899     AppendBytes(23, data, size);
41900   }
41901   void set_type(::perfetto::protos::pbzero::TrackEvent_Type value) {
41902     AppendTinyVarInt(9, value);
41903   }
41904   void set_track_uuid(uint64_t value) {
41905     AppendVarInt(11, value);
41906   }
41907   void set_counter_value(int64_t value) {
41908     AppendVarInt(30, value);
41909   }
41910   void add_extra_counter_track_uuids(uint64_t value) {
41911     AppendVarInt(31, value);
41912   }
41913   void add_extra_counter_values(int64_t value) {
41914     AppendVarInt(12, value);
41915   }
41916   template <typename T = DebugAnnotation> T* add_debug_annotations() {
41917     return BeginNestedMessage<T>(4);
41918   }
41919 
41920   template <typename T = TaskExecution> T* set_task_execution() {
41921     return BeginNestedMessage<T>(5);
41922   }
41923 
41924   template <typename T = LogMessage> T* set_log_message() {
41925     return BeginNestedMessage<T>(21);
41926   }
41927 
41928   template <typename T = ChromeCompositorSchedulerState> T* set_cc_scheduler_state() {
41929     return BeginNestedMessage<T>(24);
41930   }
41931 
41932   template <typename T = ChromeUserEvent> T* set_chrome_user_event() {
41933     return BeginNestedMessage<T>(25);
41934   }
41935 
41936   template <typename T = ChromeKeyedService> T* set_chrome_keyed_service() {
41937     return BeginNestedMessage<T>(26);
41938   }
41939 
41940   template <typename T = ChromeLegacyIpc> T* set_chrome_legacy_ipc() {
41941     return BeginNestedMessage<T>(27);
41942   }
41943 
41944   template <typename T = ChromeHistogramSample> T* set_chrome_histogram_sample() {
41945     return BeginNestedMessage<T>(28);
41946   }
41947 
41948   template <typename T = ChromeLatencyInfo> T* set_chrome_latency_info() {
41949     return BeginNestedMessage<T>(29);
41950   }
41951 
41952   template <typename T = ChromeFrameReporter> T* set_chrome_frame_reporter() {
41953     return BeginNestedMessage<T>(32);
41954   }
41955 
41956   void set_timestamp_delta_us(int64_t value) {
41957     AppendVarInt(1, value);
41958   }
41959   void set_timestamp_absolute_us(int64_t value) {
41960     AppendVarInt(16, value);
41961   }
41962   void set_thread_time_delta_us(int64_t value) {
41963     AppendVarInt(2, value);
41964   }
41965   void set_thread_time_absolute_us(int64_t value) {
41966     AppendVarInt(17, value);
41967   }
41968   void set_thread_instruction_count_delta(int64_t value) {
41969     AppendVarInt(8, value);
41970   }
41971   void set_thread_instruction_count_absolute(int64_t value) {
41972     AppendVarInt(20, value);
41973   }
41974   template <typename T = TrackEvent_LegacyEvent> T* set_legacy_event() {
41975     return BeginNestedMessage<T>(6);
41976   }
41977 
41978 };
41979 
41980 class TrackEvent_LegacyEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/19, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
41981  public:
41982   TrackEvent_LegacyEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
41983   explicit TrackEvent_LegacyEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
41984   explicit TrackEvent_LegacyEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
41985   bool has_name_iid() const { return at<1>().valid(); }
41986   uint64_t name_iid() const { return at<1>().as_uint64(); }
41987   bool has_phase() const { return at<2>().valid(); }
41988   int32_t phase() const { return at<2>().as_int32(); }
41989   bool has_duration_us() const { return at<3>().valid(); }
41990   int64_t duration_us() const { return at<3>().as_int64(); }
41991   bool has_thread_duration_us() const { return at<4>().valid(); }
41992   int64_t thread_duration_us() const { return at<4>().as_int64(); }
41993   bool has_thread_instruction_delta() const { return at<15>().valid(); }
41994   int64_t thread_instruction_delta() const { return at<15>().as_int64(); }
41995   bool has_unscoped_id() const { return at<6>().valid(); }
41996   uint64_t unscoped_id() const { return at<6>().as_uint64(); }
41997   bool has_local_id() const { return at<10>().valid(); }
41998   uint64_t local_id() const { return at<10>().as_uint64(); }
41999   bool has_global_id() const { return at<11>().valid(); }
42000   uint64_t global_id() const { return at<11>().as_uint64(); }
42001   bool has_id_scope() const { return at<7>().valid(); }
42002   ::protozero::ConstChars id_scope() const { return at<7>().as_string(); }
42003   bool has_use_async_tts() const { return at<9>().valid(); }
42004   bool use_async_tts() const { return at<9>().as_bool(); }
42005   bool has_bind_id() const { return at<8>().valid(); }
42006   uint64_t bind_id() const { return at<8>().as_uint64(); }
42007   bool has_bind_to_enclosing() const { return at<12>().valid(); }
42008   bool bind_to_enclosing() const { return at<12>().as_bool(); }
42009   bool has_flow_direction() const { return at<13>().valid(); }
42010   int32_t flow_direction() const { return at<13>().as_int32(); }
42011   bool has_instant_event_scope() const { return at<14>().valid(); }
42012   int32_t instant_event_scope() const { return at<14>().as_int32(); }
42013   bool has_pid_override() const { return at<18>().valid(); }
42014   int32_t pid_override() const { return at<18>().as_int32(); }
42015   bool has_tid_override() const { return at<19>().valid(); }
42016   int32_t tid_override() const { return at<19>().as_int32(); }
42017 };
42018 
42019 class TrackEvent_LegacyEvent : public ::protozero::Message {
42020  public:
42021   using Decoder = TrackEvent_LegacyEvent_Decoder;
42022   enum : int32_t {
42023     kNameIidFieldNumber = 1,
42024     kPhaseFieldNumber = 2,
42025     kDurationUsFieldNumber = 3,
42026     kThreadDurationUsFieldNumber = 4,
42027     kThreadInstructionDeltaFieldNumber = 15,
42028     kUnscopedIdFieldNumber = 6,
42029     kLocalIdFieldNumber = 10,
42030     kGlobalIdFieldNumber = 11,
42031     kIdScopeFieldNumber = 7,
42032     kUseAsyncTtsFieldNumber = 9,
42033     kBindIdFieldNumber = 8,
42034     kBindToEnclosingFieldNumber = 12,
42035     kFlowDirectionFieldNumber = 13,
42036     kInstantEventScopeFieldNumber = 14,
42037     kPidOverrideFieldNumber = 18,
42038     kTidOverrideFieldNumber = 19,
42039   };
42040   using FlowDirection = ::perfetto::protos::pbzero::TrackEvent_LegacyEvent_FlowDirection;
42041   using InstantEventScope = ::perfetto::protos::pbzero::TrackEvent_LegacyEvent_InstantEventScope;
42042   static const FlowDirection FLOW_UNSPECIFIED = TrackEvent_LegacyEvent_FlowDirection_FLOW_UNSPECIFIED;
42043   static const FlowDirection FLOW_IN = TrackEvent_LegacyEvent_FlowDirection_FLOW_IN;
42044   static const FlowDirection FLOW_OUT = TrackEvent_LegacyEvent_FlowDirection_FLOW_OUT;
42045   static const FlowDirection FLOW_INOUT = TrackEvent_LegacyEvent_FlowDirection_FLOW_INOUT;
42046   static const InstantEventScope SCOPE_UNSPECIFIED = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_UNSPECIFIED;
42047   static const InstantEventScope SCOPE_GLOBAL = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_GLOBAL;
42048   static const InstantEventScope SCOPE_PROCESS = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_PROCESS;
42049   static const InstantEventScope SCOPE_THREAD = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_THREAD;
42050   void set_name_iid(uint64_t value) {
42051     AppendVarInt(1, value);
42052   }
42053   void set_phase(int32_t value) {
42054     AppendVarInt(2, value);
42055   }
42056   void set_duration_us(int64_t value) {
42057     AppendVarInt(3, value);
42058   }
42059   void set_thread_duration_us(int64_t value) {
42060     AppendVarInt(4, value);
42061   }
42062   void set_thread_instruction_delta(int64_t value) {
42063     AppendVarInt(15, value);
42064   }
42065   void set_unscoped_id(uint64_t value) {
42066     AppendVarInt(6, value);
42067   }
42068   void set_local_id(uint64_t value) {
42069     AppendVarInt(10, value);
42070   }
42071   void set_global_id(uint64_t value) {
42072     AppendVarInt(11, value);
42073   }
42074   void set_id_scope(const std::string& value) {
42075     AppendBytes(7, value.data(), value.size());
42076   }
42077   void set_id_scope(const char* data, size_t size) {
42078     AppendBytes(7, data, size);
42079   }
42080   void set_use_async_tts(bool value) {
42081     AppendTinyVarInt(9, value);
42082   }
42083   void set_bind_id(uint64_t value) {
42084     AppendVarInt(8, value);
42085   }
42086   void set_bind_to_enclosing(bool value) {
42087     AppendTinyVarInt(12, value);
42088   }
42089   void set_flow_direction(::perfetto::protos::pbzero::TrackEvent_LegacyEvent_FlowDirection value) {
42090     AppendTinyVarInt(13, value);
42091   }
42092   void set_instant_event_scope(::perfetto::protos::pbzero::TrackEvent_LegacyEvent_InstantEventScope value) {
42093     AppendTinyVarInt(14, value);
42094   }
42095   void set_pid_override(int32_t value) {
42096     AppendVarInt(18, value);
42097   }
42098   void set_tid_override(int32_t value) {
42099     AppendVarInt(19, value);
42100   }
42101 };
42102 
42103 } // Namespace.
42104 } // Namespace.
42105 } // Namespace.
42106 #endif  // Include guard.
42107 // gen_amalgamated begin header: gen/protos/perfetto/trace/interned_data/interned_data.pbzero.h
42108 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
42109 
42110 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_INTERNED_DATA_INTERNED_DATA_PROTO_H_
42111 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_INTERNED_DATA_INTERNED_DATA_PROTO_H_
42112 
42113 #include <stddef.h>
42114 #include <stdint.h>
42115 
42116 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
42117 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
42118 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
42119 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
42120 
42121 namespace perfetto {
42122 namespace protos {
42123 namespace pbzero {
42124 
42125 class Callstack;
42126 class DebugAnnotationName;
42127 class EventCategory;
42128 class EventName;
42129 class Frame;
42130 class InternedGpuRenderStageSpecification;
42131 class InternedGraphicsContext;
42132 class InternedString;
42133 class LogMessageBody;
42134 class Mapping;
42135 class ProfiledFrameSymbols;
42136 class SourceLocation;
42137 
42138 class InternedData_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/24, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
42139  public:
42140   InternedData_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
42141   explicit InternedData_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
42142   explicit InternedData_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
42143   bool has_event_categories() const { return at<1>().valid(); }
42144   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> event_categories() const { return GetRepeated<::protozero::ConstBytes>(1); }
42145   bool has_event_names() const { return at<2>().valid(); }
42146   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> event_names() const { return GetRepeated<::protozero::ConstBytes>(2); }
42147   bool has_debug_annotation_names() const { return at<3>().valid(); }
42148   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> debug_annotation_names() const { return GetRepeated<::protozero::ConstBytes>(3); }
42149   bool has_source_locations() const { return at<4>().valid(); }
42150   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> source_locations() const { return GetRepeated<::protozero::ConstBytes>(4); }
42151   bool has_log_message_body() const { return at<20>().valid(); }
42152   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> log_message_body() const { return GetRepeated<::protozero::ConstBytes>(20); }
42153   bool has_build_ids() const { return at<16>().valid(); }
42154   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> build_ids() const { return GetRepeated<::protozero::ConstBytes>(16); }
42155   bool has_mapping_paths() const { return at<17>().valid(); }
42156   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> mapping_paths() const { return GetRepeated<::protozero::ConstBytes>(17); }
42157   bool has_source_paths() const { return at<18>().valid(); }
42158   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> source_paths() const { return GetRepeated<::protozero::ConstBytes>(18); }
42159   bool has_function_names() const { return at<5>().valid(); }
42160   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> function_names() const { return GetRepeated<::protozero::ConstBytes>(5); }
42161   bool has_profiled_frame_symbols() const { return at<21>().valid(); }
42162   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> profiled_frame_symbols() const { return GetRepeated<::protozero::ConstBytes>(21); }
42163   bool has_mappings() const { return at<19>().valid(); }
42164   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> mappings() const { return GetRepeated<::protozero::ConstBytes>(19); }
42165   bool has_frames() const { return at<6>().valid(); }
42166   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> frames() const { return GetRepeated<::protozero::ConstBytes>(6); }
42167   bool has_callstacks() const { return at<7>().valid(); }
42168   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> callstacks() const { return GetRepeated<::protozero::ConstBytes>(7); }
42169   bool has_vulkan_memory_keys() const { return at<22>().valid(); }
42170   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> vulkan_memory_keys() const { return GetRepeated<::protozero::ConstBytes>(22); }
42171   bool has_graphics_contexts() const { return at<23>().valid(); }
42172   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> graphics_contexts() const { return GetRepeated<::protozero::ConstBytes>(23); }
42173   bool has_gpu_specifications() const { return at<24>().valid(); }
42174   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> gpu_specifications() const { return GetRepeated<::protozero::ConstBytes>(24); }
42175 };
42176 
42177 class InternedData : public ::protozero::Message {
42178  public:
42179   using Decoder = InternedData_Decoder;
42180   enum : int32_t {
42181     kEventCategoriesFieldNumber = 1,
42182     kEventNamesFieldNumber = 2,
42183     kDebugAnnotationNamesFieldNumber = 3,
42184     kSourceLocationsFieldNumber = 4,
42185     kLogMessageBodyFieldNumber = 20,
42186     kBuildIdsFieldNumber = 16,
42187     kMappingPathsFieldNumber = 17,
42188     kSourcePathsFieldNumber = 18,
42189     kFunctionNamesFieldNumber = 5,
42190     kProfiledFrameSymbolsFieldNumber = 21,
42191     kMappingsFieldNumber = 19,
42192     kFramesFieldNumber = 6,
42193     kCallstacksFieldNumber = 7,
42194     kVulkanMemoryKeysFieldNumber = 22,
42195     kGraphicsContextsFieldNumber = 23,
42196     kGpuSpecificationsFieldNumber = 24,
42197   };
42198   template <typename T = EventCategory> T* add_event_categories() {
42199     return BeginNestedMessage<T>(1);
42200   }
42201 
42202   template <typename T = EventName> T* add_event_names() {
42203     return BeginNestedMessage<T>(2);
42204   }
42205 
42206   template <typename T = DebugAnnotationName> T* add_debug_annotation_names() {
42207     return BeginNestedMessage<T>(3);
42208   }
42209 
42210   template <typename T = SourceLocation> T* add_source_locations() {
42211     return BeginNestedMessage<T>(4);
42212   }
42213 
42214   template <typename T = LogMessageBody> T* add_log_message_body() {
42215     return BeginNestedMessage<T>(20);
42216   }
42217 
42218   template <typename T = InternedString> T* add_build_ids() {
42219     return BeginNestedMessage<T>(16);
42220   }
42221 
42222   template <typename T = InternedString> T* add_mapping_paths() {
42223     return BeginNestedMessage<T>(17);
42224   }
42225 
42226   template <typename T = InternedString> T* add_source_paths() {
42227     return BeginNestedMessage<T>(18);
42228   }
42229 
42230   template <typename T = InternedString> T* add_function_names() {
42231     return BeginNestedMessage<T>(5);
42232   }
42233 
42234   template <typename T = ProfiledFrameSymbols> T* add_profiled_frame_symbols() {
42235     return BeginNestedMessage<T>(21);
42236   }
42237 
42238   template <typename T = Mapping> T* add_mappings() {
42239     return BeginNestedMessage<T>(19);
42240   }
42241 
42242   template <typename T = Frame> T* add_frames() {
42243     return BeginNestedMessage<T>(6);
42244   }
42245 
42246   template <typename T = Callstack> T* add_callstacks() {
42247     return BeginNestedMessage<T>(7);
42248   }
42249 
42250   template <typename T = InternedString> T* add_vulkan_memory_keys() {
42251     return BeginNestedMessage<T>(22);
42252   }
42253 
42254   template <typename T = InternedGraphicsContext> T* add_graphics_contexts() {
42255     return BeginNestedMessage<T>(23);
42256   }
42257 
42258   template <typename T = InternedGpuRenderStageSpecification> T* add_gpu_specifications() {
42259     return BeginNestedMessage<T>(24);
42260   }
42261 
42262 };
42263 
42264 } // Namespace.
42265 } // Namespace.
42266 } // Namespace.
42267 #endif  // Include guard.
42268 // gen_amalgamated begin header: gen/protos/perfetto/trace/perfetto/perfetto_metatrace.pbzero.h
42269 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
42270 
42271 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PERFETTO_PERFETTO_METATRACE_PROTO_H_
42272 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PERFETTO_PERFETTO_METATRACE_PROTO_H_
42273 
42274 #include <stddef.h>
42275 #include <stdint.h>
42276 
42277 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
42278 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
42279 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
42280 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
42281 
42282 namespace perfetto {
42283 namespace protos {
42284 namespace pbzero {
42285 
42286 class PerfettoMetatrace_Arg;
42287 
42288 class PerfettoMetatrace_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/9, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
42289  public:
42290   PerfettoMetatrace_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
42291   explicit PerfettoMetatrace_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
42292   explicit PerfettoMetatrace_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
42293   bool has_event_id() const { return at<1>().valid(); }
42294   uint32_t event_id() const { return at<1>().as_uint32(); }
42295   bool has_counter_id() const { return at<2>().valid(); }
42296   uint32_t counter_id() const { return at<2>().as_uint32(); }
42297   bool has_event_name() const { return at<8>().valid(); }
42298   ::protozero::ConstChars event_name() const { return at<8>().as_string(); }
42299   bool has_counter_name() const { return at<9>().valid(); }
42300   ::protozero::ConstChars counter_name() const { return at<9>().as_string(); }
42301   bool has_event_duration_ns() const { return at<3>().valid(); }
42302   uint32_t event_duration_ns() const { return at<3>().as_uint32(); }
42303   bool has_counter_value() const { return at<4>().valid(); }
42304   int32_t counter_value() const { return at<4>().as_int32(); }
42305   bool has_thread_id() const { return at<5>().valid(); }
42306   uint32_t thread_id() const { return at<5>().as_uint32(); }
42307   bool has_has_overruns() const { return at<6>().valid(); }
42308   bool has_overruns() const { return at<6>().as_bool(); }
42309   bool has_args() const { return at<7>().valid(); }
42310   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> args() const { return GetRepeated<::protozero::ConstBytes>(7); }
42311 };
42312 
42313 class PerfettoMetatrace : public ::protozero::Message {
42314  public:
42315   using Decoder = PerfettoMetatrace_Decoder;
42316   enum : int32_t {
42317     kEventIdFieldNumber = 1,
42318     kCounterIdFieldNumber = 2,
42319     kEventNameFieldNumber = 8,
42320     kCounterNameFieldNumber = 9,
42321     kEventDurationNsFieldNumber = 3,
42322     kCounterValueFieldNumber = 4,
42323     kThreadIdFieldNumber = 5,
42324     kHasOverrunsFieldNumber = 6,
42325     kArgsFieldNumber = 7,
42326   };
42327   using Arg = ::perfetto::protos::pbzero::PerfettoMetatrace_Arg;
42328   void set_event_id(uint32_t value) {
42329     AppendVarInt(1, value);
42330   }
42331   void set_counter_id(uint32_t value) {
42332     AppendVarInt(2, value);
42333   }
42334   void set_event_name(const std::string& value) {
42335     AppendBytes(8, value.data(), value.size());
42336   }
42337   void set_event_name(const char* data, size_t size) {
42338     AppendBytes(8, data, size);
42339   }
42340   void set_counter_name(const std::string& value) {
42341     AppendBytes(9, value.data(), value.size());
42342   }
42343   void set_counter_name(const char* data, size_t size) {
42344     AppendBytes(9, data, size);
42345   }
42346   void set_event_duration_ns(uint32_t value) {
42347     AppendVarInt(3, value);
42348   }
42349   void set_counter_value(int32_t value) {
42350     AppendVarInt(4, value);
42351   }
42352   void set_thread_id(uint32_t value) {
42353     AppendVarInt(5, value);
42354   }
42355   void set_has_overruns(bool value) {
42356     AppendTinyVarInt(6, value);
42357   }
42358   template <typename T = PerfettoMetatrace_Arg> T* add_args() {
42359     return BeginNestedMessage<T>(7);
42360   }
42361 
42362 };
42363 
42364 class PerfettoMetatrace_Arg_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
42365  public:
42366   PerfettoMetatrace_Arg_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
42367   explicit PerfettoMetatrace_Arg_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
42368   explicit PerfettoMetatrace_Arg_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
42369   bool has_key() const { return at<1>().valid(); }
42370   ::protozero::ConstChars key() const { return at<1>().as_string(); }
42371   bool has_value() const { return at<2>().valid(); }
42372   ::protozero::ConstChars value() const { return at<2>().as_string(); }
42373 };
42374 
42375 class PerfettoMetatrace_Arg : public ::protozero::Message {
42376  public:
42377   using Decoder = PerfettoMetatrace_Arg_Decoder;
42378   enum : int32_t {
42379     kKeyFieldNumber = 1,
42380     kValueFieldNumber = 2,
42381   };
42382   void set_key(const std::string& value) {
42383     AppendBytes(1, value.data(), value.size());
42384   }
42385   void set_key(const char* data, size_t size) {
42386     AppendBytes(1, data, size);
42387   }
42388   void set_value(const std::string& value) {
42389     AppendBytes(2, value.data(), value.size());
42390   }
42391   void set_value(const char* data, size_t size) {
42392     AppendBytes(2, data, size);
42393   }
42394 };
42395 
42396 } // Namespace.
42397 } // Namespace.
42398 } // Namespace.
42399 #endif  // Include guard.
42400 // gen_amalgamated begin header: gen/protos/perfetto/trace/perfetto/tracing_service_event.pbzero.h
42401 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
42402 
42403 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PERFETTO_TRACING_SERVICE_EVENT_PROTO_H_
42404 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PERFETTO_TRACING_SERVICE_EVENT_PROTO_H_
42405 
42406 #include <stddef.h>
42407 #include <stdint.h>
42408 
42409 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
42410 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
42411 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
42412 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
42413 
42414 namespace perfetto {
42415 namespace protos {
42416 namespace pbzero {
42417 
42418 
42419 class TracingServiceEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
42420  public:
42421   TracingServiceEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
42422   explicit TracingServiceEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
42423   explicit TracingServiceEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
42424   bool has_tracing_started() const { return at<2>().valid(); }
42425   bool tracing_started() const { return at<2>().as_bool(); }
42426   bool has_all_data_sources_started() const { return at<1>().valid(); }
42427   bool all_data_sources_started() const { return at<1>().as_bool(); }
42428   bool has_all_data_sources_flushed() const { return at<3>().valid(); }
42429   bool all_data_sources_flushed() const { return at<3>().as_bool(); }
42430   bool has_read_tracing_buffers_completed() const { return at<4>().valid(); }
42431   bool read_tracing_buffers_completed() const { return at<4>().as_bool(); }
42432   bool has_tracing_disabled() const { return at<5>().valid(); }
42433   bool tracing_disabled() const { return at<5>().as_bool(); }
42434 };
42435 
42436 class TracingServiceEvent : public ::protozero::Message {
42437  public:
42438   using Decoder = TracingServiceEvent_Decoder;
42439   enum : int32_t {
42440     kTracingStartedFieldNumber = 2,
42441     kAllDataSourcesStartedFieldNumber = 1,
42442     kAllDataSourcesFlushedFieldNumber = 3,
42443     kReadTracingBuffersCompletedFieldNumber = 4,
42444     kTracingDisabledFieldNumber = 5,
42445   };
42446   void set_tracing_started(bool value) {
42447     AppendTinyVarInt(2, value);
42448   }
42449   void set_all_data_sources_started(bool value) {
42450     AppendTinyVarInt(1, value);
42451   }
42452   void set_all_data_sources_flushed(bool value) {
42453     AppendTinyVarInt(3, value);
42454   }
42455   void set_read_tracing_buffers_completed(bool value) {
42456     AppendTinyVarInt(4, value);
42457   }
42458   void set_tracing_disabled(bool value) {
42459     AppendTinyVarInt(5, value);
42460   }
42461 };
42462 
42463 } // Namespace.
42464 } // Namespace.
42465 } // Namespace.
42466 #endif  // Include guard.
42467 // gen_amalgamated begin header: gen/protos/perfetto/trace/power/battery_counters.pbzero.h
42468 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
42469 
42470 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_POWER_BATTERY_COUNTERS_PROTO_H_
42471 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_POWER_BATTERY_COUNTERS_PROTO_H_
42472 
42473 #include <stddef.h>
42474 #include <stdint.h>
42475 
42476 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
42477 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
42478 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
42479 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
42480 
42481 namespace perfetto {
42482 namespace protos {
42483 namespace pbzero {
42484 
42485 
42486 class BatteryCounters_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
42487  public:
42488   BatteryCounters_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
42489   explicit BatteryCounters_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
42490   explicit BatteryCounters_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
42491   bool has_charge_counter_uah() const { return at<1>().valid(); }
42492   int64_t charge_counter_uah() const { return at<1>().as_int64(); }
42493   bool has_capacity_percent() const { return at<2>().valid(); }
42494   float capacity_percent() const { return at<2>().as_float(); }
42495   bool has_current_ua() const { return at<3>().valid(); }
42496   int64_t current_ua() const { return at<3>().as_int64(); }
42497   bool has_current_avg_ua() const { return at<4>().valid(); }
42498   int64_t current_avg_ua() const { return at<4>().as_int64(); }
42499 };
42500 
42501 class BatteryCounters : public ::protozero::Message {
42502  public:
42503   using Decoder = BatteryCounters_Decoder;
42504   enum : int32_t {
42505     kChargeCounterUahFieldNumber = 1,
42506     kCapacityPercentFieldNumber = 2,
42507     kCurrentUaFieldNumber = 3,
42508     kCurrentAvgUaFieldNumber = 4,
42509   };
42510   void set_charge_counter_uah(int64_t value) {
42511     AppendVarInt(1, value);
42512   }
42513   void set_capacity_percent(float value) {
42514     AppendFixed(2, value);
42515   }
42516   void set_current_ua(int64_t value) {
42517     AppendVarInt(3, value);
42518   }
42519   void set_current_avg_ua(int64_t value) {
42520     AppendVarInt(4, value);
42521   }
42522 };
42523 
42524 } // Namespace.
42525 } // Namespace.
42526 } // Namespace.
42527 #endif  // Include guard.
42528 // gen_amalgamated begin header: gen/protos/perfetto/trace/power/power_rails.pbzero.h
42529 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
42530 
42531 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_POWER_POWER_RAILS_PROTO_H_
42532 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_POWER_POWER_RAILS_PROTO_H_
42533 
42534 #include <stddef.h>
42535 #include <stdint.h>
42536 
42537 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
42538 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
42539 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
42540 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
42541 
42542 namespace perfetto {
42543 namespace protos {
42544 namespace pbzero {
42545 
42546 class PowerRails_EnergyData;
42547 class PowerRails_RailDescriptor;
42548 
42549 class PowerRails_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
42550  public:
42551   PowerRails_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
42552   explicit PowerRails_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
42553   explicit PowerRails_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
42554   bool has_rail_descriptor() const { return at<1>().valid(); }
42555   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> rail_descriptor() const { return GetRepeated<::protozero::ConstBytes>(1); }
42556   bool has_energy_data() const { return at<2>().valid(); }
42557   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> energy_data() const { return GetRepeated<::protozero::ConstBytes>(2); }
42558 };
42559 
42560 class PowerRails : public ::protozero::Message {
42561  public:
42562   using Decoder = PowerRails_Decoder;
42563   enum : int32_t {
42564     kRailDescriptorFieldNumber = 1,
42565     kEnergyDataFieldNumber = 2,
42566   };
42567   using RailDescriptor = ::perfetto::protos::pbzero::PowerRails_RailDescriptor;
42568   using EnergyData = ::perfetto::protos::pbzero::PowerRails_EnergyData;
42569   template <typename T = PowerRails_RailDescriptor> T* add_rail_descriptor() {
42570     return BeginNestedMessage<T>(1);
42571   }
42572 
42573   template <typename T = PowerRails_EnergyData> T* add_energy_data() {
42574     return BeginNestedMessage<T>(2);
42575   }
42576 
42577 };
42578 
42579 class PowerRails_EnergyData_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
42580  public:
42581   PowerRails_EnergyData_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
42582   explicit PowerRails_EnergyData_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
42583   explicit PowerRails_EnergyData_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
42584   bool has_index() const { return at<1>().valid(); }
42585   uint32_t index() const { return at<1>().as_uint32(); }
42586   bool has_timestamp_ms() const { return at<2>().valid(); }
42587   uint64_t timestamp_ms() const { return at<2>().as_uint64(); }
42588   bool has_energy() const { return at<3>().valid(); }
42589   uint64_t energy() const { return at<3>().as_uint64(); }
42590 };
42591 
42592 class PowerRails_EnergyData : public ::protozero::Message {
42593  public:
42594   using Decoder = PowerRails_EnergyData_Decoder;
42595   enum : int32_t {
42596     kIndexFieldNumber = 1,
42597     kTimestampMsFieldNumber = 2,
42598     kEnergyFieldNumber = 3,
42599   };
42600   void set_index(uint32_t value) {
42601     AppendVarInt(1, value);
42602   }
42603   void set_timestamp_ms(uint64_t value) {
42604     AppendVarInt(2, value);
42605   }
42606   void set_energy(uint64_t value) {
42607     AppendVarInt(3, value);
42608   }
42609 };
42610 
42611 class PowerRails_RailDescriptor_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
42612  public:
42613   PowerRails_RailDescriptor_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
42614   explicit PowerRails_RailDescriptor_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
42615   explicit PowerRails_RailDescriptor_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
42616   bool has_index() const { return at<1>().valid(); }
42617   uint32_t index() const { return at<1>().as_uint32(); }
42618   bool has_rail_name() const { return at<2>().valid(); }
42619   ::protozero::ConstChars rail_name() const { return at<2>().as_string(); }
42620   bool has_subsys_name() const { return at<3>().valid(); }
42621   ::protozero::ConstChars subsys_name() const { return at<3>().as_string(); }
42622   bool has_sampling_rate() const { return at<4>().valid(); }
42623   uint32_t sampling_rate() const { return at<4>().as_uint32(); }
42624 };
42625 
42626 class PowerRails_RailDescriptor : public ::protozero::Message {
42627  public:
42628   using Decoder = PowerRails_RailDescriptor_Decoder;
42629   enum : int32_t {
42630     kIndexFieldNumber = 1,
42631     kRailNameFieldNumber = 2,
42632     kSubsysNameFieldNumber = 3,
42633     kSamplingRateFieldNumber = 4,
42634   };
42635   void set_index(uint32_t value) {
42636     AppendVarInt(1, value);
42637   }
42638   void set_rail_name(const std::string& value) {
42639     AppendBytes(2, value.data(), value.size());
42640   }
42641   void set_rail_name(const char* data, size_t size) {
42642     AppendBytes(2, data, size);
42643   }
42644   void set_subsys_name(const std::string& value) {
42645     AppendBytes(3, value.data(), value.size());
42646   }
42647   void set_subsys_name(const char* data, size_t size) {
42648     AppendBytes(3, data, size);
42649   }
42650   void set_sampling_rate(uint32_t value) {
42651     AppendVarInt(4, value);
42652   }
42653 };
42654 
42655 } // Namespace.
42656 } // Namespace.
42657 } // Namespace.
42658 #endif  // Include guard.
42659 // gen_amalgamated begin header: gen/protos/perfetto/trace/ps/process_stats.pbzero.h
42660 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
42661 
42662 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PS_PROCESS_STATS_PROTO_H_
42663 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PS_PROCESS_STATS_PROTO_H_
42664 
42665 #include <stddef.h>
42666 #include <stdint.h>
42667 
42668 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
42669 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
42670 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
42671 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
42672 
42673 namespace perfetto {
42674 namespace protos {
42675 namespace pbzero {
42676 
42677 class ProcessStats_Process;
42678 class ProcessStats_Thread;
42679 
42680 class ProcessStats_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
42681  public:
42682   ProcessStats_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
42683   explicit ProcessStats_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
42684   explicit ProcessStats_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
42685   bool has_processes() const { return at<1>().valid(); }
42686   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> processes() const { return GetRepeated<::protozero::ConstBytes>(1); }
42687   bool has_collection_end_timestamp() const { return at<2>().valid(); }
42688   uint64_t collection_end_timestamp() const { return at<2>().as_uint64(); }
42689 };
42690 
42691 class ProcessStats : public ::protozero::Message {
42692  public:
42693   using Decoder = ProcessStats_Decoder;
42694   enum : int32_t {
42695     kProcessesFieldNumber = 1,
42696     kCollectionEndTimestampFieldNumber = 2,
42697   };
42698   using Thread = ::perfetto::protos::pbzero::ProcessStats_Thread;
42699   using Process = ::perfetto::protos::pbzero::ProcessStats_Process;
42700   template <typename T = ProcessStats_Process> T* add_processes() {
42701     return BeginNestedMessage<T>(1);
42702   }
42703 
42704   void set_collection_end_timestamp(uint64_t value) {
42705     AppendVarInt(2, value);
42706   }
42707 };
42708 
42709 class ProcessStats_Process_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/14, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
42710  public:
42711   ProcessStats_Process_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
42712   explicit ProcessStats_Process_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
42713   explicit ProcessStats_Process_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
42714   bool has_pid() const { return at<1>().valid(); }
42715   int32_t pid() const { return at<1>().as_int32(); }
42716   bool has_vm_size_kb() const { return at<2>().valid(); }
42717   uint64_t vm_size_kb() const { return at<2>().as_uint64(); }
42718   bool has_vm_rss_kb() const { return at<3>().valid(); }
42719   uint64_t vm_rss_kb() const { return at<3>().as_uint64(); }
42720   bool has_rss_anon_kb() const { return at<4>().valid(); }
42721   uint64_t rss_anon_kb() const { return at<4>().as_uint64(); }
42722   bool has_rss_file_kb() const { return at<5>().valid(); }
42723   uint64_t rss_file_kb() const { return at<5>().as_uint64(); }
42724   bool has_rss_shmem_kb() const { return at<6>().valid(); }
42725   uint64_t rss_shmem_kb() const { return at<6>().as_uint64(); }
42726   bool has_vm_swap_kb() const { return at<7>().valid(); }
42727   uint64_t vm_swap_kb() const { return at<7>().as_uint64(); }
42728   bool has_vm_locked_kb() const { return at<8>().valid(); }
42729   uint64_t vm_locked_kb() const { return at<8>().as_uint64(); }
42730   bool has_vm_hwm_kb() const { return at<9>().valid(); }
42731   uint64_t vm_hwm_kb() const { return at<9>().as_uint64(); }
42732   bool has_oom_score_adj() const { return at<10>().valid(); }
42733   int64_t oom_score_adj() const { return at<10>().as_int64(); }
42734   bool has_threads() const { return at<11>().valid(); }
42735   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> threads() const { return GetRepeated<::protozero::ConstBytes>(11); }
42736   bool has_is_peak_rss_resettable() const { return at<12>().valid(); }
42737   bool is_peak_rss_resettable() const { return at<12>().as_bool(); }
42738   bool has_chrome_private_footprint_kb() const { return at<13>().valid(); }
42739   uint32_t chrome_private_footprint_kb() const { return at<13>().as_uint32(); }
42740   bool has_chrome_peak_resident_set_kb() const { return at<14>().valid(); }
42741   uint32_t chrome_peak_resident_set_kb() const { return at<14>().as_uint32(); }
42742 };
42743 
42744 class ProcessStats_Process : public ::protozero::Message {
42745  public:
42746   using Decoder = ProcessStats_Process_Decoder;
42747   enum : int32_t {
42748     kPidFieldNumber = 1,
42749     kVmSizeKbFieldNumber = 2,
42750     kVmRssKbFieldNumber = 3,
42751     kRssAnonKbFieldNumber = 4,
42752     kRssFileKbFieldNumber = 5,
42753     kRssShmemKbFieldNumber = 6,
42754     kVmSwapKbFieldNumber = 7,
42755     kVmLockedKbFieldNumber = 8,
42756     kVmHwmKbFieldNumber = 9,
42757     kOomScoreAdjFieldNumber = 10,
42758     kThreadsFieldNumber = 11,
42759     kIsPeakRssResettableFieldNumber = 12,
42760     kChromePrivateFootprintKbFieldNumber = 13,
42761     kChromePeakResidentSetKbFieldNumber = 14,
42762   };
42763   void set_pid(int32_t value) {
42764     AppendVarInt(1, value);
42765   }
42766   void set_vm_size_kb(uint64_t value) {
42767     AppendVarInt(2, value);
42768   }
42769   void set_vm_rss_kb(uint64_t value) {
42770     AppendVarInt(3, value);
42771   }
42772   void set_rss_anon_kb(uint64_t value) {
42773     AppendVarInt(4, value);
42774   }
42775   void set_rss_file_kb(uint64_t value) {
42776     AppendVarInt(5, value);
42777   }
42778   void set_rss_shmem_kb(uint64_t value) {
42779     AppendVarInt(6, value);
42780   }
42781   void set_vm_swap_kb(uint64_t value) {
42782     AppendVarInt(7, value);
42783   }
42784   void set_vm_locked_kb(uint64_t value) {
42785     AppendVarInt(8, value);
42786   }
42787   void set_vm_hwm_kb(uint64_t value) {
42788     AppendVarInt(9, value);
42789   }
42790   void set_oom_score_adj(int64_t value) {
42791     AppendVarInt(10, value);
42792   }
42793   template <typename T = ProcessStats_Thread> T* add_threads() {
42794     return BeginNestedMessage<T>(11);
42795   }
42796 
42797   void set_is_peak_rss_resettable(bool value) {
42798     AppendTinyVarInt(12, value);
42799   }
42800   void set_chrome_private_footprint_kb(uint32_t value) {
42801     AppendVarInt(13, value);
42802   }
42803   void set_chrome_peak_resident_set_kb(uint32_t value) {
42804     AppendVarInt(14, value);
42805   }
42806 };
42807 
42808 class ProcessStats_Thread_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
42809  public:
42810   ProcessStats_Thread_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
42811   explicit ProcessStats_Thread_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
42812   explicit ProcessStats_Thread_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
42813   bool has_tid() const { return at<1>().valid(); }
42814   int32_t tid() const { return at<1>().as_int32(); }
42815   bool has_cpu_freq_indices() const { return at<2>().valid(); }
42816   ::protozero::RepeatedFieldIterator<uint32_t> cpu_freq_indices() const { return GetRepeated<uint32_t>(2); }
42817   bool has_cpu_freq_ticks() const { return at<3>().valid(); }
42818   ::protozero::RepeatedFieldIterator<uint64_t> cpu_freq_ticks() const { return GetRepeated<uint64_t>(3); }
42819   bool has_cpu_freq_full() const { return at<4>().valid(); }
42820   bool cpu_freq_full() const { return at<4>().as_bool(); }
42821 };
42822 
42823 class ProcessStats_Thread : public ::protozero::Message {
42824  public:
42825   using Decoder = ProcessStats_Thread_Decoder;
42826   enum : int32_t {
42827     kTidFieldNumber = 1,
42828     kCpuFreqIndicesFieldNumber = 2,
42829     kCpuFreqTicksFieldNumber = 3,
42830     kCpuFreqFullFieldNumber = 4,
42831   };
42832   void set_tid(int32_t value) {
42833     AppendVarInt(1, value);
42834   }
42835   void add_cpu_freq_indices(uint32_t value) {
42836     AppendVarInt(2, value);
42837   }
42838   void add_cpu_freq_ticks(uint64_t value) {
42839     AppendVarInt(3, value);
42840   }
42841   void set_cpu_freq_full(bool value) {
42842     AppendTinyVarInt(4, value);
42843   }
42844 };
42845 
42846 } // Namespace.
42847 } // Namespace.
42848 } // Namespace.
42849 #endif  // Include guard.
42850 // gen_amalgamated begin header: gen/protos/perfetto/trace/ps/process_tree.pbzero.h
42851 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
42852 
42853 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PS_PROCESS_TREE_PROTO_H_
42854 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PS_PROCESS_TREE_PROTO_H_
42855 
42856 #include <stddef.h>
42857 #include <stdint.h>
42858 
42859 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
42860 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
42861 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
42862 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
42863 
42864 namespace perfetto {
42865 namespace protos {
42866 namespace pbzero {
42867 
42868 class ProcessTree_Process;
42869 class ProcessTree_Thread;
42870 
42871 class ProcessTree_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
42872  public:
42873   ProcessTree_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
42874   explicit ProcessTree_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
42875   explicit ProcessTree_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
42876   bool has_processes() const { return at<1>().valid(); }
42877   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> processes() const { return GetRepeated<::protozero::ConstBytes>(1); }
42878   bool has_threads() const { return at<2>().valid(); }
42879   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> threads() const { return GetRepeated<::protozero::ConstBytes>(2); }
42880   bool has_collection_end_timestamp() const { return at<3>().valid(); }
42881   uint64_t collection_end_timestamp() const { return at<3>().as_uint64(); }
42882 };
42883 
42884 class ProcessTree : public ::protozero::Message {
42885  public:
42886   using Decoder = ProcessTree_Decoder;
42887   enum : int32_t {
42888     kProcessesFieldNumber = 1,
42889     kThreadsFieldNumber = 2,
42890     kCollectionEndTimestampFieldNumber = 3,
42891   };
42892   using Thread = ::perfetto::protos::pbzero::ProcessTree_Thread;
42893   using Process = ::perfetto::protos::pbzero::ProcessTree_Process;
42894   template <typename T = ProcessTree_Process> T* add_processes() {
42895     return BeginNestedMessage<T>(1);
42896   }
42897 
42898   template <typename T = ProcessTree_Thread> T* add_threads() {
42899     return BeginNestedMessage<T>(2);
42900   }
42901 
42902   void set_collection_end_timestamp(uint64_t value) {
42903     AppendVarInt(3, value);
42904   }
42905 };
42906 
42907 class ProcessTree_Process_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
42908  public:
42909   ProcessTree_Process_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
42910   explicit ProcessTree_Process_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
42911   explicit ProcessTree_Process_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
42912   bool has_pid() const { return at<1>().valid(); }
42913   int32_t pid() const { return at<1>().as_int32(); }
42914   bool has_ppid() const { return at<2>().valid(); }
42915   int32_t ppid() const { return at<2>().as_int32(); }
42916   bool has_cmdline() const { return at<3>().valid(); }
42917   ::protozero::RepeatedFieldIterator<::protozero::ConstChars> cmdline() const { return GetRepeated<::protozero::ConstChars>(3); }
42918   bool has_threads_deprecated() const { return at<4>().valid(); }
42919   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> threads_deprecated() const { return GetRepeated<::protozero::ConstBytes>(4); }
42920   bool has_uid() const { return at<5>().valid(); }
42921   int32_t uid() const { return at<5>().as_int32(); }
42922 };
42923 
42924 class ProcessTree_Process : public ::protozero::Message {
42925  public:
42926   using Decoder = ProcessTree_Process_Decoder;
42927   enum : int32_t {
42928     kPidFieldNumber = 1,
42929     kPpidFieldNumber = 2,
42930     kCmdlineFieldNumber = 3,
42931     kThreadsDeprecatedFieldNumber = 4,
42932     kUidFieldNumber = 5,
42933   };
42934   void set_pid(int32_t value) {
42935     AppendVarInt(1, value);
42936   }
42937   void set_ppid(int32_t value) {
42938     AppendVarInt(2, value);
42939   }
42940   void add_cmdline(const std::string& value) {
42941     AppendBytes(3, value.data(), value.size());
42942   }
42943   void add_cmdline(const char* data, size_t size) {
42944     AppendBytes(3, data, size);
42945   }
42946   template <typename T = ProcessTree_Thread> T* add_threads_deprecated() {
42947     return BeginNestedMessage<T>(4);
42948   }
42949 
42950   void set_uid(int32_t value) {
42951     AppendVarInt(5, value);
42952   }
42953 };
42954 
42955 class ProcessTree_Thread_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
42956  public:
42957   ProcessTree_Thread_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
42958   explicit ProcessTree_Thread_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
42959   explicit ProcessTree_Thread_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
42960   bool has_tid() const { return at<1>().valid(); }
42961   int32_t tid() const { return at<1>().as_int32(); }
42962   bool has_tgid() const { return at<3>().valid(); }
42963   int32_t tgid() const { return at<3>().as_int32(); }
42964   bool has_name() const { return at<2>().valid(); }
42965   ::protozero::ConstChars name() const { return at<2>().as_string(); }
42966 };
42967 
42968 class ProcessTree_Thread : public ::protozero::Message {
42969  public:
42970   using Decoder = ProcessTree_Thread_Decoder;
42971   enum : int32_t {
42972     kTidFieldNumber = 1,
42973     kTgidFieldNumber = 3,
42974     kNameFieldNumber = 2,
42975   };
42976   void set_tid(int32_t value) {
42977     AppendVarInt(1, value);
42978   }
42979   void set_tgid(int32_t value) {
42980     AppendVarInt(3, value);
42981   }
42982   void set_name(const std::string& value) {
42983     AppendBytes(2, value.data(), value.size());
42984   }
42985   void set_name(const char* data, size_t size) {
42986     AppendBytes(2, data, size);
42987   }
42988 };
42989 
42990 } // Namespace.
42991 } // Namespace.
42992 } // Namespace.
42993 #endif  // Include guard.
42994 // gen_amalgamated begin header: gen/protos/perfetto/trace/sys_stats/sys_stats.pbzero.h
42995 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
42996 
42997 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_SYS_STATS_SYS_STATS_PROTO_H_
42998 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_SYS_STATS_SYS_STATS_PROTO_H_
42999 
43000 #include <stddef.h>
43001 #include <stdint.h>
43002 
43003 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
43004 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
43005 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
43006 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
43007 
43008 namespace perfetto {
43009 namespace protos {
43010 namespace pbzero {
43011 
43012 class SysStats_CpuTimes;
43013 class SysStats_InterruptCount;
43014 class SysStats_MeminfoValue;
43015 class SysStats_VmstatValue;
43016 enum MeminfoCounters : int32_t;
43017 enum VmstatCounters : int32_t;
43018 
43019 class SysStats_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/9, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
43020  public:
43021   SysStats_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
43022   explicit SysStats_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
43023   explicit SysStats_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
43024   bool has_meminfo() const { return at<1>().valid(); }
43025   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> meminfo() const { return GetRepeated<::protozero::ConstBytes>(1); }
43026   bool has_vmstat() const { return at<2>().valid(); }
43027   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> vmstat() const { return GetRepeated<::protozero::ConstBytes>(2); }
43028   bool has_cpu_stat() const { return at<3>().valid(); }
43029   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> cpu_stat() const { return GetRepeated<::protozero::ConstBytes>(3); }
43030   bool has_num_forks() const { return at<4>().valid(); }
43031   uint64_t num_forks() const { return at<4>().as_uint64(); }
43032   bool has_num_irq_total() const { return at<5>().valid(); }
43033   uint64_t num_irq_total() const { return at<5>().as_uint64(); }
43034   bool has_num_irq() const { return at<6>().valid(); }
43035   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> num_irq() const { return GetRepeated<::protozero::ConstBytes>(6); }
43036   bool has_num_softirq_total() const { return at<7>().valid(); }
43037   uint64_t num_softirq_total() const { return at<7>().as_uint64(); }
43038   bool has_num_softirq() const { return at<8>().valid(); }
43039   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> num_softirq() const { return GetRepeated<::protozero::ConstBytes>(8); }
43040   bool has_collection_end_timestamp() const { return at<9>().valid(); }
43041   uint64_t collection_end_timestamp() const { return at<9>().as_uint64(); }
43042 };
43043 
43044 class SysStats : public ::protozero::Message {
43045  public:
43046   using Decoder = SysStats_Decoder;
43047   enum : int32_t {
43048     kMeminfoFieldNumber = 1,
43049     kVmstatFieldNumber = 2,
43050     kCpuStatFieldNumber = 3,
43051     kNumForksFieldNumber = 4,
43052     kNumIrqTotalFieldNumber = 5,
43053     kNumIrqFieldNumber = 6,
43054     kNumSoftirqTotalFieldNumber = 7,
43055     kNumSoftirqFieldNumber = 8,
43056     kCollectionEndTimestampFieldNumber = 9,
43057   };
43058   using MeminfoValue = ::perfetto::protos::pbzero::SysStats_MeminfoValue;
43059   using VmstatValue = ::perfetto::protos::pbzero::SysStats_VmstatValue;
43060   using CpuTimes = ::perfetto::protos::pbzero::SysStats_CpuTimes;
43061   using InterruptCount = ::perfetto::protos::pbzero::SysStats_InterruptCount;
43062   template <typename T = SysStats_MeminfoValue> T* add_meminfo() {
43063     return BeginNestedMessage<T>(1);
43064   }
43065 
43066   template <typename T = SysStats_VmstatValue> T* add_vmstat() {
43067     return BeginNestedMessage<T>(2);
43068   }
43069 
43070   template <typename T = SysStats_CpuTimes> T* add_cpu_stat() {
43071     return BeginNestedMessage<T>(3);
43072   }
43073 
43074   void set_num_forks(uint64_t value) {
43075     AppendVarInt(4, value);
43076   }
43077   void set_num_irq_total(uint64_t value) {
43078     AppendVarInt(5, value);
43079   }
43080   template <typename T = SysStats_InterruptCount> T* add_num_irq() {
43081     return BeginNestedMessage<T>(6);
43082   }
43083 
43084   void set_num_softirq_total(uint64_t value) {
43085     AppendVarInt(7, value);
43086   }
43087   template <typename T = SysStats_InterruptCount> T* add_num_softirq() {
43088     return BeginNestedMessage<T>(8);
43089   }
43090 
43091   void set_collection_end_timestamp(uint64_t value) {
43092     AppendVarInt(9, value);
43093   }
43094 };
43095 
43096 class SysStats_InterruptCount_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
43097  public:
43098   SysStats_InterruptCount_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
43099   explicit SysStats_InterruptCount_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
43100   explicit SysStats_InterruptCount_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
43101   bool has_irq() const { return at<1>().valid(); }
43102   int32_t irq() const { return at<1>().as_int32(); }
43103   bool has_count() const { return at<2>().valid(); }
43104   uint64_t count() const { return at<2>().as_uint64(); }
43105 };
43106 
43107 class SysStats_InterruptCount : public ::protozero::Message {
43108  public:
43109   using Decoder = SysStats_InterruptCount_Decoder;
43110   enum : int32_t {
43111     kIrqFieldNumber = 1,
43112     kCountFieldNumber = 2,
43113   };
43114   void set_irq(int32_t value) {
43115     AppendVarInt(1, value);
43116   }
43117   void set_count(uint64_t value) {
43118     AppendVarInt(2, value);
43119   }
43120 };
43121 
43122 class SysStats_CpuTimes_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
43123  public:
43124   SysStats_CpuTimes_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
43125   explicit SysStats_CpuTimes_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
43126   explicit SysStats_CpuTimes_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
43127   bool has_cpu_id() const { return at<1>().valid(); }
43128   uint32_t cpu_id() const { return at<1>().as_uint32(); }
43129   bool has_user_ns() const { return at<2>().valid(); }
43130   uint64_t user_ns() const { return at<2>().as_uint64(); }
43131   bool has_user_ice_ns() const { return at<3>().valid(); }
43132   uint64_t user_ice_ns() const { return at<3>().as_uint64(); }
43133   bool has_system_mode_ns() const { return at<4>().valid(); }
43134   uint64_t system_mode_ns() const { return at<4>().as_uint64(); }
43135   bool has_idle_ns() const { return at<5>().valid(); }
43136   uint64_t idle_ns() const { return at<5>().as_uint64(); }
43137   bool has_io_wait_ns() const { return at<6>().valid(); }
43138   uint64_t io_wait_ns() const { return at<6>().as_uint64(); }
43139   bool has_irq_ns() const { return at<7>().valid(); }
43140   uint64_t irq_ns() const { return at<7>().as_uint64(); }
43141   bool has_softirq_ns() const { return at<8>().valid(); }
43142   uint64_t softirq_ns() const { return at<8>().as_uint64(); }
43143 };
43144 
43145 class SysStats_CpuTimes : public ::protozero::Message {
43146  public:
43147   using Decoder = SysStats_CpuTimes_Decoder;
43148   enum : int32_t {
43149     kCpuIdFieldNumber = 1,
43150     kUserNsFieldNumber = 2,
43151     kUserIceNsFieldNumber = 3,
43152     kSystemModeNsFieldNumber = 4,
43153     kIdleNsFieldNumber = 5,
43154     kIoWaitNsFieldNumber = 6,
43155     kIrqNsFieldNumber = 7,
43156     kSoftirqNsFieldNumber = 8,
43157   };
43158   void set_cpu_id(uint32_t value) {
43159     AppendVarInt(1, value);
43160   }
43161   void set_user_ns(uint64_t value) {
43162     AppendVarInt(2, value);
43163   }
43164   void set_user_ice_ns(uint64_t value) {
43165     AppendVarInt(3, value);
43166   }
43167   void set_system_mode_ns(uint64_t value) {
43168     AppendVarInt(4, value);
43169   }
43170   void set_idle_ns(uint64_t value) {
43171     AppendVarInt(5, value);
43172   }
43173   void set_io_wait_ns(uint64_t value) {
43174     AppendVarInt(6, value);
43175   }
43176   void set_irq_ns(uint64_t value) {
43177     AppendVarInt(7, value);
43178   }
43179   void set_softirq_ns(uint64_t value) {
43180     AppendVarInt(8, value);
43181   }
43182 };
43183 
43184 class SysStats_VmstatValue_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
43185  public:
43186   SysStats_VmstatValue_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
43187   explicit SysStats_VmstatValue_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
43188   explicit SysStats_VmstatValue_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
43189   bool has_key() const { return at<1>().valid(); }
43190   int32_t key() const { return at<1>().as_int32(); }
43191   bool has_value() const { return at<2>().valid(); }
43192   uint64_t value() const { return at<2>().as_uint64(); }
43193 };
43194 
43195 class SysStats_VmstatValue : public ::protozero::Message {
43196  public:
43197   using Decoder = SysStats_VmstatValue_Decoder;
43198   enum : int32_t {
43199     kKeyFieldNumber = 1,
43200     kValueFieldNumber = 2,
43201   };
43202   void set_key(::perfetto::protos::pbzero::VmstatCounters value) {
43203     AppendTinyVarInt(1, value);
43204   }
43205   void set_value(uint64_t value) {
43206     AppendVarInt(2, value);
43207   }
43208 };
43209 
43210 class SysStats_MeminfoValue_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
43211  public:
43212   SysStats_MeminfoValue_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
43213   explicit SysStats_MeminfoValue_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
43214   explicit SysStats_MeminfoValue_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
43215   bool has_key() const { return at<1>().valid(); }
43216   int32_t key() const { return at<1>().as_int32(); }
43217   bool has_value() const { return at<2>().valid(); }
43218   uint64_t value() const { return at<2>().as_uint64(); }
43219 };
43220 
43221 class SysStats_MeminfoValue : public ::protozero::Message {
43222  public:
43223   using Decoder = SysStats_MeminfoValue_Decoder;
43224   enum : int32_t {
43225     kKeyFieldNumber = 1,
43226     kValueFieldNumber = 2,
43227   };
43228   void set_key(::perfetto::protos::pbzero::MeminfoCounters value) {
43229     AppendTinyVarInt(1, value);
43230   }
43231   void set_value(uint64_t value) {
43232     AppendVarInt(2, value);
43233   }
43234 };
43235 
43236 } // Namespace.
43237 } // Namespace.
43238 } // Namespace.
43239 #endif  // Include guard.
43240 // gen_amalgamated begin header: gen/protos/perfetto/trace/system_info/cpu_info.pbzero.h
43241 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
43242 
43243 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_SYSTEM_INFO_CPU_INFO_PROTO_H_
43244 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_SYSTEM_INFO_CPU_INFO_PROTO_H_
43245 
43246 #include <stddef.h>
43247 #include <stdint.h>
43248 
43249 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
43250 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
43251 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
43252 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
43253 
43254 namespace perfetto {
43255 namespace protos {
43256 namespace pbzero {
43257 
43258 class CpuInfo_Cpu;
43259 
43260 class CpuInfo_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
43261  public:
43262   CpuInfo_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
43263   explicit CpuInfo_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
43264   explicit CpuInfo_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
43265   bool has_cpus() const { return at<1>().valid(); }
43266   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> cpus() const { return GetRepeated<::protozero::ConstBytes>(1); }
43267 };
43268 
43269 class CpuInfo : public ::protozero::Message {
43270  public:
43271   using Decoder = CpuInfo_Decoder;
43272   enum : int32_t {
43273     kCpusFieldNumber = 1,
43274   };
43275   using Cpu = ::perfetto::protos::pbzero::CpuInfo_Cpu;
43276   template <typename T = CpuInfo_Cpu> T* add_cpus() {
43277     return BeginNestedMessage<T>(1);
43278   }
43279 
43280 };
43281 
43282 class CpuInfo_Cpu_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
43283  public:
43284   CpuInfo_Cpu_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
43285   explicit CpuInfo_Cpu_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
43286   explicit CpuInfo_Cpu_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
43287   bool has_processor() const { return at<1>().valid(); }
43288   ::protozero::ConstChars processor() const { return at<1>().as_string(); }
43289   bool has_frequencies() const { return at<2>().valid(); }
43290   ::protozero::RepeatedFieldIterator<uint32_t> frequencies() const { return GetRepeated<uint32_t>(2); }
43291 };
43292 
43293 class CpuInfo_Cpu : public ::protozero::Message {
43294  public:
43295   using Decoder = CpuInfo_Cpu_Decoder;
43296   enum : int32_t {
43297     kProcessorFieldNumber = 1,
43298     kFrequenciesFieldNumber = 2,
43299   };
43300   void set_processor(const std::string& value) {
43301     AppendBytes(1, value.data(), value.size());
43302   }
43303   void set_processor(const char* data, size_t size) {
43304     AppendBytes(1, data, size);
43305   }
43306   void add_frequencies(uint32_t value) {
43307     AppendVarInt(2, value);
43308   }
43309 };
43310 
43311 } // Namespace.
43312 } // Namespace.
43313 } // Namespace.
43314 #endif  // Include guard.
43315 // gen_amalgamated begin header: gen/protos/perfetto/trace/trace_packet_defaults.pbzero.h
43316 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
43317 
43318 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACE_PACKET_DEFAULTS_PROTO_H_
43319 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACE_PACKET_DEFAULTS_PROTO_H_
43320 
43321 #include <stddef.h>
43322 #include <stdint.h>
43323 
43324 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
43325 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
43326 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
43327 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
43328 
43329 namespace perfetto {
43330 namespace protos {
43331 namespace pbzero {
43332 
43333 class TrackEventDefaults;
43334 
43335 class TracePacketDefaults_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/58, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
43336  public:
43337   TracePacketDefaults_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
43338   explicit TracePacketDefaults_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
43339   explicit TracePacketDefaults_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
43340   bool has_timestamp_clock_id() const { return at<58>().valid(); }
43341   uint32_t timestamp_clock_id() const { return at<58>().as_uint32(); }
43342   bool has_track_event_defaults() const { return at<11>().valid(); }
43343   ::protozero::ConstBytes track_event_defaults() const { return at<11>().as_bytes(); }
43344 };
43345 
43346 class TracePacketDefaults : public ::protozero::Message {
43347  public:
43348   using Decoder = TracePacketDefaults_Decoder;
43349   enum : int32_t {
43350     kTimestampClockIdFieldNumber = 58,
43351     kTrackEventDefaultsFieldNumber = 11,
43352   };
43353   void set_timestamp_clock_id(uint32_t value) {
43354     AppendVarInt(58, value);
43355   }
43356   template <typename T = TrackEventDefaults> T* set_track_event_defaults() {
43357     return BeginNestedMessage<T>(11);
43358   }
43359 
43360 };
43361 
43362 } // Namespace.
43363 } // Namespace.
43364 } // Namespace.
43365 #endif  // Include guard.
43366 // gen_amalgamated begin header: gen/protos/perfetto/trace/test_event.pbzero.h
43367 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
43368 
43369 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TEST_EVENT_PROTO_H_
43370 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TEST_EVENT_PROTO_H_
43371 
43372 #include <stddef.h>
43373 #include <stdint.h>
43374 
43375 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
43376 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
43377 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
43378 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
43379 
43380 namespace perfetto {
43381 namespace protos {
43382 namespace pbzero {
43383 
43384 class TestEvent_TestPayload;
43385 
43386 class TestEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
43387  public:
43388   TestEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
43389   explicit TestEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
43390   explicit TestEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
43391   bool has_str() const { return at<1>().valid(); }
43392   ::protozero::ConstChars str() const { return at<1>().as_string(); }
43393   bool has_seq_value() const { return at<2>().valid(); }
43394   uint32_t seq_value() const { return at<2>().as_uint32(); }
43395   bool has_counter() const { return at<3>().valid(); }
43396   uint64_t counter() const { return at<3>().as_uint64(); }
43397   bool has_is_last() const { return at<4>().valid(); }
43398   bool is_last() const { return at<4>().as_bool(); }
43399   bool has_payload() const { return at<5>().valid(); }
43400   ::protozero::ConstBytes payload() const { return at<5>().as_bytes(); }
43401 };
43402 
43403 class TestEvent : public ::protozero::Message {
43404  public:
43405   using Decoder = TestEvent_Decoder;
43406   enum : int32_t {
43407     kStrFieldNumber = 1,
43408     kSeqValueFieldNumber = 2,
43409     kCounterFieldNumber = 3,
43410     kIsLastFieldNumber = 4,
43411     kPayloadFieldNumber = 5,
43412   };
43413   using TestPayload = ::perfetto::protos::pbzero::TestEvent_TestPayload;
43414   void set_str(const std::string& value) {
43415     AppendBytes(1, value.data(), value.size());
43416   }
43417   void set_str(const char* data, size_t size) {
43418     AppendBytes(1, data, size);
43419   }
43420   void set_seq_value(uint32_t value) {
43421     AppendVarInt(2, value);
43422   }
43423   void set_counter(uint64_t value) {
43424     AppendVarInt(3, value);
43425   }
43426   void set_is_last(bool value) {
43427     AppendTinyVarInt(4, value);
43428   }
43429   template <typename T = TestEvent_TestPayload> T* set_payload() {
43430     return BeginNestedMessage<T>(5);
43431   }
43432 
43433 };
43434 
43435 class TestEvent_TestPayload_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
43436  public:
43437   TestEvent_TestPayload_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
43438   explicit TestEvent_TestPayload_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
43439   explicit TestEvent_TestPayload_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
43440   bool has_str() const { return at<1>().valid(); }
43441   ::protozero::RepeatedFieldIterator<::protozero::ConstChars> str() const { return GetRepeated<::protozero::ConstChars>(1); }
43442   bool has_nested() const { return at<2>().valid(); }
43443   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> nested() const { return GetRepeated<::protozero::ConstBytes>(2); }
43444   bool has_remaining_nesting_depth() const { return at<3>().valid(); }
43445   uint32_t remaining_nesting_depth() const { return at<3>().as_uint32(); }
43446 };
43447 
43448 class TestEvent_TestPayload : public ::protozero::Message {
43449  public:
43450   using Decoder = TestEvent_TestPayload_Decoder;
43451   enum : int32_t {
43452     kStrFieldNumber = 1,
43453     kNestedFieldNumber = 2,
43454     kRemainingNestingDepthFieldNumber = 3,
43455   };
43456   void add_str(const std::string& value) {
43457     AppendBytes(1, value.data(), value.size());
43458   }
43459   void add_str(const char* data, size_t size) {
43460     AppendBytes(1, data, size);
43461   }
43462   template <typename T = TestEvent_TestPayload> T* add_nested() {
43463     return BeginNestedMessage<T>(2);
43464   }
43465 
43466   void set_remaining_nesting_depth(uint32_t value) {
43467     AppendVarInt(3, value);
43468   }
43469 };
43470 
43471 } // Namespace.
43472 } // Namespace.
43473 } // Namespace.
43474 #endif  // Include guard.
43475 // gen_amalgamated begin header: gen/protos/perfetto/trace/trace_packet.pbzero.h
43476 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
43477 
43478 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACE_PACKET_PROTO_H_
43479 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACE_PACKET_PROTO_H_
43480 
43481 #include <stddef.h>
43482 #include <stdint.h>
43483 
43484 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
43485 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
43486 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
43487 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
43488 
43489 namespace perfetto {
43490 namespace protos {
43491 namespace pbzero {
43492 
43493 class AndroidLogPacket;
43494 class BatteryCounters;
43495 class ChromeBenchmarkMetadata;
43496 class ChromeEventBundle;
43497 class ChromeMetadataPacket;
43498 class ClockSnapshot;
43499 class CpuInfo;
43500 class DeobfuscationMapping;
43501 class ExtensionDescriptor;
43502 class FtraceEventBundle;
43503 class FtraceStats;
43504 class GpuCounterEvent;
43505 class GpuLog;
43506 class GpuMemTotalEvent;
43507 class GpuRenderStageEvent;
43508 class GraphicsFrameEvent;
43509 class HeapGraph;
43510 class InitialDisplayState;
43511 class InodeFileMap;
43512 class InternedData;
43513 class MemoryTrackerSnapshot;
43514 class ModuleSymbols;
43515 class PackagesList;
43516 class PerfSample;
43517 class PerfettoMetatrace;
43518 class PowerRails;
43519 class ProcessDescriptor;
43520 class ProcessStats;
43521 class ProcessTree;
43522 class ProfilePacket;
43523 class ProfiledFrameSymbols;
43524 class SmapsPacket;
43525 class StreamingProfilePacket;
43526 class SysStats;
43527 class SystemInfo;
43528 class TestEvent;
43529 class ThreadDescriptor;
43530 class TraceConfig;
43531 class TracePacketDefaults;
43532 class TraceStats;
43533 class TracingServiceEvent;
43534 class TrackDescriptor;
43535 class TrackEvent;
43536 class Trigger;
43537 class VulkanApiEvent;
43538 class VulkanMemoryEvent;
43539 
43540 enum TracePacket_SequenceFlags : int32_t {
43541   TracePacket_SequenceFlags_SEQ_UNSPECIFIED = 0,
43542   TracePacket_SequenceFlags_SEQ_INCREMENTAL_STATE_CLEARED = 1,
43543   TracePacket_SequenceFlags_SEQ_NEEDS_INCREMENTAL_STATE = 2,
43544 };
43545 
43546 const TracePacket_SequenceFlags TracePacket_SequenceFlags_MIN = TracePacket_SequenceFlags_SEQ_UNSPECIFIED;
43547 const TracePacket_SequenceFlags TracePacket_SequenceFlags_MAX = TracePacket_SequenceFlags_SEQ_NEEDS_INCREMENTAL_STATE;
43548 
43549 class TracePacket_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/900, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
43550  public:
43551   TracePacket_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
43552   explicit TracePacket_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
43553   explicit TracePacket_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
43554   bool has_timestamp() const { return at<8>().valid(); }
43555   uint64_t timestamp() const { return at<8>().as_uint64(); }
43556   bool has_timestamp_clock_id() const { return at<58>().valid(); }
43557   uint32_t timestamp_clock_id() const { return at<58>().as_uint32(); }
43558   bool has_process_tree() const { return at<2>().valid(); }
43559   ::protozero::ConstBytes process_tree() const { return at<2>().as_bytes(); }
43560   bool has_process_stats() const { return at<9>().valid(); }
43561   ::protozero::ConstBytes process_stats() const { return at<9>().as_bytes(); }
43562   bool has_inode_file_map() const { return at<4>().valid(); }
43563   ::protozero::ConstBytes inode_file_map() const { return at<4>().as_bytes(); }
43564   bool has_chrome_events() const { return at<5>().valid(); }
43565   ::protozero::ConstBytes chrome_events() const { return at<5>().as_bytes(); }
43566   bool has_clock_snapshot() const { return at<6>().valid(); }
43567   ::protozero::ConstBytes clock_snapshot() const { return at<6>().as_bytes(); }
43568   bool has_sys_stats() const { return at<7>().valid(); }
43569   ::protozero::ConstBytes sys_stats() const { return at<7>().as_bytes(); }
43570   bool has_track_event() const { return at<11>().valid(); }
43571   ::protozero::ConstBytes track_event() const { return at<11>().as_bytes(); }
43572   bool has_trace_config() const { return at<33>().valid(); }
43573   ::protozero::ConstBytes trace_config() const { return at<33>().as_bytes(); }
43574   bool has_ftrace_stats() const { return at<34>().valid(); }
43575   ::protozero::ConstBytes ftrace_stats() const { return at<34>().as_bytes(); }
43576   bool has_trace_stats() const { return at<35>().valid(); }
43577   ::protozero::ConstBytes trace_stats() const { return at<35>().as_bytes(); }
43578   bool has_profile_packet() const { return at<37>().valid(); }
43579   ::protozero::ConstBytes profile_packet() const { return at<37>().as_bytes(); }
43580   bool has_battery() const { return at<38>().valid(); }
43581   ::protozero::ConstBytes battery() const { return at<38>().as_bytes(); }
43582   bool has_power_rails() const { return at<40>().valid(); }
43583   ::protozero::ConstBytes power_rails() const { return at<40>().as_bytes(); }
43584   bool has_android_log() const { return at<39>().valid(); }
43585   ::protozero::ConstBytes android_log() const { return at<39>().as_bytes(); }
43586   bool has_system_info() const { return at<45>().valid(); }
43587   ::protozero::ConstBytes system_info() const { return at<45>().as_bytes(); }
43588   bool has_trigger() const { return at<46>().valid(); }
43589   ::protozero::ConstBytes trigger() const { return at<46>().as_bytes(); }
43590   bool has_packages_list() const { return at<47>().valid(); }
43591   ::protozero::ConstBytes packages_list() const { return at<47>().as_bytes(); }
43592   bool has_chrome_benchmark_metadata() const { return at<48>().valid(); }
43593   ::protozero::ConstBytes chrome_benchmark_metadata() const { return at<48>().as_bytes(); }
43594   bool has_perfetto_metatrace() const { return at<49>().valid(); }
43595   ::protozero::ConstBytes perfetto_metatrace() const { return at<49>().as_bytes(); }
43596   bool has_chrome_metadata() const { return at<51>().valid(); }
43597   ::protozero::ConstBytes chrome_metadata() const { return at<51>().as_bytes(); }
43598   bool has_gpu_counter_event() const { return at<52>().valid(); }
43599   ::protozero::ConstBytes gpu_counter_event() const { return at<52>().as_bytes(); }
43600   bool has_gpu_render_stage_event() const { return at<53>().valid(); }
43601   ::protozero::ConstBytes gpu_render_stage_event() const { return at<53>().as_bytes(); }
43602   bool has_streaming_profile_packet() const { return at<54>().valid(); }
43603   ::protozero::ConstBytes streaming_profile_packet() const { return at<54>().as_bytes(); }
43604   bool has_heap_graph() const { return at<56>().valid(); }
43605   ::protozero::ConstBytes heap_graph() const { return at<56>().as_bytes(); }
43606   bool has_graphics_frame_event() const { return at<57>().valid(); }
43607   ::protozero::ConstBytes graphics_frame_event() const { return at<57>().as_bytes(); }
43608   bool has_vulkan_memory_event() const { return at<62>().valid(); }
43609   ::protozero::ConstBytes vulkan_memory_event() const { return at<62>().as_bytes(); }
43610   bool has_gpu_log() const { return at<63>().valid(); }
43611   ::protozero::ConstBytes gpu_log() const { return at<63>().as_bytes(); }
43612   bool has_vulkan_api_event() const { return at<65>().valid(); }
43613   ::protozero::ConstBytes vulkan_api_event() const { return at<65>().as_bytes(); }
43614   bool has_perf_sample() const { return at<66>().valid(); }
43615   ::protozero::ConstBytes perf_sample() const { return at<66>().as_bytes(); }
43616   bool has_cpu_info() const { return at<67>().valid(); }
43617   ::protozero::ConstBytes cpu_info() const { return at<67>().as_bytes(); }
43618   bool has_smaps_packet() const { return at<68>().valid(); }
43619   ::protozero::ConstBytes smaps_packet() const { return at<68>().as_bytes(); }
43620   bool has_service_event() const { return at<69>().valid(); }
43621   ::protozero::ConstBytes service_event() const { return at<69>().as_bytes(); }
43622   bool has_initial_display_state() const { return at<70>().valid(); }
43623   ::protozero::ConstBytes initial_display_state() const { return at<70>().as_bytes(); }
43624   bool has_gpu_mem_total_event() const { return at<71>().valid(); }
43625   ::protozero::ConstBytes gpu_mem_total_event() const { return at<71>().as_bytes(); }
43626   bool has_memory_tracker_snapshot() const { return at<73>().valid(); }
43627   ::protozero::ConstBytes memory_tracker_snapshot() const { return at<73>().as_bytes(); }
43628   bool has_profiled_frame_symbols() const { return at<55>().valid(); }
43629   ::protozero::ConstBytes profiled_frame_symbols() const { return at<55>().as_bytes(); }
43630   bool has_module_symbols() const { return at<61>().valid(); }
43631   ::protozero::ConstBytes module_symbols() const { return at<61>().as_bytes(); }
43632   bool has_deobfuscation_mapping() const { return at<64>().valid(); }
43633   ::protozero::ConstBytes deobfuscation_mapping() const { return at<64>().as_bytes(); }
43634   bool has_track_descriptor() const { return at<60>().valid(); }
43635   ::protozero::ConstBytes track_descriptor() const { return at<60>().as_bytes(); }
43636   bool has_process_descriptor() const { return at<43>().valid(); }
43637   ::protozero::ConstBytes process_descriptor() const { return at<43>().as_bytes(); }
43638   bool has_thread_descriptor() const { return at<44>().valid(); }
43639   ::protozero::ConstBytes thread_descriptor() const { return at<44>().as_bytes(); }
43640   bool has_ftrace_events() const { return at<1>().valid(); }
43641   ::protozero::ConstBytes ftrace_events() const { return at<1>().as_bytes(); }
43642   bool has_synchronization_marker() const { return at<36>().valid(); }
43643   ::protozero::ConstBytes synchronization_marker() const { return at<36>().as_bytes(); }
43644   bool has_compressed_packets() const { return at<50>().valid(); }
43645   ::protozero::ConstBytes compressed_packets() const { return at<50>().as_bytes(); }
43646   bool has_extension_descriptor() const { return at<72>().valid(); }
43647   ::protozero::ConstBytes extension_descriptor() const { return at<72>().as_bytes(); }
43648   bool has_for_testing() const { return at<900>().valid(); }
43649   ::protozero::ConstBytes for_testing() const { return at<900>().as_bytes(); }
43650   bool has_trusted_uid() const { return at<3>().valid(); }
43651   int32_t trusted_uid() const { return at<3>().as_int32(); }
43652   bool has_trusted_packet_sequence_id() const { return at<10>().valid(); }
43653   uint32_t trusted_packet_sequence_id() const { return at<10>().as_uint32(); }
43654   bool has_interned_data() const { return at<12>().valid(); }
43655   ::protozero::ConstBytes interned_data() const { return at<12>().as_bytes(); }
43656   bool has_sequence_flags() const { return at<13>().valid(); }
43657   uint32_t sequence_flags() const { return at<13>().as_uint32(); }
43658   bool has_incremental_state_cleared() const { return at<41>().valid(); }
43659   bool incremental_state_cleared() const { return at<41>().as_bool(); }
43660   bool has_trace_packet_defaults() const { return at<59>().valid(); }
43661   ::protozero::ConstBytes trace_packet_defaults() const { return at<59>().as_bytes(); }
43662   bool has_previous_packet_dropped() const { return at<42>().valid(); }
43663   bool previous_packet_dropped() const { return at<42>().as_bool(); }
43664 };
43665 
43666 class TracePacket : public ::protozero::Message {
43667  public:
43668   using Decoder = TracePacket_Decoder;
43669   enum : int32_t {
43670     kTimestampFieldNumber = 8,
43671     kTimestampClockIdFieldNumber = 58,
43672     kProcessTreeFieldNumber = 2,
43673     kProcessStatsFieldNumber = 9,
43674     kInodeFileMapFieldNumber = 4,
43675     kChromeEventsFieldNumber = 5,
43676     kClockSnapshotFieldNumber = 6,
43677     kSysStatsFieldNumber = 7,
43678     kTrackEventFieldNumber = 11,
43679     kTraceConfigFieldNumber = 33,
43680     kFtraceStatsFieldNumber = 34,
43681     kTraceStatsFieldNumber = 35,
43682     kProfilePacketFieldNumber = 37,
43683     kBatteryFieldNumber = 38,
43684     kPowerRailsFieldNumber = 40,
43685     kAndroidLogFieldNumber = 39,
43686     kSystemInfoFieldNumber = 45,
43687     kTriggerFieldNumber = 46,
43688     kPackagesListFieldNumber = 47,
43689     kChromeBenchmarkMetadataFieldNumber = 48,
43690     kPerfettoMetatraceFieldNumber = 49,
43691     kChromeMetadataFieldNumber = 51,
43692     kGpuCounterEventFieldNumber = 52,
43693     kGpuRenderStageEventFieldNumber = 53,
43694     kStreamingProfilePacketFieldNumber = 54,
43695     kHeapGraphFieldNumber = 56,
43696     kGraphicsFrameEventFieldNumber = 57,
43697     kVulkanMemoryEventFieldNumber = 62,
43698     kGpuLogFieldNumber = 63,
43699     kVulkanApiEventFieldNumber = 65,
43700     kPerfSampleFieldNumber = 66,
43701     kCpuInfoFieldNumber = 67,
43702     kSmapsPacketFieldNumber = 68,
43703     kServiceEventFieldNumber = 69,
43704     kInitialDisplayStateFieldNumber = 70,
43705     kGpuMemTotalEventFieldNumber = 71,
43706     kMemoryTrackerSnapshotFieldNumber = 73,
43707     kProfiledFrameSymbolsFieldNumber = 55,
43708     kModuleSymbolsFieldNumber = 61,
43709     kDeobfuscationMappingFieldNumber = 64,
43710     kTrackDescriptorFieldNumber = 60,
43711     kProcessDescriptorFieldNumber = 43,
43712     kThreadDescriptorFieldNumber = 44,
43713     kFtraceEventsFieldNumber = 1,
43714     kSynchronizationMarkerFieldNumber = 36,
43715     kCompressedPacketsFieldNumber = 50,
43716     kExtensionDescriptorFieldNumber = 72,
43717     kForTestingFieldNumber = 900,
43718     kTrustedUidFieldNumber = 3,
43719     kTrustedPacketSequenceIdFieldNumber = 10,
43720     kInternedDataFieldNumber = 12,
43721     kSequenceFlagsFieldNumber = 13,
43722     kIncrementalStateClearedFieldNumber = 41,
43723     kTracePacketDefaultsFieldNumber = 59,
43724     kPreviousPacketDroppedFieldNumber = 42,
43725   };
43726   using SequenceFlags = ::perfetto::protos::pbzero::TracePacket_SequenceFlags;
43727   static const SequenceFlags SEQ_UNSPECIFIED = TracePacket_SequenceFlags_SEQ_UNSPECIFIED;
43728   static const SequenceFlags SEQ_INCREMENTAL_STATE_CLEARED = TracePacket_SequenceFlags_SEQ_INCREMENTAL_STATE_CLEARED;
43729   static const SequenceFlags SEQ_NEEDS_INCREMENTAL_STATE = TracePacket_SequenceFlags_SEQ_NEEDS_INCREMENTAL_STATE;
43730   void set_timestamp(uint64_t value) {
43731     AppendVarInt(8, value);
43732   }
43733   void set_timestamp_clock_id(uint32_t value) {
43734     AppendVarInt(58, value);
43735   }
43736   template <typename T = ProcessTree> T* set_process_tree() {
43737     return BeginNestedMessage<T>(2);
43738   }
43739 
43740   template <typename T = ProcessStats> T* set_process_stats() {
43741     return BeginNestedMessage<T>(9);
43742   }
43743 
43744   template <typename T = InodeFileMap> T* set_inode_file_map() {
43745     return BeginNestedMessage<T>(4);
43746   }
43747 
43748   template <typename T = ChromeEventBundle> T* set_chrome_events() {
43749     return BeginNestedMessage<T>(5);
43750   }
43751 
43752   template <typename T = ClockSnapshot> T* set_clock_snapshot() {
43753     return BeginNestedMessage<T>(6);
43754   }
43755 
43756   template <typename T = SysStats> T* set_sys_stats() {
43757     return BeginNestedMessage<T>(7);
43758   }
43759 
43760   template <typename T = TrackEvent> T* set_track_event() {
43761     return BeginNestedMessage<T>(11);
43762   }
43763 
43764   template <typename T = TraceConfig> T* set_trace_config() {
43765     return BeginNestedMessage<T>(33);
43766   }
43767 
43768   template <typename T = FtraceStats> T* set_ftrace_stats() {
43769     return BeginNestedMessage<T>(34);
43770   }
43771 
43772   template <typename T = TraceStats> T* set_trace_stats() {
43773     return BeginNestedMessage<T>(35);
43774   }
43775 
43776   template <typename T = ProfilePacket> T* set_profile_packet() {
43777     return BeginNestedMessage<T>(37);
43778   }
43779 
43780   template <typename T = BatteryCounters> T* set_battery() {
43781     return BeginNestedMessage<T>(38);
43782   }
43783 
43784   template <typename T = PowerRails> T* set_power_rails() {
43785     return BeginNestedMessage<T>(40);
43786   }
43787 
43788   template <typename T = AndroidLogPacket> T* set_android_log() {
43789     return BeginNestedMessage<T>(39);
43790   }
43791 
43792   template <typename T = SystemInfo> T* set_system_info() {
43793     return BeginNestedMessage<T>(45);
43794   }
43795 
43796   template <typename T = Trigger> T* set_trigger() {
43797     return BeginNestedMessage<T>(46);
43798   }
43799 
43800   template <typename T = PackagesList> T* set_packages_list() {
43801     return BeginNestedMessage<T>(47);
43802   }
43803 
43804   template <typename T = ChromeBenchmarkMetadata> T* set_chrome_benchmark_metadata() {
43805     return BeginNestedMessage<T>(48);
43806   }
43807 
43808   template <typename T = PerfettoMetatrace> T* set_perfetto_metatrace() {
43809     return BeginNestedMessage<T>(49);
43810   }
43811 
43812   template <typename T = ChromeMetadataPacket> T* set_chrome_metadata() {
43813     return BeginNestedMessage<T>(51);
43814   }
43815 
43816   template <typename T = GpuCounterEvent> T* set_gpu_counter_event() {
43817     return BeginNestedMessage<T>(52);
43818   }
43819 
43820   template <typename T = GpuRenderStageEvent> T* set_gpu_render_stage_event() {
43821     return BeginNestedMessage<T>(53);
43822   }
43823 
43824   template <typename T = StreamingProfilePacket> T* set_streaming_profile_packet() {
43825     return BeginNestedMessage<T>(54);
43826   }
43827 
43828   template <typename T = HeapGraph> T* set_heap_graph() {
43829     return BeginNestedMessage<T>(56);
43830   }
43831 
43832   template <typename T = GraphicsFrameEvent> T* set_graphics_frame_event() {
43833     return BeginNestedMessage<T>(57);
43834   }
43835 
43836   template <typename T = VulkanMemoryEvent> T* set_vulkan_memory_event() {
43837     return BeginNestedMessage<T>(62);
43838   }
43839 
43840   template <typename T = GpuLog> T* set_gpu_log() {
43841     return BeginNestedMessage<T>(63);
43842   }
43843 
43844   template <typename T = VulkanApiEvent> T* set_vulkan_api_event() {
43845     return BeginNestedMessage<T>(65);
43846   }
43847 
43848   template <typename T = PerfSample> T* set_perf_sample() {
43849     return BeginNestedMessage<T>(66);
43850   }
43851 
43852   template <typename T = CpuInfo> T* set_cpu_info() {
43853     return BeginNestedMessage<T>(67);
43854   }
43855 
43856   template <typename T = SmapsPacket> T* set_smaps_packet() {
43857     return BeginNestedMessage<T>(68);
43858   }
43859 
43860   template <typename T = TracingServiceEvent> T* set_service_event() {
43861     return BeginNestedMessage<T>(69);
43862   }
43863 
43864   template <typename T = InitialDisplayState> T* set_initial_display_state() {
43865     return BeginNestedMessage<T>(70);
43866   }
43867 
43868   template <typename T = GpuMemTotalEvent> T* set_gpu_mem_total_event() {
43869     return BeginNestedMessage<T>(71);
43870   }
43871 
43872   template <typename T = MemoryTrackerSnapshot> T* set_memory_tracker_snapshot() {
43873     return BeginNestedMessage<T>(73);
43874   }
43875 
43876   template <typename T = ProfiledFrameSymbols> T* set_profiled_frame_symbols() {
43877     return BeginNestedMessage<T>(55);
43878   }
43879 
43880   template <typename T = ModuleSymbols> T* set_module_symbols() {
43881     return BeginNestedMessage<T>(61);
43882   }
43883 
43884   template <typename T = DeobfuscationMapping> T* set_deobfuscation_mapping() {
43885     return BeginNestedMessage<T>(64);
43886   }
43887 
43888   template <typename T = TrackDescriptor> T* set_track_descriptor() {
43889     return BeginNestedMessage<T>(60);
43890   }
43891 
43892   template <typename T = ProcessDescriptor> T* set_process_descriptor() {
43893     return BeginNestedMessage<T>(43);
43894   }
43895 
43896   template <typename T = ThreadDescriptor> T* set_thread_descriptor() {
43897     return BeginNestedMessage<T>(44);
43898   }
43899 
43900   template <typename T = FtraceEventBundle> T* set_ftrace_events() {
43901     return BeginNestedMessage<T>(1);
43902   }
43903 
43904   void set_synchronization_marker(const std::string& value) {
43905     AppendBytes(36, value.data(), value.size());
43906   }
43907   void set_synchronization_marker(const uint8_t* data, size_t size) {
43908     AppendBytes(36, data, size);
43909   }
43910   void set_compressed_packets(const std::string& value) {
43911     AppendBytes(50, value.data(), value.size());
43912   }
43913   void set_compressed_packets(const uint8_t* data, size_t size) {
43914     AppendBytes(50, data, size);
43915   }
43916   template <typename T = ExtensionDescriptor> T* set_extension_descriptor() {
43917     return BeginNestedMessage<T>(72);
43918   }
43919 
43920   template <typename T = TestEvent> T* set_for_testing() {
43921     return BeginNestedMessage<T>(900);
43922   }
43923 
43924   void set_trusted_uid(int32_t value) {
43925     AppendVarInt(3, value);
43926   }
43927   void set_trusted_packet_sequence_id(uint32_t value) {
43928     AppendVarInt(10, value);
43929   }
43930   template <typename T = InternedData> T* set_interned_data() {
43931     return BeginNestedMessage<T>(12);
43932   }
43933 
43934   void set_sequence_flags(uint32_t value) {
43935     AppendVarInt(13, value);
43936   }
43937   void set_incremental_state_cleared(bool value) {
43938     AppendTinyVarInt(41, value);
43939   }
43940   template <typename T = TracePacketDefaults> T* set_trace_packet_defaults() {
43941     return BeginNestedMessage<T>(59);
43942   }
43943 
43944   void set_previous_packet_dropped(bool value) {
43945     AppendTinyVarInt(42, value);
43946   }
43947 };
43948 
43949 } // Namespace.
43950 } // Namespace.
43951 } // Namespace.
43952 #endif  // Include guard.
43953 // gen_amalgamated begin header: gen/protos/perfetto/trace/trace.pbzero.h
43954 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
43955 
43956 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACE_PROTO_H_
43957 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACE_PROTO_H_
43958 
43959 #include <stddef.h>
43960 #include <stdint.h>
43961 
43962 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
43963 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
43964 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
43965 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
43966 
43967 namespace perfetto {
43968 namespace protos {
43969 namespace pbzero {
43970 
43971 class TracePacket;
43972 
43973 class Trace_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
43974  public:
43975   Trace_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
43976   explicit Trace_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
43977   explicit Trace_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
43978   bool has_packet() const { return at<1>().valid(); }
43979   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> packet() const { return GetRepeated<::protozero::ConstBytes>(1); }
43980 };
43981 
43982 class Trace : public ::protozero::Message {
43983  public:
43984   using Decoder = Trace_Decoder;
43985   enum : int32_t {
43986     kPacketFieldNumber = 1,
43987   };
43988   template <typename T = TracePacket> T* add_packet() {
43989     return BeginNestedMessage<T>(1);
43990   }
43991 
43992 };
43993 
43994 } // Namespace.
43995 } // Namespace.
43996 } // Namespace.
43997 #endif  // Include guard.
43998 // gen_amalgamated begin header: gen/protos/perfetto/trace/extension_descriptor.pbzero.h
43999 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
44000 
44001 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_EXTENSION_DESCRIPTOR_PROTO_H_
44002 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_EXTENSION_DESCRIPTOR_PROTO_H_
44003 
44004 #include <stddef.h>
44005 #include <stdint.h>
44006 
44007 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
44008 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
44009 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
44010 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
44011 
44012 namespace perfetto {
44013 namespace protos {
44014 namespace pbzero {
44015 
44016 class FileDescriptorSet;
44017 
44018 class ExtensionDescriptor_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
44019  public:
44020   ExtensionDescriptor_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
44021   explicit ExtensionDescriptor_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
44022   explicit ExtensionDescriptor_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
44023   bool has_extension_set() const { return at<1>().valid(); }
44024   ::protozero::ConstBytes extension_set() const { return at<1>().as_bytes(); }
44025 };
44026 
44027 class ExtensionDescriptor : public ::protozero::Message {
44028  public:
44029   using Decoder = ExtensionDescriptor_Decoder;
44030   enum : int32_t {
44031     kExtensionSetFieldNumber = 1,
44032   };
44033   template <typename T = FileDescriptorSet> T* set_extension_set() {
44034     return BeginNestedMessage<T>(1);
44035   }
44036 
44037 };
44038 
44039 } // Namespace.
44040 } // Namespace.
44041 } // Namespace.
44042 #endif  // Include guard.
44043 // gen_amalgamated begin header: gen/protos/perfetto/trace/memory_graph.pbzero.h
44044 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
44045 
44046 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_MEMORY_GRAPH_PROTO_H_
44047 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_MEMORY_GRAPH_PROTO_H_
44048 
44049 #include <stddef.h>
44050 #include <stdint.h>
44051 
44052 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
44053 // gen_amalgamated expanded: #include "perfetto/protozero/packed_repeated_fields.h"
44054 // gen_amalgamated expanded: #include "perfetto/protozero/proto_decoder.h"
44055 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
44056 
44057 namespace perfetto {
44058 namespace protos {
44059 namespace pbzero {
44060 
44061 class MemoryTrackerSnapshot_ProcessSnapshot;
44062 class MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge;
44063 class MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode;
44064 class MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry;
44065 enum MemoryTrackerSnapshot_LevelOfDetail : int32_t;
44066 enum MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units : int32_t;
44067 
44068 enum MemoryTrackerSnapshot_LevelOfDetail : int32_t {
44069   MemoryTrackerSnapshot_LevelOfDetail_DETAIL_FULL = 0,
44070   MemoryTrackerSnapshot_LevelOfDetail_DETAIL_LIGHT = 1,
44071   MemoryTrackerSnapshot_LevelOfDetail_DETAIL_BACKGROUND = 2,
44072 };
44073 
44074 const MemoryTrackerSnapshot_LevelOfDetail MemoryTrackerSnapshot_LevelOfDetail_MIN = MemoryTrackerSnapshot_LevelOfDetail_DETAIL_FULL;
44075 const MemoryTrackerSnapshot_LevelOfDetail MemoryTrackerSnapshot_LevelOfDetail_MAX = MemoryTrackerSnapshot_LevelOfDetail_DETAIL_BACKGROUND;
44076 
44077 enum MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units : int32_t {
44078   MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_UNSPECIFIED = 0,
44079   MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_BYTES = 1,
44080   MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_COUNT = 2,
44081 };
44082 
44083 const MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_MIN = MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_UNSPECIFIED;
44084 const MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_MAX = MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_COUNT;
44085 
44086 class MemoryTrackerSnapshot_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
44087  public:
44088   MemoryTrackerSnapshot_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
44089   explicit MemoryTrackerSnapshot_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
44090   explicit MemoryTrackerSnapshot_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
44091   bool has_global_dump_id() const { return at<1>().valid(); }
44092   uint64_t global_dump_id() const { return at<1>().as_uint64(); }
44093   bool has_level_of_detail() const { return at<2>().valid(); }
44094   int32_t level_of_detail() const { return at<2>().as_int32(); }
44095   bool has_process_memory_dumps() const { return at<3>().valid(); }
44096   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> process_memory_dumps() const { return GetRepeated<::protozero::ConstBytes>(3); }
44097 };
44098 
44099 class MemoryTrackerSnapshot : public ::protozero::Message {
44100  public:
44101   using Decoder = MemoryTrackerSnapshot_Decoder;
44102   enum : int32_t {
44103     kGlobalDumpIdFieldNumber = 1,
44104     kLevelOfDetailFieldNumber = 2,
44105     kProcessMemoryDumpsFieldNumber = 3,
44106   };
44107   using ProcessSnapshot = ::perfetto::protos::pbzero::MemoryTrackerSnapshot_ProcessSnapshot;
44108   using LevelOfDetail = ::perfetto::protos::pbzero::MemoryTrackerSnapshot_LevelOfDetail;
44109   static const LevelOfDetail DETAIL_FULL = MemoryTrackerSnapshot_LevelOfDetail_DETAIL_FULL;
44110   static const LevelOfDetail DETAIL_LIGHT = MemoryTrackerSnapshot_LevelOfDetail_DETAIL_LIGHT;
44111   static const LevelOfDetail DETAIL_BACKGROUND = MemoryTrackerSnapshot_LevelOfDetail_DETAIL_BACKGROUND;
44112   void set_global_dump_id(uint64_t value) {
44113     AppendVarInt(1, value);
44114   }
44115   void set_level_of_detail(::perfetto::protos::pbzero::MemoryTrackerSnapshot_LevelOfDetail value) {
44116     AppendTinyVarInt(2, value);
44117   }
44118   template <typename T = MemoryTrackerSnapshot_ProcessSnapshot> T* add_process_memory_dumps() {
44119     return BeginNestedMessage<T>(3);
44120   }
44121 
44122 };
44123 
44124 class MemoryTrackerSnapshot_ProcessSnapshot_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/3, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
44125  public:
44126   MemoryTrackerSnapshot_ProcessSnapshot_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
44127   explicit MemoryTrackerSnapshot_ProcessSnapshot_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
44128   explicit MemoryTrackerSnapshot_ProcessSnapshot_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
44129   bool has_pid() const { return at<1>().valid(); }
44130   uint64_t pid() const { return at<1>().as_uint64(); }
44131   bool has_allocator_dumps() const { return at<2>().valid(); }
44132   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> allocator_dumps() const { return GetRepeated<::protozero::ConstBytes>(2); }
44133   bool has_memory_edges() const { return at<3>().valid(); }
44134   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> memory_edges() const { return GetRepeated<::protozero::ConstBytes>(3); }
44135 };
44136 
44137 class MemoryTrackerSnapshot_ProcessSnapshot : public ::protozero::Message {
44138  public:
44139   using Decoder = MemoryTrackerSnapshot_ProcessSnapshot_Decoder;
44140   enum : int32_t {
44141     kPidFieldNumber = 1,
44142     kAllocatorDumpsFieldNumber = 2,
44143     kMemoryEdgesFieldNumber = 3,
44144   };
44145   using MemoryNode = ::perfetto::protos::pbzero::MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode;
44146   using MemoryEdge = ::perfetto::protos::pbzero::MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge;
44147   void set_pid(uint64_t value) {
44148     AppendVarInt(1, value);
44149   }
44150   template <typename T = MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode> T* add_allocator_dumps() {
44151     return BeginNestedMessage<T>(2);
44152   }
44153 
44154   template <typename T = MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge> T* add_memory_edges() {
44155     return BeginNestedMessage<T>(3);
44156   }
44157 
44158 };
44159 
44160 class MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
44161  public:
44162   MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
44163   explicit MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
44164   explicit MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
44165   bool has_source_id() const { return at<1>().valid(); }
44166   uint64_t source_id() const { return at<1>().as_uint64(); }
44167   bool has_target_id() const { return at<2>().valid(); }
44168   uint64_t target_id() const { return at<2>().as_uint64(); }
44169   bool has_importance() const { return at<3>().valid(); }
44170   uint32_t importance() const { return at<3>().as_uint32(); }
44171   bool has_overridable() const { return at<4>().valid(); }
44172   bool overridable() const { return at<4>().as_bool(); }
44173 };
44174 
44175 class MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge : public ::protozero::Message {
44176  public:
44177   using Decoder = MemoryTrackerSnapshot_ProcessSnapshot_MemoryEdge_Decoder;
44178   enum : int32_t {
44179     kSourceIdFieldNumber = 1,
44180     kTargetIdFieldNumber = 2,
44181     kImportanceFieldNumber = 3,
44182     kOverridableFieldNumber = 4,
44183   };
44184   void set_source_id(uint64_t value) {
44185     AppendVarInt(1, value);
44186   }
44187   void set_target_id(uint64_t value) {
44188     AppendVarInt(2, value);
44189   }
44190   void set_importance(uint32_t value) {
44191     AppendVarInt(3, value);
44192   }
44193   void set_overridable(bool value) {
44194     AppendTinyVarInt(4, value);
44195   }
44196 };
44197 
44198 class MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/5, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
44199  public:
44200   MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
44201   explicit MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
44202   explicit MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
44203   bool has_id() const { return at<1>().valid(); }
44204   uint64_t id() const { return at<1>().as_uint64(); }
44205   bool has_absolute_name() const { return at<2>().valid(); }
44206   ::protozero::ConstChars absolute_name() const { return at<2>().as_string(); }
44207   bool has_weak() const { return at<3>().valid(); }
44208   bool weak() const { return at<3>().as_bool(); }
44209   bool has_size_bytes() const { return at<4>().valid(); }
44210   uint64_t size_bytes() const { return at<4>().as_uint64(); }
44211   bool has_entries() const { return at<5>().valid(); }
44212   ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> entries() const { return GetRepeated<::protozero::ConstBytes>(5); }
44213 };
44214 
44215 class MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode : public ::protozero::Message {
44216  public:
44217   using Decoder = MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_Decoder;
44218   enum : int32_t {
44219     kIdFieldNumber = 1,
44220     kAbsoluteNameFieldNumber = 2,
44221     kWeakFieldNumber = 3,
44222     kSizeBytesFieldNumber = 4,
44223     kEntriesFieldNumber = 5,
44224   };
44225   using MemoryNodeEntry = ::perfetto::protos::pbzero::MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry;
44226   void set_id(uint64_t value) {
44227     AppendVarInt(1, value);
44228   }
44229   void set_absolute_name(const std::string& value) {
44230     AppendBytes(2, value.data(), value.size());
44231   }
44232   void set_absolute_name(const char* data, size_t size) {
44233     AppendBytes(2, data, size);
44234   }
44235   void set_weak(bool value) {
44236     AppendTinyVarInt(3, value);
44237   }
44238   void set_size_bytes(uint64_t value) {
44239     AppendVarInt(4, value);
44240   }
44241   template <typename T = MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry> T* add_entries() {
44242     return BeginNestedMessage<T>(5);
44243   }
44244 
44245 };
44246 
44247 class MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
44248  public:
44249   MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
44250   explicit MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
44251   explicit MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
44252   bool has_name() const { return at<1>().valid(); }
44253   ::protozero::ConstChars name() const { return at<1>().as_string(); }
44254   bool has_units() const { return at<2>().valid(); }
44255   int32_t units() const { return at<2>().as_int32(); }
44256   bool has_value_uint64() const { return at<3>().valid(); }
44257   uint64_t value_uint64() const { return at<3>().as_uint64(); }
44258   bool has_value_string() const { return at<4>().valid(); }
44259   ::protozero::ConstChars value_string() const { return at<4>().as_string(); }
44260 };
44261 
44262 class MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry : public ::protozero::Message {
44263  public:
44264   using Decoder = MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Decoder;
44265   enum : int32_t {
44266     kNameFieldNumber = 1,
44267     kUnitsFieldNumber = 2,
44268     kValueUint64FieldNumber = 3,
44269     kValueStringFieldNumber = 4,
44270   };
44271   using Units = ::perfetto::protos::pbzero::MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units;
44272   static const Units UNSPECIFIED = MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_UNSPECIFIED;
44273   static const Units BYTES = MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_BYTES;
44274   static const Units COUNT = MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units_COUNT;
44275   void set_name(const std::string& value) {
44276     AppendBytes(1, value.data(), value.size());
44277   }
44278   void set_name(const char* data, size_t size) {
44279     AppendBytes(1, data, size);
44280   }
44281   void set_units(::perfetto::protos::pbzero::MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_Units value) {
44282     AppendTinyVarInt(2, value);
44283   }
44284   void set_value_uint64(uint64_t value) {
44285     AppendVarInt(3, value);
44286   }
44287   void set_value_string(const std::string& value) {
44288     AppendBytes(4, value.data(), value.size());
44289   }
44290   void set_value_string(const char* data, size_t size) {
44291     AppendBytes(4, data, size);
44292   }
44293 };
44294 
44295 } // Namespace.
44296 } // Namespace.
44297 } // Namespace.
44298 #endif  // Include guard.
44299 // gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_compositor_scheduler_state.gen.h
44300 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
44301 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_COMPOSITOR_SCHEDULER_STATE_PROTO_CPP_H_
44302 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_COMPOSITOR_SCHEDULER_STATE_PROTO_CPP_H_
44303 
44304 #include <stdint.h>
44305 #include <bitset>
44306 #include <vector>
44307 #include <string>
44308 #include <type_traits>
44309 
44310 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
44311 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
44312 // gen_amalgamated expanded: #include "perfetto/base/export.h"
44313 
44314 namespace perfetto {
44315 namespace protos {
44316 namespace gen {
44317 class CompositorTimingHistory;
44318 class BeginFrameSourceState;
44319 class BeginFrameArgs;
44320 class SourceLocation;
44321 class BeginFrameObserverState;
44322 class BeginImplFrameArgs;
44323 class BeginImplFrameArgs_TimestampsInUs;
44324 class ChromeCompositorStateMachine;
44325 class ChromeCompositorStateMachine_MinorState;
44326 class ChromeCompositorStateMachine_MajorState;
44327 class ChromeCompositorSchedulerState;
44328 enum ChromeCompositorSchedulerAction : int;
44329 enum BeginFrameArgs_BeginFrameArgsType : int;
44330 enum BeginImplFrameArgs_State : int;
44331 enum ChromeCompositorStateMachine_MinorState_TreePriority : int;
44332 enum ChromeCompositorStateMachine_MinorState_ScrollHandlerState : int;
44333 enum ChromeCompositorStateMachine_MajorState_BeginImplFrameState : int;
44334 enum ChromeCompositorStateMachine_MajorState_BeginMainFrameState : int;
44335 enum ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState : int;
44336 enum ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState : int;
44337 enum ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode : int;
44338 }  // namespace perfetto
44339 }  // namespace protos
44340 }  // namespace gen
44341 
44342 namespace protozero {
44343 class Message;
44344 }  // namespace protozero
44345 
44346 namespace perfetto {
44347 namespace protos {
44348 namespace gen {
44349 enum ChromeCompositorSchedulerAction : int {
44350   CC_SCHEDULER_ACTION_UNSPECIFIED = 0,
44351   CC_SCHEDULER_ACTION_NONE = 1,
44352   CC_SCHEDULER_ACTION_SEND_BEGIN_MAIN_FRAME = 2,
44353   CC_SCHEDULER_ACTION_COMMIT = 3,
44354   CC_SCHEDULER_ACTION_ACTIVATE_SYNC_TREE = 4,
44355   CC_SCHEDULER_ACTION_DRAW_IF_POSSIBLE = 5,
44356   CC_SCHEDULER_ACTION_DRAW_FORCED = 6,
44357   CC_SCHEDULER_ACTION_DRAW_ABORT = 7,
44358   CC_SCHEDULER_ACTION_BEGIN_LAYER_TREE_FRAME_SINK_CREATION = 8,
44359   CC_SCHEDULER_ACTION_PREPARE_TILES = 9,
44360   CC_SCHEDULER_ACTION_INVALIDATE_LAYER_TREE_FRAME_SINK = 10,
44361   CC_SCHEDULER_ACTION_PERFORM_IMPL_SIDE_INVALIDATION = 11,
44362   CC_SCHEDULER_ACTION_NOTIFY_BEGIN_MAIN_FRAME_NOT_EXPECTED_UNTIL = 12,
44363   CC_SCHEDULER_ACTION_NOTIFY_BEGIN_MAIN_FRAME_NOT_EXPECTED_SOON = 13,
44364 };
44365 enum BeginFrameArgs_BeginFrameArgsType : int {
44366   BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_UNSPECIFIED = 0,
44367   BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_INVALID = 1,
44368   BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_NORMAL = 2,
44369   BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_MISSED = 3,
44370 };
44371 enum BeginImplFrameArgs_State : int {
44372   BeginImplFrameArgs_State_BEGIN_FRAME_FINISHED = 0,
44373   BeginImplFrameArgs_State_BEGIN_FRAME_USING = 1,
44374 };
44375 enum ChromeCompositorStateMachine_MinorState_TreePriority : int {
44376   ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_UNSPECIFIED = 0,
44377   ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_SAME_PRIORITY_FOR_BOTH_TREES = 1,
44378   ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_SMOOTHNESS_TAKES_PRIORITY = 2,
44379   ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_NEW_CONTENT_TAKES_PRIORITY = 3,
44380 };
44381 enum ChromeCompositorStateMachine_MinorState_ScrollHandlerState : int {
44382   ChromeCompositorStateMachine_MinorState_ScrollHandlerState_SCROLL_HANDLER_UNSPECIFIED = 0,
44383   ChromeCompositorStateMachine_MinorState_ScrollHandlerState_SCROLL_AFFECTS_SCROLL_HANDLER = 1,
44384   ChromeCompositorStateMachine_MinorState_ScrollHandlerState_SCROLL_DOES_NOT_AFFECT_SCROLL_HANDLER = 2,
44385 };
44386 enum ChromeCompositorStateMachine_MajorState_BeginImplFrameState : int {
44387   ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_UNSPECIFIED = 0,
44388   ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_IDLE = 1,
44389   ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_INSIDE_BEGIN_FRAME = 2,
44390   ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_INSIDE_DEADLINE = 3,
44391 };
44392 enum ChromeCompositorStateMachine_MajorState_BeginMainFrameState : int {
44393   ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_UNSPECIFIED = 0,
44394   ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_IDLE = 1,
44395   ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_SENT = 2,
44396   ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_READY_TO_COMMIT = 3,
44397 };
44398 enum ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState : int {
44399   ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_UNSPECIFIED = 0,
44400   ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_NONE = 1,
44401   ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_ACTIVE = 2,
44402   ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_CREATING = 3,
44403   ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_WAITING_FOR_FIRST_COMMIT = 4,
44404   ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_WAITING_FOR_FIRST_ACTIVATION = 5,
44405 };
44406 enum ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState : int {
44407   ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_UNSPECIFIED = 0,
44408   ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_IDLE = 1,
44409   ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_WAITING_FOR_COMMIT = 2,
44410   ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_WAITING_FOR_ACTIVATION = 3,
44411   ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_WAITING_FOR_DRAW = 4,
44412 };
44413 enum ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode : int {
44414   ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_UNSPECIFIED = 0,
44415   ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_NONE = 1,
44416   ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_IMMEDIATE = 2,
44417   ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_REGULAR = 3,
44418   ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_LATE = 4,
44419   ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_BLOCKED = 5,
44420 };
44421 
44422 class PERFETTO_EXPORT CompositorTimingHistory : public ::protozero::CppMessageObj {
44423  public:
44424   enum FieldNumbers {
44425     kBeginMainFrameQueueCriticalEstimateDeltaUsFieldNumber = 1,
44426     kBeginMainFrameQueueNotCriticalEstimateDeltaUsFieldNumber = 2,
44427     kBeginMainFrameStartToReadyToCommitEstimateDeltaUsFieldNumber = 3,
44428     kCommitToReadyToActivateEstimateDeltaUsFieldNumber = 4,
44429     kPrepareTilesEstimateDeltaUsFieldNumber = 5,
44430     kActivateEstimateDeltaUsFieldNumber = 6,
44431     kDrawEstimateDeltaUsFieldNumber = 7,
44432   };
44433 
44434   CompositorTimingHistory();
44435   ~CompositorTimingHistory() override;
44436   CompositorTimingHistory(CompositorTimingHistory&&) noexcept;
44437   CompositorTimingHistory& operator=(CompositorTimingHistory&&);
44438   CompositorTimingHistory(const CompositorTimingHistory&);
44439   CompositorTimingHistory& operator=(const CompositorTimingHistory&);
44440   bool operator==(const CompositorTimingHistory&) const;
44441   bool operator!=(const CompositorTimingHistory& other) const { return !(*this == other); }
44442 
44443   bool ParseFromArray(const void*, size_t) override;
44444   std::string SerializeAsString() const override;
44445   std::vector<uint8_t> SerializeAsArray() const override;
44446   void Serialize(::protozero::Message*) const;
44447 
44448   bool has_begin_main_frame_queue_critical_estimate_delta_us() const { return _has_field_[1]; }
44449   int64_t begin_main_frame_queue_critical_estimate_delta_us() const { return begin_main_frame_queue_critical_estimate_delta_us_; }
44450   void set_begin_main_frame_queue_critical_estimate_delta_us(int64_t value) { begin_main_frame_queue_critical_estimate_delta_us_ = value; _has_field_.set(1); }
44451 
44452   bool has_begin_main_frame_queue_not_critical_estimate_delta_us() const { return _has_field_[2]; }
44453   int64_t begin_main_frame_queue_not_critical_estimate_delta_us() const { return begin_main_frame_queue_not_critical_estimate_delta_us_; }
44454   void set_begin_main_frame_queue_not_critical_estimate_delta_us(int64_t value) { begin_main_frame_queue_not_critical_estimate_delta_us_ = value; _has_field_.set(2); }
44455 
44456   bool has_begin_main_frame_start_to_ready_to_commit_estimate_delta_us() const { return _has_field_[3]; }
44457   int64_t begin_main_frame_start_to_ready_to_commit_estimate_delta_us() const { return begin_main_frame_start_to_ready_to_commit_estimate_delta_us_; }
44458   void set_begin_main_frame_start_to_ready_to_commit_estimate_delta_us(int64_t value) { begin_main_frame_start_to_ready_to_commit_estimate_delta_us_ = value; _has_field_.set(3); }
44459 
44460   bool has_commit_to_ready_to_activate_estimate_delta_us() const { return _has_field_[4]; }
44461   int64_t commit_to_ready_to_activate_estimate_delta_us() const { return commit_to_ready_to_activate_estimate_delta_us_; }
44462   void set_commit_to_ready_to_activate_estimate_delta_us(int64_t value) { commit_to_ready_to_activate_estimate_delta_us_ = value; _has_field_.set(4); }
44463 
44464   bool has_prepare_tiles_estimate_delta_us() const { return _has_field_[5]; }
44465   int64_t prepare_tiles_estimate_delta_us() const { return prepare_tiles_estimate_delta_us_; }
44466   void set_prepare_tiles_estimate_delta_us(int64_t value) { prepare_tiles_estimate_delta_us_ = value; _has_field_.set(5); }
44467 
44468   bool has_activate_estimate_delta_us() const { return _has_field_[6]; }
44469   int64_t activate_estimate_delta_us() const { return activate_estimate_delta_us_; }
44470   void set_activate_estimate_delta_us(int64_t value) { activate_estimate_delta_us_ = value; _has_field_.set(6); }
44471 
44472   bool has_draw_estimate_delta_us() const { return _has_field_[7]; }
44473   int64_t draw_estimate_delta_us() const { return draw_estimate_delta_us_; }
44474   void set_draw_estimate_delta_us(int64_t value) { draw_estimate_delta_us_ = value; _has_field_.set(7); }
44475 
44476  private:
44477   int64_t begin_main_frame_queue_critical_estimate_delta_us_{};
44478   int64_t begin_main_frame_queue_not_critical_estimate_delta_us_{};
44479   int64_t begin_main_frame_start_to_ready_to_commit_estimate_delta_us_{};
44480   int64_t commit_to_ready_to_activate_estimate_delta_us_{};
44481   int64_t prepare_tiles_estimate_delta_us_{};
44482   int64_t activate_estimate_delta_us_{};
44483   int64_t draw_estimate_delta_us_{};
44484 
44485   // Allows to preserve unknown protobuf fields for compatibility
44486   // with future versions of .proto files.
44487   std::string unknown_fields_;
44488 
44489   std::bitset<8> _has_field_{};
44490 };
44491 
44492 
44493 class PERFETTO_EXPORT BeginFrameSourceState : public ::protozero::CppMessageObj {
44494  public:
44495   enum FieldNumbers {
44496     kSourceIdFieldNumber = 1,
44497     kPausedFieldNumber = 2,
44498     kNumObserversFieldNumber = 3,
44499     kLastBeginFrameArgsFieldNumber = 4,
44500   };
44501 
44502   BeginFrameSourceState();
44503   ~BeginFrameSourceState() override;
44504   BeginFrameSourceState(BeginFrameSourceState&&) noexcept;
44505   BeginFrameSourceState& operator=(BeginFrameSourceState&&);
44506   BeginFrameSourceState(const BeginFrameSourceState&);
44507   BeginFrameSourceState& operator=(const BeginFrameSourceState&);
44508   bool operator==(const BeginFrameSourceState&) const;
44509   bool operator!=(const BeginFrameSourceState& other) const { return !(*this == other); }
44510 
44511   bool ParseFromArray(const void*, size_t) override;
44512   std::string SerializeAsString() const override;
44513   std::vector<uint8_t> SerializeAsArray() const override;
44514   void Serialize(::protozero::Message*) const;
44515 
44516   bool has_source_id() const { return _has_field_[1]; }
44517   uint32_t source_id() const { return source_id_; }
44518   void set_source_id(uint32_t value) { source_id_ = value; _has_field_.set(1); }
44519 
44520   bool has_paused() const { return _has_field_[2]; }
44521   bool paused() const { return paused_; }
44522   void set_paused(bool value) { paused_ = value; _has_field_.set(2); }
44523 
44524   bool has_num_observers() const { return _has_field_[3]; }
44525   uint32_t num_observers() const { return num_observers_; }
44526   void set_num_observers(uint32_t value) { num_observers_ = value; _has_field_.set(3); }
44527 
44528   bool has_last_begin_frame_args() const { return _has_field_[4]; }
44529   const BeginFrameArgs& last_begin_frame_args() const { return *last_begin_frame_args_; }
44530   BeginFrameArgs* mutable_last_begin_frame_args() { _has_field_.set(4); return last_begin_frame_args_.get(); }
44531 
44532  private:
44533   uint32_t source_id_{};
44534   bool paused_{};
44535   uint32_t num_observers_{};
44536   ::protozero::CopyablePtr<BeginFrameArgs> last_begin_frame_args_;
44537 
44538   // Allows to preserve unknown protobuf fields for compatibility
44539   // with future versions of .proto files.
44540   std::string unknown_fields_;
44541 
44542   std::bitset<5> _has_field_{};
44543 };
44544 
44545 
44546 class PERFETTO_EXPORT BeginFrameArgs : public ::protozero::CppMessageObj {
44547  public:
44548   using BeginFrameArgsType = BeginFrameArgs_BeginFrameArgsType;
44549   static constexpr auto BEGIN_FRAME_ARGS_TYPE_UNSPECIFIED = BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_UNSPECIFIED;
44550   static constexpr auto BEGIN_FRAME_ARGS_TYPE_INVALID = BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_INVALID;
44551   static constexpr auto BEGIN_FRAME_ARGS_TYPE_NORMAL = BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_NORMAL;
44552   static constexpr auto BEGIN_FRAME_ARGS_TYPE_MISSED = BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_MISSED;
44553   static constexpr auto BeginFrameArgsType_MIN = BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_UNSPECIFIED;
44554   static constexpr auto BeginFrameArgsType_MAX = BeginFrameArgs_BeginFrameArgsType_BEGIN_FRAME_ARGS_TYPE_MISSED;
44555   enum FieldNumbers {
44556     kTypeFieldNumber = 1,
44557     kSourceIdFieldNumber = 2,
44558     kSequenceNumberFieldNumber = 3,
44559     kFrameTimeUsFieldNumber = 4,
44560     kDeadlineUsFieldNumber = 5,
44561     kIntervalDeltaUsFieldNumber = 6,
44562     kOnCriticalPathFieldNumber = 7,
44563     kAnimateOnlyFieldNumber = 8,
44564     kSourceLocationIidFieldNumber = 9,
44565     kSourceLocationFieldNumber = 10,
44566   };
44567 
44568   BeginFrameArgs();
44569   ~BeginFrameArgs() override;
44570   BeginFrameArgs(BeginFrameArgs&&) noexcept;
44571   BeginFrameArgs& operator=(BeginFrameArgs&&);
44572   BeginFrameArgs(const BeginFrameArgs&);
44573   BeginFrameArgs& operator=(const BeginFrameArgs&);
44574   bool operator==(const BeginFrameArgs&) const;
44575   bool operator!=(const BeginFrameArgs& other) const { return !(*this == other); }
44576 
44577   bool ParseFromArray(const void*, size_t) override;
44578   std::string SerializeAsString() const override;
44579   std::vector<uint8_t> SerializeAsArray() const override;
44580   void Serialize(::protozero::Message*) const;
44581 
44582   bool has_type() const { return _has_field_[1]; }
44583   BeginFrameArgs_BeginFrameArgsType type() const { return type_; }
44584   void set_type(BeginFrameArgs_BeginFrameArgsType value) { type_ = value; _has_field_.set(1); }
44585 
44586   bool has_source_id() const { return _has_field_[2]; }
44587   uint64_t source_id() const { return source_id_; }
44588   void set_source_id(uint64_t value) { source_id_ = value; _has_field_.set(2); }
44589 
44590   bool has_sequence_number() const { return _has_field_[3]; }
44591   uint64_t sequence_number() const { return sequence_number_; }
44592   void set_sequence_number(uint64_t value) { sequence_number_ = value; _has_field_.set(3); }
44593 
44594   bool has_frame_time_us() const { return _has_field_[4]; }
44595   int64_t frame_time_us() const { return frame_time_us_; }
44596   void set_frame_time_us(int64_t value) { frame_time_us_ = value; _has_field_.set(4); }
44597 
44598   bool has_deadline_us() const { return _has_field_[5]; }
44599   int64_t deadline_us() const { return deadline_us_; }
44600   void set_deadline_us(int64_t value) { deadline_us_ = value; _has_field_.set(5); }
44601 
44602   bool has_interval_delta_us() const { return _has_field_[6]; }
44603   int64_t interval_delta_us() const { return interval_delta_us_; }
44604   void set_interval_delta_us(int64_t value) { interval_delta_us_ = value; _has_field_.set(6); }
44605 
44606   bool has_on_critical_path() const { return _has_field_[7]; }
44607   bool on_critical_path() const { return on_critical_path_; }
44608   void set_on_critical_path(bool value) { on_critical_path_ = value; _has_field_.set(7); }
44609 
44610   bool has_animate_only() const { return _has_field_[8]; }
44611   bool animate_only() const { return animate_only_; }
44612   void set_animate_only(bool value) { animate_only_ = value; _has_field_.set(8); }
44613 
44614   bool has_source_location_iid() const { return _has_field_[9]; }
44615   uint64_t source_location_iid() const { return source_location_iid_; }
44616   void set_source_location_iid(uint64_t value) { source_location_iid_ = value; _has_field_.set(9); }
44617 
44618   bool has_source_location() const { return _has_field_[10]; }
44619   const SourceLocation& source_location() const { return *source_location_; }
44620   SourceLocation* mutable_source_location() { _has_field_.set(10); return source_location_.get(); }
44621 
44622  private:
44623   BeginFrameArgs_BeginFrameArgsType type_{};
44624   uint64_t source_id_{};
44625   uint64_t sequence_number_{};
44626   int64_t frame_time_us_{};
44627   int64_t deadline_us_{};
44628   int64_t interval_delta_us_{};
44629   bool on_critical_path_{};
44630   bool animate_only_{};
44631   uint64_t source_location_iid_{};
44632   ::protozero::CopyablePtr<SourceLocation> source_location_;
44633 
44634   // Allows to preserve unknown protobuf fields for compatibility
44635   // with future versions of .proto files.
44636   std::string unknown_fields_;
44637 
44638   std::bitset<11> _has_field_{};
44639 };
44640 
44641 
44642 class PERFETTO_EXPORT BeginFrameObserverState : public ::protozero::CppMessageObj {
44643  public:
44644   enum FieldNumbers {
44645     kDroppedBeginFrameArgsFieldNumber = 1,
44646     kLastBeginFrameArgsFieldNumber = 2,
44647   };
44648 
44649   BeginFrameObserverState();
44650   ~BeginFrameObserverState() override;
44651   BeginFrameObserverState(BeginFrameObserverState&&) noexcept;
44652   BeginFrameObserverState& operator=(BeginFrameObserverState&&);
44653   BeginFrameObserverState(const BeginFrameObserverState&);
44654   BeginFrameObserverState& operator=(const BeginFrameObserverState&);
44655   bool operator==(const BeginFrameObserverState&) const;
44656   bool operator!=(const BeginFrameObserverState& other) const { return !(*this == other); }
44657 
44658   bool ParseFromArray(const void*, size_t) override;
44659   std::string SerializeAsString() const override;
44660   std::vector<uint8_t> SerializeAsArray() const override;
44661   void Serialize(::protozero::Message*) const;
44662 
44663   bool has_dropped_begin_frame_args() const { return _has_field_[1]; }
44664   int64_t dropped_begin_frame_args() const { return dropped_begin_frame_args_; }
44665   void set_dropped_begin_frame_args(int64_t value) { dropped_begin_frame_args_ = value; _has_field_.set(1); }
44666 
44667   bool has_last_begin_frame_args() const { return _has_field_[2]; }
44668   const BeginFrameArgs& last_begin_frame_args() const { return *last_begin_frame_args_; }
44669   BeginFrameArgs* mutable_last_begin_frame_args() { _has_field_.set(2); return last_begin_frame_args_.get(); }
44670 
44671  private:
44672   int64_t dropped_begin_frame_args_{};
44673   ::protozero::CopyablePtr<BeginFrameArgs> last_begin_frame_args_;
44674 
44675   // Allows to preserve unknown protobuf fields for compatibility
44676   // with future versions of .proto files.
44677   std::string unknown_fields_;
44678 
44679   std::bitset<3> _has_field_{};
44680 };
44681 
44682 
44683 class PERFETTO_EXPORT BeginImplFrameArgs : public ::protozero::CppMessageObj {
44684  public:
44685   using TimestampsInUs = BeginImplFrameArgs_TimestampsInUs;
44686   using State = BeginImplFrameArgs_State;
44687   static constexpr auto BEGIN_FRAME_FINISHED = BeginImplFrameArgs_State_BEGIN_FRAME_FINISHED;
44688   static constexpr auto BEGIN_FRAME_USING = BeginImplFrameArgs_State_BEGIN_FRAME_USING;
44689   static constexpr auto State_MIN = BeginImplFrameArgs_State_BEGIN_FRAME_FINISHED;
44690   static constexpr auto State_MAX = BeginImplFrameArgs_State_BEGIN_FRAME_USING;
44691   enum FieldNumbers {
44692     kUpdatedAtUsFieldNumber = 1,
44693     kFinishedAtUsFieldNumber = 2,
44694     kStateFieldNumber = 3,
44695     kCurrentArgsFieldNumber = 4,
44696     kLastArgsFieldNumber = 5,
44697     kTimestampsInUsFieldNumber = 6,
44698   };
44699 
44700   BeginImplFrameArgs();
44701   ~BeginImplFrameArgs() override;
44702   BeginImplFrameArgs(BeginImplFrameArgs&&) noexcept;
44703   BeginImplFrameArgs& operator=(BeginImplFrameArgs&&);
44704   BeginImplFrameArgs(const BeginImplFrameArgs&);
44705   BeginImplFrameArgs& operator=(const BeginImplFrameArgs&);
44706   bool operator==(const BeginImplFrameArgs&) const;
44707   bool operator!=(const BeginImplFrameArgs& other) const { return !(*this == other); }
44708 
44709   bool ParseFromArray(const void*, size_t) override;
44710   std::string SerializeAsString() const override;
44711   std::vector<uint8_t> SerializeAsArray() const override;
44712   void Serialize(::protozero::Message*) const;
44713 
44714   bool has_updated_at_us() const { return _has_field_[1]; }
44715   int64_t updated_at_us() const { return updated_at_us_; }
44716   void set_updated_at_us(int64_t value) { updated_at_us_ = value; _has_field_.set(1); }
44717 
44718   bool has_finished_at_us() const { return _has_field_[2]; }
44719   int64_t finished_at_us() const { return finished_at_us_; }
44720   void set_finished_at_us(int64_t value) { finished_at_us_ = value; _has_field_.set(2); }
44721 
44722   bool has_state() const { return _has_field_[3]; }
44723   BeginImplFrameArgs_State state() const { return state_; }
44724   void set_state(BeginImplFrameArgs_State value) { state_ = value; _has_field_.set(3); }
44725 
44726   bool has_current_args() const { return _has_field_[4]; }
44727   const BeginFrameArgs& current_args() const { return *current_args_; }
44728   BeginFrameArgs* mutable_current_args() { _has_field_.set(4); return current_args_.get(); }
44729 
44730   bool has_last_args() const { return _has_field_[5]; }
44731   const BeginFrameArgs& last_args() const { return *last_args_; }
44732   BeginFrameArgs* mutable_last_args() { _has_field_.set(5); return last_args_.get(); }
44733 
44734   bool has_timestamps_in_us() const { return _has_field_[6]; }
44735   const BeginImplFrameArgs_TimestampsInUs& timestamps_in_us() const { return *timestamps_in_us_; }
44736   BeginImplFrameArgs_TimestampsInUs* mutable_timestamps_in_us() { _has_field_.set(6); return timestamps_in_us_.get(); }
44737 
44738  private:
44739   int64_t updated_at_us_{};
44740   int64_t finished_at_us_{};
44741   BeginImplFrameArgs_State state_{};
44742   ::protozero::CopyablePtr<BeginFrameArgs> current_args_;
44743   ::protozero::CopyablePtr<BeginFrameArgs> last_args_;
44744   ::protozero::CopyablePtr<BeginImplFrameArgs_TimestampsInUs> timestamps_in_us_;
44745 
44746   // Allows to preserve unknown protobuf fields for compatibility
44747   // with future versions of .proto files.
44748   std::string unknown_fields_;
44749 
44750   std::bitset<7> _has_field_{};
44751 };
44752 
44753 
44754 class PERFETTO_EXPORT BeginImplFrameArgs_TimestampsInUs : public ::protozero::CppMessageObj {
44755  public:
44756   enum FieldNumbers {
44757     kIntervalDeltaFieldNumber = 1,
44758     kNowToDeadlineDeltaFieldNumber = 2,
44759     kFrameTimeToNowDeltaFieldNumber = 3,
44760     kFrameTimeToDeadlineDeltaFieldNumber = 4,
44761     kNowFieldNumber = 5,
44762     kFrameTimeFieldNumber = 6,
44763     kDeadlineFieldNumber = 7,
44764   };
44765 
44766   BeginImplFrameArgs_TimestampsInUs();
44767   ~BeginImplFrameArgs_TimestampsInUs() override;
44768   BeginImplFrameArgs_TimestampsInUs(BeginImplFrameArgs_TimestampsInUs&&) noexcept;
44769   BeginImplFrameArgs_TimestampsInUs& operator=(BeginImplFrameArgs_TimestampsInUs&&);
44770   BeginImplFrameArgs_TimestampsInUs(const BeginImplFrameArgs_TimestampsInUs&);
44771   BeginImplFrameArgs_TimestampsInUs& operator=(const BeginImplFrameArgs_TimestampsInUs&);
44772   bool operator==(const BeginImplFrameArgs_TimestampsInUs&) const;
44773   bool operator!=(const BeginImplFrameArgs_TimestampsInUs& other) const { return !(*this == other); }
44774 
44775   bool ParseFromArray(const void*, size_t) override;
44776   std::string SerializeAsString() const override;
44777   std::vector<uint8_t> SerializeAsArray() const override;
44778   void Serialize(::protozero::Message*) const;
44779 
44780   bool has_interval_delta() const { return _has_field_[1]; }
44781   int64_t interval_delta() const { return interval_delta_; }
44782   void set_interval_delta(int64_t value) { interval_delta_ = value; _has_field_.set(1); }
44783 
44784   bool has_now_to_deadline_delta() const { return _has_field_[2]; }
44785   int64_t now_to_deadline_delta() const { return now_to_deadline_delta_; }
44786   void set_now_to_deadline_delta(int64_t value) { now_to_deadline_delta_ = value; _has_field_.set(2); }
44787 
44788   bool has_frame_time_to_now_delta() const { return _has_field_[3]; }
44789   int64_t frame_time_to_now_delta() const { return frame_time_to_now_delta_; }
44790   void set_frame_time_to_now_delta(int64_t value) { frame_time_to_now_delta_ = value; _has_field_.set(3); }
44791 
44792   bool has_frame_time_to_deadline_delta() const { return _has_field_[4]; }
44793   int64_t frame_time_to_deadline_delta() const { return frame_time_to_deadline_delta_; }
44794   void set_frame_time_to_deadline_delta(int64_t value) { frame_time_to_deadline_delta_ = value; _has_field_.set(4); }
44795 
44796   bool has_now() const { return _has_field_[5]; }
44797   int64_t now() const { return now_; }
44798   void set_now(int64_t value) { now_ = value; _has_field_.set(5); }
44799 
44800   bool has_frame_time() const { return _has_field_[6]; }
44801   int64_t frame_time() const { return frame_time_; }
44802   void set_frame_time(int64_t value) { frame_time_ = value; _has_field_.set(6); }
44803 
44804   bool has_deadline() const { return _has_field_[7]; }
44805   int64_t deadline() const { return deadline_; }
44806   void set_deadline(int64_t value) { deadline_ = value; _has_field_.set(7); }
44807 
44808  private:
44809   int64_t interval_delta_{};
44810   int64_t now_to_deadline_delta_{};
44811   int64_t frame_time_to_now_delta_{};
44812   int64_t frame_time_to_deadline_delta_{};
44813   int64_t now_{};
44814   int64_t frame_time_{};
44815   int64_t deadline_{};
44816 
44817   // Allows to preserve unknown protobuf fields for compatibility
44818   // with future versions of .proto files.
44819   std::string unknown_fields_;
44820 
44821   std::bitset<8> _has_field_{};
44822 };
44823 
44824 
44825 class PERFETTO_EXPORT ChromeCompositorStateMachine : public ::protozero::CppMessageObj {
44826  public:
44827   using MajorState = ChromeCompositorStateMachine_MajorState;
44828   using MinorState = ChromeCompositorStateMachine_MinorState;
44829   enum FieldNumbers {
44830     kMajorStateFieldNumber = 1,
44831     kMinorStateFieldNumber = 2,
44832   };
44833 
44834   ChromeCompositorStateMachine();
44835   ~ChromeCompositorStateMachine() override;
44836   ChromeCompositorStateMachine(ChromeCompositorStateMachine&&) noexcept;
44837   ChromeCompositorStateMachine& operator=(ChromeCompositorStateMachine&&);
44838   ChromeCompositorStateMachine(const ChromeCompositorStateMachine&);
44839   ChromeCompositorStateMachine& operator=(const ChromeCompositorStateMachine&);
44840   bool operator==(const ChromeCompositorStateMachine&) const;
44841   bool operator!=(const ChromeCompositorStateMachine& other) const { return !(*this == other); }
44842 
44843   bool ParseFromArray(const void*, size_t) override;
44844   std::string SerializeAsString() const override;
44845   std::vector<uint8_t> SerializeAsArray() const override;
44846   void Serialize(::protozero::Message*) const;
44847 
44848   bool has_major_state() const { return _has_field_[1]; }
44849   const ChromeCompositorStateMachine_MajorState& major_state() const { return *major_state_; }
44850   ChromeCompositorStateMachine_MajorState* mutable_major_state() { _has_field_.set(1); return major_state_.get(); }
44851 
44852   bool has_minor_state() const { return _has_field_[2]; }
44853   const ChromeCompositorStateMachine_MinorState& minor_state() const { return *minor_state_; }
44854   ChromeCompositorStateMachine_MinorState* mutable_minor_state() { _has_field_.set(2); return minor_state_.get(); }
44855 
44856  private:
44857   ::protozero::CopyablePtr<ChromeCompositorStateMachine_MajorState> major_state_;
44858   ::protozero::CopyablePtr<ChromeCompositorStateMachine_MinorState> minor_state_;
44859 
44860   // Allows to preserve unknown protobuf fields for compatibility
44861   // with future versions of .proto files.
44862   std::string unknown_fields_;
44863 
44864   std::bitset<3> _has_field_{};
44865 };
44866 
44867 
44868 class PERFETTO_EXPORT ChromeCompositorStateMachine_MinorState : public ::protozero::CppMessageObj {
44869  public:
44870   using TreePriority = ChromeCompositorStateMachine_MinorState_TreePriority;
44871   static constexpr auto TREE_PRIORITY_UNSPECIFIED = ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_UNSPECIFIED;
44872   static constexpr auto TREE_PRIORITY_SAME_PRIORITY_FOR_BOTH_TREES = ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_SAME_PRIORITY_FOR_BOTH_TREES;
44873   static constexpr auto TREE_PRIORITY_SMOOTHNESS_TAKES_PRIORITY = ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_SMOOTHNESS_TAKES_PRIORITY;
44874   static constexpr auto TREE_PRIORITY_NEW_CONTENT_TAKES_PRIORITY = ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_NEW_CONTENT_TAKES_PRIORITY;
44875   static constexpr auto TreePriority_MIN = ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_UNSPECIFIED;
44876   static constexpr auto TreePriority_MAX = ChromeCompositorStateMachine_MinorState_TreePriority_TREE_PRIORITY_NEW_CONTENT_TAKES_PRIORITY;
44877   using ScrollHandlerState = ChromeCompositorStateMachine_MinorState_ScrollHandlerState;
44878   static constexpr auto SCROLL_HANDLER_UNSPECIFIED = ChromeCompositorStateMachine_MinorState_ScrollHandlerState_SCROLL_HANDLER_UNSPECIFIED;
44879   static constexpr auto SCROLL_AFFECTS_SCROLL_HANDLER = ChromeCompositorStateMachine_MinorState_ScrollHandlerState_SCROLL_AFFECTS_SCROLL_HANDLER;
44880   static constexpr auto SCROLL_DOES_NOT_AFFECT_SCROLL_HANDLER = ChromeCompositorStateMachine_MinorState_ScrollHandlerState_SCROLL_DOES_NOT_AFFECT_SCROLL_HANDLER;
44881   static constexpr auto ScrollHandlerState_MIN = ChromeCompositorStateMachine_MinorState_ScrollHandlerState_SCROLL_HANDLER_UNSPECIFIED;
44882   static constexpr auto ScrollHandlerState_MAX = ChromeCompositorStateMachine_MinorState_ScrollHandlerState_SCROLL_DOES_NOT_AFFECT_SCROLL_HANDLER;
44883   enum FieldNumbers {
44884     kCommitCountFieldNumber = 1,
44885     kCurrentFrameNumberFieldNumber = 2,
44886     kLastFrameNumberSubmitPerformedFieldNumber = 3,
44887     kLastFrameNumberDrawPerformedFieldNumber = 4,
44888     kLastFrameNumberBeginMainFrameSentFieldNumber = 5,
44889     kDidDrawFieldNumber = 6,
44890     kDidSendBeginMainFrameForCurrentFrameFieldNumber = 7,
44891     kDidNotifyBeginMainFrameNotExpectedUntilFieldNumber = 8,
44892     kDidNotifyBeginMainFrameNotExpectedSoonFieldNumber = 9,
44893     kWantsBeginMainFrameNotExpectedFieldNumber = 10,
44894     kDidCommitDuringFrameFieldNumber = 11,
44895     kDidInvalidateLayerTreeFrameSinkFieldNumber = 12,
44896     kDidPerformImplSideInvalidaionFieldNumber = 13,
44897     kDidPrepareTilesFieldNumber = 14,
44898     kConsecutiveCheckerboardAnimationsFieldNumber = 15,
44899     kPendingSubmitFramesFieldNumber = 16,
44900     kSubmitFramesWithCurrentLayerTreeFrameSinkFieldNumber = 17,
44901     kNeedsRedrawFieldNumber = 18,
44902     kNeedsPrepareTilesFieldNumber = 19,
44903     kNeedsBeginMainFrameFieldNumber = 20,
44904     kNeedsOneBeginImplFrameFieldNumber = 21,
44905     kVisibleFieldNumber = 22,
44906     kBeginFrameSourcePausedFieldNumber = 23,
44907     kCanDrawFieldNumber = 24,
44908     kResourcelessDrawFieldNumber = 25,
44909     kHasPendingTreeFieldNumber = 26,
44910     kPendingTreeIsReadyForActivationFieldNumber = 27,
44911     kActiveTreeNeedsFirstDrawFieldNumber = 28,
44912     kActiveTreeIsReadyToDrawFieldNumber = 29,
44913     kDidCreateAndInitializeFirstLayerTreeFrameSinkFieldNumber = 30,
44914     kTreePriorityFieldNumber = 31,
44915     kScrollHandlerStateFieldNumber = 32,
44916     kCriticalBeginMainFrameToActivateIsFastFieldNumber = 33,
44917     kMainThreadMissedLastDeadlineFieldNumber = 34,
44918     kSkipNextBeginMainFrameToReduceLatencyFieldNumber = 35,
44919     kVideoNeedsBeginFramesFieldNumber = 36,
44920     kDeferBeginMainFrameFieldNumber = 37,
44921     kLastCommitHadNoUpdatesFieldNumber = 38,
44922     kDidDrawInLastFrameFieldNumber = 39,
44923     kDidSubmitInLastFrameFieldNumber = 40,
44924     kNeedsImplSideInvalidationFieldNumber = 41,
44925     kCurrentPendingTreeIsImplSideFieldNumber = 42,
44926     kPreviousPendingTreeWasImplSideFieldNumber = 43,
44927     kProcessingAnimationWorkletsForActiveTreeFieldNumber = 44,
44928     kProcessingAnimationWorkletsForPendingTreeFieldNumber = 45,
44929     kProcessingPaintWorkletsForPendingTreeFieldNumber = 46,
44930   };
44931 
44932   ChromeCompositorStateMachine_MinorState();
44933   ~ChromeCompositorStateMachine_MinorState() override;
44934   ChromeCompositorStateMachine_MinorState(ChromeCompositorStateMachine_MinorState&&) noexcept;
44935   ChromeCompositorStateMachine_MinorState& operator=(ChromeCompositorStateMachine_MinorState&&);
44936   ChromeCompositorStateMachine_MinorState(const ChromeCompositorStateMachine_MinorState&);
44937   ChromeCompositorStateMachine_MinorState& operator=(const ChromeCompositorStateMachine_MinorState&);
44938   bool operator==(const ChromeCompositorStateMachine_MinorState&) const;
44939   bool operator!=(const ChromeCompositorStateMachine_MinorState& other) const { return !(*this == other); }
44940 
44941   bool ParseFromArray(const void*, size_t) override;
44942   std::string SerializeAsString() const override;
44943   std::vector<uint8_t> SerializeAsArray() const override;
44944   void Serialize(::protozero::Message*) const;
44945 
44946   bool has_commit_count() const { return _has_field_[1]; }
44947   int32_t commit_count() const { return commit_count_; }
44948   void set_commit_count(int32_t value) { commit_count_ = value; _has_field_.set(1); }
44949 
44950   bool has_current_frame_number() const { return _has_field_[2]; }
44951   int32_t current_frame_number() const { return current_frame_number_; }
44952   void set_current_frame_number(int32_t value) { current_frame_number_ = value; _has_field_.set(2); }
44953 
44954   bool has_last_frame_number_submit_performed() const { return _has_field_[3]; }
44955   int32_t last_frame_number_submit_performed() const { return last_frame_number_submit_performed_; }
44956   void set_last_frame_number_submit_performed(int32_t value) { last_frame_number_submit_performed_ = value; _has_field_.set(3); }
44957 
44958   bool has_last_frame_number_draw_performed() const { return _has_field_[4]; }
44959   int32_t last_frame_number_draw_performed() const { return last_frame_number_draw_performed_; }
44960   void set_last_frame_number_draw_performed(int32_t value) { last_frame_number_draw_performed_ = value; _has_field_.set(4); }
44961 
44962   bool has_last_frame_number_begin_main_frame_sent() const { return _has_field_[5]; }
44963   int32_t last_frame_number_begin_main_frame_sent() const { return last_frame_number_begin_main_frame_sent_; }
44964   void set_last_frame_number_begin_main_frame_sent(int32_t value) { last_frame_number_begin_main_frame_sent_ = value; _has_field_.set(5); }
44965 
44966   bool has_did_draw() const { return _has_field_[6]; }
44967   bool did_draw() const { return did_draw_; }
44968   void set_did_draw(bool value) { did_draw_ = value; _has_field_.set(6); }
44969 
44970   bool has_did_send_begin_main_frame_for_current_frame() const { return _has_field_[7]; }
44971   bool did_send_begin_main_frame_for_current_frame() const { return did_send_begin_main_frame_for_current_frame_; }
44972   void set_did_send_begin_main_frame_for_current_frame(bool value) { did_send_begin_main_frame_for_current_frame_ = value; _has_field_.set(7); }
44973 
44974   bool has_did_notify_begin_main_frame_not_expected_until() const { return _has_field_[8]; }
44975   bool did_notify_begin_main_frame_not_expected_until() const { return did_notify_begin_main_frame_not_expected_until_; }
44976   void set_did_notify_begin_main_frame_not_expected_until(bool value) { did_notify_begin_main_frame_not_expected_until_ = value; _has_field_.set(8); }
44977 
44978   bool has_did_notify_begin_main_frame_not_expected_soon() const { return _has_field_[9]; }
44979   bool did_notify_begin_main_frame_not_expected_soon() const { return did_notify_begin_main_frame_not_expected_soon_; }
44980   void set_did_notify_begin_main_frame_not_expected_soon(bool value) { did_notify_begin_main_frame_not_expected_soon_ = value; _has_field_.set(9); }
44981 
44982   bool has_wants_begin_main_frame_not_expected() const { return _has_field_[10]; }
44983   bool wants_begin_main_frame_not_expected() const { return wants_begin_main_frame_not_expected_; }
44984   void set_wants_begin_main_frame_not_expected(bool value) { wants_begin_main_frame_not_expected_ = value; _has_field_.set(10); }
44985 
44986   bool has_did_commit_during_frame() const { return _has_field_[11]; }
44987   bool did_commit_during_frame() const { return did_commit_during_frame_; }
44988   void set_did_commit_during_frame(bool value) { did_commit_during_frame_ = value; _has_field_.set(11); }
44989 
44990   bool has_did_invalidate_layer_tree_frame_sink() const { return _has_field_[12]; }
44991   bool did_invalidate_layer_tree_frame_sink() const { return did_invalidate_layer_tree_frame_sink_; }
44992   void set_did_invalidate_layer_tree_frame_sink(bool value) { did_invalidate_layer_tree_frame_sink_ = value; _has_field_.set(12); }
44993 
44994   bool has_did_perform_impl_side_invalidaion() const { return _has_field_[13]; }
44995   bool did_perform_impl_side_invalidaion() const { return did_perform_impl_side_invalidaion_; }
44996   void set_did_perform_impl_side_invalidaion(bool value) { did_perform_impl_side_invalidaion_ = value; _has_field_.set(13); }
44997 
44998   bool has_did_prepare_tiles() const { return _has_field_[14]; }
44999   bool did_prepare_tiles() const { return did_prepare_tiles_; }
45000   void set_did_prepare_tiles(bool value) { did_prepare_tiles_ = value; _has_field_.set(14); }
45001 
45002   bool has_consecutive_checkerboard_animations() const { return _has_field_[15]; }
45003   int32_t consecutive_checkerboard_animations() const { return consecutive_checkerboard_animations_; }
45004   void set_consecutive_checkerboard_animations(int32_t value) { consecutive_checkerboard_animations_ = value; _has_field_.set(15); }
45005 
45006   bool has_pending_submit_frames() const { return _has_field_[16]; }
45007   int32_t pending_submit_frames() const { return pending_submit_frames_; }
45008   void set_pending_submit_frames(int32_t value) { pending_submit_frames_ = value; _has_field_.set(16); }
45009 
45010   bool has_submit_frames_with_current_layer_tree_frame_sink() const { return _has_field_[17]; }
45011   int32_t submit_frames_with_current_layer_tree_frame_sink() const { return submit_frames_with_current_layer_tree_frame_sink_; }
45012   void set_submit_frames_with_current_layer_tree_frame_sink(int32_t value) { submit_frames_with_current_layer_tree_frame_sink_ = value; _has_field_.set(17); }
45013 
45014   bool has_needs_redraw() const { return _has_field_[18]; }
45015   bool needs_redraw() const { return needs_redraw_; }
45016   void set_needs_redraw(bool value) { needs_redraw_ = value; _has_field_.set(18); }
45017 
45018   bool has_needs_prepare_tiles() const { return _has_field_[19]; }
45019   bool needs_prepare_tiles() const { return needs_prepare_tiles_; }
45020   void set_needs_prepare_tiles(bool value) { needs_prepare_tiles_ = value; _has_field_.set(19); }
45021 
45022   bool has_needs_begin_main_frame() const { return _has_field_[20]; }
45023   bool needs_begin_main_frame() const { return needs_begin_main_frame_; }
45024   void set_needs_begin_main_frame(bool value) { needs_begin_main_frame_ = value; _has_field_.set(20); }
45025 
45026   bool has_needs_one_begin_impl_frame() const { return _has_field_[21]; }
45027   bool needs_one_begin_impl_frame() const { return needs_one_begin_impl_frame_; }
45028   void set_needs_one_begin_impl_frame(bool value) { needs_one_begin_impl_frame_ = value; _has_field_.set(21); }
45029 
45030   bool has_visible() const { return _has_field_[22]; }
45031   bool visible() const { return visible_; }
45032   void set_visible(bool value) { visible_ = value; _has_field_.set(22); }
45033 
45034   bool has_begin_frame_source_paused() const { return _has_field_[23]; }
45035   bool begin_frame_source_paused() const { return begin_frame_source_paused_; }
45036   void set_begin_frame_source_paused(bool value) { begin_frame_source_paused_ = value; _has_field_.set(23); }
45037 
45038   bool has_can_draw() const { return _has_field_[24]; }
45039   bool can_draw() const { return can_draw_; }
45040   void set_can_draw(bool value) { can_draw_ = value; _has_field_.set(24); }
45041 
45042   bool has_resourceless_draw() const { return _has_field_[25]; }
45043   bool resourceless_draw() const { return resourceless_draw_; }
45044   void set_resourceless_draw(bool value) { resourceless_draw_ = value; _has_field_.set(25); }
45045 
45046   bool has_has_pending_tree() const { return _has_field_[26]; }
45047   bool has_pending_tree() const { return has_pending_tree_; }
45048   void set_has_pending_tree(bool value) { has_pending_tree_ = value; _has_field_.set(26); }
45049 
45050   bool has_pending_tree_is_ready_for_activation() const { return _has_field_[27]; }
45051   bool pending_tree_is_ready_for_activation() const { return pending_tree_is_ready_for_activation_; }
45052   void set_pending_tree_is_ready_for_activation(bool value) { pending_tree_is_ready_for_activation_ = value; _has_field_.set(27); }
45053 
45054   bool has_active_tree_needs_first_draw() const { return _has_field_[28]; }
45055   bool active_tree_needs_first_draw() const { return active_tree_needs_first_draw_; }
45056   void set_active_tree_needs_first_draw(bool value) { active_tree_needs_first_draw_ = value; _has_field_.set(28); }
45057 
45058   bool has_active_tree_is_ready_to_draw() const { return _has_field_[29]; }
45059   bool active_tree_is_ready_to_draw() const { return active_tree_is_ready_to_draw_; }
45060   void set_active_tree_is_ready_to_draw(bool value) { active_tree_is_ready_to_draw_ = value; _has_field_.set(29); }
45061 
45062   bool has_did_create_and_initialize_first_layer_tree_frame_sink() const { return _has_field_[30]; }
45063   bool did_create_and_initialize_first_layer_tree_frame_sink() const { return did_create_and_initialize_first_layer_tree_frame_sink_; }
45064   void set_did_create_and_initialize_first_layer_tree_frame_sink(bool value) { did_create_and_initialize_first_layer_tree_frame_sink_ = value; _has_field_.set(30); }
45065 
45066   bool has_tree_priority() const { return _has_field_[31]; }
45067   ChromeCompositorStateMachine_MinorState_TreePriority tree_priority() const { return tree_priority_; }
45068   void set_tree_priority(ChromeCompositorStateMachine_MinorState_TreePriority value) { tree_priority_ = value; _has_field_.set(31); }
45069 
45070   bool has_scroll_handler_state() const { return _has_field_[32]; }
45071   ChromeCompositorStateMachine_MinorState_ScrollHandlerState scroll_handler_state() const { return scroll_handler_state_; }
45072   void set_scroll_handler_state(ChromeCompositorStateMachine_MinorState_ScrollHandlerState value) { scroll_handler_state_ = value; _has_field_.set(32); }
45073 
45074   bool has_critical_begin_main_frame_to_activate_is_fast() const { return _has_field_[33]; }
45075   bool critical_begin_main_frame_to_activate_is_fast() const { return critical_begin_main_frame_to_activate_is_fast_; }
45076   void set_critical_begin_main_frame_to_activate_is_fast(bool value) { critical_begin_main_frame_to_activate_is_fast_ = value; _has_field_.set(33); }
45077 
45078   bool has_main_thread_missed_last_deadline() const { return _has_field_[34]; }
45079   bool main_thread_missed_last_deadline() const { return main_thread_missed_last_deadline_; }
45080   void set_main_thread_missed_last_deadline(bool value) { main_thread_missed_last_deadline_ = value; _has_field_.set(34); }
45081 
45082   bool has_skip_next_begin_main_frame_to_reduce_latency() const { return _has_field_[35]; }
45083   bool skip_next_begin_main_frame_to_reduce_latency() const { return skip_next_begin_main_frame_to_reduce_latency_; }
45084   void set_skip_next_begin_main_frame_to_reduce_latency(bool value) { skip_next_begin_main_frame_to_reduce_latency_ = value; _has_field_.set(35); }
45085 
45086   bool has_video_needs_begin_frames() const { return _has_field_[36]; }
45087   bool video_needs_begin_frames() const { return video_needs_begin_frames_; }
45088   void set_video_needs_begin_frames(bool value) { video_needs_begin_frames_ = value; _has_field_.set(36); }
45089 
45090   bool has_defer_begin_main_frame() const { return _has_field_[37]; }
45091   bool defer_begin_main_frame() const { return defer_begin_main_frame_; }
45092   void set_defer_begin_main_frame(bool value) { defer_begin_main_frame_ = value; _has_field_.set(37); }
45093 
45094   bool has_last_commit_had_no_updates() const { return _has_field_[38]; }
45095   bool last_commit_had_no_updates() const { return last_commit_had_no_updates_; }
45096   void set_last_commit_had_no_updates(bool value) { last_commit_had_no_updates_ = value; _has_field_.set(38); }
45097 
45098   bool has_did_draw_in_last_frame() const { return _has_field_[39]; }
45099   bool did_draw_in_last_frame() const { return did_draw_in_last_frame_; }
45100   void set_did_draw_in_last_frame(bool value) { did_draw_in_last_frame_ = value; _has_field_.set(39); }
45101 
45102   bool has_did_submit_in_last_frame() const { return _has_field_[40]; }
45103   bool did_submit_in_last_frame() const { return did_submit_in_last_frame_; }
45104   void set_did_submit_in_last_frame(bool value) { did_submit_in_last_frame_ = value; _has_field_.set(40); }
45105 
45106   bool has_needs_impl_side_invalidation() const { return _has_field_[41]; }
45107   bool needs_impl_side_invalidation() const { return needs_impl_side_invalidation_; }
45108   void set_needs_impl_side_invalidation(bool value) { needs_impl_side_invalidation_ = value; _has_field_.set(41); }
45109 
45110   bool has_current_pending_tree_is_impl_side() const { return _has_field_[42]; }
45111   bool current_pending_tree_is_impl_side() const { return current_pending_tree_is_impl_side_; }
45112   void set_current_pending_tree_is_impl_side(bool value) { current_pending_tree_is_impl_side_ = value; _has_field_.set(42); }
45113 
45114   bool has_previous_pending_tree_was_impl_side() const { return _has_field_[43]; }
45115   bool previous_pending_tree_was_impl_side() const { return previous_pending_tree_was_impl_side_; }
45116   void set_previous_pending_tree_was_impl_side(bool value) { previous_pending_tree_was_impl_side_ = value; _has_field_.set(43); }
45117 
45118   bool has_processing_animation_worklets_for_active_tree() const { return _has_field_[44]; }
45119   bool processing_animation_worklets_for_active_tree() const { return processing_animation_worklets_for_active_tree_; }
45120   void set_processing_animation_worklets_for_active_tree(bool value) { processing_animation_worklets_for_active_tree_ = value; _has_field_.set(44); }
45121 
45122   bool has_processing_animation_worklets_for_pending_tree() const { return _has_field_[45]; }
45123   bool processing_animation_worklets_for_pending_tree() const { return processing_animation_worklets_for_pending_tree_; }
45124   void set_processing_animation_worklets_for_pending_tree(bool value) { processing_animation_worklets_for_pending_tree_ = value; _has_field_.set(45); }
45125 
45126   bool has_processing_paint_worklets_for_pending_tree() const { return _has_field_[46]; }
45127   bool processing_paint_worklets_for_pending_tree() const { return processing_paint_worklets_for_pending_tree_; }
45128   void set_processing_paint_worklets_for_pending_tree(bool value) { processing_paint_worklets_for_pending_tree_ = value; _has_field_.set(46); }
45129 
45130  private:
45131   int32_t commit_count_{};
45132   int32_t current_frame_number_{};
45133   int32_t last_frame_number_submit_performed_{};
45134   int32_t last_frame_number_draw_performed_{};
45135   int32_t last_frame_number_begin_main_frame_sent_{};
45136   bool did_draw_{};
45137   bool did_send_begin_main_frame_for_current_frame_{};
45138   bool did_notify_begin_main_frame_not_expected_until_{};
45139   bool did_notify_begin_main_frame_not_expected_soon_{};
45140   bool wants_begin_main_frame_not_expected_{};
45141   bool did_commit_during_frame_{};
45142   bool did_invalidate_layer_tree_frame_sink_{};
45143   bool did_perform_impl_side_invalidaion_{};
45144   bool did_prepare_tiles_{};
45145   int32_t consecutive_checkerboard_animations_{};
45146   int32_t pending_submit_frames_{};
45147   int32_t submit_frames_with_current_layer_tree_frame_sink_{};
45148   bool needs_redraw_{};
45149   bool needs_prepare_tiles_{};
45150   bool needs_begin_main_frame_{};
45151   bool needs_one_begin_impl_frame_{};
45152   bool visible_{};
45153   bool begin_frame_source_paused_{};
45154   bool can_draw_{};
45155   bool resourceless_draw_{};
45156   bool has_pending_tree_{};
45157   bool pending_tree_is_ready_for_activation_{};
45158   bool active_tree_needs_first_draw_{};
45159   bool active_tree_is_ready_to_draw_{};
45160   bool did_create_and_initialize_first_layer_tree_frame_sink_{};
45161   ChromeCompositorStateMachine_MinorState_TreePriority tree_priority_{};
45162   ChromeCompositorStateMachine_MinorState_ScrollHandlerState scroll_handler_state_{};
45163   bool critical_begin_main_frame_to_activate_is_fast_{};
45164   bool main_thread_missed_last_deadline_{};
45165   bool skip_next_begin_main_frame_to_reduce_latency_{};
45166   bool video_needs_begin_frames_{};
45167   bool defer_begin_main_frame_{};
45168   bool last_commit_had_no_updates_{};
45169   bool did_draw_in_last_frame_{};
45170   bool did_submit_in_last_frame_{};
45171   bool needs_impl_side_invalidation_{};
45172   bool current_pending_tree_is_impl_side_{};
45173   bool previous_pending_tree_was_impl_side_{};
45174   bool processing_animation_worklets_for_active_tree_{};
45175   bool processing_animation_worklets_for_pending_tree_{};
45176   bool processing_paint_worklets_for_pending_tree_{};
45177 
45178   // Allows to preserve unknown protobuf fields for compatibility
45179   // with future versions of .proto files.
45180   std::string unknown_fields_;
45181 
45182   std::bitset<47> _has_field_{};
45183 };
45184 
45185 
45186 class PERFETTO_EXPORT ChromeCompositorStateMachine_MajorState : public ::protozero::CppMessageObj {
45187  public:
45188   using BeginImplFrameState = ChromeCompositorStateMachine_MajorState_BeginImplFrameState;
45189   static constexpr auto BEGIN_IMPL_FRAME_UNSPECIFIED = ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_UNSPECIFIED;
45190   static constexpr auto BEGIN_IMPL_FRAME_IDLE = ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_IDLE;
45191   static constexpr auto BEGIN_IMPL_FRAME_INSIDE_BEGIN_FRAME = ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_INSIDE_BEGIN_FRAME;
45192   static constexpr auto BEGIN_IMPL_FRAME_INSIDE_DEADLINE = ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_INSIDE_DEADLINE;
45193   static constexpr auto BeginImplFrameState_MIN = ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_UNSPECIFIED;
45194   static constexpr auto BeginImplFrameState_MAX = ChromeCompositorStateMachine_MajorState_BeginImplFrameState_BEGIN_IMPL_FRAME_INSIDE_DEADLINE;
45195   using BeginMainFrameState = ChromeCompositorStateMachine_MajorState_BeginMainFrameState;
45196   static constexpr auto BEGIN_MAIN_FRAME_UNSPECIFIED = ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_UNSPECIFIED;
45197   static constexpr auto BEGIN_MAIN_FRAME_IDLE = ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_IDLE;
45198   static constexpr auto BEGIN_MAIN_FRAME_SENT = ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_SENT;
45199   static constexpr auto BEGIN_MAIN_FRAME_READY_TO_COMMIT = ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_READY_TO_COMMIT;
45200   static constexpr auto BeginMainFrameState_MIN = ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_UNSPECIFIED;
45201   static constexpr auto BeginMainFrameState_MAX = ChromeCompositorStateMachine_MajorState_BeginMainFrameState_BEGIN_MAIN_FRAME_READY_TO_COMMIT;
45202   using LayerTreeFrameSinkState = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState;
45203   static constexpr auto LAYER_TREE_FRAME_UNSPECIFIED = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_UNSPECIFIED;
45204   static constexpr auto LAYER_TREE_FRAME_NONE = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_NONE;
45205   static constexpr auto LAYER_TREE_FRAME_ACTIVE = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_ACTIVE;
45206   static constexpr auto LAYER_TREE_FRAME_CREATING = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_CREATING;
45207   static constexpr auto LAYER_TREE_FRAME_WAITING_FOR_FIRST_COMMIT = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_WAITING_FOR_FIRST_COMMIT;
45208   static constexpr auto LAYER_TREE_FRAME_WAITING_FOR_FIRST_ACTIVATION = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_WAITING_FOR_FIRST_ACTIVATION;
45209   static constexpr auto LayerTreeFrameSinkState_MIN = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_UNSPECIFIED;
45210   static constexpr auto LayerTreeFrameSinkState_MAX = ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState_LAYER_TREE_FRAME_WAITING_FOR_FIRST_ACTIVATION;
45211   using ForcedRedrawOnTimeoutState = ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState;
45212   static constexpr auto FORCED_REDRAW_UNSPECIFIED = ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_UNSPECIFIED;
45213   static constexpr auto FORCED_REDRAW_IDLE = ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_IDLE;
45214   static constexpr auto FORCED_REDRAW_WAITING_FOR_COMMIT = ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_WAITING_FOR_COMMIT;
45215   static constexpr auto FORCED_REDRAW_WAITING_FOR_ACTIVATION = ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_WAITING_FOR_ACTIVATION;
45216   static constexpr auto FORCED_REDRAW_WAITING_FOR_DRAW = ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_WAITING_FOR_DRAW;
45217   static constexpr auto ForcedRedrawOnTimeoutState_MIN = ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_UNSPECIFIED;
45218   static constexpr auto ForcedRedrawOnTimeoutState_MAX = ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState_FORCED_REDRAW_WAITING_FOR_DRAW;
45219   enum FieldNumbers {
45220     kNextActionFieldNumber = 1,
45221     kBeginImplFrameStateFieldNumber = 2,
45222     kBeginMainFrameStateFieldNumber = 3,
45223     kLayerTreeFrameSinkStateFieldNumber = 4,
45224     kForcedRedrawStateFieldNumber = 5,
45225   };
45226 
45227   ChromeCompositorStateMachine_MajorState();
45228   ~ChromeCompositorStateMachine_MajorState() override;
45229   ChromeCompositorStateMachine_MajorState(ChromeCompositorStateMachine_MajorState&&) noexcept;
45230   ChromeCompositorStateMachine_MajorState& operator=(ChromeCompositorStateMachine_MajorState&&);
45231   ChromeCompositorStateMachine_MajorState(const ChromeCompositorStateMachine_MajorState&);
45232   ChromeCompositorStateMachine_MajorState& operator=(const ChromeCompositorStateMachine_MajorState&);
45233   bool operator==(const ChromeCompositorStateMachine_MajorState&) const;
45234   bool operator!=(const ChromeCompositorStateMachine_MajorState& other) const { return !(*this == other); }
45235 
45236   bool ParseFromArray(const void*, size_t) override;
45237   std::string SerializeAsString() const override;
45238   std::vector<uint8_t> SerializeAsArray() const override;
45239   void Serialize(::protozero::Message*) const;
45240 
45241   bool has_next_action() const { return _has_field_[1]; }
45242   ChromeCompositorSchedulerAction next_action() const { return next_action_; }
45243   void set_next_action(ChromeCompositorSchedulerAction value) { next_action_ = value; _has_field_.set(1); }
45244 
45245   bool has_begin_impl_frame_state() const { return _has_field_[2]; }
45246   ChromeCompositorStateMachine_MajorState_BeginImplFrameState begin_impl_frame_state() const { return begin_impl_frame_state_; }
45247   void set_begin_impl_frame_state(ChromeCompositorStateMachine_MajorState_BeginImplFrameState value) { begin_impl_frame_state_ = value; _has_field_.set(2); }
45248 
45249   bool has_begin_main_frame_state() const { return _has_field_[3]; }
45250   ChromeCompositorStateMachine_MajorState_BeginMainFrameState begin_main_frame_state() const { return begin_main_frame_state_; }
45251   void set_begin_main_frame_state(ChromeCompositorStateMachine_MajorState_BeginMainFrameState value) { begin_main_frame_state_ = value; _has_field_.set(3); }
45252 
45253   bool has_layer_tree_frame_sink_state() const { return _has_field_[4]; }
45254   ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState layer_tree_frame_sink_state() const { return layer_tree_frame_sink_state_; }
45255   void set_layer_tree_frame_sink_state(ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState value) { layer_tree_frame_sink_state_ = value; _has_field_.set(4); }
45256 
45257   bool has_forced_redraw_state() const { return _has_field_[5]; }
45258   ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState forced_redraw_state() const { return forced_redraw_state_; }
45259   void set_forced_redraw_state(ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState value) { forced_redraw_state_ = value; _has_field_.set(5); }
45260 
45261  private:
45262   ChromeCompositorSchedulerAction next_action_{};
45263   ChromeCompositorStateMachine_MajorState_BeginImplFrameState begin_impl_frame_state_{};
45264   ChromeCompositorStateMachine_MajorState_BeginMainFrameState begin_main_frame_state_{};
45265   ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState layer_tree_frame_sink_state_{};
45266   ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState forced_redraw_state_{};
45267 
45268   // Allows to preserve unknown protobuf fields for compatibility
45269   // with future versions of .proto files.
45270   std::string unknown_fields_;
45271 
45272   std::bitset<6> _has_field_{};
45273 };
45274 
45275 
45276 class PERFETTO_EXPORT ChromeCompositorSchedulerState : public ::protozero::CppMessageObj {
45277  public:
45278   using BeginImplFrameDeadlineMode = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode;
45279   static constexpr auto DEADLINE_MODE_UNSPECIFIED = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_UNSPECIFIED;
45280   static constexpr auto DEADLINE_MODE_NONE = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_NONE;
45281   static constexpr auto DEADLINE_MODE_IMMEDIATE = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_IMMEDIATE;
45282   static constexpr auto DEADLINE_MODE_REGULAR = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_REGULAR;
45283   static constexpr auto DEADLINE_MODE_LATE = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_LATE;
45284   static constexpr auto DEADLINE_MODE_BLOCKED = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_BLOCKED;
45285   static constexpr auto BeginImplFrameDeadlineMode_MIN = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_UNSPECIFIED;
45286   static constexpr auto BeginImplFrameDeadlineMode_MAX = ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode_DEADLINE_MODE_BLOCKED;
45287   enum FieldNumbers {
45288     kStateMachineFieldNumber = 1,
45289     kObservingBeginFrameSourceFieldNumber = 2,
45290     kBeginImplFrameDeadlineTaskFieldNumber = 3,
45291     kPendingBeginFrameTaskFieldNumber = 4,
45292     kSkippedLastFrameMissedExceededDeadlineFieldNumber = 5,
45293     kSkippedLastFrameToReduceLatencyFieldNumber = 6,
45294     kInsideActionFieldNumber = 7,
45295     kDeadlineModeFieldNumber = 8,
45296     kDeadlineUsFieldNumber = 9,
45297     kDeadlineScheduledAtUsFieldNumber = 10,
45298     kNowUsFieldNumber = 11,
45299     kNowToDeadlineDeltaUsFieldNumber = 12,
45300     kNowToDeadlineScheduledAtDeltaUsFieldNumber = 13,
45301     kBeginImplFrameArgsFieldNumber = 14,
45302     kBeginFrameObserverStateFieldNumber = 15,
45303     kBeginFrameSourceStateFieldNumber = 16,
45304     kCompositorTimingHistoryFieldNumber = 17,
45305   };
45306 
45307   ChromeCompositorSchedulerState();
45308   ~ChromeCompositorSchedulerState() override;
45309   ChromeCompositorSchedulerState(ChromeCompositorSchedulerState&&) noexcept;
45310   ChromeCompositorSchedulerState& operator=(ChromeCompositorSchedulerState&&);
45311   ChromeCompositorSchedulerState(const ChromeCompositorSchedulerState&);
45312   ChromeCompositorSchedulerState& operator=(const ChromeCompositorSchedulerState&);
45313   bool operator==(const ChromeCompositorSchedulerState&) const;
45314   bool operator!=(const ChromeCompositorSchedulerState& other) const { return !(*this == other); }
45315 
45316   bool ParseFromArray(const void*, size_t) override;
45317   std::string SerializeAsString() const override;
45318   std::vector<uint8_t> SerializeAsArray() const override;
45319   void Serialize(::protozero::Message*) const;
45320 
45321   bool has_state_machine() const { return _has_field_[1]; }
45322   const ChromeCompositorStateMachine& state_machine() const { return *state_machine_; }
45323   ChromeCompositorStateMachine* mutable_state_machine() { _has_field_.set(1); return state_machine_.get(); }
45324 
45325   bool has_observing_begin_frame_source() const { return _has_field_[2]; }
45326   bool observing_begin_frame_source() const { return observing_begin_frame_source_; }
45327   void set_observing_begin_frame_source(bool value) { observing_begin_frame_source_ = value; _has_field_.set(2); }
45328 
45329   bool has_begin_impl_frame_deadline_task() const { return _has_field_[3]; }
45330   bool begin_impl_frame_deadline_task() const { return begin_impl_frame_deadline_task_; }
45331   void set_begin_impl_frame_deadline_task(bool value) { begin_impl_frame_deadline_task_ = value; _has_field_.set(3); }
45332 
45333   bool has_pending_begin_frame_task() const { return _has_field_[4]; }
45334   bool pending_begin_frame_task() const { return pending_begin_frame_task_; }
45335   void set_pending_begin_frame_task(bool value) { pending_begin_frame_task_ = value; _has_field_.set(4); }
45336 
45337   bool has_skipped_last_frame_missed_exceeded_deadline() const { return _has_field_[5]; }
45338   bool skipped_last_frame_missed_exceeded_deadline() const { return skipped_last_frame_missed_exceeded_deadline_; }
45339   void set_skipped_last_frame_missed_exceeded_deadline(bool value) { skipped_last_frame_missed_exceeded_deadline_ = value; _has_field_.set(5); }
45340 
45341   bool has_skipped_last_frame_to_reduce_latency() const { return _has_field_[6]; }
45342   bool skipped_last_frame_to_reduce_latency() const { return skipped_last_frame_to_reduce_latency_; }
45343   void set_skipped_last_frame_to_reduce_latency(bool value) { skipped_last_frame_to_reduce_latency_ = value; _has_field_.set(6); }
45344 
45345   bool has_inside_action() const { return _has_field_[7]; }
45346   ChromeCompositorSchedulerAction inside_action() const { return inside_action_; }
45347   void set_inside_action(ChromeCompositorSchedulerAction value) { inside_action_ = value; _has_field_.set(7); }
45348 
45349   bool has_deadline_mode() const { return _has_field_[8]; }
45350   ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode deadline_mode() const { return deadline_mode_; }
45351   void set_deadline_mode(ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode value) { deadline_mode_ = value; _has_field_.set(8); }
45352 
45353   bool has_deadline_us() const { return _has_field_[9]; }
45354   int64_t deadline_us() const { return deadline_us_; }
45355   void set_deadline_us(int64_t value) { deadline_us_ = value; _has_field_.set(9); }
45356 
45357   bool has_deadline_scheduled_at_us() const { return _has_field_[10]; }
45358   int64_t deadline_scheduled_at_us() const { return deadline_scheduled_at_us_; }
45359   void set_deadline_scheduled_at_us(int64_t value) { deadline_scheduled_at_us_ = value; _has_field_.set(10); }
45360 
45361   bool has_now_us() const { return _has_field_[11]; }
45362   int64_t now_us() const { return now_us_; }
45363   void set_now_us(int64_t value) { now_us_ = value; _has_field_.set(11); }
45364 
45365   bool has_now_to_deadline_delta_us() const { return _has_field_[12]; }
45366   int64_t now_to_deadline_delta_us() const { return now_to_deadline_delta_us_; }
45367   void set_now_to_deadline_delta_us(int64_t value) { now_to_deadline_delta_us_ = value; _has_field_.set(12); }
45368 
45369   bool has_now_to_deadline_scheduled_at_delta_us() const { return _has_field_[13]; }
45370   int64_t now_to_deadline_scheduled_at_delta_us() const { return now_to_deadline_scheduled_at_delta_us_; }
45371   void set_now_to_deadline_scheduled_at_delta_us(int64_t value) { now_to_deadline_scheduled_at_delta_us_ = value; _has_field_.set(13); }
45372 
45373   bool has_begin_impl_frame_args() const { return _has_field_[14]; }
45374   const BeginImplFrameArgs& begin_impl_frame_args() const { return *begin_impl_frame_args_; }
45375   BeginImplFrameArgs* mutable_begin_impl_frame_args() { _has_field_.set(14); return begin_impl_frame_args_.get(); }
45376 
45377   bool has_begin_frame_observer_state() const { return _has_field_[15]; }
45378   const BeginFrameObserverState& begin_frame_observer_state() const { return *begin_frame_observer_state_; }
45379   BeginFrameObserverState* mutable_begin_frame_observer_state() { _has_field_.set(15); return begin_frame_observer_state_.get(); }
45380 
45381   bool has_begin_frame_source_state() const { return _has_field_[16]; }
45382   const BeginFrameSourceState& begin_frame_source_state() const { return *begin_frame_source_state_; }
45383   BeginFrameSourceState* mutable_begin_frame_source_state() { _has_field_.set(16); return begin_frame_source_state_.get(); }
45384 
45385   bool has_compositor_timing_history() const { return _has_field_[17]; }
45386   const CompositorTimingHistory& compositor_timing_history() const { return *compositor_timing_history_; }
45387   CompositorTimingHistory* mutable_compositor_timing_history() { _has_field_.set(17); return compositor_timing_history_.get(); }
45388 
45389  private:
45390   ::protozero::CopyablePtr<ChromeCompositorStateMachine> state_machine_;
45391   bool observing_begin_frame_source_{};
45392   bool begin_impl_frame_deadline_task_{};
45393   bool pending_begin_frame_task_{};
45394   bool skipped_last_frame_missed_exceeded_deadline_{};
45395   bool skipped_last_frame_to_reduce_latency_{};
45396   ChromeCompositorSchedulerAction inside_action_{};
45397   ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode deadline_mode_{};
45398   int64_t deadline_us_{};
45399   int64_t deadline_scheduled_at_us_{};
45400   int64_t now_us_{};
45401   int64_t now_to_deadline_delta_us_{};
45402   int64_t now_to_deadline_scheduled_at_delta_us_{};
45403   ::protozero::CopyablePtr<BeginImplFrameArgs> begin_impl_frame_args_;
45404   ::protozero::CopyablePtr<BeginFrameObserverState> begin_frame_observer_state_;
45405   ::protozero::CopyablePtr<BeginFrameSourceState> begin_frame_source_state_;
45406   ::protozero::CopyablePtr<CompositorTimingHistory> compositor_timing_history_;
45407 
45408   // Allows to preserve unknown protobuf fields for compatibility
45409   // with future versions of .proto files.
45410   std::string unknown_fields_;
45411 
45412   std::bitset<18> _has_field_{};
45413 };
45414 
45415 }  // namespace perfetto
45416 }  // namespace protos
45417 }  // namespace gen
45418 
45419 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_COMPOSITOR_SCHEDULER_STATE_PROTO_CPP_H_
45420 // gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_frame_reporter.gen.h
45421 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
45422 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_FRAME_REPORTER_PROTO_CPP_H_
45423 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_FRAME_REPORTER_PROTO_CPP_H_
45424 
45425 #include <stdint.h>
45426 #include <bitset>
45427 #include <vector>
45428 #include <string>
45429 #include <type_traits>
45430 
45431 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
45432 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
45433 // gen_amalgamated expanded: #include "perfetto/base/export.h"
45434 
45435 namespace perfetto {
45436 namespace protos {
45437 namespace gen {
45438 class ChromeFrameReporter;
45439 enum ChromeFrameReporter_State : int;
45440 enum ChromeFrameReporter_FrameDropReason : int;
45441 }  // namespace perfetto
45442 }  // namespace protos
45443 }  // namespace gen
45444 
45445 namespace protozero {
45446 class Message;
45447 }  // namespace protozero
45448 
45449 namespace perfetto {
45450 namespace protos {
45451 namespace gen {
45452 enum ChromeFrameReporter_State : int {
45453   ChromeFrameReporter_State_STATE_NO_UPDATE_DESIRED = 0,
45454   ChromeFrameReporter_State_STATE_PRESENTED_ALL = 1,
45455   ChromeFrameReporter_State_STATE_PRESENTED_PARTIAL = 2,
45456   ChromeFrameReporter_State_STATE_DROPPED = 3,
45457 };
45458 enum ChromeFrameReporter_FrameDropReason : int {
45459   ChromeFrameReporter_FrameDropReason_REASON_UNSPECIFIED = 0,
45460   ChromeFrameReporter_FrameDropReason_REASON_DISPLAY_COMPOSITOR = 1,
45461   ChromeFrameReporter_FrameDropReason_REASON_MAIN_THREAD = 2,
45462   ChromeFrameReporter_FrameDropReason_REASON_CLIENT_COMPOSITOR = 3,
45463 };
45464 
45465 class PERFETTO_EXPORT ChromeFrameReporter : public ::protozero::CppMessageObj {
45466  public:
45467   using State = ChromeFrameReporter_State;
45468   static constexpr auto STATE_NO_UPDATE_DESIRED = ChromeFrameReporter_State_STATE_NO_UPDATE_DESIRED;
45469   static constexpr auto STATE_PRESENTED_ALL = ChromeFrameReporter_State_STATE_PRESENTED_ALL;
45470   static constexpr auto STATE_PRESENTED_PARTIAL = ChromeFrameReporter_State_STATE_PRESENTED_PARTIAL;
45471   static constexpr auto STATE_DROPPED = ChromeFrameReporter_State_STATE_DROPPED;
45472   static constexpr auto State_MIN = ChromeFrameReporter_State_STATE_NO_UPDATE_DESIRED;
45473   static constexpr auto State_MAX = ChromeFrameReporter_State_STATE_DROPPED;
45474   using FrameDropReason = ChromeFrameReporter_FrameDropReason;
45475   static constexpr auto REASON_UNSPECIFIED = ChromeFrameReporter_FrameDropReason_REASON_UNSPECIFIED;
45476   static constexpr auto REASON_DISPLAY_COMPOSITOR = ChromeFrameReporter_FrameDropReason_REASON_DISPLAY_COMPOSITOR;
45477   static constexpr auto REASON_MAIN_THREAD = ChromeFrameReporter_FrameDropReason_REASON_MAIN_THREAD;
45478   static constexpr auto REASON_CLIENT_COMPOSITOR = ChromeFrameReporter_FrameDropReason_REASON_CLIENT_COMPOSITOR;
45479   static constexpr auto FrameDropReason_MIN = ChromeFrameReporter_FrameDropReason_REASON_UNSPECIFIED;
45480   static constexpr auto FrameDropReason_MAX = ChromeFrameReporter_FrameDropReason_REASON_CLIENT_COMPOSITOR;
45481   enum FieldNumbers {
45482     kStateFieldNumber = 1,
45483     kReasonFieldNumber = 2,
45484     kFrameSourceFieldNumber = 3,
45485     kFrameSequenceFieldNumber = 4,
45486   };
45487 
45488   ChromeFrameReporter();
45489   ~ChromeFrameReporter() override;
45490   ChromeFrameReporter(ChromeFrameReporter&&) noexcept;
45491   ChromeFrameReporter& operator=(ChromeFrameReporter&&);
45492   ChromeFrameReporter(const ChromeFrameReporter&);
45493   ChromeFrameReporter& operator=(const ChromeFrameReporter&);
45494   bool operator==(const ChromeFrameReporter&) const;
45495   bool operator!=(const ChromeFrameReporter& other) const { return !(*this == other); }
45496 
45497   bool ParseFromArray(const void*, size_t) override;
45498   std::string SerializeAsString() const override;
45499   std::vector<uint8_t> SerializeAsArray() const override;
45500   void Serialize(::protozero::Message*) const;
45501 
45502   bool has_state() const { return _has_field_[1]; }
45503   ChromeFrameReporter_State state() const { return state_; }
45504   void set_state(ChromeFrameReporter_State value) { state_ = value; _has_field_.set(1); }
45505 
45506   bool has_reason() const { return _has_field_[2]; }
45507   ChromeFrameReporter_FrameDropReason reason() const { return reason_; }
45508   void set_reason(ChromeFrameReporter_FrameDropReason value) { reason_ = value; _has_field_.set(2); }
45509 
45510   bool has_frame_source() const { return _has_field_[3]; }
45511   uint64_t frame_source() const { return frame_source_; }
45512   void set_frame_source(uint64_t value) { frame_source_ = value; _has_field_.set(3); }
45513 
45514   bool has_frame_sequence() const { return _has_field_[4]; }
45515   uint64_t frame_sequence() const { return frame_sequence_; }
45516   void set_frame_sequence(uint64_t value) { frame_sequence_ = value; _has_field_.set(4); }
45517 
45518  private:
45519   ChromeFrameReporter_State state_{};
45520   ChromeFrameReporter_FrameDropReason reason_{};
45521   uint64_t frame_source_{};
45522   uint64_t frame_sequence_{};
45523 
45524   // Allows to preserve unknown protobuf fields for compatibility
45525   // with future versions of .proto files.
45526   std::string unknown_fields_;
45527 
45528   std::bitset<5> _has_field_{};
45529 };
45530 
45531 }  // namespace perfetto
45532 }  // namespace protos
45533 }  // namespace gen
45534 
45535 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_FRAME_REPORTER_PROTO_CPP_H_
45536 // gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_histogram_sample.gen.h
45537 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
45538 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_HISTOGRAM_SAMPLE_PROTO_CPP_H_
45539 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_HISTOGRAM_SAMPLE_PROTO_CPP_H_
45540 
45541 #include <stdint.h>
45542 #include <bitset>
45543 #include <vector>
45544 #include <string>
45545 #include <type_traits>
45546 
45547 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
45548 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
45549 // gen_amalgamated expanded: #include "perfetto/base/export.h"
45550 
45551 namespace perfetto {
45552 namespace protos {
45553 namespace gen {
45554 class ChromeHistogramSample;
45555 }  // namespace perfetto
45556 }  // namespace protos
45557 }  // namespace gen
45558 
45559 namespace protozero {
45560 class Message;
45561 }  // namespace protozero
45562 
45563 namespace perfetto {
45564 namespace protos {
45565 namespace gen {
45566 
45567 class PERFETTO_EXPORT ChromeHistogramSample : public ::protozero::CppMessageObj {
45568  public:
45569   enum FieldNumbers {
45570     kNameHashFieldNumber = 1,
45571     kNameFieldNumber = 2,
45572     kSampleFieldNumber = 3,
45573   };
45574 
45575   ChromeHistogramSample();
45576   ~ChromeHistogramSample() override;
45577   ChromeHistogramSample(ChromeHistogramSample&&) noexcept;
45578   ChromeHistogramSample& operator=(ChromeHistogramSample&&);
45579   ChromeHistogramSample(const ChromeHistogramSample&);
45580   ChromeHistogramSample& operator=(const ChromeHistogramSample&);
45581   bool operator==(const ChromeHistogramSample&) const;
45582   bool operator!=(const ChromeHistogramSample& other) const { return !(*this == other); }
45583 
45584   bool ParseFromArray(const void*, size_t) override;
45585   std::string SerializeAsString() const override;
45586   std::vector<uint8_t> SerializeAsArray() const override;
45587   void Serialize(::protozero::Message*) const;
45588 
45589   bool has_name_hash() const { return _has_field_[1]; }
45590   uint64_t name_hash() const { return name_hash_; }
45591   void set_name_hash(uint64_t value) { name_hash_ = value; _has_field_.set(1); }
45592 
45593   bool has_name() const { return _has_field_[2]; }
45594   const std::string& name() const { return name_; }
45595   void set_name(const std::string& value) { name_ = value; _has_field_.set(2); }
45596 
45597   bool has_sample() const { return _has_field_[3]; }
45598   int64_t sample() const { return sample_; }
45599   void set_sample(int64_t value) { sample_ = value; _has_field_.set(3); }
45600 
45601  private:
45602   uint64_t name_hash_{};
45603   std::string name_{};
45604   int64_t sample_{};
45605 
45606   // Allows to preserve unknown protobuf fields for compatibility
45607   // with future versions of .proto files.
45608   std::string unknown_fields_;
45609 
45610   std::bitset<4> _has_field_{};
45611 };
45612 
45613 }  // namespace perfetto
45614 }  // namespace protos
45615 }  // namespace gen
45616 
45617 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_HISTOGRAM_SAMPLE_PROTO_CPP_H_
45618 // gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_keyed_service.gen.h
45619 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
45620 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_KEYED_SERVICE_PROTO_CPP_H_
45621 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_KEYED_SERVICE_PROTO_CPP_H_
45622 
45623 #include <stdint.h>
45624 #include <bitset>
45625 #include <vector>
45626 #include <string>
45627 #include <type_traits>
45628 
45629 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
45630 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
45631 // gen_amalgamated expanded: #include "perfetto/base/export.h"
45632 
45633 namespace perfetto {
45634 namespace protos {
45635 namespace gen {
45636 class ChromeKeyedService;
45637 }  // namespace perfetto
45638 }  // namespace protos
45639 }  // namespace gen
45640 
45641 namespace protozero {
45642 class Message;
45643 }  // namespace protozero
45644 
45645 namespace perfetto {
45646 namespace protos {
45647 namespace gen {
45648 
45649 class PERFETTO_EXPORT ChromeKeyedService : public ::protozero::CppMessageObj {
45650  public:
45651   enum FieldNumbers {
45652     kNameFieldNumber = 1,
45653   };
45654 
45655   ChromeKeyedService();
45656   ~ChromeKeyedService() override;
45657   ChromeKeyedService(ChromeKeyedService&&) noexcept;
45658   ChromeKeyedService& operator=(ChromeKeyedService&&);
45659   ChromeKeyedService(const ChromeKeyedService&);
45660   ChromeKeyedService& operator=(const ChromeKeyedService&);
45661   bool operator==(const ChromeKeyedService&) const;
45662   bool operator!=(const ChromeKeyedService& other) const { return !(*this == other); }
45663 
45664   bool ParseFromArray(const void*, size_t) override;
45665   std::string SerializeAsString() const override;
45666   std::vector<uint8_t> SerializeAsArray() const override;
45667   void Serialize(::protozero::Message*) const;
45668 
45669   bool has_name() const { return _has_field_[1]; }
45670   const std::string& name() const { return name_; }
45671   void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
45672 
45673  private:
45674   std::string name_{};
45675 
45676   // Allows to preserve unknown protobuf fields for compatibility
45677   // with future versions of .proto files.
45678   std::string unknown_fields_;
45679 
45680   std::bitset<2> _has_field_{};
45681 };
45682 
45683 }  // namespace perfetto
45684 }  // namespace protos
45685 }  // namespace gen
45686 
45687 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_KEYED_SERVICE_PROTO_CPP_H_
45688 // gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_latency_info.gen.h
45689 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
45690 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_LATENCY_INFO_PROTO_CPP_H_
45691 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_LATENCY_INFO_PROTO_CPP_H_
45692 
45693 #include <stdint.h>
45694 #include <bitset>
45695 #include <vector>
45696 #include <string>
45697 #include <type_traits>
45698 
45699 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
45700 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
45701 // gen_amalgamated expanded: #include "perfetto/base/export.h"
45702 
45703 namespace perfetto {
45704 namespace protos {
45705 namespace gen {
45706 class ChromeLatencyInfo;
45707 class ChromeLatencyInfo_ComponentInfo;
45708 enum ChromeLatencyInfo_Step : int;
45709 enum ChromeLatencyInfo_LatencyComponentType : int;
45710 }  // namespace perfetto
45711 }  // namespace protos
45712 }  // namespace gen
45713 
45714 namespace protozero {
45715 class Message;
45716 }  // namespace protozero
45717 
45718 namespace perfetto {
45719 namespace protos {
45720 namespace gen {
45721 enum ChromeLatencyInfo_Step : int {
45722   ChromeLatencyInfo_Step_STEP_UNSPECIFIED = 0,
45723   ChromeLatencyInfo_Step_STEP_SEND_INPUT_EVENT_UI = 3,
45724   ChromeLatencyInfo_Step_STEP_HANDLE_INPUT_EVENT_IMPL = 5,
45725   ChromeLatencyInfo_Step_STEP_DID_HANDLE_INPUT_AND_OVERSCROLL = 8,
45726   ChromeLatencyInfo_Step_STEP_HANDLE_INPUT_EVENT_MAIN = 4,
45727   ChromeLatencyInfo_Step_STEP_MAIN_THREAD_SCROLL_UPDATE = 2,
45728   ChromeLatencyInfo_Step_STEP_HANDLE_INPUT_EVENT_MAIN_COMMIT = 1,
45729   ChromeLatencyInfo_Step_STEP_HANDLED_INPUT_EVENT_MAIN_OR_IMPL = 9,
45730   ChromeLatencyInfo_Step_STEP_HANDLED_INPUT_EVENT_IMPL = 10,
45731   ChromeLatencyInfo_Step_STEP_SWAP_BUFFERS = 6,
45732   ChromeLatencyInfo_Step_STEP_DRAW_AND_SWAP = 7,
45733 };
45734 enum ChromeLatencyInfo_LatencyComponentType : int {
45735   ChromeLatencyInfo_LatencyComponentType_COMPONENT_UNSPECIFIED = 0,
45736   ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_BEGIN_RWH = 1,
45737   ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL = 2,
45738   ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL = 3,
45739   ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_ORIGINAL = 4,
45740   ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_UI = 5,
45741   ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_RENDERER_MAIN = 6,
45742   ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_MAIN = 7,
45743   ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_IMPL = 8,
45744   ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_SCROLL_UPDATE_LAST_EVENT = 9,
45745   ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_ACK_RWH = 10,
45746   ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_RENDERER_SWAP = 11,
45747   ChromeLatencyInfo_LatencyComponentType_COMPONENT_DISPLAY_COMPOSITOR_RECEIVED_FRAME = 12,
45748   ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_GPU_SWAP_BUFFER = 13,
45749   ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_FRAME_SWAP = 14,
45750 };
45751 
45752 class PERFETTO_EXPORT ChromeLatencyInfo : public ::protozero::CppMessageObj {
45753  public:
45754   using ComponentInfo = ChromeLatencyInfo_ComponentInfo;
45755   using Step = ChromeLatencyInfo_Step;
45756   static constexpr auto STEP_UNSPECIFIED = ChromeLatencyInfo_Step_STEP_UNSPECIFIED;
45757   static constexpr auto STEP_SEND_INPUT_EVENT_UI = ChromeLatencyInfo_Step_STEP_SEND_INPUT_EVENT_UI;
45758   static constexpr auto STEP_HANDLE_INPUT_EVENT_IMPL = ChromeLatencyInfo_Step_STEP_HANDLE_INPUT_EVENT_IMPL;
45759   static constexpr auto STEP_DID_HANDLE_INPUT_AND_OVERSCROLL = ChromeLatencyInfo_Step_STEP_DID_HANDLE_INPUT_AND_OVERSCROLL;
45760   static constexpr auto STEP_HANDLE_INPUT_EVENT_MAIN = ChromeLatencyInfo_Step_STEP_HANDLE_INPUT_EVENT_MAIN;
45761   static constexpr auto STEP_MAIN_THREAD_SCROLL_UPDATE = ChromeLatencyInfo_Step_STEP_MAIN_THREAD_SCROLL_UPDATE;
45762   static constexpr auto STEP_HANDLE_INPUT_EVENT_MAIN_COMMIT = ChromeLatencyInfo_Step_STEP_HANDLE_INPUT_EVENT_MAIN_COMMIT;
45763   static constexpr auto STEP_HANDLED_INPUT_EVENT_MAIN_OR_IMPL = ChromeLatencyInfo_Step_STEP_HANDLED_INPUT_EVENT_MAIN_OR_IMPL;
45764   static constexpr auto STEP_HANDLED_INPUT_EVENT_IMPL = ChromeLatencyInfo_Step_STEP_HANDLED_INPUT_EVENT_IMPL;
45765   static constexpr auto STEP_SWAP_BUFFERS = ChromeLatencyInfo_Step_STEP_SWAP_BUFFERS;
45766   static constexpr auto STEP_DRAW_AND_SWAP = ChromeLatencyInfo_Step_STEP_DRAW_AND_SWAP;
45767   static constexpr auto Step_MIN = ChromeLatencyInfo_Step_STEP_UNSPECIFIED;
45768   static constexpr auto Step_MAX = ChromeLatencyInfo_Step_STEP_HANDLED_INPUT_EVENT_IMPL;
45769   using LatencyComponentType = ChromeLatencyInfo_LatencyComponentType;
45770   static constexpr auto COMPONENT_UNSPECIFIED = ChromeLatencyInfo_LatencyComponentType_COMPONENT_UNSPECIFIED;
45771   static constexpr auto COMPONENT_INPUT_EVENT_LATENCY_BEGIN_RWH = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_BEGIN_RWH;
45772   static constexpr auto COMPONENT_INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL;
45773   static constexpr auto COMPONENT_INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL;
45774   static constexpr auto COMPONENT_INPUT_EVENT_LATENCY_ORIGINAL = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_ORIGINAL;
45775   static constexpr auto COMPONENT_INPUT_EVENT_LATENCY_UI = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_UI;
45776   static constexpr auto COMPONENT_INPUT_EVENT_LATENCY_RENDERER_MAIN = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_RENDERER_MAIN;
45777   static constexpr auto COMPONENT_INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_MAIN = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_MAIN;
45778   static constexpr auto COMPONENT_INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_IMPL = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_IMPL;
45779   static constexpr auto COMPONENT_INPUT_EVENT_LATENCY_SCROLL_UPDATE_LAST_EVENT = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_SCROLL_UPDATE_LAST_EVENT;
45780   static constexpr auto COMPONENT_INPUT_EVENT_LATENCY_ACK_RWH = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_ACK_RWH;
45781   static constexpr auto COMPONENT_INPUT_EVENT_LATENCY_RENDERER_SWAP = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_RENDERER_SWAP;
45782   static constexpr auto COMPONENT_DISPLAY_COMPOSITOR_RECEIVED_FRAME = ChromeLatencyInfo_LatencyComponentType_COMPONENT_DISPLAY_COMPOSITOR_RECEIVED_FRAME;
45783   static constexpr auto COMPONENT_INPUT_EVENT_GPU_SWAP_BUFFER = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_GPU_SWAP_BUFFER;
45784   static constexpr auto COMPONENT_INPUT_EVENT_LATENCY_FRAME_SWAP = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_FRAME_SWAP;
45785   static constexpr auto LatencyComponentType_MIN = ChromeLatencyInfo_LatencyComponentType_COMPONENT_UNSPECIFIED;
45786   static constexpr auto LatencyComponentType_MAX = ChromeLatencyInfo_LatencyComponentType_COMPONENT_INPUT_EVENT_LATENCY_FRAME_SWAP;
45787   enum FieldNumbers {
45788     kTraceIdFieldNumber = 1,
45789     kStepFieldNumber = 2,
45790     kFrameTreeNodeIdFieldNumber = 3,
45791     kComponentInfoFieldNumber = 4,
45792     kIsCoalescedFieldNumber = 5,
45793     kGestureScrollIdFieldNumber = 6,
45794   };
45795 
45796   ChromeLatencyInfo();
45797   ~ChromeLatencyInfo() override;
45798   ChromeLatencyInfo(ChromeLatencyInfo&&) noexcept;
45799   ChromeLatencyInfo& operator=(ChromeLatencyInfo&&);
45800   ChromeLatencyInfo(const ChromeLatencyInfo&);
45801   ChromeLatencyInfo& operator=(const ChromeLatencyInfo&);
45802   bool operator==(const ChromeLatencyInfo&) const;
45803   bool operator!=(const ChromeLatencyInfo& other) const { return !(*this == other); }
45804 
45805   bool ParseFromArray(const void*, size_t) override;
45806   std::string SerializeAsString() const override;
45807   std::vector<uint8_t> SerializeAsArray() const override;
45808   void Serialize(::protozero::Message*) const;
45809 
45810   bool has_trace_id() const { return _has_field_[1]; }
45811   int64_t trace_id() const { return trace_id_; }
45812   void set_trace_id(int64_t value) { trace_id_ = value; _has_field_.set(1); }
45813 
45814   bool has_step() const { return _has_field_[2]; }
45815   ChromeLatencyInfo_Step step() const { return step_; }
45816   void set_step(ChromeLatencyInfo_Step value) { step_ = value; _has_field_.set(2); }
45817 
45818   bool has_frame_tree_node_id() const { return _has_field_[3]; }
45819   int32_t frame_tree_node_id() const { return frame_tree_node_id_; }
45820   void set_frame_tree_node_id(int32_t value) { frame_tree_node_id_ = value; _has_field_.set(3); }
45821 
45822   int component_info_size() const { return static_cast<int>(component_info_.size()); }
45823   const std::vector<ChromeLatencyInfo_ComponentInfo>& component_info() const { return component_info_; }
45824   std::vector<ChromeLatencyInfo_ComponentInfo>* mutable_component_info() { return &component_info_; }
45825   void clear_component_info() { component_info_.clear(); }
45826   ChromeLatencyInfo_ComponentInfo* add_component_info() { component_info_.emplace_back(); return &component_info_.back(); }
45827 
45828   bool has_is_coalesced() const { return _has_field_[5]; }
45829   bool is_coalesced() const { return is_coalesced_; }
45830   void set_is_coalesced(bool value) { is_coalesced_ = value; _has_field_.set(5); }
45831 
45832   bool has_gesture_scroll_id() const { return _has_field_[6]; }
45833   int64_t gesture_scroll_id() const { return gesture_scroll_id_; }
45834   void set_gesture_scroll_id(int64_t value) { gesture_scroll_id_ = value; _has_field_.set(6); }
45835 
45836  private:
45837   int64_t trace_id_{};
45838   ChromeLatencyInfo_Step step_{};
45839   int32_t frame_tree_node_id_{};
45840   std::vector<ChromeLatencyInfo_ComponentInfo> component_info_;
45841   bool is_coalesced_{};
45842   int64_t gesture_scroll_id_{};
45843 
45844   // Allows to preserve unknown protobuf fields for compatibility
45845   // with future versions of .proto files.
45846   std::string unknown_fields_;
45847 
45848   std::bitset<7> _has_field_{};
45849 };
45850 
45851 
45852 class PERFETTO_EXPORT ChromeLatencyInfo_ComponentInfo : public ::protozero::CppMessageObj {
45853  public:
45854   enum FieldNumbers {
45855     kComponentTypeFieldNumber = 1,
45856     kTimeUsFieldNumber = 2,
45857   };
45858 
45859   ChromeLatencyInfo_ComponentInfo();
45860   ~ChromeLatencyInfo_ComponentInfo() override;
45861   ChromeLatencyInfo_ComponentInfo(ChromeLatencyInfo_ComponentInfo&&) noexcept;
45862   ChromeLatencyInfo_ComponentInfo& operator=(ChromeLatencyInfo_ComponentInfo&&);
45863   ChromeLatencyInfo_ComponentInfo(const ChromeLatencyInfo_ComponentInfo&);
45864   ChromeLatencyInfo_ComponentInfo& operator=(const ChromeLatencyInfo_ComponentInfo&);
45865   bool operator==(const ChromeLatencyInfo_ComponentInfo&) const;
45866   bool operator!=(const ChromeLatencyInfo_ComponentInfo& other) const { return !(*this == other); }
45867 
45868   bool ParseFromArray(const void*, size_t) override;
45869   std::string SerializeAsString() const override;
45870   std::vector<uint8_t> SerializeAsArray() const override;
45871   void Serialize(::protozero::Message*) const;
45872 
45873   bool has_component_type() const { return _has_field_[1]; }
45874   ChromeLatencyInfo_LatencyComponentType component_type() const { return component_type_; }
45875   void set_component_type(ChromeLatencyInfo_LatencyComponentType value) { component_type_ = value; _has_field_.set(1); }
45876 
45877   bool has_time_us() const { return _has_field_[2]; }
45878   uint64_t time_us() const { return time_us_; }
45879   void set_time_us(uint64_t value) { time_us_ = value; _has_field_.set(2); }
45880 
45881  private:
45882   ChromeLatencyInfo_LatencyComponentType component_type_{};
45883   uint64_t time_us_{};
45884 
45885   // Allows to preserve unknown protobuf fields for compatibility
45886   // with future versions of .proto files.
45887   std::string unknown_fields_;
45888 
45889   std::bitset<3> _has_field_{};
45890 };
45891 
45892 }  // namespace perfetto
45893 }  // namespace protos
45894 }  // namespace gen
45895 
45896 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_LATENCY_INFO_PROTO_CPP_H_
45897 // gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_legacy_ipc.gen.h
45898 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
45899 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_LEGACY_IPC_PROTO_CPP_H_
45900 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_LEGACY_IPC_PROTO_CPP_H_
45901 
45902 #include <stdint.h>
45903 #include <bitset>
45904 #include <vector>
45905 #include <string>
45906 #include <type_traits>
45907 
45908 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
45909 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
45910 // gen_amalgamated expanded: #include "perfetto/base/export.h"
45911 
45912 namespace perfetto {
45913 namespace protos {
45914 namespace gen {
45915 class ChromeLegacyIpc;
45916 enum ChromeLegacyIpc_MessageClass : int;
45917 }  // namespace perfetto
45918 }  // namespace protos
45919 }  // namespace gen
45920 
45921 namespace protozero {
45922 class Message;
45923 }  // namespace protozero
45924 
45925 namespace perfetto {
45926 namespace protos {
45927 namespace gen {
45928 enum ChromeLegacyIpc_MessageClass : int {
45929   ChromeLegacyIpc_MessageClass_CLASS_UNSPECIFIED = 0,
45930   ChromeLegacyIpc_MessageClass_CLASS_AUTOMATION = 1,
45931   ChromeLegacyIpc_MessageClass_CLASS_FRAME = 2,
45932   ChromeLegacyIpc_MessageClass_CLASS_PAGE = 3,
45933   ChromeLegacyIpc_MessageClass_CLASS_VIEW = 4,
45934   ChromeLegacyIpc_MessageClass_CLASS_WIDGET = 5,
45935   ChromeLegacyIpc_MessageClass_CLASS_INPUT = 6,
45936   ChromeLegacyIpc_MessageClass_CLASS_TEST = 7,
45937   ChromeLegacyIpc_MessageClass_CLASS_WORKER = 8,
45938   ChromeLegacyIpc_MessageClass_CLASS_NACL = 9,
45939   ChromeLegacyIpc_MessageClass_CLASS_GPU_CHANNEL = 10,
45940   ChromeLegacyIpc_MessageClass_CLASS_MEDIA = 11,
45941   ChromeLegacyIpc_MessageClass_CLASS_PPAPI = 12,
45942   ChromeLegacyIpc_MessageClass_CLASS_CHROME = 13,
45943   ChromeLegacyIpc_MessageClass_CLASS_DRAG = 14,
45944   ChromeLegacyIpc_MessageClass_CLASS_PRINT = 15,
45945   ChromeLegacyIpc_MessageClass_CLASS_EXTENSION = 16,
45946   ChromeLegacyIpc_MessageClass_CLASS_TEXT_INPUT_CLIENT = 17,
45947   ChromeLegacyIpc_MessageClass_CLASS_BLINK_TEST = 18,
45948   ChromeLegacyIpc_MessageClass_CLASS_ACCESSIBILITY = 19,
45949   ChromeLegacyIpc_MessageClass_CLASS_PRERENDER = 20,
45950   ChromeLegacyIpc_MessageClass_CLASS_CHROMOTING = 21,
45951   ChromeLegacyIpc_MessageClass_CLASS_BROWSER_PLUGIN = 22,
45952   ChromeLegacyIpc_MessageClass_CLASS_ANDROID_WEB_VIEW = 23,
45953   ChromeLegacyIpc_MessageClass_CLASS_NACL_HOST = 24,
45954   ChromeLegacyIpc_MessageClass_CLASS_ENCRYPTED_MEDIA = 25,
45955   ChromeLegacyIpc_MessageClass_CLASS_CAST = 26,
45956   ChromeLegacyIpc_MessageClass_CLASS_GIN_JAVA_BRIDGE = 27,
45957   ChromeLegacyIpc_MessageClass_CLASS_CHROME_UTILITY_PRINTING = 28,
45958   ChromeLegacyIpc_MessageClass_CLASS_OZONE_GPU = 29,
45959   ChromeLegacyIpc_MessageClass_CLASS_WEB_TEST = 30,
45960   ChromeLegacyIpc_MessageClass_CLASS_NETWORK_HINTS = 31,
45961   ChromeLegacyIpc_MessageClass_CLASS_EXTENSIONS_GUEST_VIEW = 32,
45962   ChromeLegacyIpc_MessageClass_CLASS_GUEST_VIEW = 33,
45963   ChromeLegacyIpc_MessageClass_CLASS_MEDIA_PLAYER_DELEGATE = 34,
45964   ChromeLegacyIpc_MessageClass_CLASS_EXTENSION_WORKER = 35,
45965   ChromeLegacyIpc_MessageClass_CLASS_SUBRESOURCE_FILTER = 36,
45966   ChromeLegacyIpc_MessageClass_CLASS_UNFREEZABLE_FRAME = 37,
45967 };
45968 
45969 class PERFETTO_EXPORT ChromeLegacyIpc : public ::protozero::CppMessageObj {
45970  public:
45971   using MessageClass = ChromeLegacyIpc_MessageClass;
45972   static constexpr auto CLASS_UNSPECIFIED = ChromeLegacyIpc_MessageClass_CLASS_UNSPECIFIED;
45973   static constexpr auto CLASS_AUTOMATION = ChromeLegacyIpc_MessageClass_CLASS_AUTOMATION;
45974   static constexpr auto CLASS_FRAME = ChromeLegacyIpc_MessageClass_CLASS_FRAME;
45975   static constexpr auto CLASS_PAGE = ChromeLegacyIpc_MessageClass_CLASS_PAGE;
45976   static constexpr auto CLASS_VIEW = ChromeLegacyIpc_MessageClass_CLASS_VIEW;
45977   static constexpr auto CLASS_WIDGET = ChromeLegacyIpc_MessageClass_CLASS_WIDGET;
45978   static constexpr auto CLASS_INPUT = ChromeLegacyIpc_MessageClass_CLASS_INPUT;
45979   static constexpr auto CLASS_TEST = ChromeLegacyIpc_MessageClass_CLASS_TEST;
45980   static constexpr auto CLASS_WORKER = ChromeLegacyIpc_MessageClass_CLASS_WORKER;
45981   static constexpr auto CLASS_NACL = ChromeLegacyIpc_MessageClass_CLASS_NACL;
45982   static constexpr auto CLASS_GPU_CHANNEL = ChromeLegacyIpc_MessageClass_CLASS_GPU_CHANNEL;
45983   static constexpr auto CLASS_MEDIA = ChromeLegacyIpc_MessageClass_CLASS_MEDIA;
45984   static constexpr auto CLASS_PPAPI = ChromeLegacyIpc_MessageClass_CLASS_PPAPI;
45985   static constexpr auto CLASS_CHROME = ChromeLegacyIpc_MessageClass_CLASS_CHROME;
45986   static constexpr auto CLASS_DRAG = ChromeLegacyIpc_MessageClass_CLASS_DRAG;
45987   static constexpr auto CLASS_PRINT = ChromeLegacyIpc_MessageClass_CLASS_PRINT;
45988   static constexpr auto CLASS_EXTENSION = ChromeLegacyIpc_MessageClass_CLASS_EXTENSION;
45989   static constexpr auto CLASS_TEXT_INPUT_CLIENT = ChromeLegacyIpc_MessageClass_CLASS_TEXT_INPUT_CLIENT;
45990   static constexpr auto CLASS_BLINK_TEST = ChromeLegacyIpc_MessageClass_CLASS_BLINK_TEST;
45991   static constexpr auto CLASS_ACCESSIBILITY = ChromeLegacyIpc_MessageClass_CLASS_ACCESSIBILITY;
45992   static constexpr auto CLASS_PRERENDER = ChromeLegacyIpc_MessageClass_CLASS_PRERENDER;
45993   static constexpr auto CLASS_CHROMOTING = ChromeLegacyIpc_MessageClass_CLASS_CHROMOTING;
45994   static constexpr auto CLASS_BROWSER_PLUGIN = ChromeLegacyIpc_MessageClass_CLASS_BROWSER_PLUGIN;
45995   static constexpr auto CLASS_ANDROID_WEB_VIEW = ChromeLegacyIpc_MessageClass_CLASS_ANDROID_WEB_VIEW;
45996   static constexpr auto CLASS_NACL_HOST = ChromeLegacyIpc_MessageClass_CLASS_NACL_HOST;
45997   static constexpr auto CLASS_ENCRYPTED_MEDIA = ChromeLegacyIpc_MessageClass_CLASS_ENCRYPTED_MEDIA;
45998   static constexpr auto CLASS_CAST = ChromeLegacyIpc_MessageClass_CLASS_CAST;
45999   static constexpr auto CLASS_GIN_JAVA_BRIDGE = ChromeLegacyIpc_MessageClass_CLASS_GIN_JAVA_BRIDGE;
46000   static constexpr auto CLASS_CHROME_UTILITY_PRINTING = ChromeLegacyIpc_MessageClass_CLASS_CHROME_UTILITY_PRINTING;
46001   static constexpr auto CLASS_OZONE_GPU = ChromeLegacyIpc_MessageClass_CLASS_OZONE_GPU;
46002   static constexpr auto CLASS_WEB_TEST = ChromeLegacyIpc_MessageClass_CLASS_WEB_TEST;
46003   static constexpr auto CLASS_NETWORK_HINTS = ChromeLegacyIpc_MessageClass_CLASS_NETWORK_HINTS;
46004   static constexpr auto CLASS_EXTENSIONS_GUEST_VIEW = ChromeLegacyIpc_MessageClass_CLASS_EXTENSIONS_GUEST_VIEW;
46005   static constexpr auto CLASS_GUEST_VIEW = ChromeLegacyIpc_MessageClass_CLASS_GUEST_VIEW;
46006   static constexpr auto CLASS_MEDIA_PLAYER_DELEGATE = ChromeLegacyIpc_MessageClass_CLASS_MEDIA_PLAYER_DELEGATE;
46007   static constexpr auto CLASS_EXTENSION_WORKER = ChromeLegacyIpc_MessageClass_CLASS_EXTENSION_WORKER;
46008   static constexpr auto CLASS_SUBRESOURCE_FILTER = ChromeLegacyIpc_MessageClass_CLASS_SUBRESOURCE_FILTER;
46009   static constexpr auto CLASS_UNFREEZABLE_FRAME = ChromeLegacyIpc_MessageClass_CLASS_UNFREEZABLE_FRAME;
46010   static constexpr auto MessageClass_MIN = ChromeLegacyIpc_MessageClass_CLASS_UNSPECIFIED;
46011   static constexpr auto MessageClass_MAX = ChromeLegacyIpc_MessageClass_CLASS_UNFREEZABLE_FRAME;
46012   enum FieldNumbers {
46013     kMessageClassFieldNumber = 1,
46014     kMessageLineFieldNumber = 2,
46015   };
46016 
46017   ChromeLegacyIpc();
46018   ~ChromeLegacyIpc() override;
46019   ChromeLegacyIpc(ChromeLegacyIpc&&) noexcept;
46020   ChromeLegacyIpc& operator=(ChromeLegacyIpc&&);
46021   ChromeLegacyIpc(const ChromeLegacyIpc&);
46022   ChromeLegacyIpc& operator=(const ChromeLegacyIpc&);
46023   bool operator==(const ChromeLegacyIpc&) const;
46024   bool operator!=(const ChromeLegacyIpc& other) const { return !(*this == other); }
46025 
46026   bool ParseFromArray(const void*, size_t) override;
46027   std::string SerializeAsString() const override;
46028   std::vector<uint8_t> SerializeAsArray() const override;
46029   void Serialize(::protozero::Message*) const;
46030 
46031   bool has_message_class() const { return _has_field_[1]; }
46032   ChromeLegacyIpc_MessageClass message_class() const { return message_class_; }
46033   void set_message_class(ChromeLegacyIpc_MessageClass value) { message_class_ = value; _has_field_.set(1); }
46034 
46035   bool has_message_line() const { return _has_field_[2]; }
46036   uint32_t message_line() const { return message_line_; }
46037   void set_message_line(uint32_t value) { message_line_ = value; _has_field_.set(2); }
46038 
46039  private:
46040   ChromeLegacyIpc_MessageClass message_class_{};
46041   uint32_t message_line_{};
46042 
46043   // Allows to preserve unknown protobuf fields for compatibility
46044   // with future versions of .proto files.
46045   std::string unknown_fields_;
46046 
46047   std::bitset<3> _has_field_{};
46048 };
46049 
46050 }  // namespace perfetto
46051 }  // namespace protos
46052 }  // namespace gen
46053 
46054 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_LEGACY_IPC_PROTO_CPP_H_
46055 // gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_process_descriptor.gen.h
46056 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
46057 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_PROCESS_DESCRIPTOR_PROTO_CPP_H_
46058 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_PROCESS_DESCRIPTOR_PROTO_CPP_H_
46059 
46060 #include <stdint.h>
46061 #include <bitset>
46062 #include <vector>
46063 #include <string>
46064 #include <type_traits>
46065 
46066 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
46067 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
46068 // gen_amalgamated expanded: #include "perfetto/base/export.h"
46069 
46070 namespace perfetto {
46071 namespace protos {
46072 namespace gen {
46073 class ChromeProcessDescriptor;
46074 enum ChromeProcessDescriptor_ProcessType : int;
46075 }  // namespace perfetto
46076 }  // namespace protos
46077 }  // namespace gen
46078 
46079 namespace protozero {
46080 class Message;
46081 }  // namespace protozero
46082 
46083 namespace perfetto {
46084 namespace protos {
46085 namespace gen {
46086 enum ChromeProcessDescriptor_ProcessType : int {
46087   ChromeProcessDescriptor_ProcessType_PROCESS_UNSPECIFIED = 0,
46088   ChromeProcessDescriptor_ProcessType_PROCESS_BROWSER = 1,
46089   ChromeProcessDescriptor_ProcessType_PROCESS_RENDERER = 2,
46090   ChromeProcessDescriptor_ProcessType_PROCESS_UTILITY = 3,
46091   ChromeProcessDescriptor_ProcessType_PROCESS_ZYGOTE = 4,
46092   ChromeProcessDescriptor_ProcessType_PROCESS_SANDBOX_HELPER = 5,
46093   ChromeProcessDescriptor_ProcessType_PROCESS_GPU = 6,
46094   ChromeProcessDescriptor_ProcessType_PROCESS_PPAPI_PLUGIN = 7,
46095   ChromeProcessDescriptor_ProcessType_PROCESS_PPAPI_BROKER = 8,
46096 };
46097 
46098 class PERFETTO_EXPORT ChromeProcessDescriptor : public ::protozero::CppMessageObj {
46099  public:
46100   using ProcessType = ChromeProcessDescriptor_ProcessType;
46101   static constexpr auto PROCESS_UNSPECIFIED = ChromeProcessDescriptor_ProcessType_PROCESS_UNSPECIFIED;
46102   static constexpr auto PROCESS_BROWSER = ChromeProcessDescriptor_ProcessType_PROCESS_BROWSER;
46103   static constexpr auto PROCESS_RENDERER = ChromeProcessDescriptor_ProcessType_PROCESS_RENDERER;
46104   static constexpr auto PROCESS_UTILITY = ChromeProcessDescriptor_ProcessType_PROCESS_UTILITY;
46105   static constexpr auto PROCESS_ZYGOTE = ChromeProcessDescriptor_ProcessType_PROCESS_ZYGOTE;
46106   static constexpr auto PROCESS_SANDBOX_HELPER = ChromeProcessDescriptor_ProcessType_PROCESS_SANDBOX_HELPER;
46107   static constexpr auto PROCESS_GPU = ChromeProcessDescriptor_ProcessType_PROCESS_GPU;
46108   static constexpr auto PROCESS_PPAPI_PLUGIN = ChromeProcessDescriptor_ProcessType_PROCESS_PPAPI_PLUGIN;
46109   static constexpr auto PROCESS_PPAPI_BROKER = ChromeProcessDescriptor_ProcessType_PROCESS_PPAPI_BROKER;
46110   static constexpr auto ProcessType_MIN = ChromeProcessDescriptor_ProcessType_PROCESS_UNSPECIFIED;
46111   static constexpr auto ProcessType_MAX = ChromeProcessDescriptor_ProcessType_PROCESS_PPAPI_BROKER;
46112   enum FieldNumbers {
46113     kProcessTypeFieldNumber = 1,
46114     kProcessPriorityFieldNumber = 2,
46115     kLegacySortIndexFieldNumber = 3,
46116     kHostAppPackageNameFieldNumber = 4,
46117   };
46118 
46119   ChromeProcessDescriptor();
46120   ~ChromeProcessDescriptor() override;
46121   ChromeProcessDescriptor(ChromeProcessDescriptor&&) noexcept;
46122   ChromeProcessDescriptor& operator=(ChromeProcessDescriptor&&);
46123   ChromeProcessDescriptor(const ChromeProcessDescriptor&);
46124   ChromeProcessDescriptor& operator=(const ChromeProcessDescriptor&);
46125   bool operator==(const ChromeProcessDescriptor&) const;
46126   bool operator!=(const ChromeProcessDescriptor& other) const { return !(*this == other); }
46127 
46128   bool ParseFromArray(const void*, size_t) override;
46129   std::string SerializeAsString() const override;
46130   std::vector<uint8_t> SerializeAsArray() const override;
46131   void Serialize(::protozero::Message*) const;
46132 
46133   bool has_process_type() const { return _has_field_[1]; }
46134   ChromeProcessDescriptor_ProcessType process_type() const { return process_type_; }
46135   void set_process_type(ChromeProcessDescriptor_ProcessType value) { process_type_ = value; _has_field_.set(1); }
46136 
46137   bool has_process_priority() const { return _has_field_[2]; }
46138   int32_t process_priority() const { return process_priority_; }
46139   void set_process_priority(int32_t value) { process_priority_ = value; _has_field_.set(2); }
46140 
46141   bool has_legacy_sort_index() const { return _has_field_[3]; }
46142   int32_t legacy_sort_index() const { return legacy_sort_index_; }
46143   void set_legacy_sort_index(int32_t value) { legacy_sort_index_ = value; _has_field_.set(3); }
46144 
46145   bool has_host_app_package_name() const { return _has_field_[4]; }
46146   const std::string& host_app_package_name() const { return host_app_package_name_; }
46147   void set_host_app_package_name(const std::string& value) { host_app_package_name_ = value; _has_field_.set(4); }
46148 
46149  private:
46150   ChromeProcessDescriptor_ProcessType process_type_{};
46151   int32_t process_priority_{};
46152   int32_t legacy_sort_index_{};
46153   std::string host_app_package_name_{};
46154 
46155   // Allows to preserve unknown protobuf fields for compatibility
46156   // with future versions of .proto files.
46157   std::string unknown_fields_;
46158 
46159   std::bitset<5> _has_field_{};
46160 };
46161 
46162 }  // namespace perfetto
46163 }  // namespace protos
46164 }  // namespace gen
46165 
46166 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_PROCESS_DESCRIPTOR_PROTO_CPP_H_
46167 // gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_thread_descriptor.gen.h
46168 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
46169 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_THREAD_DESCRIPTOR_PROTO_CPP_H_
46170 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_THREAD_DESCRIPTOR_PROTO_CPP_H_
46171 
46172 #include <stdint.h>
46173 #include <bitset>
46174 #include <vector>
46175 #include <string>
46176 #include <type_traits>
46177 
46178 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
46179 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
46180 // gen_amalgamated expanded: #include "perfetto/base/export.h"
46181 
46182 namespace perfetto {
46183 namespace protos {
46184 namespace gen {
46185 class ChromeThreadDescriptor;
46186 enum ChromeThreadDescriptor_ThreadType : int;
46187 }  // namespace perfetto
46188 }  // namespace protos
46189 }  // namespace gen
46190 
46191 namespace protozero {
46192 class Message;
46193 }  // namespace protozero
46194 
46195 namespace perfetto {
46196 namespace protos {
46197 namespace gen {
46198 enum ChromeThreadDescriptor_ThreadType : int {
46199   ChromeThreadDescriptor_ThreadType_THREAD_UNSPECIFIED = 0,
46200   ChromeThreadDescriptor_ThreadType_THREAD_MAIN = 1,
46201   ChromeThreadDescriptor_ThreadType_THREAD_IO = 2,
46202   ChromeThreadDescriptor_ThreadType_THREAD_POOL_BG_WORKER = 3,
46203   ChromeThreadDescriptor_ThreadType_THREAD_POOL_FG_WORKER = 4,
46204   ChromeThreadDescriptor_ThreadType_THREAD_POOL_BG_BLOCKING = 6,
46205   ChromeThreadDescriptor_ThreadType_THREAD_POOL_FG_BLOCKING = 5,
46206   ChromeThreadDescriptor_ThreadType_THREAD_POOL_SERVICE = 7,
46207   ChromeThreadDescriptor_ThreadType_THREAD_COMPOSITOR = 8,
46208   ChromeThreadDescriptor_ThreadType_THREAD_VIZ_COMPOSITOR = 9,
46209   ChromeThreadDescriptor_ThreadType_THREAD_COMPOSITOR_WORKER = 10,
46210   ChromeThreadDescriptor_ThreadType_THREAD_SERVICE_WORKER = 11,
46211   ChromeThreadDescriptor_ThreadType_THREAD_MEMORY_INFRA = 50,
46212   ChromeThreadDescriptor_ThreadType_THREAD_SAMPLING_PROFILER = 51,
46213 };
46214 
46215 class PERFETTO_EXPORT ChromeThreadDescriptor : public ::protozero::CppMessageObj {
46216  public:
46217   using ThreadType = ChromeThreadDescriptor_ThreadType;
46218   static constexpr auto THREAD_UNSPECIFIED = ChromeThreadDescriptor_ThreadType_THREAD_UNSPECIFIED;
46219   static constexpr auto THREAD_MAIN = ChromeThreadDescriptor_ThreadType_THREAD_MAIN;
46220   static constexpr auto THREAD_IO = ChromeThreadDescriptor_ThreadType_THREAD_IO;
46221   static constexpr auto THREAD_POOL_BG_WORKER = ChromeThreadDescriptor_ThreadType_THREAD_POOL_BG_WORKER;
46222   static constexpr auto THREAD_POOL_FG_WORKER = ChromeThreadDescriptor_ThreadType_THREAD_POOL_FG_WORKER;
46223   static constexpr auto THREAD_POOL_BG_BLOCKING = ChromeThreadDescriptor_ThreadType_THREAD_POOL_BG_BLOCKING;
46224   static constexpr auto THREAD_POOL_FG_BLOCKING = ChromeThreadDescriptor_ThreadType_THREAD_POOL_FG_BLOCKING;
46225   static constexpr auto THREAD_POOL_SERVICE = ChromeThreadDescriptor_ThreadType_THREAD_POOL_SERVICE;
46226   static constexpr auto THREAD_COMPOSITOR = ChromeThreadDescriptor_ThreadType_THREAD_COMPOSITOR;
46227   static constexpr auto THREAD_VIZ_COMPOSITOR = ChromeThreadDescriptor_ThreadType_THREAD_VIZ_COMPOSITOR;
46228   static constexpr auto THREAD_COMPOSITOR_WORKER = ChromeThreadDescriptor_ThreadType_THREAD_COMPOSITOR_WORKER;
46229   static constexpr auto THREAD_SERVICE_WORKER = ChromeThreadDescriptor_ThreadType_THREAD_SERVICE_WORKER;
46230   static constexpr auto THREAD_MEMORY_INFRA = ChromeThreadDescriptor_ThreadType_THREAD_MEMORY_INFRA;
46231   static constexpr auto THREAD_SAMPLING_PROFILER = ChromeThreadDescriptor_ThreadType_THREAD_SAMPLING_PROFILER;
46232   static constexpr auto ThreadType_MIN = ChromeThreadDescriptor_ThreadType_THREAD_UNSPECIFIED;
46233   static constexpr auto ThreadType_MAX = ChromeThreadDescriptor_ThreadType_THREAD_SAMPLING_PROFILER;
46234   enum FieldNumbers {
46235     kThreadTypeFieldNumber = 1,
46236     kLegacySortIndexFieldNumber = 2,
46237   };
46238 
46239   ChromeThreadDescriptor();
46240   ~ChromeThreadDescriptor() override;
46241   ChromeThreadDescriptor(ChromeThreadDescriptor&&) noexcept;
46242   ChromeThreadDescriptor& operator=(ChromeThreadDescriptor&&);
46243   ChromeThreadDescriptor(const ChromeThreadDescriptor&);
46244   ChromeThreadDescriptor& operator=(const ChromeThreadDescriptor&);
46245   bool operator==(const ChromeThreadDescriptor&) const;
46246   bool operator!=(const ChromeThreadDescriptor& other) const { return !(*this == other); }
46247 
46248   bool ParseFromArray(const void*, size_t) override;
46249   std::string SerializeAsString() const override;
46250   std::vector<uint8_t> SerializeAsArray() const override;
46251   void Serialize(::protozero::Message*) const;
46252 
46253   bool has_thread_type() const { return _has_field_[1]; }
46254   ChromeThreadDescriptor_ThreadType thread_type() const { return thread_type_; }
46255   void set_thread_type(ChromeThreadDescriptor_ThreadType value) { thread_type_ = value; _has_field_.set(1); }
46256 
46257   bool has_legacy_sort_index() const { return _has_field_[2]; }
46258   int32_t legacy_sort_index() const { return legacy_sort_index_; }
46259   void set_legacy_sort_index(int32_t value) { legacy_sort_index_ = value; _has_field_.set(2); }
46260 
46261  private:
46262   ChromeThreadDescriptor_ThreadType thread_type_{};
46263   int32_t legacy_sort_index_{};
46264 
46265   // Allows to preserve unknown protobuf fields for compatibility
46266   // with future versions of .proto files.
46267   std::string unknown_fields_;
46268 
46269   std::bitset<3> _has_field_{};
46270 };
46271 
46272 }  // namespace perfetto
46273 }  // namespace protos
46274 }  // namespace gen
46275 
46276 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_THREAD_DESCRIPTOR_PROTO_CPP_H_
46277 // gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/chrome_user_event.gen.h
46278 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
46279 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_USER_EVENT_PROTO_CPP_H_
46280 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_USER_EVENT_PROTO_CPP_H_
46281 
46282 #include <stdint.h>
46283 #include <bitset>
46284 #include <vector>
46285 #include <string>
46286 #include <type_traits>
46287 
46288 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
46289 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
46290 // gen_amalgamated expanded: #include "perfetto/base/export.h"
46291 
46292 namespace perfetto {
46293 namespace protos {
46294 namespace gen {
46295 class ChromeUserEvent;
46296 }  // namespace perfetto
46297 }  // namespace protos
46298 }  // namespace gen
46299 
46300 namespace protozero {
46301 class Message;
46302 }  // namespace protozero
46303 
46304 namespace perfetto {
46305 namespace protos {
46306 namespace gen {
46307 
46308 class PERFETTO_EXPORT ChromeUserEvent : public ::protozero::CppMessageObj {
46309  public:
46310   enum FieldNumbers {
46311     kActionFieldNumber = 1,
46312     kActionHashFieldNumber = 2,
46313   };
46314 
46315   ChromeUserEvent();
46316   ~ChromeUserEvent() override;
46317   ChromeUserEvent(ChromeUserEvent&&) noexcept;
46318   ChromeUserEvent& operator=(ChromeUserEvent&&);
46319   ChromeUserEvent(const ChromeUserEvent&);
46320   ChromeUserEvent& operator=(const ChromeUserEvent&);
46321   bool operator==(const ChromeUserEvent&) const;
46322   bool operator!=(const ChromeUserEvent& other) const { return !(*this == other); }
46323 
46324   bool ParseFromArray(const void*, size_t) override;
46325   std::string SerializeAsString() const override;
46326   std::vector<uint8_t> SerializeAsArray() const override;
46327   void Serialize(::protozero::Message*) const;
46328 
46329   bool has_action() const { return _has_field_[1]; }
46330   const std::string& action() const { return action_; }
46331   void set_action(const std::string& value) { action_ = value; _has_field_.set(1); }
46332 
46333   bool has_action_hash() const { return _has_field_[2]; }
46334   uint64_t action_hash() const { return action_hash_; }
46335   void set_action_hash(uint64_t value) { action_hash_ = value; _has_field_.set(2); }
46336 
46337  private:
46338   std::string action_{};
46339   uint64_t action_hash_{};
46340 
46341   // Allows to preserve unknown protobuf fields for compatibility
46342   // with future versions of .proto files.
46343   std::string unknown_fields_;
46344 
46345   std::bitset<3> _has_field_{};
46346 };
46347 
46348 }  // namespace perfetto
46349 }  // namespace protos
46350 }  // namespace gen
46351 
46352 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_CHROME_USER_EVENT_PROTO_CPP_H_
46353 // gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/counter_descriptor.gen.h
46354 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
46355 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_COUNTER_DESCRIPTOR_PROTO_CPP_H_
46356 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_COUNTER_DESCRIPTOR_PROTO_CPP_H_
46357 
46358 #include <stdint.h>
46359 #include <bitset>
46360 #include <vector>
46361 #include <string>
46362 #include <type_traits>
46363 
46364 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
46365 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
46366 // gen_amalgamated expanded: #include "perfetto/base/export.h"
46367 
46368 namespace perfetto {
46369 namespace protos {
46370 namespace gen {
46371 class CounterDescriptor;
46372 enum CounterDescriptor_BuiltinCounterType : int;
46373 enum CounterDescriptor_Unit : int;
46374 }  // namespace perfetto
46375 }  // namespace protos
46376 }  // namespace gen
46377 
46378 namespace protozero {
46379 class Message;
46380 }  // namespace protozero
46381 
46382 namespace perfetto {
46383 namespace protos {
46384 namespace gen {
46385 enum CounterDescriptor_BuiltinCounterType : int {
46386   CounterDescriptor_BuiltinCounterType_COUNTER_UNSPECIFIED = 0,
46387   CounterDescriptor_BuiltinCounterType_COUNTER_THREAD_TIME_NS = 1,
46388   CounterDescriptor_BuiltinCounterType_COUNTER_THREAD_INSTRUCTION_COUNT = 2,
46389 };
46390 enum CounterDescriptor_Unit : int {
46391   CounterDescriptor_Unit_UNIT_UNSPECIFIED = 0,
46392   CounterDescriptor_Unit_UNIT_TIME_NS = 1,
46393   CounterDescriptor_Unit_UNIT_COUNT = 2,
46394   CounterDescriptor_Unit_UNIT_SIZE_BYTES = 3,
46395 };
46396 
46397 class PERFETTO_EXPORT CounterDescriptor : public ::protozero::CppMessageObj {
46398  public:
46399   using BuiltinCounterType = CounterDescriptor_BuiltinCounterType;
46400   static constexpr auto COUNTER_UNSPECIFIED = CounterDescriptor_BuiltinCounterType_COUNTER_UNSPECIFIED;
46401   static constexpr auto COUNTER_THREAD_TIME_NS = CounterDescriptor_BuiltinCounterType_COUNTER_THREAD_TIME_NS;
46402   static constexpr auto COUNTER_THREAD_INSTRUCTION_COUNT = CounterDescriptor_BuiltinCounterType_COUNTER_THREAD_INSTRUCTION_COUNT;
46403   static constexpr auto BuiltinCounterType_MIN = CounterDescriptor_BuiltinCounterType_COUNTER_UNSPECIFIED;
46404   static constexpr auto BuiltinCounterType_MAX = CounterDescriptor_BuiltinCounterType_COUNTER_THREAD_INSTRUCTION_COUNT;
46405   using Unit = CounterDescriptor_Unit;
46406   static constexpr auto UNIT_UNSPECIFIED = CounterDescriptor_Unit_UNIT_UNSPECIFIED;
46407   static constexpr auto UNIT_TIME_NS = CounterDescriptor_Unit_UNIT_TIME_NS;
46408   static constexpr auto UNIT_COUNT = CounterDescriptor_Unit_UNIT_COUNT;
46409   static constexpr auto UNIT_SIZE_BYTES = CounterDescriptor_Unit_UNIT_SIZE_BYTES;
46410   static constexpr auto Unit_MIN = CounterDescriptor_Unit_UNIT_UNSPECIFIED;
46411   static constexpr auto Unit_MAX = CounterDescriptor_Unit_UNIT_SIZE_BYTES;
46412   enum FieldNumbers {
46413     kTypeFieldNumber = 1,
46414     kCategoriesFieldNumber = 2,
46415     kUnitFieldNumber = 3,
46416     kUnitMultiplierFieldNumber = 4,
46417     kIsIncrementalFieldNumber = 5,
46418   };
46419 
46420   CounterDescriptor();
46421   ~CounterDescriptor() override;
46422   CounterDescriptor(CounterDescriptor&&) noexcept;
46423   CounterDescriptor& operator=(CounterDescriptor&&);
46424   CounterDescriptor(const CounterDescriptor&);
46425   CounterDescriptor& operator=(const CounterDescriptor&);
46426   bool operator==(const CounterDescriptor&) const;
46427   bool operator!=(const CounterDescriptor& other) const { return !(*this == other); }
46428 
46429   bool ParseFromArray(const void*, size_t) override;
46430   std::string SerializeAsString() const override;
46431   std::vector<uint8_t> SerializeAsArray() const override;
46432   void Serialize(::protozero::Message*) const;
46433 
46434   bool has_type() const { return _has_field_[1]; }
46435   CounterDescriptor_BuiltinCounterType type() const { return type_; }
46436   void set_type(CounterDescriptor_BuiltinCounterType value) { type_ = value; _has_field_.set(1); }
46437 
46438   int categories_size() const { return static_cast<int>(categories_.size()); }
46439   const std::vector<std::string>& categories() const { return categories_; }
46440   std::vector<std::string>* mutable_categories() { return &categories_; }
46441   void clear_categories() { categories_.clear(); }
46442   void add_categories(std::string value) { categories_.emplace_back(value); }
46443   std::string* add_categories() { categories_.emplace_back(); return &categories_.back(); }
46444 
46445   bool has_unit() const { return _has_field_[3]; }
46446   CounterDescriptor_Unit unit() const { return unit_; }
46447   void set_unit(CounterDescriptor_Unit value) { unit_ = value; _has_field_.set(3); }
46448 
46449   bool has_unit_multiplier() const { return _has_field_[4]; }
46450   int64_t unit_multiplier() const { return unit_multiplier_; }
46451   void set_unit_multiplier(int64_t value) { unit_multiplier_ = value; _has_field_.set(4); }
46452 
46453   bool has_is_incremental() const { return _has_field_[5]; }
46454   bool is_incremental() const { return is_incremental_; }
46455   void set_is_incremental(bool value) { is_incremental_ = value; _has_field_.set(5); }
46456 
46457  private:
46458   CounterDescriptor_BuiltinCounterType type_{};
46459   std::vector<std::string> categories_;
46460   CounterDescriptor_Unit unit_{};
46461   int64_t unit_multiplier_{};
46462   bool is_incremental_{};
46463 
46464   // Allows to preserve unknown protobuf fields for compatibility
46465   // with future versions of .proto files.
46466   std::string unknown_fields_;
46467 
46468   std::bitset<6> _has_field_{};
46469 };
46470 
46471 }  // namespace perfetto
46472 }  // namespace protos
46473 }  // namespace gen
46474 
46475 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_COUNTER_DESCRIPTOR_PROTO_CPP_H_
46476 // gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/debug_annotation.gen.h
46477 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
46478 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_DEBUG_ANNOTATION_PROTO_CPP_H_
46479 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_DEBUG_ANNOTATION_PROTO_CPP_H_
46480 
46481 #include <stdint.h>
46482 #include <bitset>
46483 #include <vector>
46484 #include <string>
46485 #include <type_traits>
46486 
46487 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
46488 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
46489 // gen_amalgamated expanded: #include "perfetto/base/export.h"
46490 
46491 namespace perfetto {
46492 namespace protos {
46493 namespace gen {
46494 class DebugAnnotationName;
46495 class DebugAnnotation;
46496 class DebugAnnotation_NestedValue;
46497 enum DebugAnnotation_NestedValue_NestedType : int;
46498 }  // namespace perfetto
46499 }  // namespace protos
46500 }  // namespace gen
46501 
46502 namespace protozero {
46503 class Message;
46504 }  // namespace protozero
46505 
46506 namespace perfetto {
46507 namespace protos {
46508 namespace gen {
46509 enum DebugAnnotation_NestedValue_NestedType : int {
46510   DebugAnnotation_NestedValue_NestedType_UNSPECIFIED = 0,
46511   DebugAnnotation_NestedValue_NestedType_DICT = 1,
46512   DebugAnnotation_NestedValue_NestedType_ARRAY = 2,
46513 };
46514 
46515 class PERFETTO_EXPORT DebugAnnotationName : public ::protozero::CppMessageObj {
46516  public:
46517   enum FieldNumbers {
46518     kIidFieldNumber = 1,
46519     kNameFieldNumber = 2,
46520   };
46521 
46522   DebugAnnotationName();
46523   ~DebugAnnotationName() override;
46524   DebugAnnotationName(DebugAnnotationName&&) noexcept;
46525   DebugAnnotationName& operator=(DebugAnnotationName&&);
46526   DebugAnnotationName(const DebugAnnotationName&);
46527   DebugAnnotationName& operator=(const DebugAnnotationName&);
46528   bool operator==(const DebugAnnotationName&) const;
46529   bool operator!=(const DebugAnnotationName& other) const { return !(*this == other); }
46530 
46531   bool ParseFromArray(const void*, size_t) override;
46532   std::string SerializeAsString() const override;
46533   std::vector<uint8_t> SerializeAsArray() const override;
46534   void Serialize(::protozero::Message*) const;
46535 
46536   bool has_iid() const { return _has_field_[1]; }
46537   uint64_t iid() const { return iid_; }
46538   void set_iid(uint64_t value) { iid_ = value; _has_field_.set(1); }
46539 
46540   bool has_name() const { return _has_field_[2]; }
46541   const std::string& name() const { return name_; }
46542   void set_name(const std::string& value) { name_ = value; _has_field_.set(2); }
46543 
46544  private:
46545   uint64_t iid_{};
46546   std::string name_{};
46547 
46548   // Allows to preserve unknown protobuf fields for compatibility
46549   // with future versions of .proto files.
46550   std::string unknown_fields_;
46551 
46552   std::bitset<3> _has_field_{};
46553 };
46554 
46555 
46556 class PERFETTO_EXPORT DebugAnnotation : public ::protozero::CppMessageObj {
46557  public:
46558   using NestedValue = DebugAnnotation_NestedValue;
46559   enum FieldNumbers {
46560     kNameIidFieldNumber = 1,
46561     kNameFieldNumber = 10,
46562     kBoolValueFieldNumber = 2,
46563     kUintValueFieldNumber = 3,
46564     kIntValueFieldNumber = 4,
46565     kDoubleValueFieldNumber = 5,
46566     kStringValueFieldNumber = 6,
46567     kPointerValueFieldNumber = 7,
46568     kNestedValueFieldNumber = 8,
46569     kLegacyJsonValueFieldNumber = 9,
46570   };
46571 
46572   DebugAnnotation();
46573   ~DebugAnnotation() override;
46574   DebugAnnotation(DebugAnnotation&&) noexcept;
46575   DebugAnnotation& operator=(DebugAnnotation&&);
46576   DebugAnnotation(const DebugAnnotation&);
46577   DebugAnnotation& operator=(const DebugAnnotation&);
46578   bool operator==(const DebugAnnotation&) const;
46579   bool operator!=(const DebugAnnotation& other) const { return !(*this == other); }
46580 
46581   bool ParseFromArray(const void*, size_t) override;
46582   std::string SerializeAsString() const override;
46583   std::vector<uint8_t> SerializeAsArray() const override;
46584   void Serialize(::protozero::Message*) const;
46585 
46586   bool has_name_iid() const { return _has_field_[1]; }
46587   uint64_t name_iid() const { return name_iid_; }
46588   void set_name_iid(uint64_t value) { name_iid_ = value; _has_field_.set(1); }
46589 
46590   bool has_name() const { return _has_field_[10]; }
46591   const std::string& name() const { return name_; }
46592   void set_name(const std::string& value) { name_ = value; _has_field_.set(10); }
46593 
46594   bool has_bool_value() const { return _has_field_[2]; }
46595   bool bool_value() const { return bool_value_; }
46596   void set_bool_value(bool value) { bool_value_ = value; _has_field_.set(2); }
46597 
46598   bool has_uint_value() const { return _has_field_[3]; }
46599   uint64_t uint_value() const { return uint_value_; }
46600   void set_uint_value(uint64_t value) { uint_value_ = value; _has_field_.set(3); }
46601 
46602   bool has_int_value() const { return _has_field_[4]; }
46603   int64_t int_value() const { return int_value_; }
46604   void set_int_value(int64_t value) { int_value_ = value; _has_field_.set(4); }
46605 
46606   bool has_double_value() const { return _has_field_[5]; }
46607   double double_value() const { return double_value_; }
46608   void set_double_value(double value) { double_value_ = value; _has_field_.set(5); }
46609 
46610   bool has_string_value() const { return _has_field_[6]; }
46611   const std::string& string_value() const { return string_value_; }
46612   void set_string_value(const std::string& value) { string_value_ = value; _has_field_.set(6); }
46613 
46614   bool has_pointer_value() const { return _has_field_[7]; }
46615   uint64_t pointer_value() const { return pointer_value_; }
46616   void set_pointer_value(uint64_t value) { pointer_value_ = value; _has_field_.set(7); }
46617 
46618   bool has_nested_value() const { return _has_field_[8]; }
46619   const DebugAnnotation_NestedValue& nested_value() const { return *nested_value_; }
46620   DebugAnnotation_NestedValue* mutable_nested_value() { _has_field_.set(8); return nested_value_.get(); }
46621 
46622   bool has_legacy_json_value() const { return _has_field_[9]; }
46623   const std::string& legacy_json_value() const { return legacy_json_value_; }
46624   void set_legacy_json_value(const std::string& value) { legacy_json_value_ = value; _has_field_.set(9); }
46625 
46626  private:
46627   uint64_t name_iid_{};
46628   std::string name_{};
46629   bool bool_value_{};
46630   uint64_t uint_value_{};
46631   int64_t int_value_{};
46632   double double_value_{};
46633   std::string string_value_{};
46634   uint64_t pointer_value_{};
46635   ::protozero::CopyablePtr<DebugAnnotation_NestedValue> nested_value_;
46636   std::string legacy_json_value_{};
46637 
46638   // Allows to preserve unknown protobuf fields for compatibility
46639   // with future versions of .proto files.
46640   std::string unknown_fields_;
46641 
46642   std::bitset<11> _has_field_{};
46643 };
46644 
46645 
46646 class PERFETTO_EXPORT DebugAnnotation_NestedValue : public ::protozero::CppMessageObj {
46647  public:
46648   using NestedType = DebugAnnotation_NestedValue_NestedType;
46649   static constexpr auto UNSPECIFIED = DebugAnnotation_NestedValue_NestedType_UNSPECIFIED;
46650   static constexpr auto DICT = DebugAnnotation_NestedValue_NestedType_DICT;
46651   static constexpr auto ARRAY = DebugAnnotation_NestedValue_NestedType_ARRAY;
46652   static constexpr auto NestedType_MIN = DebugAnnotation_NestedValue_NestedType_UNSPECIFIED;
46653   static constexpr auto NestedType_MAX = DebugAnnotation_NestedValue_NestedType_ARRAY;
46654   enum FieldNumbers {
46655     kNestedTypeFieldNumber = 1,
46656     kDictKeysFieldNumber = 2,
46657     kDictValuesFieldNumber = 3,
46658     kArrayValuesFieldNumber = 4,
46659     kIntValueFieldNumber = 5,
46660     kDoubleValueFieldNumber = 6,
46661     kBoolValueFieldNumber = 7,
46662     kStringValueFieldNumber = 8,
46663   };
46664 
46665   DebugAnnotation_NestedValue();
46666   ~DebugAnnotation_NestedValue() override;
46667   DebugAnnotation_NestedValue(DebugAnnotation_NestedValue&&) noexcept;
46668   DebugAnnotation_NestedValue& operator=(DebugAnnotation_NestedValue&&);
46669   DebugAnnotation_NestedValue(const DebugAnnotation_NestedValue&);
46670   DebugAnnotation_NestedValue& operator=(const DebugAnnotation_NestedValue&);
46671   bool operator==(const DebugAnnotation_NestedValue&) const;
46672   bool operator!=(const DebugAnnotation_NestedValue& other) const { return !(*this == other); }
46673 
46674   bool ParseFromArray(const void*, size_t) override;
46675   std::string SerializeAsString() const override;
46676   std::vector<uint8_t> SerializeAsArray() const override;
46677   void Serialize(::protozero::Message*) const;
46678 
46679   bool has_nested_type() const { return _has_field_[1]; }
46680   DebugAnnotation_NestedValue_NestedType nested_type() const { return nested_type_; }
46681   void set_nested_type(DebugAnnotation_NestedValue_NestedType value) { nested_type_ = value; _has_field_.set(1); }
46682 
46683   int dict_keys_size() const { return static_cast<int>(dict_keys_.size()); }
46684   const std::vector<std::string>& dict_keys() const { return dict_keys_; }
46685   std::vector<std::string>* mutable_dict_keys() { return &dict_keys_; }
46686   void clear_dict_keys() { dict_keys_.clear(); }
46687   void add_dict_keys(std::string value) { dict_keys_.emplace_back(value); }
46688   std::string* add_dict_keys() { dict_keys_.emplace_back(); return &dict_keys_.back(); }
46689 
46690   int dict_values_size() const { return static_cast<int>(dict_values_.size()); }
46691   const std::vector<DebugAnnotation_NestedValue>& dict_values() const { return dict_values_; }
46692   std::vector<DebugAnnotation_NestedValue>* mutable_dict_values() { return &dict_values_; }
46693   void clear_dict_values() { dict_values_.clear(); }
46694   DebugAnnotation_NestedValue* add_dict_values() { dict_values_.emplace_back(); return &dict_values_.back(); }
46695 
46696   int array_values_size() const { return static_cast<int>(array_values_.size()); }
46697   const std::vector<DebugAnnotation_NestedValue>& array_values() const { return array_values_; }
46698   std::vector<DebugAnnotation_NestedValue>* mutable_array_values() { return &array_values_; }
46699   void clear_array_values() { array_values_.clear(); }
46700   DebugAnnotation_NestedValue* add_array_values() { array_values_.emplace_back(); return &array_values_.back(); }
46701 
46702   bool has_int_value() const { return _has_field_[5]; }
46703   int64_t int_value() const { return int_value_; }
46704   void set_int_value(int64_t value) { int_value_ = value; _has_field_.set(5); }
46705 
46706   bool has_double_value() const { return _has_field_[6]; }
46707   double double_value() const { return double_value_; }
46708   void set_double_value(double value) { double_value_ = value; _has_field_.set(6); }
46709 
46710   bool has_bool_value() const { return _has_field_[7]; }
46711   bool bool_value() const { return bool_value_; }
46712   void set_bool_value(bool value) { bool_value_ = value; _has_field_.set(7); }
46713 
46714   bool has_string_value() const { return _has_field_[8]; }
46715   const std::string& string_value() const { return string_value_; }
46716   void set_string_value(const std::string& value) { string_value_ = value; _has_field_.set(8); }
46717 
46718  private:
46719   DebugAnnotation_NestedValue_NestedType nested_type_{};
46720   std::vector<std::string> dict_keys_;
46721   std::vector<DebugAnnotation_NestedValue> dict_values_;
46722   std::vector<DebugAnnotation_NestedValue> array_values_;
46723   int64_t int_value_{};
46724   double double_value_{};
46725   bool bool_value_{};
46726   std::string string_value_{};
46727 
46728   // Allows to preserve unknown protobuf fields for compatibility
46729   // with future versions of .proto files.
46730   std::string unknown_fields_;
46731 
46732   std::bitset<9> _has_field_{};
46733 };
46734 
46735 }  // namespace perfetto
46736 }  // namespace protos
46737 }  // namespace gen
46738 
46739 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_DEBUG_ANNOTATION_PROTO_CPP_H_
46740 // gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/log_message.gen.h
46741 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
46742 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_LOG_MESSAGE_PROTO_CPP_H_
46743 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_LOG_MESSAGE_PROTO_CPP_H_
46744 
46745 #include <stdint.h>
46746 #include <bitset>
46747 #include <vector>
46748 #include <string>
46749 #include <type_traits>
46750 
46751 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
46752 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
46753 // gen_amalgamated expanded: #include "perfetto/base/export.h"
46754 
46755 namespace perfetto {
46756 namespace protos {
46757 namespace gen {
46758 class LogMessageBody;
46759 class LogMessage;
46760 }  // namespace perfetto
46761 }  // namespace protos
46762 }  // namespace gen
46763 
46764 namespace protozero {
46765 class Message;
46766 }  // namespace protozero
46767 
46768 namespace perfetto {
46769 namespace protos {
46770 namespace gen {
46771 
46772 class PERFETTO_EXPORT LogMessageBody : public ::protozero::CppMessageObj {
46773  public:
46774   enum FieldNumbers {
46775     kIidFieldNumber = 1,
46776     kBodyFieldNumber = 2,
46777   };
46778 
46779   LogMessageBody();
46780   ~LogMessageBody() override;
46781   LogMessageBody(LogMessageBody&&) noexcept;
46782   LogMessageBody& operator=(LogMessageBody&&);
46783   LogMessageBody(const LogMessageBody&);
46784   LogMessageBody& operator=(const LogMessageBody&);
46785   bool operator==(const LogMessageBody&) const;
46786   bool operator!=(const LogMessageBody& other) const { return !(*this == other); }
46787 
46788   bool ParseFromArray(const void*, size_t) override;
46789   std::string SerializeAsString() const override;
46790   std::vector<uint8_t> SerializeAsArray() const override;
46791   void Serialize(::protozero::Message*) const;
46792 
46793   bool has_iid() const { return _has_field_[1]; }
46794   uint64_t iid() const { return iid_; }
46795   void set_iid(uint64_t value) { iid_ = value; _has_field_.set(1); }
46796 
46797   bool has_body() const { return _has_field_[2]; }
46798   const std::string& body() const { return body_; }
46799   void set_body(const std::string& value) { body_ = value; _has_field_.set(2); }
46800 
46801  private:
46802   uint64_t iid_{};
46803   std::string body_{};
46804 
46805   // Allows to preserve unknown protobuf fields for compatibility
46806   // with future versions of .proto files.
46807   std::string unknown_fields_;
46808 
46809   std::bitset<3> _has_field_{};
46810 };
46811 
46812 
46813 class PERFETTO_EXPORT LogMessage : public ::protozero::CppMessageObj {
46814  public:
46815   enum FieldNumbers {
46816     kSourceLocationIidFieldNumber = 1,
46817     kBodyIidFieldNumber = 2,
46818   };
46819 
46820   LogMessage();
46821   ~LogMessage() override;
46822   LogMessage(LogMessage&&) noexcept;
46823   LogMessage& operator=(LogMessage&&);
46824   LogMessage(const LogMessage&);
46825   LogMessage& operator=(const LogMessage&);
46826   bool operator==(const LogMessage&) const;
46827   bool operator!=(const LogMessage& other) const { return !(*this == other); }
46828 
46829   bool ParseFromArray(const void*, size_t) override;
46830   std::string SerializeAsString() const override;
46831   std::vector<uint8_t> SerializeAsArray() const override;
46832   void Serialize(::protozero::Message*) const;
46833 
46834   bool has_source_location_iid() const { return _has_field_[1]; }
46835   uint64_t source_location_iid() const { return source_location_iid_; }
46836   void set_source_location_iid(uint64_t value) { source_location_iid_ = value; _has_field_.set(1); }
46837 
46838   bool has_body_iid() const { return _has_field_[2]; }
46839   uint64_t body_iid() const { return body_iid_; }
46840   void set_body_iid(uint64_t value) { body_iid_ = value; _has_field_.set(2); }
46841 
46842  private:
46843   uint64_t source_location_iid_{};
46844   uint64_t body_iid_{};
46845 
46846   // Allows to preserve unknown protobuf fields for compatibility
46847   // with future versions of .proto files.
46848   std::string unknown_fields_;
46849 
46850   std::bitset<3> _has_field_{};
46851 };
46852 
46853 }  // namespace perfetto
46854 }  // namespace protos
46855 }  // namespace gen
46856 
46857 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_LOG_MESSAGE_PROTO_CPP_H_
46858 // gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/process_descriptor.gen.h
46859 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
46860 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_PROCESS_DESCRIPTOR_PROTO_CPP_H_
46861 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_PROCESS_DESCRIPTOR_PROTO_CPP_H_
46862 
46863 #include <stdint.h>
46864 #include <bitset>
46865 #include <vector>
46866 #include <string>
46867 #include <type_traits>
46868 
46869 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
46870 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
46871 // gen_amalgamated expanded: #include "perfetto/base/export.h"
46872 
46873 namespace perfetto {
46874 namespace protos {
46875 namespace gen {
46876 class ProcessDescriptor;
46877 enum ProcessDescriptor_ChromeProcessType : int;
46878 }  // namespace perfetto
46879 }  // namespace protos
46880 }  // namespace gen
46881 
46882 namespace protozero {
46883 class Message;
46884 }  // namespace protozero
46885 
46886 namespace perfetto {
46887 namespace protos {
46888 namespace gen {
46889 enum ProcessDescriptor_ChromeProcessType : int {
46890   ProcessDescriptor_ChromeProcessType_PROCESS_UNSPECIFIED = 0,
46891   ProcessDescriptor_ChromeProcessType_PROCESS_BROWSER = 1,
46892   ProcessDescriptor_ChromeProcessType_PROCESS_RENDERER = 2,
46893   ProcessDescriptor_ChromeProcessType_PROCESS_UTILITY = 3,
46894   ProcessDescriptor_ChromeProcessType_PROCESS_ZYGOTE = 4,
46895   ProcessDescriptor_ChromeProcessType_PROCESS_SANDBOX_HELPER = 5,
46896   ProcessDescriptor_ChromeProcessType_PROCESS_GPU = 6,
46897   ProcessDescriptor_ChromeProcessType_PROCESS_PPAPI_PLUGIN = 7,
46898   ProcessDescriptor_ChromeProcessType_PROCESS_PPAPI_BROKER = 8,
46899 };
46900 
46901 class PERFETTO_EXPORT ProcessDescriptor : public ::protozero::CppMessageObj {
46902  public:
46903   using ChromeProcessType = ProcessDescriptor_ChromeProcessType;
46904   static constexpr auto PROCESS_UNSPECIFIED = ProcessDescriptor_ChromeProcessType_PROCESS_UNSPECIFIED;
46905   static constexpr auto PROCESS_BROWSER = ProcessDescriptor_ChromeProcessType_PROCESS_BROWSER;
46906   static constexpr auto PROCESS_RENDERER = ProcessDescriptor_ChromeProcessType_PROCESS_RENDERER;
46907   static constexpr auto PROCESS_UTILITY = ProcessDescriptor_ChromeProcessType_PROCESS_UTILITY;
46908   static constexpr auto PROCESS_ZYGOTE = ProcessDescriptor_ChromeProcessType_PROCESS_ZYGOTE;
46909   static constexpr auto PROCESS_SANDBOX_HELPER = ProcessDescriptor_ChromeProcessType_PROCESS_SANDBOX_HELPER;
46910   static constexpr auto PROCESS_GPU = ProcessDescriptor_ChromeProcessType_PROCESS_GPU;
46911   static constexpr auto PROCESS_PPAPI_PLUGIN = ProcessDescriptor_ChromeProcessType_PROCESS_PPAPI_PLUGIN;
46912   static constexpr auto PROCESS_PPAPI_BROKER = ProcessDescriptor_ChromeProcessType_PROCESS_PPAPI_BROKER;
46913   static constexpr auto ChromeProcessType_MIN = ProcessDescriptor_ChromeProcessType_PROCESS_UNSPECIFIED;
46914   static constexpr auto ChromeProcessType_MAX = ProcessDescriptor_ChromeProcessType_PROCESS_PPAPI_BROKER;
46915   enum FieldNumbers {
46916     kPidFieldNumber = 1,
46917     kCmdlineFieldNumber = 2,
46918     kProcessNameFieldNumber = 6,
46919     kProcessPriorityFieldNumber = 5,
46920     kChromeProcessTypeFieldNumber = 4,
46921     kLegacySortIndexFieldNumber = 3,
46922   };
46923 
46924   ProcessDescriptor();
46925   ~ProcessDescriptor() override;
46926   ProcessDescriptor(ProcessDescriptor&&) noexcept;
46927   ProcessDescriptor& operator=(ProcessDescriptor&&);
46928   ProcessDescriptor(const ProcessDescriptor&);
46929   ProcessDescriptor& operator=(const ProcessDescriptor&);
46930   bool operator==(const ProcessDescriptor&) const;
46931   bool operator!=(const ProcessDescriptor& other) const { return !(*this == other); }
46932 
46933   bool ParseFromArray(const void*, size_t) override;
46934   std::string SerializeAsString() const override;
46935   std::vector<uint8_t> SerializeAsArray() const override;
46936   void Serialize(::protozero::Message*) const;
46937 
46938   bool has_pid() const { return _has_field_[1]; }
46939   int32_t pid() const { return pid_; }
46940   void set_pid(int32_t value) { pid_ = value; _has_field_.set(1); }
46941 
46942   int cmdline_size() const { return static_cast<int>(cmdline_.size()); }
46943   const std::vector<std::string>& cmdline() const { return cmdline_; }
46944   std::vector<std::string>* mutable_cmdline() { return &cmdline_; }
46945   void clear_cmdline() { cmdline_.clear(); }
46946   void add_cmdline(std::string value) { cmdline_.emplace_back(value); }
46947   std::string* add_cmdline() { cmdline_.emplace_back(); return &cmdline_.back(); }
46948 
46949   bool has_process_name() const { return _has_field_[6]; }
46950   const std::string& process_name() const { return process_name_; }
46951   void set_process_name(const std::string& value) { process_name_ = value; _has_field_.set(6); }
46952 
46953   bool has_process_priority() const { return _has_field_[5]; }
46954   int32_t process_priority() const { return process_priority_; }
46955   void set_process_priority(int32_t value) { process_priority_ = value; _has_field_.set(5); }
46956 
46957   bool has_chrome_process_type() const { return _has_field_[4]; }
46958   ProcessDescriptor_ChromeProcessType chrome_process_type() const { return chrome_process_type_; }
46959   void set_chrome_process_type(ProcessDescriptor_ChromeProcessType value) { chrome_process_type_ = value; _has_field_.set(4); }
46960 
46961   bool has_legacy_sort_index() const { return _has_field_[3]; }
46962   int32_t legacy_sort_index() const { return legacy_sort_index_; }
46963   void set_legacy_sort_index(int32_t value) { legacy_sort_index_ = value; _has_field_.set(3); }
46964 
46965  private:
46966   int32_t pid_{};
46967   std::vector<std::string> cmdline_;
46968   std::string process_name_{};
46969   int32_t process_priority_{};
46970   ProcessDescriptor_ChromeProcessType chrome_process_type_{};
46971   int32_t legacy_sort_index_{};
46972 
46973   // Allows to preserve unknown protobuf fields for compatibility
46974   // with future versions of .proto files.
46975   std::string unknown_fields_;
46976 
46977   std::bitset<7> _has_field_{};
46978 };
46979 
46980 }  // namespace perfetto
46981 }  // namespace protos
46982 }  // namespace gen
46983 
46984 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_PROCESS_DESCRIPTOR_PROTO_CPP_H_
46985 // gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/source_location.gen.h
46986 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
46987 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_SOURCE_LOCATION_PROTO_CPP_H_
46988 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_SOURCE_LOCATION_PROTO_CPP_H_
46989 
46990 #include <stdint.h>
46991 #include <bitset>
46992 #include <vector>
46993 #include <string>
46994 #include <type_traits>
46995 
46996 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
46997 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
46998 // gen_amalgamated expanded: #include "perfetto/base/export.h"
46999 
47000 namespace perfetto {
47001 namespace protos {
47002 namespace gen {
47003 class SourceLocation;
47004 }  // namespace perfetto
47005 }  // namespace protos
47006 }  // namespace gen
47007 
47008 namespace protozero {
47009 class Message;
47010 }  // namespace protozero
47011 
47012 namespace perfetto {
47013 namespace protos {
47014 namespace gen {
47015 
47016 class PERFETTO_EXPORT SourceLocation : public ::protozero::CppMessageObj {
47017  public:
47018   enum FieldNumbers {
47019     kIidFieldNumber = 1,
47020     kFileNameFieldNumber = 2,
47021     kFunctionNameFieldNumber = 3,
47022     kLineNumberFieldNumber = 4,
47023   };
47024 
47025   SourceLocation();
47026   ~SourceLocation() override;
47027   SourceLocation(SourceLocation&&) noexcept;
47028   SourceLocation& operator=(SourceLocation&&);
47029   SourceLocation(const SourceLocation&);
47030   SourceLocation& operator=(const SourceLocation&);
47031   bool operator==(const SourceLocation&) const;
47032   bool operator!=(const SourceLocation& other) const { return !(*this == other); }
47033 
47034   bool ParseFromArray(const void*, size_t) override;
47035   std::string SerializeAsString() const override;
47036   std::vector<uint8_t> SerializeAsArray() const override;
47037   void Serialize(::protozero::Message*) const;
47038 
47039   bool has_iid() const { return _has_field_[1]; }
47040   uint64_t iid() const { return iid_; }
47041   void set_iid(uint64_t value) { iid_ = value; _has_field_.set(1); }
47042 
47043   bool has_file_name() const { return _has_field_[2]; }
47044   const std::string& file_name() const { return file_name_; }
47045   void set_file_name(const std::string& value) { file_name_ = value; _has_field_.set(2); }
47046 
47047   bool has_function_name() const { return _has_field_[3]; }
47048   const std::string& function_name() const { return function_name_; }
47049   void set_function_name(const std::string& value) { function_name_ = value; _has_field_.set(3); }
47050 
47051   bool has_line_number() const { return _has_field_[4]; }
47052   uint32_t line_number() const { return line_number_; }
47053   void set_line_number(uint32_t value) { line_number_ = value; _has_field_.set(4); }
47054 
47055  private:
47056   uint64_t iid_{};
47057   std::string file_name_{};
47058   std::string function_name_{};
47059   uint32_t line_number_{};
47060 
47061   // Allows to preserve unknown protobuf fields for compatibility
47062   // with future versions of .proto files.
47063   std::string unknown_fields_;
47064 
47065   std::bitset<5> _has_field_{};
47066 };
47067 
47068 }  // namespace perfetto
47069 }  // namespace protos
47070 }  // namespace gen
47071 
47072 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_SOURCE_LOCATION_PROTO_CPP_H_
47073 // gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/task_execution.gen.h
47074 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
47075 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TASK_EXECUTION_PROTO_CPP_H_
47076 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TASK_EXECUTION_PROTO_CPP_H_
47077 
47078 #include <stdint.h>
47079 #include <bitset>
47080 #include <vector>
47081 #include <string>
47082 #include <type_traits>
47083 
47084 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
47085 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
47086 // gen_amalgamated expanded: #include "perfetto/base/export.h"
47087 
47088 namespace perfetto {
47089 namespace protos {
47090 namespace gen {
47091 class TaskExecution;
47092 }  // namespace perfetto
47093 }  // namespace protos
47094 }  // namespace gen
47095 
47096 namespace protozero {
47097 class Message;
47098 }  // namespace protozero
47099 
47100 namespace perfetto {
47101 namespace protos {
47102 namespace gen {
47103 
47104 class PERFETTO_EXPORT TaskExecution : public ::protozero::CppMessageObj {
47105  public:
47106   enum FieldNumbers {
47107     kPostedFromIidFieldNumber = 1,
47108   };
47109 
47110   TaskExecution();
47111   ~TaskExecution() override;
47112   TaskExecution(TaskExecution&&) noexcept;
47113   TaskExecution& operator=(TaskExecution&&);
47114   TaskExecution(const TaskExecution&);
47115   TaskExecution& operator=(const TaskExecution&);
47116   bool operator==(const TaskExecution&) const;
47117   bool operator!=(const TaskExecution& other) const { return !(*this == other); }
47118 
47119   bool ParseFromArray(const void*, size_t) override;
47120   std::string SerializeAsString() const override;
47121   std::vector<uint8_t> SerializeAsArray() const override;
47122   void Serialize(::protozero::Message*) const;
47123 
47124   bool has_posted_from_iid() const { return _has_field_[1]; }
47125   uint64_t posted_from_iid() const { return posted_from_iid_; }
47126   void set_posted_from_iid(uint64_t value) { posted_from_iid_ = value; _has_field_.set(1); }
47127 
47128  private:
47129   uint64_t posted_from_iid_{};
47130 
47131   // Allows to preserve unknown protobuf fields for compatibility
47132   // with future versions of .proto files.
47133   std::string unknown_fields_;
47134 
47135   std::bitset<2> _has_field_{};
47136 };
47137 
47138 }  // namespace perfetto
47139 }  // namespace protos
47140 }  // namespace gen
47141 
47142 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TASK_EXECUTION_PROTO_CPP_H_
47143 // gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/thread_descriptor.gen.h
47144 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
47145 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_THREAD_DESCRIPTOR_PROTO_CPP_H_
47146 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_THREAD_DESCRIPTOR_PROTO_CPP_H_
47147 
47148 #include <stdint.h>
47149 #include <bitset>
47150 #include <vector>
47151 #include <string>
47152 #include <type_traits>
47153 
47154 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
47155 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
47156 // gen_amalgamated expanded: #include "perfetto/base/export.h"
47157 
47158 namespace perfetto {
47159 namespace protos {
47160 namespace gen {
47161 class ThreadDescriptor;
47162 enum ThreadDescriptor_ChromeThreadType : int;
47163 }  // namespace perfetto
47164 }  // namespace protos
47165 }  // namespace gen
47166 
47167 namespace protozero {
47168 class Message;
47169 }  // namespace protozero
47170 
47171 namespace perfetto {
47172 namespace protos {
47173 namespace gen {
47174 enum ThreadDescriptor_ChromeThreadType : int {
47175   ThreadDescriptor_ChromeThreadType_CHROME_THREAD_UNSPECIFIED = 0,
47176   ThreadDescriptor_ChromeThreadType_CHROME_THREAD_MAIN = 1,
47177   ThreadDescriptor_ChromeThreadType_CHROME_THREAD_IO = 2,
47178   ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_BG_WORKER = 3,
47179   ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_FG_WORKER = 4,
47180   ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_FB_BLOCKING = 5,
47181   ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_BG_BLOCKING = 6,
47182   ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_SERVICE = 7,
47183   ThreadDescriptor_ChromeThreadType_CHROME_THREAD_COMPOSITOR = 8,
47184   ThreadDescriptor_ChromeThreadType_CHROME_THREAD_VIZ_COMPOSITOR = 9,
47185   ThreadDescriptor_ChromeThreadType_CHROME_THREAD_COMPOSITOR_WORKER = 10,
47186   ThreadDescriptor_ChromeThreadType_CHROME_THREAD_SERVICE_WORKER = 11,
47187   ThreadDescriptor_ChromeThreadType_CHROME_THREAD_MEMORY_INFRA = 50,
47188   ThreadDescriptor_ChromeThreadType_CHROME_THREAD_SAMPLING_PROFILER = 51,
47189 };
47190 
47191 class PERFETTO_EXPORT ThreadDescriptor : public ::protozero::CppMessageObj {
47192  public:
47193   using ChromeThreadType = ThreadDescriptor_ChromeThreadType;
47194   static constexpr auto CHROME_THREAD_UNSPECIFIED = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_UNSPECIFIED;
47195   static constexpr auto CHROME_THREAD_MAIN = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_MAIN;
47196   static constexpr auto CHROME_THREAD_IO = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_IO;
47197   static constexpr auto CHROME_THREAD_POOL_BG_WORKER = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_BG_WORKER;
47198   static constexpr auto CHROME_THREAD_POOL_FG_WORKER = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_FG_WORKER;
47199   static constexpr auto CHROME_THREAD_POOL_FB_BLOCKING = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_FB_BLOCKING;
47200   static constexpr auto CHROME_THREAD_POOL_BG_BLOCKING = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_BG_BLOCKING;
47201   static constexpr auto CHROME_THREAD_POOL_SERVICE = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_POOL_SERVICE;
47202   static constexpr auto CHROME_THREAD_COMPOSITOR = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_COMPOSITOR;
47203   static constexpr auto CHROME_THREAD_VIZ_COMPOSITOR = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_VIZ_COMPOSITOR;
47204   static constexpr auto CHROME_THREAD_COMPOSITOR_WORKER = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_COMPOSITOR_WORKER;
47205   static constexpr auto CHROME_THREAD_SERVICE_WORKER = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_SERVICE_WORKER;
47206   static constexpr auto CHROME_THREAD_MEMORY_INFRA = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_MEMORY_INFRA;
47207   static constexpr auto CHROME_THREAD_SAMPLING_PROFILER = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_SAMPLING_PROFILER;
47208   static constexpr auto ChromeThreadType_MIN = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_UNSPECIFIED;
47209   static constexpr auto ChromeThreadType_MAX = ThreadDescriptor_ChromeThreadType_CHROME_THREAD_SAMPLING_PROFILER;
47210   enum FieldNumbers {
47211     kPidFieldNumber = 1,
47212     kTidFieldNumber = 2,
47213     kThreadNameFieldNumber = 5,
47214     kChromeThreadTypeFieldNumber = 4,
47215     kReferenceTimestampUsFieldNumber = 6,
47216     kReferenceThreadTimeUsFieldNumber = 7,
47217     kReferenceThreadInstructionCountFieldNumber = 8,
47218     kLegacySortIndexFieldNumber = 3,
47219   };
47220 
47221   ThreadDescriptor();
47222   ~ThreadDescriptor() override;
47223   ThreadDescriptor(ThreadDescriptor&&) noexcept;
47224   ThreadDescriptor& operator=(ThreadDescriptor&&);
47225   ThreadDescriptor(const ThreadDescriptor&);
47226   ThreadDescriptor& operator=(const ThreadDescriptor&);
47227   bool operator==(const ThreadDescriptor&) const;
47228   bool operator!=(const ThreadDescriptor& other) const { return !(*this == other); }
47229 
47230   bool ParseFromArray(const void*, size_t) override;
47231   std::string SerializeAsString() const override;
47232   std::vector<uint8_t> SerializeAsArray() const override;
47233   void Serialize(::protozero::Message*) const;
47234 
47235   bool has_pid() const { return _has_field_[1]; }
47236   int32_t pid() const { return pid_; }
47237   void set_pid(int32_t value) { pid_ = value; _has_field_.set(1); }
47238 
47239   bool has_tid() const { return _has_field_[2]; }
47240   int32_t tid() const { return tid_; }
47241   void set_tid(int32_t value) { tid_ = value; _has_field_.set(2); }
47242 
47243   bool has_thread_name() const { return _has_field_[5]; }
47244   const std::string& thread_name() const { return thread_name_; }
47245   void set_thread_name(const std::string& value) { thread_name_ = value; _has_field_.set(5); }
47246 
47247   bool has_chrome_thread_type() const { return _has_field_[4]; }
47248   ThreadDescriptor_ChromeThreadType chrome_thread_type() const { return chrome_thread_type_; }
47249   void set_chrome_thread_type(ThreadDescriptor_ChromeThreadType value) { chrome_thread_type_ = value; _has_field_.set(4); }
47250 
47251   bool has_reference_timestamp_us() const { return _has_field_[6]; }
47252   int64_t reference_timestamp_us() const { return reference_timestamp_us_; }
47253   void set_reference_timestamp_us(int64_t value) { reference_timestamp_us_ = value; _has_field_.set(6); }
47254 
47255   bool has_reference_thread_time_us() const { return _has_field_[7]; }
47256   int64_t reference_thread_time_us() const { return reference_thread_time_us_; }
47257   void set_reference_thread_time_us(int64_t value) { reference_thread_time_us_ = value; _has_field_.set(7); }
47258 
47259   bool has_reference_thread_instruction_count() const { return _has_field_[8]; }
47260   int64_t reference_thread_instruction_count() const { return reference_thread_instruction_count_; }
47261   void set_reference_thread_instruction_count(int64_t value) { reference_thread_instruction_count_ = value; _has_field_.set(8); }
47262 
47263   bool has_legacy_sort_index() const { return _has_field_[3]; }
47264   int32_t legacy_sort_index() const { return legacy_sort_index_; }
47265   void set_legacy_sort_index(int32_t value) { legacy_sort_index_ = value; _has_field_.set(3); }
47266 
47267  private:
47268   int32_t pid_{};
47269   int32_t tid_{};
47270   std::string thread_name_{};
47271   ThreadDescriptor_ChromeThreadType chrome_thread_type_{};
47272   int64_t reference_timestamp_us_{};
47273   int64_t reference_thread_time_us_{};
47274   int64_t reference_thread_instruction_count_{};
47275   int32_t legacy_sort_index_{};
47276 
47277   // Allows to preserve unknown protobuf fields for compatibility
47278   // with future versions of .proto files.
47279   std::string unknown_fields_;
47280 
47281   std::bitset<9> _has_field_{};
47282 };
47283 
47284 }  // namespace perfetto
47285 }  // namespace protos
47286 }  // namespace gen
47287 
47288 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_THREAD_DESCRIPTOR_PROTO_CPP_H_
47289 // gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/track_descriptor.gen.h
47290 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
47291 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TRACK_DESCRIPTOR_PROTO_CPP_H_
47292 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TRACK_DESCRIPTOR_PROTO_CPP_H_
47293 
47294 #include <stdint.h>
47295 #include <bitset>
47296 #include <vector>
47297 #include <string>
47298 #include <type_traits>
47299 
47300 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
47301 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
47302 // gen_amalgamated expanded: #include "perfetto/base/export.h"
47303 
47304 namespace perfetto {
47305 namespace protos {
47306 namespace gen {
47307 class TrackDescriptor;
47308 class CounterDescriptor;
47309 class ChromeThreadDescriptor;
47310 class ThreadDescriptor;
47311 class ChromeProcessDescriptor;
47312 class ProcessDescriptor;
47313 enum CounterDescriptor_BuiltinCounterType : int;
47314 enum CounterDescriptor_Unit : int;
47315 enum ChromeThreadDescriptor_ThreadType : int;
47316 enum ThreadDescriptor_ChromeThreadType : int;
47317 enum ChromeProcessDescriptor_ProcessType : int;
47318 enum ProcessDescriptor_ChromeProcessType : int;
47319 }  // namespace perfetto
47320 }  // namespace protos
47321 }  // namespace gen
47322 
47323 namespace protozero {
47324 class Message;
47325 }  // namespace protozero
47326 
47327 namespace perfetto {
47328 namespace protos {
47329 namespace gen {
47330 
47331 class PERFETTO_EXPORT TrackDescriptor : public ::protozero::CppMessageObj {
47332  public:
47333   enum FieldNumbers {
47334     kUuidFieldNumber = 1,
47335     kParentUuidFieldNumber = 5,
47336     kNameFieldNumber = 2,
47337     kProcessFieldNumber = 3,
47338     kChromeProcessFieldNumber = 6,
47339     kThreadFieldNumber = 4,
47340     kChromeThreadFieldNumber = 7,
47341     kCounterFieldNumber = 8,
47342   };
47343 
47344   TrackDescriptor();
47345   ~TrackDescriptor() override;
47346   TrackDescriptor(TrackDescriptor&&) noexcept;
47347   TrackDescriptor& operator=(TrackDescriptor&&);
47348   TrackDescriptor(const TrackDescriptor&);
47349   TrackDescriptor& operator=(const TrackDescriptor&);
47350   bool operator==(const TrackDescriptor&) const;
47351   bool operator!=(const TrackDescriptor& other) const { return !(*this == other); }
47352 
47353   bool ParseFromArray(const void*, size_t) override;
47354   std::string SerializeAsString() const override;
47355   std::vector<uint8_t> SerializeAsArray() const override;
47356   void Serialize(::protozero::Message*) const;
47357 
47358   bool has_uuid() const { return _has_field_[1]; }
47359   uint64_t uuid() const { return uuid_; }
47360   void set_uuid(uint64_t value) { uuid_ = value; _has_field_.set(1); }
47361 
47362   bool has_parent_uuid() const { return _has_field_[5]; }
47363   uint64_t parent_uuid() const { return parent_uuid_; }
47364   void set_parent_uuid(uint64_t value) { parent_uuid_ = value; _has_field_.set(5); }
47365 
47366   bool has_name() const { return _has_field_[2]; }
47367   const std::string& name() const { return name_; }
47368   void set_name(const std::string& value) { name_ = value; _has_field_.set(2); }
47369 
47370   bool has_process() const { return _has_field_[3]; }
47371   const ProcessDescriptor& process() const { return *process_; }
47372   ProcessDescriptor* mutable_process() { _has_field_.set(3); return process_.get(); }
47373 
47374   bool has_chrome_process() const { return _has_field_[6]; }
47375   const ChromeProcessDescriptor& chrome_process() const { return *chrome_process_; }
47376   ChromeProcessDescriptor* mutable_chrome_process() { _has_field_.set(6); return chrome_process_.get(); }
47377 
47378   bool has_thread() const { return _has_field_[4]; }
47379   const ThreadDescriptor& thread() const { return *thread_; }
47380   ThreadDescriptor* mutable_thread() { _has_field_.set(4); return thread_.get(); }
47381 
47382   bool has_chrome_thread() const { return _has_field_[7]; }
47383   const ChromeThreadDescriptor& chrome_thread() const { return *chrome_thread_; }
47384   ChromeThreadDescriptor* mutable_chrome_thread() { _has_field_.set(7); return chrome_thread_.get(); }
47385 
47386   bool has_counter() const { return _has_field_[8]; }
47387   const CounterDescriptor& counter() const { return *counter_; }
47388   CounterDescriptor* mutable_counter() { _has_field_.set(8); return counter_.get(); }
47389 
47390  private:
47391   uint64_t uuid_{};
47392   uint64_t parent_uuid_{};
47393   std::string name_{};
47394   ::protozero::CopyablePtr<ProcessDescriptor> process_;
47395   ::protozero::CopyablePtr<ChromeProcessDescriptor> chrome_process_;
47396   ::protozero::CopyablePtr<ThreadDescriptor> thread_;
47397   ::protozero::CopyablePtr<ChromeThreadDescriptor> chrome_thread_;
47398   ::protozero::CopyablePtr<CounterDescriptor> counter_;
47399 
47400   // Allows to preserve unknown protobuf fields for compatibility
47401   // with future versions of .proto files.
47402   std::string unknown_fields_;
47403 
47404   std::bitset<9> _has_field_{};
47405 };
47406 
47407 }  // namespace perfetto
47408 }  // namespace protos
47409 }  // namespace gen
47410 
47411 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TRACK_DESCRIPTOR_PROTO_CPP_H_
47412 // gen_amalgamated begin header: gen/protos/perfetto/trace/track_event/track_event.gen.h
47413 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
47414 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TRACK_EVENT_PROTO_CPP_H_
47415 #define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TRACK_EVENT_PROTO_CPP_H_
47416 
47417 #include <stdint.h>
47418 #include <bitset>
47419 #include <vector>
47420 #include <string>
47421 #include <type_traits>
47422 
47423 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
47424 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
47425 // gen_amalgamated expanded: #include "perfetto/base/export.h"
47426 
47427 namespace perfetto {
47428 namespace protos {
47429 namespace gen {
47430 class EventName;
47431 class EventCategory;
47432 class TrackEventDefaults;
47433 class TrackEvent;
47434 class TrackEvent_LegacyEvent;
47435 class ChromeFrameReporter;
47436 class ChromeLatencyInfo;
47437 class ChromeLatencyInfo_ComponentInfo;
47438 class ChromeHistogramSample;
47439 class ChromeLegacyIpc;
47440 class ChromeKeyedService;
47441 class ChromeUserEvent;
47442 class ChromeCompositorSchedulerState;
47443 class CompositorTimingHistory;
47444 class BeginFrameSourceState;
47445 class BeginFrameArgs;
47446 class SourceLocation;
47447 class BeginFrameObserverState;
47448 class BeginImplFrameArgs;
47449 class BeginImplFrameArgs_TimestampsInUs;
47450 class ChromeCompositorStateMachine;
47451 class ChromeCompositorStateMachine_MinorState;
47452 class ChromeCompositorStateMachine_MajorState;
47453 class LogMessage;
47454 class TaskExecution;
47455 class DebugAnnotation;
47456 class DebugAnnotation_NestedValue;
47457 enum TrackEvent_Type : int;
47458 enum TrackEvent_LegacyEvent_FlowDirection : int;
47459 enum TrackEvent_LegacyEvent_InstantEventScope : int;
47460 enum ChromeFrameReporter_State : int;
47461 enum ChromeFrameReporter_FrameDropReason : int;
47462 enum ChromeLatencyInfo_Step : int;
47463 enum ChromeLatencyInfo_LatencyComponentType : int;
47464 enum ChromeLegacyIpc_MessageClass : int;
47465 enum ChromeCompositorSchedulerState_BeginImplFrameDeadlineMode : int;
47466 enum ChromeCompositorSchedulerAction : int;
47467 enum BeginFrameArgs_BeginFrameArgsType : int;
47468 enum BeginImplFrameArgs_State : int;
47469 enum ChromeCompositorStateMachine_MinorState_TreePriority : int;
47470 enum ChromeCompositorStateMachine_MinorState_ScrollHandlerState : int;
47471 enum ChromeCompositorStateMachine_MajorState_BeginImplFrameState : int;
47472 enum ChromeCompositorStateMachine_MajorState_BeginMainFrameState : int;
47473 enum ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkState : int;
47474 enum ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutState : int;
47475 enum DebugAnnotation_NestedValue_NestedType : int;
47476 }  // namespace perfetto
47477 }  // namespace protos
47478 }  // namespace gen
47479 
47480 namespace protozero {
47481 class Message;
47482 }  // namespace protozero
47483 
47484 namespace perfetto {
47485 namespace protos {
47486 namespace gen {
47487 enum TrackEvent_Type : int {
47488   TrackEvent_Type_TYPE_UNSPECIFIED = 0,
47489   TrackEvent_Type_TYPE_SLICE_BEGIN = 1,
47490   TrackEvent_Type_TYPE_SLICE_END = 2,
47491   TrackEvent_Type_TYPE_INSTANT = 3,
47492   TrackEvent_Type_TYPE_COUNTER = 4,
47493 };
47494 enum TrackEvent_LegacyEvent_FlowDirection : int {
47495   TrackEvent_LegacyEvent_FlowDirection_FLOW_UNSPECIFIED = 0,
47496   TrackEvent_LegacyEvent_FlowDirection_FLOW_IN = 1,
47497   TrackEvent_LegacyEvent_FlowDirection_FLOW_OUT = 2,
47498   TrackEvent_LegacyEvent_FlowDirection_FLOW_INOUT = 3,
47499 };
47500 enum TrackEvent_LegacyEvent_InstantEventScope : int {
47501   TrackEvent_LegacyEvent_InstantEventScope_SCOPE_UNSPECIFIED = 0,
47502   TrackEvent_LegacyEvent_InstantEventScope_SCOPE_GLOBAL = 1,
47503   TrackEvent_LegacyEvent_InstantEventScope_SCOPE_PROCESS = 2,
47504   TrackEvent_LegacyEvent_InstantEventScope_SCOPE_THREAD = 3,
47505 };
47506 
47507 class PERFETTO_EXPORT EventName : public ::protozero::CppMessageObj {
47508  public:
47509   enum FieldNumbers {
47510     kIidFieldNumber = 1,
47511     kNameFieldNumber = 2,
47512   };
47513 
47514   EventName();
47515   ~EventName() override;
47516   EventName(EventName&&) noexcept;
47517   EventName& operator=(EventName&&);
47518   EventName(const EventName&);
47519   EventName& operator=(const EventName&);
47520   bool operator==(const EventName&) const;
47521   bool operator!=(const EventName& other) const { return !(*this == other); }
47522 
47523   bool ParseFromArray(const void*, size_t) override;
47524   std::string SerializeAsString() const override;
47525   std::vector<uint8_t> SerializeAsArray() const override;
47526   void Serialize(::protozero::Message*) const;
47527 
47528   bool has_iid() const { return _has_field_[1]; }
47529   uint64_t iid() const { return iid_; }
47530   void set_iid(uint64_t value) { iid_ = value; _has_field_.set(1); }
47531 
47532   bool has_name() const { return _has_field_[2]; }
47533   const std::string& name() const { return name_; }
47534   void set_name(const std::string& value) { name_ = value; _has_field_.set(2); }
47535 
47536  private:
47537   uint64_t iid_{};
47538   std::string name_{};
47539 
47540   // Allows to preserve unknown protobuf fields for compatibility
47541   // with future versions of .proto files.
47542   std::string unknown_fields_;
47543 
47544   std::bitset<3> _has_field_{};
47545 };
47546 
47547 
47548 class PERFETTO_EXPORT EventCategory : public ::protozero::CppMessageObj {
47549  public:
47550   enum FieldNumbers {
47551     kIidFieldNumber = 1,
47552     kNameFieldNumber = 2,
47553   };
47554 
47555   EventCategory();
47556   ~EventCategory() override;
47557   EventCategory(EventCategory&&) noexcept;
47558   EventCategory& operator=(EventCategory&&);
47559   EventCategory(const EventCategory&);
47560   EventCategory& operator=(const EventCategory&);
47561   bool operator==(const EventCategory&) const;
47562   bool operator!=(const EventCategory& other) const { return !(*this == other); }
47563 
47564   bool ParseFromArray(const void*, size_t) override;
47565   std::string SerializeAsString() const override;
47566   std::vector<uint8_t> SerializeAsArray() const override;
47567   void Serialize(::protozero::Message*) const;
47568 
47569   bool has_iid() const { return _has_field_[1]; }
47570   uint64_t iid() const { return iid_; }
47571   void set_iid(uint64_t value) { iid_ = value; _has_field_.set(1); }
47572 
47573   bool has_name() const { return _has_field_[2]; }
47574   const std::string& name() const { return name_; }
47575   void set_name(const std::string& value) { name_ = value; _has_field_.set(2); }
47576 
47577  private:
47578   uint64_t iid_{};
47579   std::string name_{};
47580 
47581   // Allows to preserve unknown protobuf fields for compatibility
47582   // with future versions of .proto files.
47583   std::string unknown_fields_;
47584 
47585   std::bitset<3> _has_field_{};
47586 };
47587 
47588 
47589 class PERFETTO_EXPORT TrackEventDefaults : public ::protozero::CppMessageObj {
47590  public:
47591   enum FieldNumbers {
47592     kTrackUuidFieldNumber = 11,
47593     kExtraCounterTrackUuidsFieldNumber = 31,
47594   };
47595 
47596   TrackEventDefaults();
47597   ~TrackEventDefaults() override;
47598   TrackEventDefaults(TrackEventDefaults&&) noexcept;
47599   TrackEventDefaults& operator=(TrackEventDefaults&&);
47600   TrackEventDefaults(const TrackEventDefaults&);
47601   TrackEventDefaults& operator=(const TrackEventDefaults&);
47602   bool operator==(const TrackEventDefaults&) const;
47603   bool operator!=(const TrackEventDefaults& other) const { return !(*this == other); }
47604 
47605   bool ParseFromArray(const void*, size_t) override;
47606   std::string SerializeAsString() const override;
47607   std::vector<uint8_t> SerializeAsArray() const override;
47608   void Serialize(::protozero::Message*) const;
47609 
47610   bool has_track_uuid() const { return _has_field_[11]; }
47611   uint64_t track_uuid() const { return track_uuid_; }
47612   void set_track_uuid(uint64_t value) { track_uuid_ = value; _has_field_.set(11); }
47613 
47614   int extra_counter_track_uuids_size() const { return static_cast<int>(extra_counter_track_uuids_.size()); }
47615   const std::vector<uint64_t>& extra_counter_track_uuids() const { return extra_counter_track_uuids_; }
47616   std::vector<uint64_t>* mutable_extra_counter_track_uuids() { return &extra_counter_track_uuids_; }
47617   void clear_extra_counter_track_uuids() { extra_counter_track_uuids_.clear(); }
47618   void add_extra_counter_track_uuids(uint64_t value) { extra_counter_track_uuids_.emplace_back(value); }
47619   uint64_t* add_extra_counter_track_uuids() { extra_counter_track_uuids_.emplace_back(); return &extra_counter_track_uuids_.back(); }
47620 
47621  private:
47622   uint64_t track_uuid_{};
47623   std::vector<uint64_t> extra_counter_track_uuids_;
47624 
47625   // Allows to preserve unknown protobuf fields for compatibility
47626   // with future versions of .proto files.
47627   std::string unknown_fields_;
47628 
47629   std::bitset<32> _has_field_{};
47630 };
47631 
47632 
47633 class PERFETTO_EXPORT TrackEvent : public ::protozero::CppMessageObj {
47634  public:
47635   using LegacyEvent = TrackEvent_LegacyEvent;
47636   using Type = TrackEvent_Type;
47637   static constexpr auto TYPE_UNSPECIFIED = TrackEvent_Type_TYPE_UNSPECIFIED;
47638   static constexpr auto TYPE_SLICE_BEGIN = TrackEvent_Type_TYPE_SLICE_BEGIN;
47639   static constexpr auto TYPE_SLICE_END = TrackEvent_Type_TYPE_SLICE_END;
47640   static constexpr auto TYPE_INSTANT = TrackEvent_Type_TYPE_INSTANT;
47641   static constexpr auto TYPE_COUNTER = TrackEvent_Type_TYPE_COUNTER;
47642   static constexpr auto Type_MIN = TrackEvent_Type_TYPE_UNSPECIFIED;
47643   static constexpr auto Type_MAX = TrackEvent_Type_TYPE_COUNTER;
47644   enum FieldNumbers {
47645     kCategoryIidsFieldNumber = 3,
47646     kCategoriesFieldNumber = 22,
47647     kNameIidFieldNumber = 10,
47648     kNameFieldNumber = 23,
47649     kTypeFieldNumber = 9,
47650     kTrackUuidFieldNumber = 11,
47651     kCounterValueFieldNumber = 30,
47652     kExtraCounterTrackUuidsFieldNumber = 31,
47653     kExtraCounterValuesFieldNumber = 12,
47654     kDebugAnnotationsFieldNumber = 4,
47655     kTaskExecutionFieldNumber = 5,
47656     kLogMessageFieldNumber = 21,
47657     kCcSchedulerStateFieldNumber = 24,
47658     kChromeUserEventFieldNumber = 25,
47659     kChromeKeyedServiceFieldNumber = 26,
47660     kChromeLegacyIpcFieldNumber = 27,
47661     kChromeHistogramSampleFieldNumber = 28,
47662     kChromeLatencyInfoFieldNumber = 29,
47663     kChromeFrameReporterFieldNumber = 32,
47664     kTimestampDeltaUsFieldNumber = 1,
47665     kTimestampAbsoluteUsFieldNumber = 16,
47666     kThreadTimeDeltaUsFieldNumber = 2,
47667     kThreadTimeAbsoluteUsFieldNumber = 17,
47668     kThreadInstructionCountDeltaFieldNumber = 8,
47669     kThreadInstructionCountAbsoluteFieldNumber = 20,
47670     kLegacyEventFieldNumber = 6,
47671   };
47672 
47673   TrackEvent();
47674   ~TrackEvent() override;
47675   TrackEvent(TrackEvent&&) noexcept;
47676   TrackEvent& operator=(TrackEvent&&);
47677   TrackEvent(const TrackEvent&);
47678   TrackEvent& operator=(const TrackEvent&);
47679   bool operator==(const TrackEvent&) const;
47680   bool operator!=(const TrackEvent& other) const { return !(*this == other); }
47681 
47682   bool ParseFromArray(const void*, size_t) override;
47683   std::string SerializeAsString() const override;
47684   std::vector<uint8_t> SerializeAsArray() const override;
47685   void Serialize(::protozero::Message*) const;
47686 
47687   int category_iids_size() const { return static_cast<int>(category_iids_.size()); }
47688   const std::vector<uint64_t>& category_iids() const { return category_iids_; }
47689   std::vector<uint64_t>* mutable_category_iids() { return &category_iids_; }
47690   void clear_category_iids() { category_iids_.clear(); }
47691   void add_category_iids(uint64_t value) { category_iids_.emplace_back(value); }
47692   uint64_t* add_category_iids() { category_iids_.emplace_back(); return &category_iids_.back(); }
47693 
47694   int categories_size() const { return static_cast<int>(categories_.size()); }
47695   const std::vector<std::string>& categories() const { return categories_; }
47696   std::vector<std::string>* mutable_categories() { return &categories_; }
47697   void clear_categories() { categories_.clear(); }
47698   void add_categories(std::string value) { categories_.emplace_back(value); }
47699   std::string* add_categories() { categories_.emplace_back(); return &categories_.back(); }
47700 
47701   bool has_name_iid() const { return _has_field_[10]; }
47702   uint64_t name_iid() const { return name_iid_; }
47703   void set_name_iid(uint64_t value) { name_iid_ = value; _has_field_.set(10); }
47704 
47705   bool has_name() const { return _has_field_[23]; }
47706   const std::string& name() const { return name_; }
47707   void set_name(const std::string& value) { name_ = value; _has_field_.set(23); }
47708 
47709   bool has_type() const { return _has_field_[9]; }
47710   TrackEvent_Type type() const { return type_; }
47711   void set_type(TrackEvent_Type value) { type_ = value; _has_field_.set(9); }
47712 
47713   bool has_track_uuid() const { return _has_field_[11]; }
47714   uint64_t track_uuid() const { return track_uuid_; }
47715   void set_track_uuid(uint64_t value) { track_uuid_ = value; _has_field_.set(11); }
47716 
47717   bool has_counter_value() const { return _has_field_[30]; }
47718   int64_t counter_value() const { return counter_value_; }
47719   void set_counter_value(int64_t value) { counter_value_ = value; _has_field_.set(30); }
47720 
47721   int extra_counter_track_uuids_size() const { return static_cast<int>(extra_counter_track_uuids_.size()); }
47722   const std::vector<uint64_t>& extra_counter_track_uuids() const { return extra_counter_track_uuids_; }
47723   std::vector<uint64_t>* mutable_extra_counter_track_uuids() { return &extra_counter_track_uuids_; }
47724   void clear_extra_counter_track_uuids() { extra_counter_track_uuids_.clear(); }
47725   void add_extra_counter_track_uuids(uint64_t value) { extra_counter_track_uuids_.emplace_back(value); }
47726   uint64_t* add_extra_counter_track_uuids() { extra_counter_track_uuids_.emplace_back(); return &extra_counter_track_uuids_.back(); }
47727 
47728   int extra_counter_values_size() const { return static_cast<int>(extra_counter_values_.size()); }
47729   const std::vector<int64_t>& extra_counter_values() const { return extra_counter_values_; }
47730   std::vector<int64_t>* mutable_extra_counter_values() { return &extra_counter_values_; }
47731   void clear_extra_counter_values() { extra_counter_values_.clear(); }
47732   void add_extra_counter_values(int64_t value) { extra_counter_values_.emplace_back(value); }
47733   int64_t* add_extra_counter_values() { extra_counter_values_.emplace_back(); return &extra_counter_values_.back(); }
47734 
47735   int debug_annotations_size() const { return static_cast<int>(debug_annotations_.size()); }
47736   const std::vector<DebugAnnotation>& debug_annotations() const { return debug_annotations_; }
47737   std::vector<DebugAnnotation>* mutable_debug_annotations() { return &debug_annotations_; }
47738   void clear_debug_annotations() { debug_annotations_.clear(); }
47739   DebugAnnotation* add_debug_annotations() { debug_annotations_.emplace_back(); return &debug_annotations_.back(); }
47740 
47741   bool has_task_execution() const { return _has_field_[5]; }
47742   const TaskExecution& task_execution() const { return *task_execution_; }
47743   TaskExecution* mutable_task_execution() { _has_field_.set(5); return task_execution_.get(); }
47744 
47745   bool has_log_message() const { return _has_field_[21]; }
47746   const LogMessage& log_message() const { return *log_message_; }
47747   LogMessage* mutable_log_message() { _has_field_.set(21); return log_message_.get(); }
47748 
47749   bool has_cc_scheduler_state() const { return _has_field_[24]; }
47750   const ChromeCompositorSchedulerState& cc_scheduler_state() const { return *cc_scheduler_state_; }
47751   ChromeCompositorSchedulerState* mutable_cc_scheduler_state() { _has_field_.set(24); return cc_scheduler_state_.get(); }
47752 
47753   bool has_chrome_user_event() const { return _has_field_[25]; }
47754   const ChromeUserEvent& chrome_user_event() const { return *chrome_user_event_; }
47755   ChromeUserEvent* mutable_chrome_user_event() { _has_field_.set(25); return chrome_user_event_.get(); }
47756 
47757   bool has_chrome_keyed_service() const { return _has_field_[26]; }
47758   const ChromeKeyedService& chrome_keyed_service() const { return *chrome_keyed_service_; }
47759   ChromeKeyedService* mutable_chrome_keyed_service() { _has_field_.set(26); return chrome_keyed_service_.get(); }
47760 
47761   bool has_chrome_legacy_ipc() const { return _has_field_[27]; }
47762   const ChromeLegacyIpc& chrome_legacy_ipc() const { return *chrome_legacy_ipc_; }
47763   ChromeLegacyIpc* mutable_chrome_legacy_ipc() { _has_field_.set(27); return chrome_legacy_ipc_.get(); }
47764 
47765   bool has_chrome_histogram_sample() const { return _has_field_[28]; }
47766   const ChromeHistogramSample& chrome_histogram_sample() const { return *chrome_histogram_sample_; }
47767   ChromeHistogramSample* mutable_chrome_histogram_sample() { _has_field_.set(28); return chrome_histogram_sample_.get(); }
47768 
47769   bool has_chrome_latency_info() const { return _has_field_[29]; }
47770   const ChromeLatencyInfo& chrome_latency_info() const { return *chrome_latency_info_; }
47771   ChromeLatencyInfo* mutable_chrome_latency_info() { _has_field_.set(29); return chrome_latency_info_.get(); }
47772 
47773   bool has_chrome_frame_reporter() const { return _has_field_[32]; }
47774   const ChromeFrameReporter& chrome_frame_reporter() const { return *chrome_frame_reporter_; }
47775   ChromeFrameReporter* mutable_chrome_frame_reporter() { _has_field_.set(32); return chrome_frame_reporter_.get(); }
47776 
47777   bool has_timestamp_delta_us() const { return _has_field_[1]; }
47778   int64_t timestamp_delta_us() const { return timestamp_delta_us_; }
47779   void set_timestamp_delta_us(int64_t value) { timestamp_delta_us_ = value; _has_field_.set(1); }
47780 
47781   bool has_timestamp_absolute_us() const { return _has_field_[16]; }
47782   int64_t timestamp_absolute_us() const { return timestamp_absolute_us_; }
47783   void set_timestamp_absolute_us(int64_t value) { timestamp_absolute_us_ = value; _has_field_.set(16); }
47784 
47785   bool has_thread_time_delta_us() const { return _has_field_[2]; }
47786   int64_t thread_time_delta_us() const { return thread_time_delta_us_; }
47787   void set_thread_time_delta_us(int64_t value) { thread_time_delta_us_ = value; _has_field_.set(2); }
47788 
47789   bool has_thread_time_absolute_us() const { return _has_field_[17]; }
47790   int64_t thread_time_absolute_us() const { return thread_time_absolute_us_; }
47791   void set_thread_time_absolute_us(int64_t value) { thread_time_absolute_us_ = value; _has_field_.set(17); }
47792 
47793   bool has_thread_instruction_count_delta() const { return _has_field_[8]; }
47794   int64_t thread_instruction_count_delta() const { return thread_instruction_count_delta_; }
47795   void set_thread_instruction_count_delta(int64_t value) { thread_instruction_count_delta_ = value; _has_field_.set(8); }
47796 
47797   bool has_thread_instruction_count_absolute() const { return _has_field_[20]; }
47798   int64_t thread_instruction_count_absolute() const { return thread_instruction_count_absolute_; }
47799   void set_thread_instruction_count_absolute(int64_t value) { thread_instruction_count_absolute_ = value; _has_field_.set(20); }
47800 
47801   bool has_legacy_event() const { return _has_field_[6]; }
47802   const TrackEvent_LegacyEvent& legacy_event() const { return *legacy_event_; }
47803   TrackEvent_LegacyEvent* mutable_legacy_event() { _has_field_.set(6); return legacy_event_.get(); }
47804 
47805  private:
47806   std::vector<uint64_t> category_iids_;
47807   std::vector<std::string> categories_;
47808   uint64_t name_iid_{};
47809   std::string name_{};
47810   TrackEvent_Type type_{};
47811   uint64_t track_uuid_{};
47812   int64_t counter_value_{};
47813   std::vector<uint64_t> extra_counter_track_uuids_;
47814   std::vector<int64_t> extra_counter_values_;
47815   std::vector<DebugAnnotation> debug_annotations_;
47816   ::protozero::CopyablePtr<TaskExecution> task_execution_;
47817   ::protozero::CopyablePtr<LogMessage> log_message_;
47818   ::protozero::CopyablePtr<ChromeCompositorSchedulerState> cc_scheduler_state_;
47819   ::protozero::CopyablePtr<ChromeUserEvent> chrome_user_event_;
47820   ::protozero::CopyablePtr<ChromeKeyedService> chrome_keyed_service_;
47821   ::protozero::CopyablePtr<ChromeLegacyIpc> chrome_legacy_ipc_;
47822   ::protozero::CopyablePtr<ChromeHistogramSample> chrome_histogram_sample_;
47823   ::protozero::CopyablePtr<ChromeLatencyInfo> chrome_latency_info_;
47824   ::protozero::CopyablePtr<ChromeFrameReporter> chrome_frame_reporter_;
47825   int64_t timestamp_delta_us_{};
47826   int64_t timestamp_absolute_us_{};
47827   int64_t thread_time_delta_us_{};
47828   int64_t thread_time_absolute_us_{};
47829   int64_t thread_instruction_count_delta_{};
47830   int64_t thread_instruction_count_absolute_{};
47831   ::protozero::CopyablePtr<TrackEvent_LegacyEvent> legacy_event_;
47832 
47833   // Allows to preserve unknown protobuf fields for compatibility
47834   // with future versions of .proto files.
47835   std::string unknown_fields_;
47836 
47837   std::bitset<33> _has_field_{};
47838 };
47839 
47840 
47841 class PERFETTO_EXPORT TrackEvent_LegacyEvent : public ::protozero::CppMessageObj {
47842  public:
47843   using FlowDirection = TrackEvent_LegacyEvent_FlowDirection;
47844   static constexpr auto FLOW_UNSPECIFIED = TrackEvent_LegacyEvent_FlowDirection_FLOW_UNSPECIFIED;
47845   static constexpr auto FLOW_IN = TrackEvent_LegacyEvent_FlowDirection_FLOW_IN;
47846   static constexpr auto FLOW_OUT = TrackEvent_LegacyEvent_FlowDirection_FLOW_OUT;
47847   static constexpr auto FLOW_INOUT = TrackEvent_LegacyEvent_FlowDirection_FLOW_INOUT;
47848   static constexpr auto FlowDirection_MIN = TrackEvent_LegacyEvent_FlowDirection_FLOW_UNSPECIFIED;
47849   static constexpr auto FlowDirection_MAX = TrackEvent_LegacyEvent_FlowDirection_FLOW_INOUT;
47850   using InstantEventScope = TrackEvent_LegacyEvent_InstantEventScope;
47851   static constexpr auto SCOPE_UNSPECIFIED = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_UNSPECIFIED;
47852   static constexpr auto SCOPE_GLOBAL = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_GLOBAL;
47853   static constexpr auto SCOPE_PROCESS = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_PROCESS;
47854   static constexpr auto SCOPE_THREAD = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_THREAD;
47855   static constexpr auto InstantEventScope_MIN = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_UNSPECIFIED;
47856   static constexpr auto InstantEventScope_MAX = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_THREAD;
47857   enum FieldNumbers {
47858     kNameIidFieldNumber = 1,
47859     kPhaseFieldNumber = 2,
47860     kDurationUsFieldNumber = 3,
47861     kThreadDurationUsFieldNumber = 4,
47862     kThreadInstructionDeltaFieldNumber = 15,
47863     kUnscopedIdFieldNumber = 6,
47864     kLocalIdFieldNumber = 10,
47865     kGlobalIdFieldNumber = 11,
47866     kIdScopeFieldNumber = 7,
47867     kUseAsyncTtsFieldNumber = 9,
47868     kBindIdFieldNumber = 8,
47869     kBindToEnclosingFieldNumber = 12,
47870     kFlowDirectionFieldNumber = 13,
47871     kInstantEventScopeFieldNumber = 14,
47872     kPidOverrideFieldNumber = 18,
47873     kTidOverrideFieldNumber = 19,
47874   };
47875 
47876   TrackEvent_LegacyEvent();
47877   ~TrackEvent_LegacyEvent() override;
47878   TrackEvent_LegacyEvent(TrackEvent_LegacyEvent&&) noexcept;
47879   TrackEvent_LegacyEvent& operator=(TrackEvent_LegacyEvent&&);
47880   TrackEvent_LegacyEvent(const TrackEvent_LegacyEvent&);
47881   TrackEvent_LegacyEvent& operator=(const TrackEvent_LegacyEvent&);
47882   bool operator==(const TrackEvent_LegacyEvent&) const;
47883   bool operator!=(const TrackEvent_LegacyEvent& other) const { return !(*this == other); }
47884 
47885   bool ParseFromArray(const void*, size_t) override;
47886   std::string SerializeAsString() const override;
47887   std::vector<uint8_t> SerializeAsArray() const override;
47888   void Serialize(::protozero::Message*) const;
47889 
47890   bool has_name_iid() const { return _has_field_[1]; }
47891   uint64_t name_iid() const { return name_iid_; }
47892   void set_name_iid(uint64_t value) { name_iid_ = value; _has_field_.set(1); }
47893 
47894   bool has_phase() const { return _has_field_[2]; }
47895   int32_t phase() const { return phase_; }
47896   void set_phase(int32_t value) { phase_ = value; _has_field_.set(2); }
47897 
47898   bool has_duration_us() const { return _has_field_[3]; }
47899   int64_t duration_us() const { return duration_us_; }
47900   void set_duration_us(int64_t value) { duration_us_ = value; _has_field_.set(3); }
47901 
47902   bool has_thread_duration_us() const { return _has_field_[4]; }
47903   int64_t thread_duration_us() const { return thread_duration_us_; }
47904   void set_thread_duration_us(int64_t value) { thread_duration_us_ = value; _has_field_.set(4); }
47905 
47906   bool has_thread_instruction_delta() const { return _has_field_[15]; }
47907   int64_t thread_instruction_delta() const { return thread_instruction_delta_; }
47908   void set_thread_instruction_delta(int64_t value) { thread_instruction_delta_ = value; _has_field_.set(15); }
47909 
47910   bool has_unscoped_id() const { return _has_field_[6]; }
47911   uint64_t unscoped_id() const { return unscoped_id_; }
47912   void set_unscoped_id(uint64_t value) { unscoped_id_ = value; _has_field_.set(6); }
47913 
47914   bool has_local_id() const { return _has_field_[10]; }
47915   uint64_t local_id() const { return local_id_; }
47916   void set_local_id(uint64_t value) { local_id_ = value; _has_field_.set(10); }
47917 
47918   bool has_global_id() const { return _has_field_[11]; }
47919   uint64_t global_id() const { return global_id_; }
47920   void set_global_id(uint64_t value) { global_id_ = value; _has_field_.set(11); }
47921 
47922   bool has_id_scope() const { return _has_field_[7]; }
47923   const std::string& id_scope() const { return id_scope_; }
47924   void set_id_scope(const std::string& value) { id_scope_ = value; _has_field_.set(7); }
47925 
47926   bool has_use_async_tts() const { return _has_field_[9]; }
47927   bool use_async_tts() const { return use_async_tts_; }
47928   void set_use_async_tts(bool value) { use_async_tts_ = value; _has_field_.set(9); }
47929 
47930   bool has_bind_id() const { return _has_field_[8]; }
47931   uint64_t bind_id() const { return bind_id_; }
47932   void set_bind_id(uint64_t value) { bind_id_ = value; _has_field_.set(8); }
47933 
47934   bool has_bind_to_enclosing() const { return _has_field_[12]; }
47935   bool bind_to_enclosing() const { return bind_to_enclosing_; }
47936   void set_bind_to_enclosing(bool value) { bind_to_enclosing_ = value; _has_field_.set(12); }
47937 
47938   bool has_flow_direction() const { return _has_field_[13]; }
47939   TrackEvent_LegacyEvent_FlowDirection flow_direction() const { return flow_direction_; }
47940   void set_flow_direction(TrackEvent_LegacyEvent_FlowDirection value) { flow_direction_ = value; _has_field_.set(13); }
47941 
47942   bool has_instant_event_scope() const { return _has_field_[14]; }
47943   TrackEvent_LegacyEvent_InstantEventScope instant_event_scope() const { return instant_event_scope_; }
47944   void set_instant_event_scope(TrackEvent_LegacyEvent_InstantEventScope value) { instant_event_scope_ = value; _has_field_.set(14); }
47945 
47946   bool has_pid_override() const { return _has_field_[18]; }
47947   int32_t pid_override() const { return pid_override_; }
47948   void set_pid_override(int32_t value) { pid_override_ = value; _has_field_.set(18); }
47949 
47950   bool has_tid_override() const { return _has_field_[19]; }
47951   int32_t tid_override() const { return tid_override_; }
47952   void set_tid_override(int32_t value) { tid_override_ = value; _has_field_.set(19); }
47953 
47954  private:
47955   uint64_t name_iid_{};
47956   int32_t phase_{};
47957   int64_t duration_us_{};
47958   int64_t thread_duration_us_{};
47959   int64_t thread_instruction_delta_{};
47960   uint64_t unscoped_id_{};
47961   uint64_t local_id_{};
47962   uint64_t global_id_{};
47963   std::string id_scope_{};
47964   bool use_async_tts_{};
47965   uint64_t bind_id_{};
47966   bool bind_to_enclosing_{};
47967   TrackEvent_LegacyEvent_FlowDirection flow_direction_{};
47968   TrackEvent_LegacyEvent_InstantEventScope instant_event_scope_{};
47969   int32_t pid_override_{};
47970   int32_t tid_override_{};
47971 
47972   // Allows to preserve unknown protobuf fields for compatibility
47973   // with future versions of .proto files.
47974   std::string unknown_fields_;
47975 
47976   std::bitset<20> _has_field_{};
47977 };
47978 
47979 }  // namespace perfetto
47980 }  // namespace protos
47981 }  // namespace gen
47982 
47983 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACK_EVENT_TRACK_EVENT_PROTO_CPP_H_
47984 // gen_amalgamated begin header: gen/protos/perfetto/config/android/android_log_config.gen.h
47985 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
47986 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_ANDROID_ANDROID_LOG_CONFIG_PROTO_CPP_H_
47987 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_ANDROID_ANDROID_LOG_CONFIG_PROTO_CPP_H_
47988 
47989 #include <stdint.h>
47990 #include <bitset>
47991 #include <vector>
47992 #include <string>
47993 #include <type_traits>
47994 
47995 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
47996 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
47997 // gen_amalgamated expanded: #include "perfetto/base/export.h"
47998 
47999 namespace perfetto {
48000 namespace protos {
48001 namespace gen {
48002 class AndroidLogConfig;
48003 enum AndroidLogId : int;
48004 enum AndroidLogPriority : int;
48005 }  // namespace perfetto
48006 }  // namespace protos
48007 }  // namespace gen
48008 
48009 namespace protozero {
48010 class Message;
48011 }  // namespace protozero
48012 
48013 namespace perfetto {
48014 namespace protos {
48015 namespace gen {
48016 
48017 class PERFETTO_EXPORT AndroidLogConfig : public ::protozero::CppMessageObj {
48018  public:
48019   enum FieldNumbers {
48020     kLogIdsFieldNumber = 1,
48021     kMinPrioFieldNumber = 3,
48022     kFilterTagsFieldNumber = 4,
48023   };
48024 
48025   AndroidLogConfig();
48026   ~AndroidLogConfig() override;
48027   AndroidLogConfig(AndroidLogConfig&&) noexcept;
48028   AndroidLogConfig& operator=(AndroidLogConfig&&);
48029   AndroidLogConfig(const AndroidLogConfig&);
48030   AndroidLogConfig& operator=(const AndroidLogConfig&);
48031   bool operator==(const AndroidLogConfig&) const;
48032   bool operator!=(const AndroidLogConfig& other) const { return !(*this == other); }
48033 
48034   bool ParseFromArray(const void*, size_t) override;
48035   std::string SerializeAsString() const override;
48036   std::vector<uint8_t> SerializeAsArray() const override;
48037   void Serialize(::protozero::Message*) const;
48038 
48039   int log_ids_size() const { return static_cast<int>(log_ids_.size()); }
48040   const std::vector<AndroidLogId>& log_ids() const { return log_ids_; }
48041   std::vector<AndroidLogId>* mutable_log_ids() { return &log_ids_; }
48042   void clear_log_ids() { log_ids_.clear(); }
48043   void add_log_ids(AndroidLogId value) { log_ids_.emplace_back(value); }
48044   AndroidLogId* add_log_ids() { log_ids_.emplace_back(); return &log_ids_.back(); }
48045 
48046   bool has_min_prio() const { return _has_field_[3]; }
48047   AndroidLogPriority min_prio() const { return min_prio_; }
48048   void set_min_prio(AndroidLogPriority value) { min_prio_ = value; _has_field_.set(3); }
48049 
48050   int filter_tags_size() const { return static_cast<int>(filter_tags_.size()); }
48051   const std::vector<std::string>& filter_tags() const { return filter_tags_; }
48052   std::vector<std::string>* mutable_filter_tags() { return &filter_tags_; }
48053   void clear_filter_tags() { filter_tags_.clear(); }
48054   void add_filter_tags(std::string value) { filter_tags_.emplace_back(value); }
48055   std::string* add_filter_tags() { filter_tags_.emplace_back(); return &filter_tags_.back(); }
48056 
48057  private:
48058   std::vector<AndroidLogId> log_ids_;
48059   AndroidLogPriority min_prio_{};
48060   std::vector<std::string> filter_tags_;
48061 
48062   // Allows to preserve unknown protobuf fields for compatibility
48063   // with future versions of .proto files.
48064   std::string unknown_fields_;
48065 
48066   std::bitset<5> _has_field_{};
48067 };
48068 
48069 }  // namespace perfetto
48070 }  // namespace protos
48071 }  // namespace gen
48072 
48073 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_ANDROID_ANDROID_LOG_CONFIG_PROTO_CPP_H_
48074 // gen_amalgamated begin header: gen/protos/perfetto/config/android/android_polled_state_config.gen.h
48075 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
48076 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_ANDROID_ANDROID_POLLED_STATE_CONFIG_PROTO_CPP_H_
48077 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_ANDROID_ANDROID_POLLED_STATE_CONFIG_PROTO_CPP_H_
48078 
48079 #include <stdint.h>
48080 #include <bitset>
48081 #include <vector>
48082 #include <string>
48083 #include <type_traits>
48084 
48085 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
48086 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
48087 // gen_amalgamated expanded: #include "perfetto/base/export.h"
48088 
48089 namespace perfetto {
48090 namespace protos {
48091 namespace gen {
48092 class AndroidPolledStateConfig;
48093 }  // namespace perfetto
48094 }  // namespace protos
48095 }  // namespace gen
48096 
48097 namespace protozero {
48098 class Message;
48099 }  // namespace protozero
48100 
48101 namespace perfetto {
48102 namespace protos {
48103 namespace gen {
48104 
48105 class PERFETTO_EXPORT AndroidPolledStateConfig : public ::protozero::CppMessageObj {
48106  public:
48107   enum FieldNumbers {
48108     kPollMsFieldNumber = 1,
48109   };
48110 
48111   AndroidPolledStateConfig();
48112   ~AndroidPolledStateConfig() override;
48113   AndroidPolledStateConfig(AndroidPolledStateConfig&&) noexcept;
48114   AndroidPolledStateConfig& operator=(AndroidPolledStateConfig&&);
48115   AndroidPolledStateConfig(const AndroidPolledStateConfig&);
48116   AndroidPolledStateConfig& operator=(const AndroidPolledStateConfig&);
48117   bool operator==(const AndroidPolledStateConfig&) const;
48118   bool operator!=(const AndroidPolledStateConfig& other) const { return !(*this == other); }
48119 
48120   bool ParseFromArray(const void*, size_t) override;
48121   std::string SerializeAsString() const override;
48122   std::vector<uint8_t> SerializeAsArray() const override;
48123   void Serialize(::protozero::Message*) const;
48124 
48125   bool has_poll_ms() const { return _has_field_[1]; }
48126   uint32_t poll_ms() const { return poll_ms_; }
48127   void set_poll_ms(uint32_t value) { poll_ms_ = value; _has_field_.set(1); }
48128 
48129  private:
48130   uint32_t poll_ms_{};
48131 
48132   // Allows to preserve unknown protobuf fields for compatibility
48133   // with future versions of .proto files.
48134   std::string unknown_fields_;
48135 
48136   std::bitset<2> _has_field_{};
48137 };
48138 
48139 }  // namespace perfetto
48140 }  // namespace protos
48141 }  // namespace gen
48142 
48143 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_ANDROID_ANDROID_POLLED_STATE_CONFIG_PROTO_CPP_H_
48144 // gen_amalgamated begin header: gen/protos/perfetto/config/android/packages_list_config.gen.h
48145 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
48146 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_ANDROID_PACKAGES_LIST_CONFIG_PROTO_CPP_H_
48147 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_ANDROID_PACKAGES_LIST_CONFIG_PROTO_CPP_H_
48148 
48149 #include <stdint.h>
48150 #include <bitset>
48151 #include <vector>
48152 #include <string>
48153 #include <type_traits>
48154 
48155 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
48156 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
48157 // gen_amalgamated expanded: #include "perfetto/base/export.h"
48158 
48159 namespace perfetto {
48160 namespace protos {
48161 namespace gen {
48162 class PackagesListConfig;
48163 }  // namespace perfetto
48164 }  // namespace protos
48165 }  // namespace gen
48166 
48167 namespace protozero {
48168 class Message;
48169 }  // namespace protozero
48170 
48171 namespace perfetto {
48172 namespace protos {
48173 namespace gen {
48174 
48175 class PERFETTO_EXPORT PackagesListConfig : public ::protozero::CppMessageObj {
48176  public:
48177   enum FieldNumbers {
48178     kPackageNameFilterFieldNumber = 1,
48179   };
48180 
48181   PackagesListConfig();
48182   ~PackagesListConfig() override;
48183   PackagesListConfig(PackagesListConfig&&) noexcept;
48184   PackagesListConfig& operator=(PackagesListConfig&&);
48185   PackagesListConfig(const PackagesListConfig&);
48186   PackagesListConfig& operator=(const PackagesListConfig&);
48187   bool operator==(const PackagesListConfig&) const;
48188   bool operator!=(const PackagesListConfig& other) const { return !(*this == other); }
48189 
48190   bool ParseFromArray(const void*, size_t) override;
48191   std::string SerializeAsString() const override;
48192   std::vector<uint8_t> SerializeAsArray() const override;
48193   void Serialize(::protozero::Message*) const;
48194 
48195   int package_name_filter_size() const { return static_cast<int>(package_name_filter_.size()); }
48196   const std::vector<std::string>& package_name_filter() const { return package_name_filter_; }
48197   std::vector<std::string>* mutable_package_name_filter() { return &package_name_filter_; }
48198   void clear_package_name_filter() { package_name_filter_.clear(); }
48199   void add_package_name_filter(std::string value) { package_name_filter_.emplace_back(value); }
48200   std::string* add_package_name_filter() { package_name_filter_.emplace_back(); return &package_name_filter_.back(); }
48201 
48202  private:
48203   std::vector<std::string> package_name_filter_;
48204 
48205   // Allows to preserve unknown protobuf fields for compatibility
48206   // with future versions of .proto files.
48207   std::string unknown_fields_;
48208 
48209   std::bitset<2> _has_field_{};
48210 };
48211 
48212 }  // namespace perfetto
48213 }  // namespace protos
48214 }  // namespace gen
48215 
48216 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_ANDROID_PACKAGES_LIST_CONFIG_PROTO_CPP_H_
48217 // gen_amalgamated begin header: gen/protos/perfetto/config/ftrace/ftrace_config.gen.h
48218 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
48219 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_FTRACE_FTRACE_CONFIG_PROTO_CPP_H_
48220 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_FTRACE_FTRACE_CONFIG_PROTO_CPP_H_
48221 
48222 #include <stdint.h>
48223 #include <bitset>
48224 #include <vector>
48225 #include <string>
48226 #include <type_traits>
48227 
48228 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
48229 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
48230 // gen_amalgamated expanded: #include "perfetto/base/export.h"
48231 
48232 namespace perfetto {
48233 namespace protos {
48234 namespace gen {
48235 class FtraceConfig;
48236 class FtraceConfig_CompactSchedConfig;
48237 }  // namespace perfetto
48238 }  // namespace protos
48239 }  // namespace gen
48240 
48241 namespace protozero {
48242 class Message;
48243 }  // namespace protozero
48244 
48245 namespace perfetto {
48246 namespace protos {
48247 namespace gen {
48248 
48249 class PERFETTO_EXPORT FtraceConfig : public ::protozero::CppMessageObj {
48250  public:
48251   using CompactSchedConfig = FtraceConfig_CompactSchedConfig;
48252   enum FieldNumbers {
48253     kFtraceEventsFieldNumber = 1,
48254     kAtraceCategoriesFieldNumber = 2,
48255     kAtraceAppsFieldNumber = 3,
48256     kBufferSizeKbFieldNumber = 10,
48257     kDrainPeriodMsFieldNumber = 11,
48258     kCompactSchedFieldNumber = 12,
48259   };
48260 
48261   FtraceConfig();
48262   ~FtraceConfig() override;
48263   FtraceConfig(FtraceConfig&&) noexcept;
48264   FtraceConfig& operator=(FtraceConfig&&);
48265   FtraceConfig(const FtraceConfig&);
48266   FtraceConfig& operator=(const FtraceConfig&);
48267   bool operator==(const FtraceConfig&) const;
48268   bool operator!=(const FtraceConfig& other) const { return !(*this == other); }
48269 
48270   bool ParseFromArray(const void*, size_t) override;
48271   std::string SerializeAsString() const override;
48272   std::vector<uint8_t> SerializeAsArray() const override;
48273   void Serialize(::protozero::Message*) const;
48274 
48275   int ftrace_events_size() const { return static_cast<int>(ftrace_events_.size()); }
48276   const std::vector<std::string>& ftrace_events() const { return ftrace_events_; }
48277   std::vector<std::string>* mutable_ftrace_events() { return &ftrace_events_; }
48278   void clear_ftrace_events() { ftrace_events_.clear(); }
48279   void add_ftrace_events(std::string value) { ftrace_events_.emplace_back(value); }
48280   std::string* add_ftrace_events() { ftrace_events_.emplace_back(); return &ftrace_events_.back(); }
48281 
48282   int atrace_categories_size() const { return static_cast<int>(atrace_categories_.size()); }
48283   const std::vector<std::string>& atrace_categories() const { return atrace_categories_; }
48284   std::vector<std::string>* mutable_atrace_categories() { return &atrace_categories_; }
48285   void clear_atrace_categories() { atrace_categories_.clear(); }
48286   void add_atrace_categories(std::string value) { atrace_categories_.emplace_back(value); }
48287   std::string* add_atrace_categories() { atrace_categories_.emplace_back(); return &atrace_categories_.back(); }
48288 
48289   int atrace_apps_size() const { return static_cast<int>(atrace_apps_.size()); }
48290   const std::vector<std::string>& atrace_apps() const { return atrace_apps_; }
48291   std::vector<std::string>* mutable_atrace_apps() { return &atrace_apps_; }
48292   void clear_atrace_apps() { atrace_apps_.clear(); }
48293   void add_atrace_apps(std::string value) { atrace_apps_.emplace_back(value); }
48294   std::string* add_atrace_apps() { atrace_apps_.emplace_back(); return &atrace_apps_.back(); }
48295 
48296   bool has_buffer_size_kb() const { return _has_field_[10]; }
48297   uint32_t buffer_size_kb() const { return buffer_size_kb_; }
48298   void set_buffer_size_kb(uint32_t value) { buffer_size_kb_ = value; _has_field_.set(10); }
48299 
48300   bool has_drain_period_ms() const { return _has_field_[11]; }
48301   uint32_t drain_period_ms() const { return drain_period_ms_; }
48302   void set_drain_period_ms(uint32_t value) { drain_period_ms_ = value; _has_field_.set(11); }
48303 
48304   bool has_compact_sched() const { return _has_field_[12]; }
48305   const FtraceConfig_CompactSchedConfig& compact_sched() const { return *compact_sched_; }
48306   FtraceConfig_CompactSchedConfig* mutable_compact_sched() { _has_field_.set(12); return compact_sched_.get(); }
48307 
48308  private:
48309   std::vector<std::string> ftrace_events_;
48310   std::vector<std::string> atrace_categories_;
48311   std::vector<std::string> atrace_apps_;
48312   uint32_t buffer_size_kb_{};
48313   uint32_t drain_period_ms_{};
48314   ::protozero::CopyablePtr<FtraceConfig_CompactSchedConfig> compact_sched_;
48315 
48316   // Allows to preserve unknown protobuf fields for compatibility
48317   // with future versions of .proto files.
48318   std::string unknown_fields_;
48319 
48320   std::bitset<13> _has_field_{};
48321 };
48322 
48323 
48324 class PERFETTO_EXPORT FtraceConfig_CompactSchedConfig : public ::protozero::CppMessageObj {
48325  public:
48326   enum FieldNumbers {
48327     kEnabledFieldNumber = 1,
48328   };
48329 
48330   FtraceConfig_CompactSchedConfig();
48331   ~FtraceConfig_CompactSchedConfig() override;
48332   FtraceConfig_CompactSchedConfig(FtraceConfig_CompactSchedConfig&&) noexcept;
48333   FtraceConfig_CompactSchedConfig& operator=(FtraceConfig_CompactSchedConfig&&);
48334   FtraceConfig_CompactSchedConfig(const FtraceConfig_CompactSchedConfig&);
48335   FtraceConfig_CompactSchedConfig& operator=(const FtraceConfig_CompactSchedConfig&);
48336   bool operator==(const FtraceConfig_CompactSchedConfig&) const;
48337   bool operator!=(const FtraceConfig_CompactSchedConfig& other) const { return !(*this == other); }
48338 
48339   bool ParseFromArray(const void*, size_t) override;
48340   std::string SerializeAsString() const override;
48341   std::vector<uint8_t> SerializeAsArray() const override;
48342   void Serialize(::protozero::Message*) const;
48343 
48344   bool has_enabled() const { return _has_field_[1]; }
48345   bool enabled() const { return enabled_; }
48346   void set_enabled(bool value) { enabled_ = value; _has_field_.set(1); }
48347 
48348  private:
48349   bool enabled_{};
48350 
48351   // Allows to preserve unknown protobuf fields for compatibility
48352   // with future versions of .proto files.
48353   std::string unknown_fields_;
48354 
48355   std::bitset<2> _has_field_{};
48356 };
48357 
48358 }  // namespace perfetto
48359 }  // namespace protos
48360 }  // namespace gen
48361 
48362 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_FTRACE_FTRACE_CONFIG_PROTO_CPP_H_
48363 // gen_amalgamated begin header: gen/protos/perfetto/config/gpu/gpu_counter_config.gen.h
48364 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
48365 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_GPU_GPU_COUNTER_CONFIG_PROTO_CPP_H_
48366 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_GPU_GPU_COUNTER_CONFIG_PROTO_CPP_H_
48367 
48368 #include <stdint.h>
48369 #include <bitset>
48370 #include <vector>
48371 #include <string>
48372 #include <type_traits>
48373 
48374 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
48375 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
48376 // gen_amalgamated expanded: #include "perfetto/base/export.h"
48377 
48378 namespace perfetto {
48379 namespace protos {
48380 namespace gen {
48381 class GpuCounterConfig;
48382 }  // namespace perfetto
48383 }  // namespace protos
48384 }  // namespace gen
48385 
48386 namespace protozero {
48387 class Message;
48388 }  // namespace protozero
48389 
48390 namespace perfetto {
48391 namespace protos {
48392 namespace gen {
48393 
48394 class PERFETTO_EXPORT GpuCounterConfig : public ::protozero::CppMessageObj {
48395  public:
48396   enum FieldNumbers {
48397     kCounterPeriodNsFieldNumber = 1,
48398     kCounterIdsFieldNumber = 2,
48399     kInstrumentedSamplingFieldNumber = 3,
48400     kFixGpuClockFieldNumber = 4,
48401   };
48402 
48403   GpuCounterConfig();
48404   ~GpuCounterConfig() override;
48405   GpuCounterConfig(GpuCounterConfig&&) noexcept;
48406   GpuCounterConfig& operator=(GpuCounterConfig&&);
48407   GpuCounterConfig(const GpuCounterConfig&);
48408   GpuCounterConfig& operator=(const GpuCounterConfig&);
48409   bool operator==(const GpuCounterConfig&) const;
48410   bool operator!=(const GpuCounterConfig& other) const { return !(*this == other); }
48411 
48412   bool ParseFromArray(const void*, size_t) override;
48413   std::string SerializeAsString() const override;
48414   std::vector<uint8_t> SerializeAsArray() const override;
48415   void Serialize(::protozero::Message*) const;
48416 
48417   bool has_counter_period_ns() const { return _has_field_[1]; }
48418   uint64_t counter_period_ns() const { return counter_period_ns_; }
48419   void set_counter_period_ns(uint64_t value) { counter_period_ns_ = value; _has_field_.set(1); }
48420 
48421   int counter_ids_size() const { return static_cast<int>(counter_ids_.size()); }
48422   const std::vector<uint32_t>& counter_ids() const { return counter_ids_; }
48423   std::vector<uint32_t>* mutable_counter_ids() { return &counter_ids_; }
48424   void clear_counter_ids() { counter_ids_.clear(); }
48425   void add_counter_ids(uint32_t value) { counter_ids_.emplace_back(value); }
48426   uint32_t* add_counter_ids() { counter_ids_.emplace_back(); return &counter_ids_.back(); }
48427 
48428   bool has_instrumented_sampling() const { return _has_field_[3]; }
48429   bool instrumented_sampling() const { return instrumented_sampling_; }
48430   void set_instrumented_sampling(bool value) { instrumented_sampling_ = value; _has_field_.set(3); }
48431 
48432   bool has_fix_gpu_clock() const { return _has_field_[4]; }
48433   bool fix_gpu_clock() const { return fix_gpu_clock_; }
48434   void set_fix_gpu_clock(bool value) { fix_gpu_clock_ = value; _has_field_.set(4); }
48435 
48436  private:
48437   uint64_t counter_period_ns_{};
48438   std::vector<uint32_t> counter_ids_;
48439   bool instrumented_sampling_{};
48440   bool fix_gpu_clock_{};
48441 
48442   // Allows to preserve unknown protobuf fields for compatibility
48443   // with future versions of .proto files.
48444   std::string unknown_fields_;
48445 
48446   std::bitset<5> _has_field_{};
48447 };
48448 
48449 }  // namespace perfetto
48450 }  // namespace protos
48451 }  // namespace gen
48452 
48453 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_GPU_GPU_COUNTER_CONFIG_PROTO_CPP_H_
48454 // gen_amalgamated begin header: gen/protos/perfetto/config/gpu/vulkan_memory_config.gen.h
48455 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
48456 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_GPU_VULKAN_MEMORY_CONFIG_PROTO_CPP_H_
48457 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_GPU_VULKAN_MEMORY_CONFIG_PROTO_CPP_H_
48458 
48459 #include <stdint.h>
48460 #include <bitset>
48461 #include <vector>
48462 #include <string>
48463 #include <type_traits>
48464 
48465 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
48466 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
48467 // gen_amalgamated expanded: #include "perfetto/base/export.h"
48468 
48469 namespace perfetto {
48470 namespace protos {
48471 namespace gen {
48472 class VulkanMemoryConfig;
48473 }  // namespace perfetto
48474 }  // namespace protos
48475 }  // namespace gen
48476 
48477 namespace protozero {
48478 class Message;
48479 }  // namespace protozero
48480 
48481 namespace perfetto {
48482 namespace protos {
48483 namespace gen {
48484 
48485 class PERFETTO_EXPORT VulkanMemoryConfig : public ::protozero::CppMessageObj {
48486  public:
48487   enum FieldNumbers {
48488     kTrackDriverMemoryUsageFieldNumber = 1,
48489     kTrackDeviceMemoryUsageFieldNumber = 2,
48490   };
48491 
48492   VulkanMemoryConfig();
48493   ~VulkanMemoryConfig() override;
48494   VulkanMemoryConfig(VulkanMemoryConfig&&) noexcept;
48495   VulkanMemoryConfig& operator=(VulkanMemoryConfig&&);
48496   VulkanMemoryConfig(const VulkanMemoryConfig&);
48497   VulkanMemoryConfig& operator=(const VulkanMemoryConfig&);
48498   bool operator==(const VulkanMemoryConfig&) const;
48499   bool operator!=(const VulkanMemoryConfig& other) const { return !(*this == other); }
48500 
48501   bool ParseFromArray(const void*, size_t) override;
48502   std::string SerializeAsString() const override;
48503   std::vector<uint8_t> SerializeAsArray() const override;
48504   void Serialize(::protozero::Message*) const;
48505 
48506   bool has_track_driver_memory_usage() const { return _has_field_[1]; }
48507   bool track_driver_memory_usage() const { return track_driver_memory_usage_; }
48508   void set_track_driver_memory_usage(bool value) { track_driver_memory_usage_ = value; _has_field_.set(1); }
48509 
48510   bool has_track_device_memory_usage() const { return _has_field_[2]; }
48511   bool track_device_memory_usage() const { return track_device_memory_usage_; }
48512   void set_track_device_memory_usage(bool value) { track_device_memory_usage_ = value; _has_field_.set(2); }
48513 
48514  private:
48515   bool track_driver_memory_usage_{};
48516   bool track_device_memory_usage_{};
48517 
48518   // Allows to preserve unknown protobuf fields for compatibility
48519   // with future versions of .proto files.
48520   std::string unknown_fields_;
48521 
48522   std::bitset<3> _has_field_{};
48523 };
48524 
48525 }  // namespace perfetto
48526 }  // namespace protos
48527 }  // namespace gen
48528 
48529 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_GPU_VULKAN_MEMORY_CONFIG_PROTO_CPP_H_
48530 // gen_amalgamated begin header: gen/protos/perfetto/config/inode_file/inode_file_config.gen.h
48531 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
48532 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_INODE_FILE_INODE_FILE_CONFIG_PROTO_CPP_H_
48533 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_INODE_FILE_INODE_FILE_CONFIG_PROTO_CPP_H_
48534 
48535 #include <stdint.h>
48536 #include <bitset>
48537 #include <vector>
48538 #include <string>
48539 #include <type_traits>
48540 
48541 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
48542 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
48543 // gen_amalgamated expanded: #include "perfetto/base/export.h"
48544 
48545 namespace perfetto {
48546 namespace protos {
48547 namespace gen {
48548 class InodeFileConfig;
48549 class InodeFileConfig_MountPointMappingEntry;
48550 }  // namespace perfetto
48551 }  // namespace protos
48552 }  // namespace gen
48553 
48554 namespace protozero {
48555 class Message;
48556 }  // namespace protozero
48557 
48558 namespace perfetto {
48559 namespace protos {
48560 namespace gen {
48561 
48562 class PERFETTO_EXPORT InodeFileConfig : public ::protozero::CppMessageObj {
48563  public:
48564   using MountPointMappingEntry = InodeFileConfig_MountPointMappingEntry;
48565   enum FieldNumbers {
48566     kScanIntervalMsFieldNumber = 1,
48567     kScanDelayMsFieldNumber = 2,
48568     kScanBatchSizeFieldNumber = 3,
48569     kDoNotScanFieldNumber = 4,
48570     kScanMountPointsFieldNumber = 5,
48571     kMountPointMappingFieldNumber = 6,
48572   };
48573 
48574   InodeFileConfig();
48575   ~InodeFileConfig() override;
48576   InodeFileConfig(InodeFileConfig&&) noexcept;
48577   InodeFileConfig& operator=(InodeFileConfig&&);
48578   InodeFileConfig(const InodeFileConfig&);
48579   InodeFileConfig& operator=(const InodeFileConfig&);
48580   bool operator==(const InodeFileConfig&) const;
48581   bool operator!=(const InodeFileConfig& other) const { return !(*this == other); }
48582 
48583   bool ParseFromArray(const void*, size_t) override;
48584   std::string SerializeAsString() const override;
48585   std::vector<uint8_t> SerializeAsArray() const override;
48586   void Serialize(::protozero::Message*) const;
48587 
48588   bool has_scan_interval_ms() const { return _has_field_[1]; }
48589   uint32_t scan_interval_ms() const { return scan_interval_ms_; }
48590   void set_scan_interval_ms(uint32_t value) { scan_interval_ms_ = value; _has_field_.set(1); }
48591 
48592   bool has_scan_delay_ms() const { return _has_field_[2]; }
48593   uint32_t scan_delay_ms() const { return scan_delay_ms_; }
48594   void set_scan_delay_ms(uint32_t value) { scan_delay_ms_ = value; _has_field_.set(2); }
48595 
48596   bool has_scan_batch_size() const { return _has_field_[3]; }
48597   uint32_t scan_batch_size() const { return scan_batch_size_; }
48598   void set_scan_batch_size(uint32_t value) { scan_batch_size_ = value; _has_field_.set(3); }
48599 
48600   bool has_do_not_scan() const { return _has_field_[4]; }
48601   bool do_not_scan() const { return do_not_scan_; }
48602   void set_do_not_scan(bool value) { do_not_scan_ = value; _has_field_.set(4); }
48603 
48604   int scan_mount_points_size() const { return static_cast<int>(scan_mount_points_.size()); }
48605   const std::vector<std::string>& scan_mount_points() const { return scan_mount_points_; }
48606   std::vector<std::string>* mutable_scan_mount_points() { return &scan_mount_points_; }
48607   void clear_scan_mount_points() { scan_mount_points_.clear(); }
48608   void add_scan_mount_points(std::string value) { scan_mount_points_.emplace_back(value); }
48609   std::string* add_scan_mount_points() { scan_mount_points_.emplace_back(); return &scan_mount_points_.back(); }
48610 
48611   int mount_point_mapping_size() const { return static_cast<int>(mount_point_mapping_.size()); }
48612   const std::vector<InodeFileConfig_MountPointMappingEntry>& mount_point_mapping() const { return mount_point_mapping_; }
48613   std::vector<InodeFileConfig_MountPointMappingEntry>* mutable_mount_point_mapping() { return &mount_point_mapping_; }
48614   void clear_mount_point_mapping() { mount_point_mapping_.clear(); }
48615   InodeFileConfig_MountPointMappingEntry* add_mount_point_mapping() { mount_point_mapping_.emplace_back(); return &mount_point_mapping_.back(); }
48616 
48617  private:
48618   uint32_t scan_interval_ms_{};
48619   uint32_t scan_delay_ms_{};
48620   uint32_t scan_batch_size_{};
48621   bool do_not_scan_{};
48622   std::vector<std::string> scan_mount_points_;
48623   std::vector<InodeFileConfig_MountPointMappingEntry> mount_point_mapping_;
48624 
48625   // Allows to preserve unknown protobuf fields for compatibility
48626   // with future versions of .proto files.
48627   std::string unknown_fields_;
48628 
48629   std::bitset<7> _has_field_{};
48630 };
48631 
48632 
48633 class PERFETTO_EXPORT InodeFileConfig_MountPointMappingEntry : public ::protozero::CppMessageObj {
48634  public:
48635   enum FieldNumbers {
48636     kMountpointFieldNumber = 1,
48637     kScanRootsFieldNumber = 2,
48638   };
48639 
48640   InodeFileConfig_MountPointMappingEntry();
48641   ~InodeFileConfig_MountPointMappingEntry() override;
48642   InodeFileConfig_MountPointMappingEntry(InodeFileConfig_MountPointMappingEntry&&) noexcept;
48643   InodeFileConfig_MountPointMappingEntry& operator=(InodeFileConfig_MountPointMappingEntry&&);
48644   InodeFileConfig_MountPointMappingEntry(const InodeFileConfig_MountPointMappingEntry&);
48645   InodeFileConfig_MountPointMappingEntry& operator=(const InodeFileConfig_MountPointMappingEntry&);
48646   bool operator==(const InodeFileConfig_MountPointMappingEntry&) const;
48647   bool operator!=(const InodeFileConfig_MountPointMappingEntry& other) const { return !(*this == other); }
48648 
48649   bool ParseFromArray(const void*, size_t) override;
48650   std::string SerializeAsString() const override;
48651   std::vector<uint8_t> SerializeAsArray() const override;
48652   void Serialize(::protozero::Message*) const;
48653 
48654   bool has_mountpoint() const { return _has_field_[1]; }
48655   const std::string& mountpoint() const { return mountpoint_; }
48656   void set_mountpoint(const std::string& value) { mountpoint_ = value; _has_field_.set(1); }
48657 
48658   int scan_roots_size() const { return static_cast<int>(scan_roots_.size()); }
48659   const std::vector<std::string>& scan_roots() const { return scan_roots_; }
48660   std::vector<std::string>* mutable_scan_roots() { return &scan_roots_; }
48661   void clear_scan_roots() { scan_roots_.clear(); }
48662   void add_scan_roots(std::string value) { scan_roots_.emplace_back(value); }
48663   std::string* add_scan_roots() { scan_roots_.emplace_back(); return &scan_roots_.back(); }
48664 
48665  private:
48666   std::string mountpoint_{};
48667   std::vector<std::string> scan_roots_;
48668 
48669   // Allows to preserve unknown protobuf fields for compatibility
48670   // with future versions of .proto files.
48671   std::string unknown_fields_;
48672 
48673   std::bitset<3> _has_field_{};
48674 };
48675 
48676 }  // namespace perfetto
48677 }  // namespace protos
48678 }  // namespace gen
48679 
48680 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_INODE_FILE_INODE_FILE_CONFIG_PROTO_CPP_H_
48681 // gen_amalgamated begin header: gen/protos/perfetto/config/power/android_power_config.gen.h
48682 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
48683 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_POWER_ANDROID_POWER_CONFIG_PROTO_CPP_H_
48684 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_POWER_ANDROID_POWER_CONFIG_PROTO_CPP_H_
48685 
48686 #include <stdint.h>
48687 #include <bitset>
48688 #include <vector>
48689 #include <string>
48690 #include <type_traits>
48691 
48692 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
48693 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
48694 // gen_amalgamated expanded: #include "perfetto/base/export.h"
48695 
48696 namespace perfetto {
48697 namespace protos {
48698 namespace gen {
48699 class AndroidPowerConfig;
48700 enum AndroidPowerConfig_BatteryCounters : int;
48701 }  // namespace perfetto
48702 }  // namespace protos
48703 }  // namespace gen
48704 
48705 namespace protozero {
48706 class Message;
48707 }  // namespace protozero
48708 
48709 namespace perfetto {
48710 namespace protos {
48711 namespace gen {
48712 enum AndroidPowerConfig_BatteryCounters : int {
48713   AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_UNSPECIFIED = 0,
48714   AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CHARGE = 1,
48715   AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CAPACITY_PERCENT = 2,
48716   AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CURRENT = 3,
48717   AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CURRENT_AVG = 4,
48718 };
48719 
48720 class PERFETTO_EXPORT AndroidPowerConfig : public ::protozero::CppMessageObj {
48721  public:
48722   using BatteryCounters = AndroidPowerConfig_BatteryCounters;
48723   static constexpr auto BATTERY_COUNTER_UNSPECIFIED = AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_UNSPECIFIED;
48724   static constexpr auto BATTERY_COUNTER_CHARGE = AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CHARGE;
48725   static constexpr auto BATTERY_COUNTER_CAPACITY_PERCENT = AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CAPACITY_PERCENT;
48726   static constexpr auto BATTERY_COUNTER_CURRENT = AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CURRENT;
48727   static constexpr auto BATTERY_COUNTER_CURRENT_AVG = AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CURRENT_AVG;
48728   static constexpr auto BatteryCounters_MIN = AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_UNSPECIFIED;
48729   static constexpr auto BatteryCounters_MAX = AndroidPowerConfig_BatteryCounters_BATTERY_COUNTER_CURRENT_AVG;
48730   enum FieldNumbers {
48731     kBatteryPollMsFieldNumber = 1,
48732     kBatteryCountersFieldNumber = 2,
48733     kCollectPowerRailsFieldNumber = 3,
48734   };
48735 
48736   AndroidPowerConfig();
48737   ~AndroidPowerConfig() override;
48738   AndroidPowerConfig(AndroidPowerConfig&&) noexcept;
48739   AndroidPowerConfig& operator=(AndroidPowerConfig&&);
48740   AndroidPowerConfig(const AndroidPowerConfig&);
48741   AndroidPowerConfig& operator=(const AndroidPowerConfig&);
48742   bool operator==(const AndroidPowerConfig&) const;
48743   bool operator!=(const AndroidPowerConfig& other) const { return !(*this == other); }
48744 
48745   bool ParseFromArray(const void*, size_t) override;
48746   std::string SerializeAsString() const override;
48747   std::vector<uint8_t> SerializeAsArray() const override;
48748   void Serialize(::protozero::Message*) const;
48749 
48750   bool has_battery_poll_ms() const { return _has_field_[1]; }
48751   uint32_t battery_poll_ms() const { return battery_poll_ms_; }
48752   void set_battery_poll_ms(uint32_t value) { battery_poll_ms_ = value; _has_field_.set(1); }
48753 
48754   int battery_counters_size() const { return static_cast<int>(battery_counters_.size()); }
48755   const std::vector<AndroidPowerConfig_BatteryCounters>& battery_counters() const { return battery_counters_; }
48756   std::vector<AndroidPowerConfig_BatteryCounters>* mutable_battery_counters() { return &battery_counters_; }
48757   void clear_battery_counters() { battery_counters_.clear(); }
48758   void add_battery_counters(AndroidPowerConfig_BatteryCounters value) { battery_counters_.emplace_back(value); }
48759   AndroidPowerConfig_BatteryCounters* add_battery_counters() { battery_counters_.emplace_back(); return &battery_counters_.back(); }
48760 
48761   bool has_collect_power_rails() const { return _has_field_[3]; }
48762   bool collect_power_rails() const { return collect_power_rails_; }
48763   void set_collect_power_rails(bool value) { collect_power_rails_ = value; _has_field_.set(3); }
48764 
48765  private:
48766   uint32_t battery_poll_ms_{};
48767   std::vector<AndroidPowerConfig_BatteryCounters> battery_counters_;
48768   bool collect_power_rails_{};
48769 
48770   // Allows to preserve unknown protobuf fields for compatibility
48771   // with future versions of .proto files.
48772   std::string unknown_fields_;
48773 
48774   std::bitset<4> _has_field_{};
48775 };
48776 
48777 }  // namespace perfetto
48778 }  // namespace protos
48779 }  // namespace gen
48780 
48781 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_POWER_ANDROID_POWER_CONFIG_PROTO_CPP_H_
48782 // gen_amalgamated begin header: gen/protos/perfetto/config/process_stats/process_stats_config.gen.h
48783 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
48784 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROCESS_STATS_PROCESS_STATS_CONFIG_PROTO_CPP_H_
48785 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROCESS_STATS_PROCESS_STATS_CONFIG_PROTO_CPP_H_
48786 
48787 #include <stdint.h>
48788 #include <bitset>
48789 #include <vector>
48790 #include <string>
48791 #include <type_traits>
48792 
48793 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
48794 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
48795 // gen_amalgamated expanded: #include "perfetto/base/export.h"
48796 
48797 namespace perfetto {
48798 namespace protos {
48799 namespace gen {
48800 class ProcessStatsConfig;
48801 enum ProcessStatsConfig_Quirks : int;
48802 }  // namespace perfetto
48803 }  // namespace protos
48804 }  // namespace gen
48805 
48806 namespace protozero {
48807 class Message;
48808 }  // namespace protozero
48809 
48810 namespace perfetto {
48811 namespace protos {
48812 namespace gen {
48813 enum ProcessStatsConfig_Quirks : int {
48814   ProcessStatsConfig_Quirks_QUIRKS_UNSPECIFIED = 0,
48815   ProcessStatsConfig_Quirks_DISABLE_INITIAL_DUMP = 1,
48816   ProcessStatsConfig_Quirks_DISABLE_ON_DEMAND = 2,
48817 };
48818 
48819 class PERFETTO_EXPORT ProcessStatsConfig : public ::protozero::CppMessageObj {
48820  public:
48821   using Quirks = ProcessStatsConfig_Quirks;
48822   static constexpr auto QUIRKS_UNSPECIFIED = ProcessStatsConfig_Quirks_QUIRKS_UNSPECIFIED;
48823   static constexpr auto DISABLE_INITIAL_DUMP = ProcessStatsConfig_Quirks_DISABLE_INITIAL_DUMP;
48824   static constexpr auto DISABLE_ON_DEMAND = ProcessStatsConfig_Quirks_DISABLE_ON_DEMAND;
48825   static constexpr auto Quirks_MIN = ProcessStatsConfig_Quirks_QUIRKS_UNSPECIFIED;
48826   static constexpr auto Quirks_MAX = ProcessStatsConfig_Quirks_DISABLE_ON_DEMAND;
48827   enum FieldNumbers {
48828     kQuirksFieldNumber = 1,
48829     kScanAllProcessesOnStartFieldNumber = 2,
48830     kRecordThreadNamesFieldNumber = 3,
48831     kProcStatsPollMsFieldNumber = 4,
48832     kProcStatsCacheTtlMsFieldNumber = 6,
48833     kRecordThreadTimeInStateFieldNumber = 7,
48834     kThreadTimeInStateCacheSizeFieldNumber = 8,
48835   };
48836 
48837   ProcessStatsConfig();
48838   ~ProcessStatsConfig() override;
48839   ProcessStatsConfig(ProcessStatsConfig&&) noexcept;
48840   ProcessStatsConfig& operator=(ProcessStatsConfig&&);
48841   ProcessStatsConfig(const ProcessStatsConfig&);
48842   ProcessStatsConfig& operator=(const ProcessStatsConfig&);
48843   bool operator==(const ProcessStatsConfig&) const;
48844   bool operator!=(const ProcessStatsConfig& other) const { return !(*this == other); }
48845 
48846   bool ParseFromArray(const void*, size_t) override;
48847   std::string SerializeAsString() const override;
48848   std::vector<uint8_t> SerializeAsArray() const override;
48849   void Serialize(::protozero::Message*) const;
48850 
48851   int quirks_size() const { return static_cast<int>(quirks_.size()); }
48852   const std::vector<ProcessStatsConfig_Quirks>& quirks() const { return quirks_; }
48853   std::vector<ProcessStatsConfig_Quirks>* mutable_quirks() { return &quirks_; }
48854   void clear_quirks() { quirks_.clear(); }
48855   void add_quirks(ProcessStatsConfig_Quirks value) { quirks_.emplace_back(value); }
48856   ProcessStatsConfig_Quirks* add_quirks() { quirks_.emplace_back(); return &quirks_.back(); }
48857 
48858   bool has_scan_all_processes_on_start() const { return _has_field_[2]; }
48859   bool scan_all_processes_on_start() const { return scan_all_processes_on_start_; }
48860   void set_scan_all_processes_on_start(bool value) { scan_all_processes_on_start_ = value; _has_field_.set(2); }
48861 
48862   bool has_record_thread_names() const { return _has_field_[3]; }
48863   bool record_thread_names() const { return record_thread_names_; }
48864   void set_record_thread_names(bool value) { record_thread_names_ = value; _has_field_.set(3); }
48865 
48866   bool has_proc_stats_poll_ms() const { return _has_field_[4]; }
48867   uint32_t proc_stats_poll_ms() const { return proc_stats_poll_ms_; }
48868   void set_proc_stats_poll_ms(uint32_t value) { proc_stats_poll_ms_ = value; _has_field_.set(4); }
48869 
48870   bool has_proc_stats_cache_ttl_ms() const { return _has_field_[6]; }
48871   uint32_t proc_stats_cache_ttl_ms() const { return proc_stats_cache_ttl_ms_; }
48872   void set_proc_stats_cache_ttl_ms(uint32_t value) { proc_stats_cache_ttl_ms_ = value; _has_field_.set(6); }
48873 
48874   bool has_record_thread_time_in_state() const { return _has_field_[7]; }
48875   bool record_thread_time_in_state() const { return record_thread_time_in_state_; }
48876   void set_record_thread_time_in_state(bool value) { record_thread_time_in_state_ = value; _has_field_.set(7); }
48877 
48878   bool has_thread_time_in_state_cache_size() const { return _has_field_[8]; }
48879   uint32_t thread_time_in_state_cache_size() const { return thread_time_in_state_cache_size_; }
48880   void set_thread_time_in_state_cache_size(uint32_t value) { thread_time_in_state_cache_size_ = value; _has_field_.set(8); }
48881 
48882  private:
48883   std::vector<ProcessStatsConfig_Quirks> quirks_;
48884   bool scan_all_processes_on_start_{};
48885   bool record_thread_names_{};
48886   uint32_t proc_stats_poll_ms_{};
48887   uint32_t proc_stats_cache_ttl_ms_{};
48888   bool record_thread_time_in_state_{};
48889   uint32_t thread_time_in_state_cache_size_{};
48890 
48891   // Allows to preserve unknown protobuf fields for compatibility
48892   // with future versions of .proto files.
48893   std::string unknown_fields_;
48894 
48895   std::bitset<9> _has_field_{};
48896 };
48897 
48898 }  // namespace perfetto
48899 }  // namespace protos
48900 }  // namespace gen
48901 
48902 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROCESS_STATS_PROCESS_STATS_CONFIG_PROTO_CPP_H_
48903 // gen_amalgamated begin header: gen/protos/perfetto/config/profiling/heapprofd_config.gen.h
48904 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
48905 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROFILING_HEAPPROFD_CONFIG_PROTO_CPP_H_
48906 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROFILING_HEAPPROFD_CONFIG_PROTO_CPP_H_
48907 
48908 #include <stdint.h>
48909 #include <bitset>
48910 #include <vector>
48911 #include <string>
48912 #include <type_traits>
48913 
48914 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
48915 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
48916 // gen_amalgamated expanded: #include "perfetto/base/export.h"
48917 
48918 namespace perfetto {
48919 namespace protos {
48920 namespace gen {
48921 class HeapprofdConfig;
48922 class HeapprofdConfig_ContinuousDumpConfig;
48923 }  // namespace perfetto
48924 }  // namespace protos
48925 }  // namespace gen
48926 
48927 namespace protozero {
48928 class Message;
48929 }  // namespace protozero
48930 
48931 namespace perfetto {
48932 namespace protos {
48933 namespace gen {
48934 
48935 class PERFETTO_EXPORT HeapprofdConfig : public ::protozero::CppMessageObj {
48936  public:
48937   using ContinuousDumpConfig = HeapprofdConfig_ContinuousDumpConfig;
48938   enum FieldNumbers {
48939     kSamplingIntervalBytesFieldNumber = 1,
48940     kProcessCmdlineFieldNumber = 2,
48941     kPidFieldNumber = 4,
48942     kHeapsFieldNumber = 20,
48943     kAllHeapsFieldNumber = 21,
48944     kAllFieldNumber = 5,
48945     kMinAnonymousMemoryKbFieldNumber = 15,
48946     kMaxHeapprofdMemoryKbFieldNumber = 16,
48947     kMaxHeapprofdCpuSecsFieldNumber = 17,
48948     kSkipSymbolPrefixFieldNumber = 7,
48949     kContinuousDumpConfigFieldNumber = 6,
48950     kShmemSizeBytesFieldNumber = 8,
48951     kBlockClientFieldNumber = 9,
48952     kBlockClientTimeoutUsFieldNumber = 14,
48953     kNoStartupFieldNumber = 10,
48954     kNoRunningFieldNumber = 11,
48955     kIdleAllocationsFieldNumber = 12,
48956     kDumpAtMaxFieldNumber = 13,
48957     kDisableForkTeardownFieldNumber = 18,
48958     kDisableVforkDetectionFieldNumber = 19,
48959   };
48960 
48961   HeapprofdConfig();
48962   ~HeapprofdConfig() override;
48963   HeapprofdConfig(HeapprofdConfig&&) noexcept;
48964   HeapprofdConfig& operator=(HeapprofdConfig&&);
48965   HeapprofdConfig(const HeapprofdConfig&);
48966   HeapprofdConfig& operator=(const HeapprofdConfig&);
48967   bool operator==(const HeapprofdConfig&) const;
48968   bool operator!=(const HeapprofdConfig& other) const { return !(*this == other); }
48969 
48970   bool ParseFromArray(const void*, size_t) override;
48971   std::string SerializeAsString() const override;
48972   std::vector<uint8_t> SerializeAsArray() const override;
48973   void Serialize(::protozero::Message*) const;
48974 
48975   bool has_sampling_interval_bytes() const { return _has_field_[1]; }
48976   uint64_t sampling_interval_bytes() const { return sampling_interval_bytes_; }
48977   void set_sampling_interval_bytes(uint64_t value) { sampling_interval_bytes_ = value; _has_field_.set(1); }
48978 
48979   int process_cmdline_size() const { return static_cast<int>(process_cmdline_.size()); }
48980   const std::vector<std::string>& process_cmdline() const { return process_cmdline_; }
48981   std::vector<std::string>* mutable_process_cmdline() { return &process_cmdline_; }
48982   void clear_process_cmdline() { process_cmdline_.clear(); }
48983   void add_process_cmdline(std::string value) { process_cmdline_.emplace_back(value); }
48984   std::string* add_process_cmdline() { process_cmdline_.emplace_back(); return &process_cmdline_.back(); }
48985 
48986   int pid_size() const { return static_cast<int>(pid_.size()); }
48987   const std::vector<uint64_t>& pid() const { return pid_; }
48988   std::vector<uint64_t>* mutable_pid() { return &pid_; }
48989   void clear_pid() { pid_.clear(); }
48990   void add_pid(uint64_t value) { pid_.emplace_back(value); }
48991   uint64_t* add_pid() { pid_.emplace_back(); return &pid_.back(); }
48992 
48993   int heaps_size() const { return static_cast<int>(heaps_.size()); }
48994   const std::vector<std::string>& heaps() const { return heaps_; }
48995   std::vector<std::string>* mutable_heaps() { return &heaps_; }
48996   void clear_heaps() { heaps_.clear(); }
48997   void add_heaps(std::string value) { heaps_.emplace_back(value); }
48998   std::string* add_heaps() { heaps_.emplace_back(); return &heaps_.back(); }
48999 
49000   bool has_all_heaps() const { return _has_field_[21]; }
49001   bool all_heaps() const { return all_heaps_; }
49002   void set_all_heaps(bool value) { all_heaps_ = value; _has_field_.set(21); }
49003 
49004   bool has_all() const { return _has_field_[5]; }
49005   bool all() const { return all_; }
49006   void set_all(bool value) { all_ = value; _has_field_.set(5); }
49007 
49008   bool has_min_anonymous_memory_kb() const { return _has_field_[15]; }
49009   uint32_t min_anonymous_memory_kb() const { return min_anonymous_memory_kb_; }
49010   void set_min_anonymous_memory_kb(uint32_t value) { min_anonymous_memory_kb_ = value; _has_field_.set(15); }
49011 
49012   bool has_max_heapprofd_memory_kb() const { return _has_field_[16]; }
49013   uint32_t max_heapprofd_memory_kb() const { return max_heapprofd_memory_kb_; }
49014   void set_max_heapprofd_memory_kb(uint32_t value) { max_heapprofd_memory_kb_ = value; _has_field_.set(16); }
49015 
49016   bool has_max_heapprofd_cpu_secs() const { return _has_field_[17]; }
49017   uint64_t max_heapprofd_cpu_secs() const { return max_heapprofd_cpu_secs_; }
49018   void set_max_heapprofd_cpu_secs(uint64_t value) { max_heapprofd_cpu_secs_ = value; _has_field_.set(17); }
49019 
49020   int skip_symbol_prefix_size() const { return static_cast<int>(skip_symbol_prefix_.size()); }
49021   const std::vector<std::string>& skip_symbol_prefix() const { return skip_symbol_prefix_; }
49022   std::vector<std::string>* mutable_skip_symbol_prefix() { return &skip_symbol_prefix_; }
49023   void clear_skip_symbol_prefix() { skip_symbol_prefix_.clear(); }
49024   void add_skip_symbol_prefix(std::string value) { skip_symbol_prefix_.emplace_back(value); }
49025   std::string* add_skip_symbol_prefix() { skip_symbol_prefix_.emplace_back(); return &skip_symbol_prefix_.back(); }
49026 
49027   bool has_continuous_dump_config() const { return _has_field_[6]; }
49028   const HeapprofdConfig_ContinuousDumpConfig& continuous_dump_config() const { return *continuous_dump_config_; }
49029   HeapprofdConfig_ContinuousDumpConfig* mutable_continuous_dump_config() { _has_field_.set(6); return continuous_dump_config_.get(); }
49030 
49031   bool has_shmem_size_bytes() const { return _has_field_[8]; }
49032   uint64_t shmem_size_bytes() const { return shmem_size_bytes_; }
49033   void set_shmem_size_bytes(uint64_t value) { shmem_size_bytes_ = value; _has_field_.set(8); }
49034 
49035   bool has_block_client() const { return _has_field_[9]; }
49036   bool block_client() const { return block_client_; }
49037   void set_block_client(bool value) { block_client_ = value; _has_field_.set(9); }
49038 
49039   bool has_block_client_timeout_us() const { return _has_field_[14]; }
49040   uint32_t block_client_timeout_us() const { return block_client_timeout_us_; }
49041   void set_block_client_timeout_us(uint32_t value) { block_client_timeout_us_ = value; _has_field_.set(14); }
49042 
49043   bool has_no_startup() const { return _has_field_[10]; }
49044   bool no_startup() const { return no_startup_; }
49045   void set_no_startup(bool value) { no_startup_ = value; _has_field_.set(10); }
49046 
49047   bool has_no_running() const { return _has_field_[11]; }
49048   bool no_running() const { return no_running_; }
49049   void set_no_running(bool value) { no_running_ = value; _has_field_.set(11); }
49050 
49051   bool has_idle_allocations() const { return _has_field_[12]; }
49052   bool idle_allocations() const { return idle_allocations_; }
49053   void set_idle_allocations(bool value) { idle_allocations_ = value; _has_field_.set(12); }
49054 
49055   bool has_dump_at_max() const { return _has_field_[13]; }
49056   bool dump_at_max() const { return dump_at_max_; }
49057   void set_dump_at_max(bool value) { dump_at_max_ = value; _has_field_.set(13); }
49058 
49059   bool has_disable_fork_teardown() const { return _has_field_[18]; }
49060   bool disable_fork_teardown() const { return disable_fork_teardown_; }
49061   void set_disable_fork_teardown(bool value) { disable_fork_teardown_ = value; _has_field_.set(18); }
49062 
49063   bool has_disable_vfork_detection() const { return _has_field_[19]; }
49064   bool disable_vfork_detection() const { return disable_vfork_detection_; }
49065   void set_disable_vfork_detection(bool value) { disable_vfork_detection_ = value; _has_field_.set(19); }
49066 
49067  private:
49068   uint64_t sampling_interval_bytes_{};
49069   std::vector<std::string> process_cmdline_;
49070   std::vector<uint64_t> pid_;
49071   std::vector<std::string> heaps_;
49072   bool all_heaps_{};
49073   bool all_{};
49074   uint32_t min_anonymous_memory_kb_{};
49075   uint32_t max_heapprofd_memory_kb_{};
49076   uint64_t max_heapprofd_cpu_secs_{};
49077   std::vector<std::string> skip_symbol_prefix_;
49078   ::protozero::CopyablePtr<HeapprofdConfig_ContinuousDumpConfig> continuous_dump_config_;
49079   uint64_t shmem_size_bytes_{};
49080   bool block_client_{};
49081   uint32_t block_client_timeout_us_{};
49082   bool no_startup_{};
49083   bool no_running_{};
49084   bool idle_allocations_{};
49085   bool dump_at_max_{};
49086   bool disable_fork_teardown_{};
49087   bool disable_vfork_detection_{};
49088 
49089   // Allows to preserve unknown protobuf fields for compatibility
49090   // with future versions of .proto files.
49091   std::string unknown_fields_;
49092 
49093   std::bitset<22> _has_field_{};
49094 };
49095 
49096 
49097 class PERFETTO_EXPORT HeapprofdConfig_ContinuousDumpConfig : public ::protozero::CppMessageObj {
49098  public:
49099   enum FieldNumbers {
49100     kDumpPhaseMsFieldNumber = 5,
49101     kDumpIntervalMsFieldNumber = 6,
49102   };
49103 
49104   HeapprofdConfig_ContinuousDumpConfig();
49105   ~HeapprofdConfig_ContinuousDumpConfig() override;
49106   HeapprofdConfig_ContinuousDumpConfig(HeapprofdConfig_ContinuousDumpConfig&&) noexcept;
49107   HeapprofdConfig_ContinuousDumpConfig& operator=(HeapprofdConfig_ContinuousDumpConfig&&);
49108   HeapprofdConfig_ContinuousDumpConfig(const HeapprofdConfig_ContinuousDumpConfig&);
49109   HeapprofdConfig_ContinuousDumpConfig& operator=(const HeapprofdConfig_ContinuousDumpConfig&);
49110   bool operator==(const HeapprofdConfig_ContinuousDumpConfig&) const;
49111   bool operator!=(const HeapprofdConfig_ContinuousDumpConfig& other) const { return !(*this == other); }
49112 
49113   bool ParseFromArray(const void*, size_t) override;
49114   std::string SerializeAsString() const override;
49115   std::vector<uint8_t> SerializeAsArray() const override;
49116   void Serialize(::protozero::Message*) const;
49117 
49118   bool has_dump_phase_ms() const { return _has_field_[5]; }
49119   uint32_t dump_phase_ms() const { return dump_phase_ms_; }
49120   void set_dump_phase_ms(uint32_t value) { dump_phase_ms_ = value; _has_field_.set(5); }
49121 
49122   bool has_dump_interval_ms() const { return _has_field_[6]; }
49123   uint32_t dump_interval_ms() const { return dump_interval_ms_; }
49124   void set_dump_interval_ms(uint32_t value) { dump_interval_ms_ = value; _has_field_.set(6); }
49125 
49126  private:
49127   uint32_t dump_phase_ms_{};
49128   uint32_t dump_interval_ms_{};
49129 
49130   // Allows to preserve unknown protobuf fields for compatibility
49131   // with future versions of .proto files.
49132   std::string unknown_fields_;
49133 
49134   std::bitset<7> _has_field_{};
49135 };
49136 
49137 }  // namespace perfetto
49138 }  // namespace protos
49139 }  // namespace gen
49140 
49141 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROFILING_HEAPPROFD_CONFIG_PROTO_CPP_H_
49142 // gen_amalgamated begin header: gen/protos/perfetto/config/profiling/java_hprof_config.gen.h
49143 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
49144 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROFILING_JAVA_HPROF_CONFIG_PROTO_CPP_H_
49145 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROFILING_JAVA_HPROF_CONFIG_PROTO_CPP_H_
49146 
49147 #include <stdint.h>
49148 #include <bitset>
49149 #include <vector>
49150 #include <string>
49151 #include <type_traits>
49152 
49153 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
49154 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
49155 // gen_amalgamated expanded: #include "perfetto/base/export.h"
49156 
49157 namespace perfetto {
49158 namespace protos {
49159 namespace gen {
49160 class JavaHprofConfig;
49161 class JavaHprofConfig_ContinuousDumpConfig;
49162 }  // namespace perfetto
49163 }  // namespace protos
49164 }  // namespace gen
49165 
49166 namespace protozero {
49167 class Message;
49168 }  // namespace protozero
49169 
49170 namespace perfetto {
49171 namespace protos {
49172 namespace gen {
49173 
49174 class PERFETTO_EXPORT JavaHprofConfig : public ::protozero::CppMessageObj {
49175  public:
49176   using ContinuousDumpConfig = JavaHprofConfig_ContinuousDumpConfig;
49177   enum FieldNumbers {
49178     kProcessCmdlineFieldNumber = 1,
49179     kPidFieldNumber = 2,
49180     kContinuousDumpConfigFieldNumber = 3,
49181     kMinAnonymousMemoryKbFieldNumber = 4,
49182     kDumpSmapsFieldNumber = 5,
49183   };
49184 
49185   JavaHprofConfig();
49186   ~JavaHprofConfig() override;
49187   JavaHprofConfig(JavaHprofConfig&&) noexcept;
49188   JavaHprofConfig& operator=(JavaHprofConfig&&);
49189   JavaHprofConfig(const JavaHprofConfig&);
49190   JavaHprofConfig& operator=(const JavaHprofConfig&);
49191   bool operator==(const JavaHprofConfig&) const;
49192   bool operator!=(const JavaHprofConfig& other) const { return !(*this == other); }
49193 
49194   bool ParseFromArray(const void*, size_t) override;
49195   std::string SerializeAsString() const override;
49196   std::vector<uint8_t> SerializeAsArray() const override;
49197   void Serialize(::protozero::Message*) const;
49198 
49199   int process_cmdline_size() const { return static_cast<int>(process_cmdline_.size()); }
49200   const std::vector<std::string>& process_cmdline() const { return process_cmdline_; }
49201   std::vector<std::string>* mutable_process_cmdline() { return &process_cmdline_; }
49202   void clear_process_cmdline() { process_cmdline_.clear(); }
49203   void add_process_cmdline(std::string value) { process_cmdline_.emplace_back(value); }
49204   std::string* add_process_cmdline() { process_cmdline_.emplace_back(); return &process_cmdline_.back(); }
49205 
49206   int pid_size() const { return static_cast<int>(pid_.size()); }
49207   const std::vector<uint64_t>& pid() const { return pid_; }
49208   std::vector<uint64_t>* mutable_pid() { return &pid_; }
49209   void clear_pid() { pid_.clear(); }
49210   void add_pid(uint64_t value) { pid_.emplace_back(value); }
49211   uint64_t* add_pid() { pid_.emplace_back(); return &pid_.back(); }
49212 
49213   bool has_continuous_dump_config() const { return _has_field_[3]; }
49214   const JavaHprofConfig_ContinuousDumpConfig& continuous_dump_config() const { return *continuous_dump_config_; }
49215   JavaHprofConfig_ContinuousDumpConfig* mutable_continuous_dump_config() { _has_field_.set(3); return continuous_dump_config_.get(); }
49216 
49217   bool has_min_anonymous_memory_kb() const { return _has_field_[4]; }
49218   uint32_t min_anonymous_memory_kb() const { return min_anonymous_memory_kb_; }
49219   void set_min_anonymous_memory_kb(uint32_t value) { min_anonymous_memory_kb_ = value; _has_field_.set(4); }
49220 
49221   bool has_dump_smaps() const { return _has_field_[5]; }
49222   bool dump_smaps() const { return dump_smaps_; }
49223   void set_dump_smaps(bool value) { dump_smaps_ = value; _has_field_.set(5); }
49224 
49225  private:
49226   std::vector<std::string> process_cmdline_;
49227   std::vector<uint64_t> pid_;
49228   ::protozero::CopyablePtr<JavaHprofConfig_ContinuousDumpConfig> continuous_dump_config_;
49229   uint32_t min_anonymous_memory_kb_{};
49230   bool dump_smaps_{};
49231 
49232   // Allows to preserve unknown protobuf fields for compatibility
49233   // with future versions of .proto files.
49234   std::string unknown_fields_;
49235 
49236   std::bitset<6> _has_field_{};
49237 };
49238 
49239 
49240 class PERFETTO_EXPORT JavaHprofConfig_ContinuousDumpConfig : public ::protozero::CppMessageObj {
49241  public:
49242   enum FieldNumbers {
49243     kDumpPhaseMsFieldNumber = 1,
49244     kDumpIntervalMsFieldNumber = 2,
49245   };
49246 
49247   JavaHprofConfig_ContinuousDumpConfig();
49248   ~JavaHprofConfig_ContinuousDumpConfig() override;
49249   JavaHprofConfig_ContinuousDumpConfig(JavaHprofConfig_ContinuousDumpConfig&&) noexcept;
49250   JavaHprofConfig_ContinuousDumpConfig& operator=(JavaHprofConfig_ContinuousDumpConfig&&);
49251   JavaHprofConfig_ContinuousDumpConfig(const JavaHprofConfig_ContinuousDumpConfig&);
49252   JavaHprofConfig_ContinuousDumpConfig& operator=(const JavaHprofConfig_ContinuousDumpConfig&);
49253   bool operator==(const JavaHprofConfig_ContinuousDumpConfig&) const;
49254   bool operator!=(const JavaHprofConfig_ContinuousDumpConfig& other) const { return !(*this == other); }
49255 
49256   bool ParseFromArray(const void*, size_t) override;
49257   std::string SerializeAsString() const override;
49258   std::vector<uint8_t> SerializeAsArray() const override;
49259   void Serialize(::protozero::Message*) const;
49260 
49261   bool has_dump_phase_ms() const { return _has_field_[1]; }
49262   uint32_t dump_phase_ms() const { return dump_phase_ms_; }
49263   void set_dump_phase_ms(uint32_t value) { dump_phase_ms_ = value; _has_field_.set(1); }
49264 
49265   bool has_dump_interval_ms() const { return _has_field_[2]; }
49266   uint32_t dump_interval_ms() const { return dump_interval_ms_; }
49267   void set_dump_interval_ms(uint32_t value) { dump_interval_ms_ = value; _has_field_.set(2); }
49268 
49269  private:
49270   uint32_t dump_phase_ms_{};
49271   uint32_t dump_interval_ms_{};
49272 
49273   // Allows to preserve unknown protobuf fields for compatibility
49274   // with future versions of .proto files.
49275   std::string unknown_fields_;
49276 
49277   std::bitset<3> _has_field_{};
49278 };
49279 
49280 }  // namespace perfetto
49281 }  // namespace protos
49282 }  // namespace gen
49283 
49284 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROFILING_JAVA_HPROF_CONFIG_PROTO_CPP_H_
49285 // gen_amalgamated begin header: gen/protos/perfetto/config/profiling/perf_event_config.gen.h
49286 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
49287 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROFILING_PERF_EVENT_CONFIG_PROTO_CPP_H_
49288 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROFILING_PERF_EVENT_CONFIG_PROTO_CPP_H_
49289 
49290 #include <stdint.h>
49291 #include <bitset>
49292 #include <vector>
49293 #include <string>
49294 #include <type_traits>
49295 
49296 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
49297 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
49298 // gen_amalgamated expanded: #include "perfetto/base/export.h"
49299 
49300 namespace perfetto {
49301 namespace protos {
49302 namespace gen {
49303 class PerfEventConfig;
49304 }  // namespace perfetto
49305 }  // namespace protos
49306 }  // namespace gen
49307 
49308 namespace protozero {
49309 class Message;
49310 }  // namespace protozero
49311 
49312 namespace perfetto {
49313 namespace protos {
49314 namespace gen {
49315 
49316 class PERFETTO_EXPORT PerfEventConfig : public ::protozero::CppMessageObj {
49317  public:
49318   enum FieldNumbers {
49319     kAllCpusFieldNumber = 1,
49320     kSamplingFrequencyFieldNumber = 2,
49321     kRingBufferReadPeriodMsFieldNumber = 8,
49322     kRingBufferPagesFieldNumber = 3,
49323     kTargetPidFieldNumber = 4,
49324     kTargetCmdlineFieldNumber = 5,
49325     kExcludePidFieldNumber = 6,
49326     kExcludeCmdlineFieldNumber = 7,
49327     kRemoteDescriptorTimeoutMsFieldNumber = 9,
49328     kUnwindStateClearPeriodMsFieldNumber = 10,
49329   };
49330 
49331   PerfEventConfig();
49332   ~PerfEventConfig() override;
49333   PerfEventConfig(PerfEventConfig&&) noexcept;
49334   PerfEventConfig& operator=(PerfEventConfig&&);
49335   PerfEventConfig(const PerfEventConfig&);
49336   PerfEventConfig& operator=(const PerfEventConfig&);
49337   bool operator==(const PerfEventConfig&) const;
49338   bool operator!=(const PerfEventConfig& other) const { return !(*this == other); }
49339 
49340   bool ParseFromArray(const void*, size_t) override;
49341   std::string SerializeAsString() const override;
49342   std::vector<uint8_t> SerializeAsArray() const override;
49343   void Serialize(::protozero::Message*) const;
49344 
49345   bool has_all_cpus() const { return _has_field_[1]; }
49346   bool all_cpus() const { return all_cpus_; }
49347   void set_all_cpus(bool value) { all_cpus_ = value; _has_field_.set(1); }
49348 
49349   bool has_sampling_frequency() const { return _has_field_[2]; }
49350   uint32_t sampling_frequency() const { return sampling_frequency_; }
49351   void set_sampling_frequency(uint32_t value) { sampling_frequency_ = value; _has_field_.set(2); }
49352 
49353   bool has_ring_buffer_read_period_ms() const { return _has_field_[8]; }
49354   uint32_t ring_buffer_read_period_ms() const { return ring_buffer_read_period_ms_; }
49355   void set_ring_buffer_read_period_ms(uint32_t value) { ring_buffer_read_period_ms_ = value; _has_field_.set(8); }
49356 
49357   bool has_ring_buffer_pages() const { return _has_field_[3]; }
49358   uint32_t ring_buffer_pages() const { return ring_buffer_pages_; }
49359   void set_ring_buffer_pages(uint32_t value) { ring_buffer_pages_ = value; _has_field_.set(3); }
49360 
49361   int target_pid_size() const { return static_cast<int>(target_pid_.size()); }
49362   const std::vector<int32_t>& target_pid() const { return target_pid_; }
49363   std::vector<int32_t>* mutable_target_pid() { return &target_pid_; }
49364   void clear_target_pid() { target_pid_.clear(); }
49365   void add_target_pid(int32_t value) { target_pid_.emplace_back(value); }
49366   int32_t* add_target_pid() { target_pid_.emplace_back(); return &target_pid_.back(); }
49367 
49368   int target_cmdline_size() const { return static_cast<int>(target_cmdline_.size()); }
49369   const std::vector<std::string>& target_cmdline() const { return target_cmdline_; }
49370   std::vector<std::string>* mutable_target_cmdline() { return &target_cmdline_; }
49371   void clear_target_cmdline() { target_cmdline_.clear(); }
49372   void add_target_cmdline(std::string value) { target_cmdline_.emplace_back(value); }
49373   std::string* add_target_cmdline() { target_cmdline_.emplace_back(); return &target_cmdline_.back(); }
49374 
49375   int exclude_pid_size() const { return static_cast<int>(exclude_pid_.size()); }
49376   const std::vector<int32_t>& exclude_pid() const { return exclude_pid_; }
49377   std::vector<int32_t>* mutable_exclude_pid() { return &exclude_pid_; }
49378   void clear_exclude_pid() { exclude_pid_.clear(); }
49379   void add_exclude_pid(int32_t value) { exclude_pid_.emplace_back(value); }
49380   int32_t* add_exclude_pid() { exclude_pid_.emplace_back(); return &exclude_pid_.back(); }
49381 
49382   int exclude_cmdline_size() const { return static_cast<int>(exclude_cmdline_.size()); }
49383   const std::vector<std::string>& exclude_cmdline() const { return exclude_cmdline_; }
49384   std::vector<std::string>* mutable_exclude_cmdline() { return &exclude_cmdline_; }
49385   void clear_exclude_cmdline() { exclude_cmdline_.clear(); }
49386   void add_exclude_cmdline(std::string value) { exclude_cmdline_.emplace_back(value); }
49387   std::string* add_exclude_cmdline() { exclude_cmdline_.emplace_back(); return &exclude_cmdline_.back(); }
49388 
49389   bool has_remote_descriptor_timeout_ms() const { return _has_field_[9]; }
49390   uint32_t remote_descriptor_timeout_ms() const { return remote_descriptor_timeout_ms_; }
49391   void set_remote_descriptor_timeout_ms(uint32_t value) { remote_descriptor_timeout_ms_ = value; _has_field_.set(9); }
49392 
49393   bool has_unwind_state_clear_period_ms() const { return _has_field_[10]; }
49394   uint32_t unwind_state_clear_period_ms() const { return unwind_state_clear_period_ms_; }
49395   void set_unwind_state_clear_period_ms(uint32_t value) { unwind_state_clear_period_ms_ = value; _has_field_.set(10); }
49396 
49397  private:
49398   bool all_cpus_{};
49399   uint32_t sampling_frequency_{};
49400   uint32_t ring_buffer_read_period_ms_{};
49401   uint32_t ring_buffer_pages_{};
49402   std::vector<int32_t> target_pid_;
49403   std::vector<std::string> target_cmdline_;
49404   std::vector<int32_t> exclude_pid_;
49405   std::vector<std::string> exclude_cmdline_;
49406   uint32_t remote_descriptor_timeout_ms_{};
49407   uint32_t unwind_state_clear_period_ms_{};
49408 
49409   // Allows to preserve unknown protobuf fields for compatibility
49410   // with future versions of .proto files.
49411   std::string unknown_fields_;
49412 
49413   std::bitset<11> _has_field_{};
49414 };
49415 
49416 }  // namespace perfetto
49417 }  // namespace protos
49418 }  // namespace gen
49419 
49420 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_PROFILING_PERF_EVENT_CONFIG_PROTO_CPP_H_
49421 // gen_amalgamated begin header: gen/protos/perfetto/config/sys_stats/sys_stats_config.gen.h
49422 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
49423 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_SYS_STATS_SYS_STATS_CONFIG_PROTO_CPP_H_
49424 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_SYS_STATS_SYS_STATS_CONFIG_PROTO_CPP_H_
49425 
49426 #include <stdint.h>
49427 #include <bitset>
49428 #include <vector>
49429 #include <string>
49430 #include <type_traits>
49431 
49432 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
49433 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
49434 // gen_amalgamated expanded: #include "perfetto/base/export.h"
49435 
49436 namespace perfetto {
49437 namespace protos {
49438 namespace gen {
49439 class SysStatsConfig;
49440 enum SysStatsConfig_StatCounters : int;
49441 enum MeminfoCounters : int;
49442 enum VmstatCounters : int;
49443 }  // namespace perfetto
49444 }  // namespace protos
49445 }  // namespace gen
49446 
49447 namespace protozero {
49448 class Message;
49449 }  // namespace protozero
49450 
49451 namespace perfetto {
49452 namespace protos {
49453 namespace gen {
49454 enum SysStatsConfig_StatCounters : int {
49455   SysStatsConfig_StatCounters_STAT_UNSPECIFIED = 0,
49456   SysStatsConfig_StatCounters_STAT_CPU_TIMES = 1,
49457   SysStatsConfig_StatCounters_STAT_IRQ_COUNTS = 2,
49458   SysStatsConfig_StatCounters_STAT_SOFTIRQ_COUNTS = 3,
49459   SysStatsConfig_StatCounters_STAT_FORK_COUNT = 4,
49460 };
49461 
49462 class PERFETTO_EXPORT SysStatsConfig : public ::protozero::CppMessageObj {
49463  public:
49464   using StatCounters = SysStatsConfig_StatCounters;
49465   static constexpr auto STAT_UNSPECIFIED = SysStatsConfig_StatCounters_STAT_UNSPECIFIED;
49466   static constexpr auto STAT_CPU_TIMES = SysStatsConfig_StatCounters_STAT_CPU_TIMES;
49467   static constexpr auto STAT_IRQ_COUNTS = SysStatsConfig_StatCounters_STAT_IRQ_COUNTS;
49468   static constexpr auto STAT_SOFTIRQ_COUNTS = SysStatsConfig_StatCounters_STAT_SOFTIRQ_COUNTS;
49469   static constexpr auto STAT_FORK_COUNT = SysStatsConfig_StatCounters_STAT_FORK_COUNT;
49470   static constexpr auto StatCounters_MIN = SysStatsConfig_StatCounters_STAT_UNSPECIFIED;
49471   static constexpr auto StatCounters_MAX = SysStatsConfig_StatCounters_STAT_FORK_COUNT;
49472   enum FieldNumbers {
49473     kMeminfoPeriodMsFieldNumber = 1,
49474     kMeminfoCountersFieldNumber = 2,
49475     kVmstatPeriodMsFieldNumber = 3,
49476     kVmstatCountersFieldNumber = 4,
49477     kStatPeriodMsFieldNumber = 5,
49478     kStatCountersFieldNumber = 6,
49479   };
49480 
49481   SysStatsConfig();
49482   ~SysStatsConfig() override;
49483   SysStatsConfig(SysStatsConfig&&) noexcept;
49484   SysStatsConfig& operator=(SysStatsConfig&&);
49485   SysStatsConfig(const SysStatsConfig&);
49486   SysStatsConfig& operator=(const SysStatsConfig&);
49487   bool operator==(const SysStatsConfig&) const;
49488   bool operator!=(const SysStatsConfig& other) const { return !(*this == other); }
49489 
49490   bool ParseFromArray(const void*, size_t) override;
49491   std::string SerializeAsString() const override;
49492   std::vector<uint8_t> SerializeAsArray() const override;
49493   void Serialize(::protozero::Message*) const;
49494 
49495   bool has_meminfo_period_ms() const { return _has_field_[1]; }
49496   uint32_t meminfo_period_ms() const { return meminfo_period_ms_; }
49497   void set_meminfo_period_ms(uint32_t value) { meminfo_period_ms_ = value; _has_field_.set(1); }
49498 
49499   int meminfo_counters_size() const { return static_cast<int>(meminfo_counters_.size()); }
49500   const std::vector<MeminfoCounters>& meminfo_counters() const { return meminfo_counters_; }
49501   std::vector<MeminfoCounters>* mutable_meminfo_counters() { return &meminfo_counters_; }
49502   void clear_meminfo_counters() { meminfo_counters_.clear(); }
49503   void add_meminfo_counters(MeminfoCounters value) { meminfo_counters_.emplace_back(value); }
49504   MeminfoCounters* add_meminfo_counters() { meminfo_counters_.emplace_back(); return &meminfo_counters_.back(); }
49505 
49506   bool has_vmstat_period_ms() const { return _has_field_[3]; }
49507   uint32_t vmstat_period_ms() const { return vmstat_period_ms_; }
49508   void set_vmstat_period_ms(uint32_t value) { vmstat_period_ms_ = value; _has_field_.set(3); }
49509 
49510   int vmstat_counters_size() const { return static_cast<int>(vmstat_counters_.size()); }
49511   const std::vector<VmstatCounters>& vmstat_counters() const { return vmstat_counters_; }
49512   std::vector<VmstatCounters>* mutable_vmstat_counters() { return &vmstat_counters_; }
49513   void clear_vmstat_counters() { vmstat_counters_.clear(); }
49514   void add_vmstat_counters(VmstatCounters value) { vmstat_counters_.emplace_back(value); }
49515   VmstatCounters* add_vmstat_counters() { vmstat_counters_.emplace_back(); return &vmstat_counters_.back(); }
49516 
49517   bool has_stat_period_ms() const { return _has_field_[5]; }
49518   uint32_t stat_period_ms() const { return stat_period_ms_; }
49519   void set_stat_period_ms(uint32_t value) { stat_period_ms_ = value; _has_field_.set(5); }
49520 
49521   int stat_counters_size() const { return static_cast<int>(stat_counters_.size()); }
49522   const std::vector<SysStatsConfig_StatCounters>& stat_counters() const { return stat_counters_; }
49523   std::vector<SysStatsConfig_StatCounters>* mutable_stat_counters() { return &stat_counters_; }
49524   void clear_stat_counters() { stat_counters_.clear(); }
49525   void add_stat_counters(SysStatsConfig_StatCounters value) { stat_counters_.emplace_back(value); }
49526   SysStatsConfig_StatCounters* add_stat_counters() { stat_counters_.emplace_back(); return &stat_counters_.back(); }
49527 
49528  private:
49529   uint32_t meminfo_period_ms_{};
49530   std::vector<MeminfoCounters> meminfo_counters_;
49531   uint32_t vmstat_period_ms_{};
49532   std::vector<VmstatCounters> vmstat_counters_;
49533   uint32_t stat_period_ms_{};
49534   std::vector<SysStatsConfig_StatCounters> stat_counters_;
49535 
49536   // Allows to preserve unknown protobuf fields for compatibility
49537   // with future versions of .proto files.
49538   std::string unknown_fields_;
49539 
49540   std::bitset<7> _has_field_{};
49541 };
49542 
49543 }  // namespace perfetto
49544 }  // namespace protos
49545 }  // namespace gen
49546 
49547 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_SYS_STATS_SYS_STATS_CONFIG_PROTO_CPP_H_
49548 // gen_amalgamated begin header: gen/protos/perfetto/config/chrome/chrome_config.gen.h
49549 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
49550 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_CHROME_CHROME_CONFIG_PROTO_CPP_H_
49551 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_CHROME_CHROME_CONFIG_PROTO_CPP_H_
49552 
49553 #include <stdint.h>
49554 #include <bitset>
49555 #include <vector>
49556 #include <string>
49557 #include <type_traits>
49558 
49559 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
49560 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
49561 // gen_amalgamated expanded: #include "perfetto/base/export.h"
49562 
49563 namespace perfetto {
49564 namespace protos {
49565 namespace gen {
49566 class ChromeConfig;
49567 }  // namespace perfetto
49568 }  // namespace protos
49569 }  // namespace gen
49570 
49571 namespace protozero {
49572 class Message;
49573 }  // namespace protozero
49574 
49575 namespace perfetto {
49576 namespace protos {
49577 namespace gen {
49578 
49579 class PERFETTO_EXPORT ChromeConfig : public ::protozero::CppMessageObj {
49580  public:
49581   enum FieldNumbers {
49582     kTraceConfigFieldNumber = 1,
49583     kPrivacyFilteringEnabledFieldNumber = 2,
49584     kConvertToLegacyJsonFieldNumber = 3,
49585   };
49586 
49587   ChromeConfig();
49588   ~ChromeConfig() override;
49589   ChromeConfig(ChromeConfig&&) noexcept;
49590   ChromeConfig& operator=(ChromeConfig&&);
49591   ChromeConfig(const ChromeConfig&);
49592   ChromeConfig& operator=(const ChromeConfig&);
49593   bool operator==(const ChromeConfig&) const;
49594   bool operator!=(const ChromeConfig& other) const { return !(*this == other); }
49595 
49596   bool ParseFromArray(const void*, size_t) override;
49597   std::string SerializeAsString() const override;
49598   std::vector<uint8_t> SerializeAsArray() const override;
49599   void Serialize(::protozero::Message*) const;
49600 
49601   bool has_trace_config() const { return _has_field_[1]; }
49602   const std::string& trace_config() const { return trace_config_; }
49603   void set_trace_config(const std::string& value) { trace_config_ = value; _has_field_.set(1); }
49604 
49605   bool has_privacy_filtering_enabled() const { return _has_field_[2]; }
49606   bool privacy_filtering_enabled() const { return privacy_filtering_enabled_; }
49607   void set_privacy_filtering_enabled(bool value) { privacy_filtering_enabled_ = value; _has_field_.set(2); }
49608 
49609   bool has_convert_to_legacy_json() const { return _has_field_[3]; }
49610   bool convert_to_legacy_json() const { return convert_to_legacy_json_; }
49611   void set_convert_to_legacy_json(bool value) { convert_to_legacy_json_ = value; _has_field_.set(3); }
49612 
49613  private:
49614   std::string trace_config_{};
49615   bool privacy_filtering_enabled_{};
49616   bool convert_to_legacy_json_{};
49617 
49618   // Allows to preserve unknown protobuf fields for compatibility
49619   // with future versions of .proto files.
49620   std::string unknown_fields_;
49621 
49622   std::bitset<4> _has_field_{};
49623 };
49624 
49625 }  // namespace perfetto
49626 }  // namespace protos
49627 }  // namespace gen
49628 
49629 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_CHROME_CHROME_CONFIG_PROTO_CPP_H_
49630 // gen_amalgamated begin header: gen/protos/perfetto/config/data_source_config.gen.h
49631 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
49632 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_DATA_SOURCE_CONFIG_PROTO_CPP_H_
49633 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_DATA_SOURCE_CONFIG_PROTO_CPP_H_
49634 
49635 #include <stdint.h>
49636 #include <bitset>
49637 #include <vector>
49638 #include <string>
49639 #include <type_traits>
49640 
49641 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
49642 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
49643 // gen_amalgamated expanded: #include "perfetto/base/export.h"
49644 
49645 namespace perfetto {
49646 namespace protos {
49647 namespace gen {
49648 class DataSourceConfig;
49649 class TestConfig;
49650 class TestConfig_DummyFields;
49651 class ChromeConfig;
49652 }  // namespace perfetto
49653 }  // namespace protos
49654 }  // namespace gen
49655 
49656 namespace protozero {
49657 class Message;
49658 }  // namespace protozero
49659 
49660 namespace perfetto {
49661 namespace protos {
49662 namespace gen {
49663 
49664 class PERFETTO_EXPORT DataSourceConfig : public ::protozero::CppMessageObj {
49665  public:
49666   enum FieldNumbers {
49667     kNameFieldNumber = 1,
49668     kTargetBufferFieldNumber = 2,
49669     kTraceDurationMsFieldNumber = 3,
49670     kStopTimeoutMsFieldNumber = 7,
49671     kEnableExtraGuardrailsFieldNumber = 6,
49672     kTracingSessionIdFieldNumber = 4,
49673     kFtraceConfigFieldNumber = 100,
49674     kInodeFileConfigFieldNumber = 102,
49675     kProcessStatsConfigFieldNumber = 103,
49676     kSysStatsConfigFieldNumber = 104,
49677     kHeapprofdConfigFieldNumber = 105,
49678     kJavaHprofConfigFieldNumber = 110,
49679     kAndroidPowerConfigFieldNumber = 106,
49680     kAndroidLogConfigFieldNumber = 107,
49681     kGpuCounterConfigFieldNumber = 108,
49682     kPackagesListConfigFieldNumber = 109,
49683     kPerfEventConfigFieldNumber = 111,
49684     kVulkanMemoryConfigFieldNumber = 112,
49685     kTrackEventConfigFieldNumber = 113,
49686     kAndroidPolledStateConfigFieldNumber = 114,
49687     kChromeConfigFieldNumber = 101,
49688     kLegacyConfigFieldNumber = 1000,
49689     kForTestingFieldNumber = 1001,
49690   };
49691 
49692   DataSourceConfig();
49693   ~DataSourceConfig() override;
49694   DataSourceConfig(DataSourceConfig&&) noexcept;
49695   DataSourceConfig& operator=(DataSourceConfig&&);
49696   DataSourceConfig(const DataSourceConfig&);
49697   DataSourceConfig& operator=(const DataSourceConfig&);
49698   bool operator==(const DataSourceConfig&) const;
49699   bool operator!=(const DataSourceConfig& other) const { return !(*this == other); }
49700 
49701   bool ParseFromArray(const void*, size_t) override;
49702   std::string SerializeAsString() const override;
49703   std::vector<uint8_t> SerializeAsArray() const override;
49704   void Serialize(::protozero::Message*) const;
49705 
49706   bool has_name() const { return _has_field_[1]; }
49707   const std::string& name() const { return name_; }
49708   void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
49709 
49710   bool has_target_buffer() const { return _has_field_[2]; }
49711   uint32_t target_buffer() const { return target_buffer_; }
49712   void set_target_buffer(uint32_t value) { target_buffer_ = value; _has_field_.set(2); }
49713 
49714   bool has_trace_duration_ms() const { return _has_field_[3]; }
49715   uint32_t trace_duration_ms() const { return trace_duration_ms_; }
49716   void set_trace_duration_ms(uint32_t value) { trace_duration_ms_ = value; _has_field_.set(3); }
49717 
49718   bool has_stop_timeout_ms() const { return _has_field_[7]; }
49719   uint32_t stop_timeout_ms() const { return stop_timeout_ms_; }
49720   void set_stop_timeout_ms(uint32_t value) { stop_timeout_ms_ = value; _has_field_.set(7); }
49721 
49722   bool has_enable_extra_guardrails() const { return _has_field_[6]; }
49723   bool enable_extra_guardrails() const { return enable_extra_guardrails_; }
49724   void set_enable_extra_guardrails(bool value) { enable_extra_guardrails_ = value; _has_field_.set(6); }
49725 
49726   bool has_tracing_session_id() const { return _has_field_[4]; }
49727   uint64_t tracing_session_id() const { return tracing_session_id_; }
49728   void set_tracing_session_id(uint64_t value) { tracing_session_id_ = value; _has_field_.set(4); }
49729 
49730   const std::string& ftrace_config_raw() const { return ftrace_config_; }
49731   void set_ftrace_config_raw(const std::string& raw) { ftrace_config_ = raw; _has_field_.set(100); }
49732 
49733   const std::string& inode_file_config_raw() const { return inode_file_config_; }
49734   void set_inode_file_config_raw(const std::string& raw) { inode_file_config_ = raw; _has_field_.set(102); }
49735 
49736   const std::string& process_stats_config_raw() const { return process_stats_config_; }
49737   void set_process_stats_config_raw(const std::string& raw) { process_stats_config_ = raw; _has_field_.set(103); }
49738 
49739   const std::string& sys_stats_config_raw() const { return sys_stats_config_; }
49740   void set_sys_stats_config_raw(const std::string& raw) { sys_stats_config_ = raw; _has_field_.set(104); }
49741 
49742   const std::string& heapprofd_config_raw() const { return heapprofd_config_; }
49743   void set_heapprofd_config_raw(const std::string& raw) { heapprofd_config_ = raw; _has_field_.set(105); }
49744 
49745   const std::string& java_hprof_config_raw() const { return java_hprof_config_; }
49746   void set_java_hprof_config_raw(const std::string& raw) { java_hprof_config_ = raw; _has_field_.set(110); }
49747 
49748   const std::string& android_power_config_raw() const { return android_power_config_; }
49749   void set_android_power_config_raw(const std::string& raw) { android_power_config_ = raw; _has_field_.set(106); }
49750 
49751   const std::string& android_log_config_raw() const { return android_log_config_; }
49752   void set_android_log_config_raw(const std::string& raw) { android_log_config_ = raw; _has_field_.set(107); }
49753 
49754   const std::string& gpu_counter_config_raw() const { return gpu_counter_config_; }
49755   void set_gpu_counter_config_raw(const std::string& raw) { gpu_counter_config_ = raw; _has_field_.set(108); }
49756 
49757   const std::string& packages_list_config_raw() const { return packages_list_config_; }
49758   void set_packages_list_config_raw(const std::string& raw) { packages_list_config_ = raw; _has_field_.set(109); }
49759 
49760   const std::string& perf_event_config_raw() const { return perf_event_config_; }
49761   void set_perf_event_config_raw(const std::string& raw) { perf_event_config_ = raw; _has_field_.set(111); }
49762 
49763   const std::string& vulkan_memory_config_raw() const { return vulkan_memory_config_; }
49764   void set_vulkan_memory_config_raw(const std::string& raw) { vulkan_memory_config_ = raw; _has_field_.set(112); }
49765 
49766   const std::string& track_event_config_raw() const { return track_event_config_; }
49767   void set_track_event_config_raw(const std::string& raw) { track_event_config_ = raw; _has_field_.set(113); }
49768 
49769   const std::string& android_polled_state_config_raw() const { return android_polled_state_config_; }
49770   void set_android_polled_state_config_raw(const std::string& raw) { android_polled_state_config_ = raw; _has_field_.set(114); }
49771 
49772   bool has_chrome_config() const { return _has_field_[101]; }
49773   const ChromeConfig& chrome_config() const { return *chrome_config_; }
49774   ChromeConfig* mutable_chrome_config() { _has_field_.set(101); return chrome_config_.get(); }
49775 
49776   bool has_legacy_config() const { return _has_field_[1000]; }
49777   const std::string& legacy_config() const { return legacy_config_; }
49778   void set_legacy_config(const std::string& value) { legacy_config_ = value; _has_field_.set(1000); }
49779 
49780   bool has_for_testing() const { return _has_field_[1001]; }
49781   const TestConfig& for_testing() const { return *for_testing_; }
49782   TestConfig* mutable_for_testing() { _has_field_.set(1001); return for_testing_.get(); }
49783 
49784  private:
49785   std::string name_{};
49786   uint32_t target_buffer_{};
49787   uint32_t trace_duration_ms_{};
49788   uint32_t stop_timeout_ms_{};
49789   bool enable_extra_guardrails_{};
49790   uint64_t tracing_session_id_{};
49791   std::string ftrace_config_;  // [lazy=true]
49792   std::string inode_file_config_;  // [lazy=true]
49793   std::string process_stats_config_;  // [lazy=true]
49794   std::string sys_stats_config_;  // [lazy=true]
49795   std::string heapprofd_config_;  // [lazy=true]
49796   std::string java_hprof_config_;  // [lazy=true]
49797   std::string android_power_config_;  // [lazy=true]
49798   std::string android_log_config_;  // [lazy=true]
49799   std::string gpu_counter_config_;  // [lazy=true]
49800   std::string packages_list_config_;  // [lazy=true]
49801   std::string perf_event_config_;  // [lazy=true]
49802   std::string vulkan_memory_config_;  // [lazy=true]
49803   std::string track_event_config_;  // [lazy=true]
49804   std::string android_polled_state_config_;  // [lazy=true]
49805   ::protozero::CopyablePtr<ChromeConfig> chrome_config_;
49806   std::string legacy_config_{};
49807   ::protozero::CopyablePtr<TestConfig> for_testing_;
49808 
49809   // Allows to preserve unknown protobuf fields for compatibility
49810   // with future versions of .proto files.
49811   std::string unknown_fields_;
49812 
49813   std::bitset<1002> _has_field_{};
49814 };
49815 
49816 }  // namespace perfetto
49817 }  // namespace protos
49818 }  // namespace gen
49819 
49820 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_DATA_SOURCE_CONFIG_PROTO_CPP_H_
49821 // gen_amalgamated begin header: gen/protos/perfetto/config/stress_test_config.gen.h
49822 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
49823 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_STRESS_TEST_CONFIG_PROTO_CPP_H_
49824 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_STRESS_TEST_CONFIG_PROTO_CPP_H_
49825 
49826 #include <stdint.h>
49827 #include <bitset>
49828 #include <vector>
49829 #include <string>
49830 #include <type_traits>
49831 
49832 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
49833 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
49834 // gen_amalgamated expanded: #include "perfetto/base/export.h"
49835 
49836 namespace perfetto {
49837 namespace protos {
49838 namespace gen {
49839 class StressTestConfig;
49840 class StressTestConfig_WriterTiming;
49841 class TraceConfig;
49842 class TraceConfig_IncidentReportConfig;
49843 class TraceConfig_IncrementalStateConfig;
49844 class TraceConfig_TriggerConfig;
49845 class TraceConfig_TriggerConfig_Trigger;
49846 class TraceConfig_GuardrailOverrides;
49847 class TraceConfig_StatsdMetadata;
49848 class TraceConfig_ProducerConfig;
49849 class TraceConfig_BuiltinDataSource;
49850 class TraceConfig_DataSource;
49851 class DataSourceConfig;
49852 class TestConfig;
49853 class TestConfig_DummyFields;
49854 class ChromeConfig;
49855 class TraceConfig_BufferConfig;
49856 enum TraceConfig_LockdownModeOperation : int;
49857 enum TraceConfig_CompressionType : int;
49858 enum TraceConfig_TriggerConfig_TriggerMode : int;
49859 enum BuiltinClock : int;
49860 enum TraceConfig_BufferConfig_FillPolicy : int;
49861 }  // namespace perfetto
49862 }  // namespace protos
49863 }  // namespace gen
49864 
49865 namespace protozero {
49866 class Message;
49867 }  // namespace protozero
49868 
49869 namespace perfetto {
49870 namespace protos {
49871 namespace gen {
49872 
49873 class PERFETTO_EXPORT StressTestConfig : public ::protozero::CppMessageObj {
49874  public:
49875   using WriterTiming = StressTestConfig_WriterTiming;
49876   enum FieldNumbers {
49877     kTraceConfigFieldNumber = 1,
49878     kShmemSizeKbFieldNumber = 2,
49879     kShmemPageSizeKbFieldNumber = 3,
49880     kNumProcessesFieldNumber = 4,
49881     kNumThreadsFieldNumber = 5,
49882     kMaxEventsFieldNumber = 6,
49883     kNestingFieldNumber = 7,
49884     kSteadyStateTimingsFieldNumber = 8,
49885     kBurstPeriodMsFieldNumber = 9,
49886     kBurstDurationMsFieldNumber = 10,
49887     kBurstTimingsFieldNumber = 11,
49888   };
49889 
49890   StressTestConfig();
49891   ~StressTestConfig() override;
49892   StressTestConfig(StressTestConfig&&) noexcept;
49893   StressTestConfig& operator=(StressTestConfig&&);
49894   StressTestConfig(const StressTestConfig&);
49895   StressTestConfig& operator=(const StressTestConfig&);
49896   bool operator==(const StressTestConfig&) const;
49897   bool operator!=(const StressTestConfig& other) const { return !(*this == other); }
49898 
49899   bool ParseFromArray(const void*, size_t) override;
49900   std::string SerializeAsString() const override;
49901   std::vector<uint8_t> SerializeAsArray() const override;
49902   void Serialize(::protozero::Message*) const;
49903 
49904   bool has_trace_config() const { return _has_field_[1]; }
49905   const TraceConfig& trace_config() const { return *trace_config_; }
49906   TraceConfig* mutable_trace_config() { _has_field_.set(1); return trace_config_.get(); }
49907 
49908   bool has_shmem_size_kb() const { return _has_field_[2]; }
49909   uint32_t shmem_size_kb() const { return shmem_size_kb_; }
49910   void set_shmem_size_kb(uint32_t value) { shmem_size_kb_ = value; _has_field_.set(2); }
49911 
49912   bool has_shmem_page_size_kb() const { return _has_field_[3]; }
49913   uint32_t shmem_page_size_kb() const { return shmem_page_size_kb_; }
49914   void set_shmem_page_size_kb(uint32_t value) { shmem_page_size_kb_ = value; _has_field_.set(3); }
49915 
49916   bool has_num_processes() const { return _has_field_[4]; }
49917   uint32_t num_processes() const { return num_processes_; }
49918   void set_num_processes(uint32_t value) { num_processes_ = value; _has_field_.set(4); }
49919 
49920   bool has_num_threads() const { return _has_field_[5]; }
49921   uint32_t num_threads() const { return num_threads_; }
49922   void set_num_threads(uint32_t value) { num_threads_ = value; _has_field_.set(5); }
49923 
49924   bool has_max_events() const { return _has_field_[6]; }
49925   uint32_t max_events() const { return max_events_; }
49926   void set_max_events(uint32_t value) { max_events_ = value; _has_field_.set(6); }
49927 
49928   bool has_nesting() const { return _has_field_[7]; }
49929   uint32_t nesting() const { return nesting_; }
49930   void set_nesting(uint32_t value) { nesting_ = value; _has_field_.set(7); }
49931 
49932   bool has_steady_state_timings() const { return _has_field_[8]; }
49933   const StressTestConfig_WriterTiming& steady_state_timings() const { return *steady_state_timings_; }
49934   StressTestConfig_WriterTiming* mutable_steady_state_timings() { _has_field_.set(8); return steady_state_timings_.get(); }
49935 
49936   bool has_burst_period_ms() const { return _has_field_[9]; }
49937   uint32_t burst_period_ms() const { return burst_period_ms_; }
49938   void set_burst_period_ms(uint32_t value) { burst_period_ms_ = value; _has_field_.set(9); }
49939 
49940   bool has_burst_duration_ms() const { return _has_field_[10]; }
49941   uint32_t burst_duration_ms() const { return burst_duration_ms_; }
49942   void set_burst_duration_ms(uint32_t value) { burst_duration_ms_ = value; _has_field_.set(10); }
49943 
49944   bool has_burst_timings() const { return _has_field_[11]; }
49945   const StressTestConfig_WriterTiming& burst_timings() const { return *burst_timings_; }
49946   StressTestConfig_WriterTiming* mutable_burst_timings() { _has_field_.set(11); return burst_timings_.get(); }
49947 
49948  private:
49949   ::protozero::CopyablePtr<TraceConfig> trace_config_;
49950   uint32_t shmem_size_kb_{};
49951   uint32_t shmem_page_size_kb_{};
49952   uint32_t num_processes_{};
49953   uint32_t num_threads_{};
49954   uint32_t max_events_{};
49955   uint32_t nesting_{};
49956   ::protozero::CopyablePtr<StressTestConfig_WriterTiming> steady_state_timings_;
49957   uint32_t burst_period_ms_{};
49958   uint32_t burst_duration_ms_{};
49959   ::protozero::CopyablePtr<StressTestConfig_WriterTiming> burst_timings_;
49960 
49961   // Allows to preserve unknown protobuf fields for compatibility
49962   // with future versions of .proto files.
49963   std::string unknown_fields_;
49964 
49965   std::bitset<12> _has_field_{};
49966 };
49967 
49968 
49969 class PERFETTO_EXPORT StressTestConfig_WriterTiming : public ::protozero::CppMessageObj {
49970  public:
49971   enum FieldNumbers {
49972     kPayloadMeanFieldNumber = 1,
49973     kPayloadStddevFieldNumber = 2,
49974     kRateMeanFieldNumber = 3,
49975     kRateStddevFieldNumber = 4,
49976     kPayloadWriteTimeMsFieldNumber = 5,
49977   };
49978 
49979   StressTestConfig_WriterTiming();
49980   ~StressTestConfig_WriterTiming() override;
49981   StressTestConfig_WriterTiming(StressTestConfig_WriterTiming&&) noexcept;
49982   StressTestConfig_WriterTiming& operator=(StressTestConfig_WriterTiming&&);
49983   StressTestConfig_WriterTiming(const StressTestConfig_WriterTiming&);
49984   StressTestConfig_WriterTiming& operator=(const StressTestConfig_WriterTiming&);
49985   bool operator==(const StressTestConfig_WriterTiming&) const;
49986   bool operator!=(const StressTestConfig_WriterTiming& other) const { return !(*this == other); }
49987 
49988   bool ParseFromArray(const void*, size_t) override;
49989   std::string SerializeAsString() const override;
49990   std::vector<uint8_t> SerializeAsArray() const override;
49991   void Serialize(::protozero::Message*) const;
49992 
49993   bool has_payload_mean() const { return _has_field_[1]; }
49994   double payload_mean() const { return payload_mean_; }
49995   void set_payload_mean(double value) { payload_mean_ = value; _has_field_.set(1); }
49996 
49997   bool has_payload_stddev() const { return _has_field_[2]; }
49998   double payload_stddev() const { return payload_stddev_; }
49999   void set_payload_stddev(double value) { payload_stddev_ = value; _has_field_.set(2); }
50000 
50001   bool has_rate_mean() const { return _has_field_[3]; }
50002   double rate_mean() const { return rate_mean_; }
50003   void set_rate_mean(double value) { rate_mean_ = value; _has_field_.set(3); }
50004 
50005   bool has_rate_stddev() const { return _has_field_[4]; }
50006   double rate_stddev() const { return rate_stddev_; }
50007   void set_rate_stddev(double value) { rate_stddev_ = value; _has_field_.set(4); }
50008 
50009   bool has_payload_write_time_ms() const { return _has_field_[5]; }
50010   uint32_t payload_write_time_ms() const { return payload_write_time_ms_; }
50011   void set_payload_write_time_ms(uint32_t value) { payload_write_time_ms_ = value; _has_field_.set(5); }
50012 
50013  private:
50014   double payload_mean_{};
50015   double payload_stddev_{};
50016   double rate_mean_{};
50017   double rate_stddev_{};
50018   uint32_t payload_write_time_ms_{};
50019 
50020   // Allows to preserve unknown protobuf fields for compatibility
50021   // with future versions of .proto files.
50022   std::string unknown_fields_;
50023 
50024   std::bitset<6> _has_field_{};
50025 };
50026 
50027 }  // namespace perfetto
50028 }  // namespace protos
50029 }  // namespace gen
50030 
50031 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_STRESS_TEST_CONFIG_PROTO_CPP_H_
50032 // gen_amalgamated begin header: gen/protos/perfetto/config/test_config.gen.h
50033 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
50034 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TEST_CONFIG_PROTO_CPP_H_
50035 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TEST_CONFIG_PROTO_CPP_H_
50036 
50037 #include <stdint.h>
50038 #include <bitset>
50039 #include <vector>
50040 #include <string>
50041 #include <type_traits>
50042 
50043 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
50044 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
50045 // gen_amalgamated expanded: #include "perfetto/base/export.h"
50046 
50047 namespace perfetto {
50048 namespace protos {
50049 namespace gen {
50050 class TestConfig;
50051 class TestConfig_DummyFields;
50052 }  // namespace perfetto
50053 }  // namespace protos
50054 }  // namespace gen
50055 
50056 namespace protozero {
50057 class Message;
50058 }  // namespace protozero
50059 
50060 namespace perfetto {
50061 namespace protos {
50062 namespace gen {
50063 
50064 class PERFETTO_EXPORT TestConfig : public ::protozero::CppMessageObj {
50065  public:
50066   using DummyFields = TestConfig_DummyFields;
50067   enum FieldNumbers {
50068     kMessageCountFieldNumber = 1,
50069     kMaxMessagesPerSecondFieldNumber = 2,
50070     kSeedFieldNumber = 3,
50071     kMessageSizeFieldNumber = 4,
50072     kSendBatchOnRegisterFieldNumber = 5,
50073     kDummyFieldsFieldNumber = 6,
50074   };
50075 
50076   TestConfig();
50077   ~TestConfig() override;
50078   TestConfig(TestConfig&&) noexcept;
50079   TestConfig& operator=(TestConfig&&);
50080   TestConfig(const TestConfig&);
50081   TestConfig& operator=(const TestConfig&);
50082   bool operator==(const TestConfig&) const;
50083   bool operator!=(const TestConfig& other) const { return !(*this == other); }
50084 
50085   bool ParseFromArray(const void*, size_t) override;
50086   std::string SerializeAsString() const override;
50087   std::vector<uint8_t> SerializeAsArray() const override;
50088   void Serialize(::protozero::Message*) const;
50089 
50090   bool has_message_count() const { return _has_field_[1]; }
50091   uint32_t message_count() const { return message_count_; }
50092   void set_message_count(uint32_t value) { message_count_ = value; _has_field_.set(1); }
50093 
50094   bool has_max_messages_per_second() const { return _has_field_[2]; }
50095   uint32_t max_messages_per_second() const { return max_messages_per_second_; }
50096   void set_max_messages_per_second(uint32_t value) { max_messages_per_second_ = value; _has_field_.set(2); }
50097 
50098   bool has_seed() const { return _has_field_[3]; }
50099   uint32_t seed() const { return seed_; }
50100   void set_seed(uint32_t value) { seed_ = value; _has_field_.set(3); }
50101 
50102   bool has_message_size() const { return _has_field_[4]; }
50103   uint32_t message_size() const { return message_size_; }
50104   void set_message_size(uint32_t value) { message_size_ = value; _has_field_.set(4); }
50105 
50106   bool has_send_batch_on_register() const { return _has_field_[5]; }
50107   bool send_batch_on_register() const { return send_batch_on_register_; }
50108   void set_send_batch_on_register(bool value) { send_batch_on_register_ = value; _has_field_.set(5); }
50109 
50110   bool has_dummy_fields() const { return _has_field_[6]; }
50111   const TestConfig_DummyFields& dummy_fields() const { return *dummy_fields_; }
50112   TestConfig_DummyFields* mutable_dummy_fields() { _has_field_.set(6); return dummy_fields_.get(); }
50113 
50114  private:
50115   uint32_t message_count_{};
50116   uint32_t max_messages_per_second_{};
50117   uint32_t seed_{};
50118   uint32_t message_size_{};
50119   bool send_batch_on_register_{};
50120   ::protozero::CopyablePtr<TestConfig_DummyFields> dummy_fields_;
50121 
50122   // Allows to preserve unknown protobuf fields for compatibility
50123   // with future versions of .proto files.
50124   std::string unknown_fields_;
50125 
50126   std::bitset<7> _has_field_{};
50127 };
50128 
50129 
50130 class PERFETTO_EXPORT TestConfig_DummyFields : public ::protozero::CppMessageObj {
50131  public:
50132   enum FieldNumbers {
50133     kFieldUint32FieldNumber = 1,
50134     kFieldInt32FieldNumber = 2,
50135     kFieldUint64FieldNumber = 3,
50136     kFieldInt64FieldNumber = 4,
50137     kFieldFixed64FieldNumber = 5,
50138     kFieldSfixed64FieldNumber = 6,
50139     kFieldFixed32FieldNumber = 7,
50140     kFieldSfixed32FieldNumber = 8,
50141     kFieldDoubleFieldNumber = 9,
50142     kFieldFloatFieldNumber = 10,
50143     kFieldSint64FieldNumber = 11,
50144     kFieldSint32FieldNumber = 12,
50145     kFieldStringFieldNumber = 13,
50146     kFieldBytesFieldNumber = 14,
50147   };
50148 
50149   TestConfig_DummyFields();
50150   ~TestConfig_DummyFields() override;
50151   TestConfig_DummyFields(TestConfig_DummyFields&&) noexcept;
50152   TestConfig_DummyFields& operator=(TestConfig_DummyFields&&);
50153   TestConfig_DummyFields(const TestConfig_DummyFields&);
50154   TestConfig_DummyFields& operator=(const TestConfig_DummyFields&);
50155   bool operator==(const TestConfig_DummyFields&) const;
50156   bool operator!=(const TestConfig_DummyFields& other) const { return !(*this == other); }
50157 
50158   bool ParseFromArray(const void*, size_t) override;
50159   std::string SerializeAsString() const override;
50160   std::vector<uint8_t> SerializeAsArray() const override;
50161   void Serialize(::protozero::Message*) const;
50162 
50163   bool has_field_uint32() const { return _has_field_[1]; }
50164   uint32_t field_uint32() const { return field_uint32_; }
50165   void set_field_uint32(uint32_t value) { field_uint32_ = value; _has_field_.set(1); }
50166 
50167   bool has_field_int32() const { return _has_field_[2]; }
50168   int32_t field_int32() const { return field_int32_; }
50169   void set_field_int32(int32_t value) { field_int32_ = value; _has_field_.set(2); }
50170 
50171   bool has_field_uint64() const { return _has_field_[3]; }
50172   uint64_t field_uint64() const { return field_uint64_; }
50173   void set_field_uint64(uint64_t value) { field_uint64_ = value; _has_field_.set(3); }
50174 
50175   bool has_field_int64() const { return _has_field_[4]; }
50176   int64_t field_int64() const { return field_int64_; }
50177   void set_field_int64(int64_t value) { field_int64_ = value; _has_field_.set(4); }
50178 
50179   bool has_field_fixed64() const { return _has_field_[5]; }
50180   uint64_t field_fixed64() const { return field_fixed64_; }
50181   void set_field_fixed64(uint64_t value) { field_fixed64_ = value; _has_field_.set(5); }
50182 
50183   bool has_field_sfixed64() const { return _has_field_[6]; }
50184   int64_t field_sfixed64() const { return field_sfixed64_; }
50185   void set_field_sfixed64(int64_t value) { field_sfixed64_ = value; _has_field_.set(6); }
50186 
50187   bool has_field_fixed32() const { return _has_field_[7]; }
50188   uint32_t field_fixed32() const { return field_fixed32_; }
50189   void set_field_fixed32(uint32_t value) { field_fixed32_ = value; _has_field_.set(7); }
50190 
50191   bool has_field_sfixed32() const { return _has_field_[8]; }
50192   int32_t field_sfixed32() const { return field_sfixed32_; }
50193   void set_field_sfixed32(int32_t value) { field_sfixed32_ = value; _has_field_.set(8); }
50194 
50195   bool has_field_double() const { return _has_field_[9]; }
50196   double field_double() const { return field_double_; }
50197   void set_field_double(double value) { field_double_ = value; _has_field_.set(9); }
50198 
50199   bool has_field_float() const { return _has_field_[10]; }
50200   float field_float() const { return field_float_; }
50201   void set_field_float(float value) { field_float_ = value; _has_field_.set(10); }
50202 
50203   bool has_field_sint64() const { return _has_field_[11]; }
50204   int64_t field_sint64() const { return field_sint64_; }
50205   void set_field_sint64(int64_t value) { field_sint64_ = value; _has_field_.set(11); }
50206 
50207   bool has_field_sint32() const { return _has_field_[12]; }
50208   int32_t field_sint32() const { return field_sint32_; }
50209   void set_field_sint32(int32_t value) { field_sint32_ = value; _has_field_.set(12); }
50210 
50211   bool has_field_string() const { return _has_field_[13]; }
50212   const std::string& field_string() const { return field_string_; }
50213   void set_field_string(const std::string& value) { field_string_ = value; _has_field_.set(13); }
50214 
50215   bool has_field_bytes() const { return _has_field_[14]; }
50216   const std::string& field_bytes() const { return field_bytes_; }
50217   void set_field_bytes(const std::string& value) { field_bytes_ = value; _has_field_.set(14); }
50218   void set_field_bytes(const void* p, size_t s) { field_bytes_.assign(reinterpret_cast<const char*>(p), s); _has_field_.set(14); }
50219 
50220  private:
50221   uint32_t field_uint32_{};
50222   int32_t field_int32_{};
50223   uint64_t field_uint64_{};
50224   int64_t field_int64_{};
50225   uint64_t field_fixed64_{};
50226   int64_t field_sfixed64_{};
50227   uint32_t field_fixed32_{};
50228   int32_t field_sfixed32_{};
50229   double field_double_{};
50230   float field_float_{};
50231   int64_t field_sint64_{};
50232   int32_t field_sint32_{};
50233   std::string field_string_{};
50234   std::string field_bytes_{};
50235 
50236   // Allows to preserve unknown protobuf fields for compatibility
50237   // with future versions of .proto files.
50238   std::string unknown_fields_;
50239 
50240   std::bitset<15> _has_field_{};
50241 };
50242 
50243 }  // namespace perfetto
50244 }  // namespace protos
50245 }  // namespace gen
50246 
50247 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TEST_CONFIG_PROTO_CPP_H_
50248 // gen_amalgamated begin header: gen/protos/perfetto/config/trace_config.gen.h
50249 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
50250 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TRACE_CONFIG_PROTO_CPP_H_
50251 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TRACE_CONFIG_PROTO_CPP_H_
50252 
50253 #include <stdint.h>
50254 #include <bitset>
50255 #include <vector>
50256 #include <string>
50257 #include <type_traits>
50258 
50259 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
50260 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
50261 // gen_amalgamated expanded: #include "perfetto/base/export.h"
50262 
50263 namespace perfetto {
50264 namespace protos {
50265 namespace gen {
50266 class TraceConfig;
50267 class TraceConfig_IncidentReportConfig;
50268 class TraceConfig_IncrementalStateConfig;
50269 class TraceConfig_TriggerConfig;
50270 class TraceConfig_TriggerConfig_Trigger;
50271 class TraceConfig_GuardrailOverrides;
50272 class TraceConfig_StatsdMetadata;
50273 class TraceConfig_ProducerConfig;
50274 class TraceConfig_BuiltinDataSource;
50275 class TraceConfig_DataSource;
50276 class DataSourceConfig;
50277 class TestConfig;
50278 class TestConfig_DummyFields;
50279 class ChromeConfig;
50280 class TraceConfig_BufferConfig;
50281 enum TraceConfig_LockdownModeOperation : int;
50282 enum TraceConfig_CompressionType : int;
50283 enum TraceConfig_TriggerConfig_TriggerMode : int;
50284 enum BuiltinClock : int;
50285 enum TraceConfig_BufferConfig_FillPolicy : int;
50286 }  // namespace perfetto
50287 }  // namespace protos
50288 }  // namespace gen
50289 
50290 namespace protozero {
50291 class Message;
50292 }  // namespace protozero
50293 
50294 namespace perfetto {
50295 namespace protos {
50296 namespace gen {
50297 enum TraceConfig_LockdownModeOperation : int {
50298   TraceConfig_LockdownModeOperation_LOCKDOWN_UNCHANGED = 0,
50299   TraceConfig_LockdownModeOperation_LOCKDOWN_CLEAR = 1,
50300   TraceConfig_LockdownModeOperation_LOCKDOWN_SET = 2,
50301 };
50302 enum TraceConfig_CompressionType : int {
50303   TraceConfig_CompressionType_COMPRESSION_TYPE_UNSPECIFIED = 0,
50304   TraceConfig_CompressionType_COMPRESSION_TYPE_DEFLATE = 1,
50305 };
50306 enum TraceConfig_TriggerConfig_TriggerMode : int {
50307   TraceConfig_TriggerConfig_TriggerMode_UNSPECIFIED = 0,
50308   TraceConfig_TriggerConfig_TriggerMode_START_TRACING = 1,
50309   TraceConfig_TriggerConfig_TriggerMode_STOP_TRACING = 2,
50310 };
50311 enum TraceConfig_BufferConfig_FillPolicy : int {
50312   TraceConfig_BufferConfig_FillPolicy_UNSPECIFIED = 0,
50313   TraceConfig_BufferConfig_FillPolicy_RING_BUFFER = 1,
50314   TraceConfig_BufferConfig_FillPolicy_DISCARD = 2,
50315 };
50316 
50317 class PERFETTO_EXPORT TraceConfig : public ::protozero::CppMessageObj {
50318  public:
50319   using BufferConfig = TraceConfig_BufferConfig;
50320   using DataSource = TraceConfig_DataSource;
50321   using BuiltinDataSource = TraceConfig_BuiltinDataSource;
50322   using ProducerConfig = TraceConfig_ProducerConfig;
50323   using StatsdMetadata = TraceConfig_StatsdMetadata;
50324   using GuardrailOverrides = TraceConfig_GuardrailOverrides;
50325   using TriggerConfig = TraceConfig_TriggerConfig;
50326   using IncrementalStateConfig = TraceConfig_IncrementalStateConfig;
50327   using IncidentReportConfig = TraceConfig_IncidentReportConfig;
50328   using LockdownModeOperation = TraceConfig_LockdownModeOperation;
50329   static constexpr auto LOCKDOWN_UNCHANGED = TraceConfig_LockdownModeOperation_LOCKDOWN_UNCHANGED;
50330   static constexpr auto LOCKDOWN_CLEAR = TraceConfig_LockdownModeOperation_LOCKDOWN_CLEAR;
50331   static constexpr auto LOCKDOWN_SET = TraceConfig_LockdownModeOperation_LOCKDOWN_SET;
50332   static constexpr auto LockdownModeOperation_MIN = TraceConfig_LockdownModeOperation_LOCKDOWN_UNCHANGED;
50333   static constexpr auto LockdownModeOperation_MAX = TraceConfig_LockdownModeOperation_LOCKDOWN_SET;
50334   using CompressionType = TraceConfig_CompressionType;
50335   static constexpr auto COMPRESSION_TYPE_UNSPECIFIED = TraceConfig_CompressionType_COMPRESSION_TYPE_UNSPECIFIED;
50336   static constexpr auto COMPRESSION_TYPE_DEFLATE = TraceConfig_CompressionType_COMPRESSION_TYPE_DEFLATE;
50337   static constexpr auto CompressionType_MIN = TraceConfig_CompressionType_COMPRESSION_TYPE_UNSPECIFIED;
50338   static constexpr auto CompressionType_MAX = TraceConfig_CompressionType_COMPRESSION_TYPE_DEFLATE;
50339   enum FieldNumbers {
50340     kBuffersFieldNumber = 1,
50341     kDataSourcesFieldNumber = 2,
50342     kBuiltinDataSourcesFieldNumber = 20,
50343     kDurationMsFieldNumber = 3,
50344     kEnableExtraGuardrailsFieldNumber = 4,
50345     kLockdownModeFieldNumber = 5,
50346     kProducersFieldNumber = 6,
50347     kStatsdMetadataFieldNumber = 7,
50348     kWriteIntoFileFieldNumber = 8,
50349     kOutputPathFieldNumber = 29,
50350     kFileWritePeriodMsFieldNumber = 9,
50351     kMaxFileSizeBytesFieldNumber = 10,
50352     kGuardrailOverridesFieldNumber = 11,
50353     kDeferredStartFieldNumber = 12,
50354     kFlushPeriodMsFieldNumber = 13,
50355     kFlushTimeoutMsFieldNumber = 14,
50356     kDataSourceStopTimeoutMsFieldNumber = 23,
50357     kNotifyTraceurFieldNumber = 16,
50358     kTriggerConfigFieldNumber = 17,
50359     kActivateTriggersFieldNumber = 18,
50360     kIncrementalStateConfigFieldNumber = 21,
50361     kAllowUserBuildTracingFieldNumber = 19,
50362     kUniqueSessionNameFieldNumber = 22,
50363     kCompressionTypeFieldNumber = 24,
50364     kIncidentReportConfigFieldNumber = 25,
50365     kTraceUuidMsbFieldNumber = 27,
50366     kTraceUuidLsbFieldNumber = 28,
50367   };
50368 
50369   TraceConfig();
50370   ~TraceConfig() override;
50371   TraceConfig(TraceConfig&&) noexcept;
50372   TraceConfig& operator=(TraceConfig&&);
50373   TraceConfig(const TraceConfig&);
50374   TraceConfig& operator=(const TraceConfig&);
50375   bool operator==(const TraceConfig&) const;
50376   bool operator!=(const TraceConfig& other) const { return !(*this == other); }
50377 
50378   bool ParseFromArray(const void*, size_t) override;
50379   std::string SerializeAsString() const override;
50380   std::vector<uint8_t> SerializeAsArray() const override;
50381   void Serialize(::protozero::Message*) const;
50382 
50383   int buffers_size() const { return static_cast<int>(buffers_.size()); }
50384   const std::vector<TraceConfig_BufferConfig>& buffers() const { return buffers_; }
50385   std::vector<TraceConfig_BufferConfig>* mutable_buffers() { return &buffers_; }
50386   void clear_buffers() { buffers_.clear(); }
50387   TraceConfig_BufferConfig* add_buffers() { buffers_.emplace_back(); return &buffers_.back(); }
50388 
50389   int data_sources_size() const { return static_cast<int>(data_sources_.size()); }
50390   const std::vector<TraceConfig_DataSource>& data_sources() const { return data_sources_; }
50391   std::vector<TraceConfig_DataSource>* mutable_data_sources() { return &data_sources_; }
50392   void clear_data_sources() { data_sources_.clear(); }
50393   TraceConfig_DataSource* add_data_sources() { data_sources_.emplace_back(); return &data_sources_.back(); }
50394 
50395   bool has_builtin_data_sources() const { return _has_field_[20]; }
50396   const TraceConfig_BuiltinDataSource& builtin_data_sources() const { return *builtin_data_sources_; }
50397   TraceConfig_BuiltinDataSource* mutable_builtin_data_sources() { _has_field_.set(20); return builtin_data_sources_.get(); }
50398 
50399   bool has_duration_ms() const { return _has_field_[3]; }
50400   uint32_t duration_ms() const { return duration_ms_; }
50401   void set_duration_ms(uint32_t value) { duration_ms_ = value; _has_field_.set(3); }
50402 
50403   bool has_enable_extra_guardrails() const { return _has_field_[4]; }
50404   bool enable_extra_guardrails() const { return enable_extra_guardrails_; }
50405   void set_enable_extra_guardrails(bool value) { enable_extra_guardrails_ = value; _has_field_.set(4); }
50406 
50407   bool has_lockdown_mode() const { return _has_field_[5]; }
50408   TraceConfig_LockdownModeOperation lockdown_mode() const { return lockdown_mode_; }
50409   void set_lockdown_mode(TraceConfig_LockdownModeOperation value) { lockdown_mode_ = value; _has_field_.set(5); }
50410 
50411   int producers_size() const { return static_cast<int>(producers_.size()); }
50412   const std::vector<TraceConfig_ProducerConfig>& producers() const { return producers_; }
50413   std::vector<TraceConfig_ProducerConfig>* mutable_producers() { return &producers_; }
50414   void clear_producers() { producers_.clear(); }
50415   TraceConfig_ProducerConfig* add_producers() { producers_.emplace_back(); return &producers_.back(); }
50416 
50417   bool has_statsd_metadata() const { return _has_field_[7]; }
50418   const TraceConfig_StatsdMetadata& statsd_metadata() const { return *statsd_metadata_; }
50419   TraceConfig_StatsdMetadata* mutable_statsd_metadata() { _has_field_.set(7); return statsd_metadata_.get(); }
50420 
50421   bool has_write_into_file() const { return _has_field_[8]; }
50422   bool write_into_file() const { return write_into_file_; }
50423   void set_write_into_file(bool value) { write_into_file_ = value; _has_field_.set(8); }
50424 
50425   bool has_output_path() const { return _has_field_[29]; }
50426   const std::string& output_path() const { return output_path_; }
50427   void set_output_path(const std::string& value) { output_path_ = value; _has_field_.set(29); }
50428 
50429   bool has_file_write_period_ms() const { return _has_field_[9]; }
50430   uint32_t file_write_period_ms() const { return file_write_period_ms_; }
50431   void set_file_write_period_ms(uint32_t value) { file_write_period_ms_ = value; _has_field_.set(9); }
50432 
50433   bool has_max_file_size_bytes() const { return _has_field_[10]; }
50434   uint64_t max_file_size_bytes() const { return max_file_size_bytes_; }
50435   void set_max_file_size_bytes(uint64_t value) { max_file_size_bytes_ = value; _has_field_.set(10); }
50436 
50437   bool has_guardrail_overrides() const { return _has_field_[11]; }
50438   const TraceConfig_GuardrailOverrides& guardrail_overrides() const { return *guardrail_overrides_; }
50439   TraceConfig_GuardrailOverrides* mutable_guardrail_overrides() { _has_field_.set(11); return guardrail_overrides_.get(); }
50440 
50441   bool has_deferred_start() const { return _has_field_[12]; }
50442   bool deferred_start() const { return deferred_start_; }
50443   void set_deferred_start(bool value) { deferred_start_ = value; _has_field_.set(12); }
50444 
50445   bool has_flush_period_ms() const { return _has_field_[13]; }
50446   uint32_t flush_period_ms() const { return flush_period_ms_; }
50447   void set_flush_period_ms(uint32_t value) { flush_period_ms_ = value; _has_field_.set(13); }
50448 
50449   bool has_flush_timeout_ms() const { return _has_field_[14]; }
50450   uint32_t flush_timeout_ms() const { return flush_timeout_ms_; }
50451   void set_flush_timeout_ms(uint32_t value) { flush_timeout_ms_ = value; _has_field_.set(14); }
50452 
50453   bool has_data_source_stop_timeout_ms() const { return _has_field_[23]; }
50454   uint32_t data_source_stop_timeout_ms() const { return data_source_stop_timeout_ms_; }
50455   void set_data_source_stop_timeout_ms(uint32_t value) { data_source_stop_timeout_ms_ = value; _has_field_.set(23); }
50456 
50457   bool has_notify_traceur() const { return _has_field_[16]; }
50458   bool notify_traceur() const { return notify_traceur_; }
50459   void set_notify_traceur(bool value) { notify_traceur_ = value; _has_field_.set(16); }
50460 
50461   bool has_trigger_config() const { return _has_field_[17]; }
50462   const TraceConfig_TriggerConfig& trigger_config() const { return *trigger_config_; }
50463   TraceConfig_TriggerConfig* mutable_trigger_config() { _has_field_.set(17); return trigger_config_.get(); }
50464 
50465   int activate_triggers_size() const { return static_cast<int>(activate_triggers_.size()); }
50466   const std::vector<std::string>& activate_triggers() const { return activate_triggers_; }
50467   std::vector<std::string>* mutable_activate_triggers() { return &activate_triggers_; }
50468   void clear_activate_triggers() { activate_triggers_.clear(); }
50469   void add_activate_triggers(std::string value) { activate_triggers_.emplace_back(value); }
50470   std::string* add_activate_triggers() { activate_triggers_.emplace_back(); return &activate_triggers_.back(); }
50471 
50472   bool has_incremental_state_config() const { return _has_field_[21]; }
50473   const TraceConfig_IncrementalStateConfig& incremental_state_config() const { return *incremental_state_config_; }
50474   TraceConfig_IncrementalStateConfig* mutable_incremental_state_config() { _has_field_.set(21); return incremental_state_config_.get(); }
50475 
50476   bool has_allow_user_build_tracing() const { return _has_field_[19]; }
50477   bool allow_user_build_tracing() const { return allow_user_build_tracing_; }
50478   void set_allow_user_build_tracing(bool value) { allow_user_build_tracing_ = value; _has_field_.set(19); }
50479 
50480   bool has_unique_session_name() const { return _has_field_[22]; }
50481   const std::string& unique_session_name() const { return unique_session_name_; }
50482   void set_unique_session_name(const std::string& value) { unique_session_name_ = value; _has_field_.set(22); }
50483 
50484   bool has_compression_type() const { return _has_field_[24]; }
50485   TraceConfig_CompressionType compression_type() const { return compression_type_; }
50486   void set_compression_type(TraceConfig_CompressionType value) { compression_type_ = value; _has_field_.set(24); }
50487 
50488   bool has_incident_report_config() const { return _has_field_[25]; }
50489   const TraceConfig_IncidentReportConfig& incident_report_config() const { return *incident_report_config_; }
50490   TraceConfig_IncidentReportConfig* mutable_incident_report_config() { _has_field_.set(25); return incident_report_config_.get(); }
50491 
50492   bool has_trace_uuid_msb() const { return _has_field_[27]; }
50493   int64_t trace_uuid_msb() const { return trace_uuid_msb_; }
50494   void set_trace_uuid_msb(int64_t value) { trace_uuid_msb_ = value; _has_field_.set(27); }
50495 
50496   bool has_trace_uuid_lsb() const { return _has_field_[28]; }
50497   int64_t trace_uuid_lsb() const { return trace_uuid_lsb_; }
50498   void set_trace_uuid_lsb(int64_t value) { trace_uuid_lsb_ = value; _has_field_.set(28); }
50499 
50500  private:
50501   std::vector<TraceConfig_BufferConfig> buffers_;
50502   std::vector<TraceConfig_DataSource> data_sources_;
50503   ::protozero::CopyablePtr<TraceConfig_BuiltinDataSource> builtin_data_sources_;
50504   uint32_t duration_ms_{};
50505   bool enable_extra_guardrails_{};
50506   TraceConfig_LockdownModeOperation lockdown_mode_{};
50507   std::vector<TraceConfig_ProducerConfig> producers_;
50508   ::protozero::CopyablePtr<TraceConfig_StatsdMetadata> statsd_metadata_;
50509   bool write_into_file_{};
50510   std::string output_path_{};
50511   uint32_t file_write_period_ms_{};
50512   uint64_t max_file_size_bytes_{};
50513   ::protozero::CopyablePtr<TraceConfig_GuardrailOverrides> guardrail_overrides_;
50514   bool deferred_start_{};
50515   uint32_t flush_period_ms_{};
50516   uint32_t flush_timeout_ms_{};
50517   uint32_t data_source_stop_timeout_ms_{};
50518   bool notify_traceur_{};
50519   ::protozero::CopyablePtr<TraceConfig_TriggerConfig> trigger_config_;
50520   std::vector<std::string> activate_triggers_;
50521   ::protozero::CopyablePtr<TraceConfig_IncrementalStateConfig> incremental_state_config_;
50522   bool allow_user_build_tracing_{};
50523   std::string unique_session_name_{};
50524   TraceConfig_CompressionType compression_type_{};
50525   ::protozero::CopyablePtr<TraceConfig_IncidentReportConfig> incident_report_config_;
50526   int64_t trace_uuid_msb_{};
50527   int64_t trace_uuid_lsb_{};
50528 
50529   // Allows to preserve unknown protobuf fields for compatibility
50530   // with future versions of .proto files.
50531   std::string unknown_fields_;
50532 
50533   std::bitset<30> _has_field_{};
50534 };
50535 
50536 
50537 class PERFETTO_EXPORT TraceConfig_IncidentReportConfig : public ::protozero::CppMessageObj {
50538  public:
50539   enum FieldNumbers {
50540     kDestinationPackageFieldNumber = 1,
50541     kDestinationClassFieldNumber = 2,
50542     kPrivacyLevelFieldNumber = 3,
50543     kSkipDropboxFieldNumber = 4,
50544   };
50545 
50546   TraceConfig_IncidentReportConfig();
50547   ~TraceConfig_IncidentReportConfig() override;
50548   TraceConfig_IncidentReportConfig(TraceConfig_IncidentReportConfig&&) noexcept;
50549   TraceConfig_IncidentReportConfig& operator=(TraceConfig_IncidentReportConfig&&);
50550   TraceConfig_IncidentReportConfig(const TraceConfig_IncidentReportConfig&);
50551   TraceConfig_IncidentReportConfig& operator=(const TraceConfig_IncidentReportConfig&);
50552   bool operator==(const TraceConfig_IncidentReportConfig&) const;
50553   bool operator!=(const TraceConfig_IncidentReportConfig& other) const { return !(*this == other); }
50554 
50555   bool ParseFromArray(const void*, size_t) override;
50556   std::string SerializeAsString() const override;
50557   std::vector<uint8_t> SerializeAsArray() const override;
50558   void Serialize(::protozero::Message*) const;
50559 
50560   bool has_destination_package() const { return _has_field_[1]; }
50561   const std::string& destination_package() const { return destination_package_; }
50562   void set_destination_package(const std::string& value) { destination_package_ = value; _has_field_.set(1); }
50563 
50564   bool has_destination_class() const { return _has_field_[2]; }
50565   const std::string& destination_class() const { return destination_class_; }
50566   void set_destination_class(const std::string& value) { destination_class_ = value; _has_field_.set(2); }
50567 
50568   bool has_privacy_level() const { return _has_field_[3]; }
50569   int32_t privacy_level() const { return privacy_level_; }
50570   void set_privacy_level(int32_t value) { privacy_level_ = value; _has_field_.set(3); }
50571 
50572   bool has_skip_dropbox() const { return _has_field_[4]; }
50573   bool skip_dropbox() const { return skip_dropbox_; }
50574   void set_skip_dropbox(bool value) { skip_dropbox_ = value; _has_field_.set(4); }
50575 
50576  private:
50577   std::string destination_package_{};
50578   std::string destination_class_{};
50579   int32_t privacy_level_{};
50580   bool skip_dropbox_{};
50581 
50582   // Allows to preserve unknown protobuf fields for compatibility
50583   // with future versions of .proto files.
50584   std::string unknown_fields_;
50585 
50586   std::bitset<5> _has_field_{};
50587 };
50588 
50589 
50590 class PERFETTO_EXPORT TraceConfig_IncrementalStateConfig : public ::protozero::CppMessageObj {
50591  public:
50592   enum FieldNumbers {
50593     kClearPeriodMsFieldNumber = 1,
50594   };
50595 
50596   TraceConfig_IncrementalStateConfig();
50597   ~TraceConfig_IncrementalStateConfig() override;
50598   TraceConfig_IncrementalStateConfig(TraceConfig_IncrementalStateConfig&&) noexcept;
50599   TraceConfig_IncrementalStateConfig& operator=(TraceConfig_IncrementalStateConfig&&);
50600   TraceConfig_IncrementalStateConfig(const TraceConfig_IncrementalStateConfig&);
50601   TraceConfig_IncrementalStateConfig& operator=(const TraceConfig_IncrementalStateConfig&);
50602   bool operator==(const TraceConfig_IncrementalStateConfig&) const;
50603   bool operator!=(const TraceConfig_IncrementalStateConfig& other) const { return !(*this == other); }
50604 
50605   bool ParseFromArray(const void*, size_t) override;
50606   std::string SerializeAsString() const override;
50607   std::vector<uint8_t> SerializeAsArray() const override;
50608   void Serialize(::protozero::Message*) const;
50609 
50610   bool has_clear_period_ms() const { return _has_field_[1]; }
50611   uint32_t clear_period_ms() const { return clear_period_ms_; }
50612   void set_clear_period_ms(uint32_t value) { clear_period_ms_ = value; _has_field_.set(1); }
50613 
50614  private:
50615   uint32_t clear_period_ms_{};
50616 
50617   // Allows to preserve unknown protobuf fields for compatibility
50618   // with future versions of .proto files.
50619   std::string unknown_fields_;
50620 
50621   std::bitset<2> _has_field_{};
50622 };
50623 
50624 
50625 class PERFETTO_EXPORT TraceConfig_TriggerConfig : public ::protozero::CppMessageObj {
50626  public:
50627   using Trigger = TraceConfig_TriggerConfig_Trigger;
50628   using TriggerMode = TraceConfig_TriggerConfig_TriggerMode;
50629   static constexpr auto UNSPECIFIED = TraceConfig_TriggerConfig_TriggerMode_UNSPECIFIED;
50630   static constexpr auto START_TRACING = TraceConfig_TriggerConfig_TriggerMode_START_TRACING;
50631   static constexpr auto STOP_TRACING = TraceConfig_TriggerConfig_TriggerMode_STOP_TRACING;
50632   static constexpr auto TriggerMode_MIN = TraceConfig_TriggerConfig_TriggerMode_UNSPECIFIED;
50633   static constexpr auto TriggerMode_MAX = TraceConfig_TriggerConfig_TriggerMode_STOP_TRACING;
50634   enum FieldNumbers {
50635     kTriggerModeFieldNumber = 1,
50636     kTriggersFieldNumber = 2,
50637     kTriggerTimeoutMsFieldNumber = 3,
50638   };
50639 
50640   TraceConfig_TriggerConfig();
50641   ~TraceConfig_TriggerConfig() override;
50642   TraceConfig_TriggerConfig(TraceConfig_TriggerConfig&&) noexcept;
50643   TraceConfig_TriggerConfig& operator=(TraceConfig_TriggerConfig&&);
50644   TraceConfig_TriggerConfig(const TraceConfig_TriggerConfig&);
50645   TraceConfig_TriggerConfig& operator=(const TraceConfig_TriggerConfig&);
50646   bool operator==(const TraceConfig_TriggerConfig&) const;
50647   bool operator!=(const TraceConfig_TriggerConfig& other) const { return !(*this == other); }
50648 
50649   bool ParseFromArray(const void*, size_t) override;
50650   std::string SerializeAsString() const override;
50651   std::vector<uint8_t> SerializeAsArray() const override;
50652   void Serialize(::protozero::Message*) const;
50653 
50654   bool has_trigger_mode() const { return _has_field_[1]; }
50655   TraceConfig_TriggerConfig_TriggerMode trigger_mode() const { return trigger_mode_; }
50656   void set_trigger_mode(TraceConfig_TriggerConfig_TriggerMode value) { trigger_mode_ = value; _has_field_.set(1); }
50657 
50658   int triggers_size() const { return static_cast<int>(triggers_.size()); }
50659   const std::vector<TraceConfig_TriggerConfig_Trigger>& triggers() const { return triggers_; }
50660   std::vector<TraceConfig_TriggerConfig_Trigger>* mutable_triggers() { return &triggers_; }
50661   void clear_triggers() { triggers_.clear(); }
50662   TraceConfig_TriggerConfig_Trigger* add_triggers() { triggers_.emplace_back(); return &triggers_.back(); }
50663 
50664   bool has_trigger_timeout_ms() const { return _has_field_[3]; }
50665   uint32_t trigger_timeout_ms() const { return trigger_timeout_ms_; }
50666   void set_trigger_timeout_ms(uint32_t value) { trigger_timeout_ms_ = value; _has_field_.set(3); }
50667 
50668  private:
50669   TraceConfig_TriggerConfig_TriggerMode trigger_mode_{};
50670   std::vector<TraceConfig_TriggerConfig_Trigger> triggers_;
50671   uint32_t trigger_timeout_ms_{};
50672 
50673   // Allows to preserve unknown protobuf fields for compatibility
50674   // with future versions of .proto files.
50675   std::string unknown_fields_;
50676 
50677   std::bitset<4> _has_field_{};
50678 };
50679 
50680 
50681 class PERFETTO_EXPORT TraceConfig_TriggerConfig_Trigger : public ::protozero::CppMessageObj {
50682  public:
50683   enum FieldNumbers {
50684     kNameFieldNumber = 1,
50685     kProducerNameRegexFieldNumber = 2,
50686     kStopDelayMsFieldNumber = 3,
50687   };
50688 
50689   TraceConfig_TriggerConfig_Trigger();
50690   ~TraceConfig_TriggerConfig_Trigger() override;
50691   TraceConfig_TriggerConfig_Trigger(TraceConfig_TriggerConfig_Trigger&&) noexcept;
50692   TraceConfig_TriggerConfig_Trigger& operator=(TraceConfig_TriggerConfig_Trigger&&);
50693   TraceConfig_TriggerConfig_Trigger(const TraceConfig_TriggerConfig_Trigger&);
50694   TraceConfig_TriggerConfig_Trigger& operator=(const TraceConfig_TriggerConfig_Trigger&);
50695   bool operator==(const TraceConfig_TriggerConfig_Trigger&) const;
50696   bool operator!=(const TraceConfig_TriggerConfig_Trigger& other) const { return !(*this == other); }
50697 
50698   bool ParseFromArray(const void*, size_t) override;
50699   std::string SerializeAsString() const override;
50700   std::vector<uint8_t> SerializeAsArray() const override;
50701   void Serialize(::protozero::Message*) const;
50702 
50703   bool has_name() const { return _has_field_[1]; }
50704   const std::string& name() const { return name_; }
50705   void set_name(const std::string& value) { name_ = value; _has_field_.set(1); }
50706 
50707   bool has_producer_name_regex() const { return _has_field_[2]; }
50708   const std::string& producer_name_regex() const { return producer_name_regex_; }
50709   void set_producer_name_regex(const std::string& value) { producer_name_regex_ = value; _has_field_.set(2); }
50710 
50711   bool has_stop_delay_ms() const { return _has_field_[3]; }
50712   uint32_t stop_delay_ms() const { return stop_delay_ms_; }
50713   void set_stop_delay_ms(uint32_t value) { stop_delay_ms_ = value; _has_field_.set(3); }
50714 
50715  private:
50716   std::string name_{};
50717   std::string producer_name_regex_{};
50718   uint32_t stop_delay_ms_{};
50719 
50720   // Allows to preserve unknown protobuf fields for compatibility
50721   // with future versions of .proto files.
50722   std::string unknown_fields_;
50723 
50724   std::bitset<4> _has_field_{};
50725 };
50726 
50727 
50728 class PERFETTO_EXPORT TraceConfig_GuardrailOverrides : public ::protozero::CppMessageObj {
50729  public:
50730   enum FieldNumbers {
50731     kMaxUploadPerDayBytesFieldNumber = 1,
50732   };
50733 
50734   TraceConfig_GuardrailOverrides();
50735   ~TraceConfig_GuardrailOverrides() override;
50736   TraceConfig_GuardrailOverrides(TraceConfig_GuardrailOverrides&&) noexcept;
50737   TraceConfig_GuardrailOverrides& operator=(TraceConfig_GuardrailOverrides&&);
50738   TraceConfig_GuardrailOverrides(const TraceConfig_GuardrailOverrides&);
50739   TraceConfig_GuardrailOverrides& operator=(const TraceConfig_GuardrailOverrides&);
50740   bool operator==(const TraceConfig_GuardrailOverrides&) const;
50741   bool operator!=(const TraceConfig_GuardrailOverrides& other) const { return !(*this == other); }
50742 
50743   bool ParseFromArray(const void*, size_t) override;
50744   std::string SerializeAsString() const override;
50745   std::vector<uint8_t> SerializeAsArray() const override;
50746   void Serialize(::protozero::Message*) const;
50747 
50748   bool has_max_upload_per_day_bytes() const { return _has_field_[1]; }
50749   uint64_t max_upload_per_day_bytes() const { return max_upload_per_day_bytes_; }
50750   void set_max_upload_per_day_bytes(uint64_t value) { max_upload_per_day_bytes_ = value; _has_field_.set(1); }
50751 
50752  private:
50753   uint64_t max_upload_per_day_bytes_{};
50754 
50755   // Allows to preserve unknown protobuf fields for compatibility
50756   // with future versions of .proto files.
50757   std::string unknown_fields_;
50758 
50759   std::bitset<2> _has_field_{};
50760 };
50761 
50762 
50763 class PERFETTO_EXPORT TraceConfig_StatsdMetadata : public ::protozero::CppMessageObj {
50764  public:
50765   enum FieldNumbers {
50766     kTriggeringAlertIdFieldNumber = 1,
50767     kTriggeringConfigUidFieldNumber = 2,
50768     kTriggeringConfigIdFieldNumber = 3,
50769     kTriggeringSubscriptionIdFieldNumber = 4,
50770   };
50771 
50772   TraceConfig_StatsdMetadata();
50773   ~TraceConfig_StatsdMetadata() override;
50774   TraceConfig_StatsdMetadata(TraceConfig_StatsdMetadata&&) noexcept;
50775   TraceConfig_StatsdMetadata& operator=(TraceConfig_StatsdMetadata&&);
50776   TraceConfig_StatsdMetadata(const TraceConfig_StatsdMetadata&);
50777   TraceConfig_StatsdMetadata& operator=(const TraceConfig_StatsdMetadata&);
50778   bool operator==(const TraceConfig_StatsdMetadata&) const;
50779   bool operator!=(const TraceConfig_StatsdMetadata& other) const { return !(*this == other); }
50780 
50781   bool ParseFromArray(const void*, size_t) override;
50782   std::string SerializeAsString() const override;
50783   std::vector<uint8_t> SerializeAsArray() const override;
50784   void Serialize(::protozero::Message*) const;
50785 
50786   bool has_triggering_alert_id() const { return _has_field_[1]; }
50787   int64_t triggering_alert_id() const { return triggering_alert_id_; }
50788   void set_triggering_alert_id(int64_t value) { triggering_alert_id_ = value; _has_field_.set(1); }
50789 
50790   bool has_triggering_config_uid() const { return _has_field_[2]; }
50791   int32_t triggering_config_uid() const { return triggering_config_uid_; }
50792   void set_triggering_config_uid(int32_t value) { triggering_config_uid_ = value; _has_field_.set(2); }
50793 
50794   bool has_triggering_config_id() const { return _has_field_[3]; }
50795   int64_t triggering_config_id() const { return triggering_config_id_; }
50796   void set_triggering_config_id(int64_t value) { triggering_config_id_ = value; _has_field_.set(3); }
50797 
50798   bool has_triggering_subscription_id() const { return _has_field_[4]; }
50799   int64_t triggering_subscription_id() const { return triggering_subscription_id_; }
50800   void set_triggering_subscription_id(int64_t value) { triggering_subscription_id_ = value; _has_field_.set(4); }
50801 
50802  private:
50803   int64_t triggering_alert_id_{};
50804   int32_t triggering_config_uid_{};
50805   int64_t triggering_config_id_{};
50806   int64_t triggering_subscription_id_{};
50807 
50808   // Allows to preserve unknown protobuf fields for compatibility
50809   // with future versions of .proto files.
50810   std::string unknown_fields_;
50811 
50812   std::bitset<5> _has_field_{};
50813 };
50814 
50815 
50816 class PERFETTO_EXPORT TraceConfig_ProducerConfig : public ::protozero::CppMessageObj {
50817  public:
50818   enum FieldNumbers {
50819     kProducerNameFieldNumber = 1,
50820     kShmSizeKbFieldNumber = 2,
50821     kPageSizeKbFieldNumber = 3,
50822   };
50823 
50824   TraceConfig_ProducerConfig();
50825   ~TraceConfig_ProducerConfig() override;
50826   TraceConfig_ProducerConfig(TraceConfig_ProducerConfig&&) noexcept;
50827   TraceConfig_ProducerConfig& operator=(TraceConfig_ProducerConfig&&);
50828   TraceConfig_ProducerConfig(const TraceConfig_ProducerConfig&);
50829   TraceConfig_ProducerConfig& operator=(const TraceConfig_ProducerConfig&);
50830   bool operator==(const TraceConfig_ProducerConfig&) const;
50831   bool operator!=(const TraceConfig_ProducerConfig& other) const { return !(*this == other); }
50832 
50833   bool ParseFromArray(const void*, size_t) override;
50834   std::string SerializeAsString() const override;
50835   std::vector<uint8_t> SerializeAsArray() const override;
50836   void Serialize(::protozero::Message*) const;
50837 
50838   bool has_producer_name() const { return _has_field_[1]; }
50839   const std::string& producer_name() const { return producer_name_; }
50840   void set_producer_name(const std::string& value) { producer_name_ = value; _has_field_.set(1); }
50841 
50842   bool has_shm_size_kb() const { return _has_field_[2]; }
50843   uint32_t shm_size_kb() const { return shm_size_kb_; }
50844   void set_shm_size_kb(uint32_t value) { shm_size_kb_ = value; _has_field_.set(2); }
50845 
50846   bool has_page_size_kb() const { return _has_field_[3]; }
50847   uint32_t page_size_kb() const { return page_size_kb_; }
50848   void set_page_size_kb(uint32_t value) { page_size_kb_ = value; _has_field_.set(3); }
50849 
50850  private:
50851   std::string producer_name_{};
50852   uint32_t shm_size_kb_{};
50853   uint32_t page_size_kb_{};
50854 
50855   // Allows to preserve unknown protobuf fields for compatibility
50856   // with future versions of .proto files.
50857   std::string unknown_fields_;
50858 
50859   std::bitset<4> _has_field_{};
50860 };
50861 
50862 
50863 class PERFETTO_EXPORT TraceConfig_BuiltinDataSource : public ::protozero::CppMessageObj {
50864  public:
50865   enum FieldNumbers {
50866     kDisableClockSnapshottingFieldNumber = 1,
50867     kDisableTraceConfigFieldNumber = 2,
50868     kDisableSystemInfoFieldNumber = 3,
50869     kDisableServiceEventsFieldNumber = 4,
50870     kPrimaryTraceClockFieldNumber = 5,
50871     kSnapshotIntervalMsFieldNumber = 6,
50872   };
50873 
50874   TraceConfig_BuiltinDataSource();
50875   ~TraceConfig_BuiltinDataSource() override;
50876   TraceConfig_BuiltinDataSource(TraceConfig_BuiltinDataSource&&) noexcept;
50877   TraceConfig_BuiltinDataSource& operator=(TraceConfig_BuiltinDataSource&&);
50878   TraceConfig_BuiltinDataSource(const TraceConfig_BuiltinDataSource&);
50879   TraceConfig_BuiltinDataSource& operator=(const TraceConfig_BuiltinDataSource&);
50880   bool operator==(const TraceConfig_BuiltinDataSource&) const;
50881   bool operator!=(const TraceConfig_BuiltinDataSource& other) const { return !(*this == other); }
50882 
50883   bool ParseFromArray(const void*, size_t) override;
50884   std::string SerializeAsString() const override;
50885   std::vector<uint8_t> SerializeAsArray() const override;
50886   void Serialize(::protozero::Message*) const;
50887 
50888   bool has_disable_clock_snapshotting() const { return _has_field_[1]; }
50889   bool disable_clock_snapshotting() const { return disable_clock_snapshotting_; }
50890   void set_disable_clock_snapshotting(bool value) { disable_clock_snapshotting_ = value; _has_field_.set(1); }
50891 
50892   bool has_disable_trace_config() const { return _has_field_[2]; }
50893   bool disable_trace_config() const { return disable_trace_config_; }
50894   void set_disable_trace_config(bool value) { disable_trace_config_ = value; _has_field_.set(2); }
50895 
50896   bool has_disable_system_info() const { return _has_field_[3]; }
50897   bool disable_system_info() const { return disable_system_info_; }
50898   void set_disable_system_info(bool value) { disable_system_info_ = value; _has_field_.set(3); }
50899 
50900   bool has_disable_service_events() const { return _has_field_[4]; }
50901   bool disable_service_events() const { return disable_service_events_; }
50902   void set_disable_service_events(bool value) { disable_service_events_ = value; _has_field_.set(4); }
50903 
50904   bool has_primary_trace_clock() const { return _has_field_[5]; }
50905   BuiltinClock primary_trace_clock() const { return primary_trace_clock_; }
50906   void set_primary_trace_clock(BuiltinClock value) { primary_trace_clock_ = value; _has_field_.set(5); }
50907 
50908   bool has_snapshot_interval_ms() const { return _has_field_[6]; }
50909   uint32_t snapshot_interval_ms() const { return snapshot_interval_ms_; }
50910   void set_snapshot_interval_ms(uint32_t value) { snapshot_interval_ms_ = value; _has_field_.set(6); }
50911 
50912  private:
50913   bool disable_clock_snapshotting_{};
50914   bool disable_trace_config_{};
50915   bool disable_system_info_{};
50916   bool disable_service_events_{};
50917   BuiltinClock primary_trace_clock_{};
50918   uint32_t snapshot_interval_ms_{};
50919 
50920   // Allows to preserve unknown protobuf fields for compatibility
50921   // with future versions of .proto files.
50922   std::string unknown_fields_;
50923 
50924   std::bitset<7> _has_field_{};
50925 };
50926 
50927 
50928 class PERFETTO_EXPORT TraceConfig_DataSource : public ::protozero::CppMessageObj {
50929  public:
50930   enum FieldNumbers {
50931     kConfigFieldNumber = 1,
50932     kProducerNameFilterFieldNumber = 2,
50933     kProducerNameRegexFilterFieldNumber = 3,
50934   };
50935 
50936   TraceConfig_DataSource();
50937   ~TraceConfig_DataSource() override;
50938   TraceConfig_DataSource(TraceConfig_DataSource&&) noexcept;
50939   TraceConfig_DataSource& operator=(TraceConfig_DataSource&&);
50940   TraceConfig_DataSource(const TraceConfig_DataSource&);
50941   TraceConfig_DataSource& operator=(const TraceConfig_DataSource&);
50942   bool operator==(const TraceConfig_DataSource&) const;
50943   bool operator!=(const TraceConfig_DataSource& other) const { return !(*this == other); }
50944 
50945   bool ParseFromArray(const void*, size_t) override;
50946   std::string SerializeAsString() const override;
50947   std::vector<uint8_t> SerializeAsArray() const override;
50948   void Serialize(::protozero::Message*) const;
50949 
50950   bool has_config() const { return _has_field_[1]; }
50951   const DataSourceConfig& config() const { return *config_; }
50952   DataSourceConfig* mutable_config() { _has_field_.set(1); return config_.get(); }
50953 
50954   int producer_name_filter_size() const { return static_cast<int>(producer_name_filter_.size()); }
50955   const std::vector<std::string>& producer_name_filter() const { return producer_name_filter_; }
50956   std::vector<std::string>* mutable_producer_name_filter() { return &producer_name_filter_; }
50957   void clear_producer_name_filter() { producer_name_filter_.clear(); }
50958   void add_producer_name_filter(std::string value) { producer_name_filter_.emplace_back(value); }
50959   std::string* add_producer_name_filter() { producer_name_filter_.emplace_back(); return &producer_name_filter_.back(); }
50960 
50961   int producer_name_regex_filter_size() const { return static_cast<int>(producer_name_regex_filter_.size()); }
50962   const std::vector<std::string>& producer_name_regex_filter() const { return producer_name_regex_filter_; }
50963   std::vector<std::string>* mutable_producer_name_regex_filter() { return &producer_name_regex_filter_; }
50964   void clear_producer_name_regex_filter() { producer_name_regex_filter_.clear(); }
50965   void add_producer_name_regex_filter(std::string value) { producer_name_regex_filter_.emplace_back(value); }
50966   std::string* add_producer_name_regex_filter() { producer_name_regex_filter_.emplace_back(); return &producer_name_regex_filter_.back(); }
50967 
50968  private:
50969   ::protozero::CopyablePtr<DataSourceConfig> config_;
50970   std::vector<std::string> producer_name_filter_;
50971   std::vector<std::string> producer_name_regex_filter_;
50972 
50973   // Allows to preserve unknown protobuf fields for compatibility
50974   // with future versions of .proto files.
50975   std::string unknown_fields_;
50976 
50977   std::bitset<4> _has_field_{};
50978 };
50979 
50980 
50981 class PERFETTO_EXPORT TraceConfig_BufferConfig : public ::protozero::CppMessageObj {
50982  public:
50983   using FillPolicy = TraceConfig_BufferConfig_FillPolicy;
50984   static constexpr auto UNSPECIFIED = TraceConfig_BufferConfig_FillPolicy_UNSPECIFIED;
50985   static constexpr auto RING_BUFFER = TraceConfig_BufferConfig_FillPolicy_RING_BUFFER;
50986   static constexpr auto DISCARD = TraceConfig_BufferConfig_FillPolicy_DISCARD;
50987   static constexpr auto FillPolicy_MIN = TraceConfig_BufferConfig_FillPolicy_UNSPECIFIED;
50988   static constexpr auto FillPolicy_MAX = TraceConfig_BufferConfig_FillPolicy_DISCARD;
50989   enum FieldNumbers {
50990     kSizeKbFieldNumber = 1,
50991     kFillPolicyFieldNumber = 4,
50992   };
50993 
50994   TraceConfig_BufferConfig();
50995   ~TraceConfig_BufferConfig() override;
50996   TraceConfig_BufferConfig(TraceConfig_BufferConfig&&) noexcept;
50997   TraceConfig_BufferConfig& operator=(TraceConfig_BufferConfig&&);
50998   TraceConfig_BufferConfig(const TraceConfig_BufferConfig&);
50999   TraceConfig_BufferConfig& operator=(const TraceConfig_BufferConfig&);
51000   bool operator==(const TraceConfig_BufferConfig&) const;
51001   bool operator!=(const TraceConfig_BufferConfig& other) const { return !(*this == other); }
51002 
51003   bool ParseFromArray(const void*, size_t) override;
51004   std::string SerializeAsString() const override;
51005   std::vector<uint8_t> SerializeAsArray() const override;
51006   void Serialize(::protozero::Message*) const;
51007 
51008   bool has_size_kb() const { return _has_field_[1]; }
51009   uint32_t size_kb() const { return size_kb_; }
51010   void set_size_kb(uint32_t value) { size_kb_ = value; _has_field_.set(1); }
51011 
51012   bool has_fill_policy() const { return _has_field_[4]; }
51013   TraceConfig_BufferConfig_FillPolicy fill_policy() const { return fill_policy_; }
51014   void set_fill_policy(TraceConfig_BufferConfig_FillPolicy value) { fill_policy_ = value; _has_field_.set(4); }
51015 
51016  private:
51017   uint32_t size_kb_{};
51018   TraceConfig_BufferConfig_FillPolicy fill_policy_{};
51019 
51020   // Allows to preserve unknown protobuf fields for compatibility
51021   // with future versions of .proto files.
51022   std::string unknown_fields_;
51023 
51024   std::bitset<5> _has_field_{};
51025 };
51026 
51027 }  // namespace perfetto
51028 }  // namespace protos
51029 }  // namespace gen
51030 
51031 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_TRACE_CONFIG_PROTO_CPP_H_
51032 // gen_amalgamated begin header: gen/protos/perfetto/ipc/consumer_port.gen.h
51033 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
51034 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_IPC_CONSUMER_PORT_PROTO_CPP_H_
51035 #define PERFETTO_PROTOS_PROTOS_PERFETTO_IPC_CONSUMER_PORT_PROTO_CPP_H_
51036 
51037 #include <stdint.h>
51038 #include <bitset>
51039 #include <vector>
51040 #include <string>
51041 #include <type_traits>
51042 
51043 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
51044 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
51045 // gen_amalgamated expanded: #include "perfetto/base/export.h"
51046 
51047 namespace perfetto {
51048 namespace protos {
51049 namespace gen {
51050 class QueryCapabilitiesResponse;
51051 class TracingServiceCapabilities;
51052 class QueryCapabilitiesRequest;
51053 class QueryServiceStateResponse;
51054 class TracingServiceState;
51055 class TracingServiceState_DataSource;
51056 class DataSourceDescriptor;
51057 class TracingServiceState_Producer;
51058 class QueryServiceStateRequest;
51059 class ObserveEventsResponse;
51060 class ObservableEvents;
51061 class ObservableEvents_DataSourceInstanceStateChange;
51062 class ObserveEventsRequest;
51063 class GetTraceStatsResponse;
51064 class TraceStats;
51065 class TraceStats_BufferStats;
51066 class GetTraceStatsRequest;
51067 class AttachResponse;
51068 class TraceConfig;
51069 class TraceConfig_IncidentReportConfig;
51070 class TraceConfig_IncrementalStateConfig;
51071 class TraceConfig_TriggerConfig;
51072 class TraceConfig_TriggerConfig_Trigger;
51073 class TraceConfig_GuardrailOverrides;
51074 class TraceConfig_StatsdMetadata;
51075 class TraceConfig_ProducerConfig;
51076 class TraceConfig_BuiltinDataSource;
51077 class TraceConfig_DataSource;
51078 class DataSourceConfig;
51079 class TestConfig;
51080 class TestConfig_DummyFields;
51081 class ChromeConfig;
51082 class TraceConfig_BufferConfig;
51083 class AttachRequest;
51084 class DetachResponse;
51085 class DetachRequest;
51086 class FlushResponse;
51087 class FlushRequest;
51088 class FreeBuffersResponse;
51089 class FreeBuffersRequest;
51090 class ReadBuffersResponse;
51091 class ReadBuffersResponse_Slice;
51092 class ReadBuffersRequest;
51093 class DisableTracingResponse;
51094 class DisableTracingRequest;
51095 class ChangeTraceConfigResponse;
51096 class ChangeTraceConfigRequest;
51097 class StartTracingResponse;
51098 class StartTracingRequest;
51099 class EnableTracingResponse;
51100 class EnableTracingRequest;
51101 enum ObservableEvents_Type : int;
51102 enum ObservableEvents_DataSourceInstanceState : int;
51103 enum TraceConfig_LockdownModeOperation : int;
51104 enum TraceConfig_CompressionType : int;
51105 enum TraceConfig_TriggerConfig_TriggerMode : int;
51106 enum BuiltinClock : int;
51107 enum TraceConfig_BufferConfig_FillPolicy : int;
51108 }  // namespace perfetto
51109 }  // namespace protos
51110 }  // namespace gen
51111 
51112 namespace protozero {
51113 class Message;
51114 }  // namespace protozero
51115 
51116 namespace perfetto {
51117 namespace protos {
51118 namespace gen {
51119 
51120 class PERFETTO_EXPORT QueryCapabilitiesResponse : public ::protozero::CppMessageObj {
51121  public:
51122   enum FieldNumbers {
51123     kCapabilitiesFieldNumber = 1,
51124   };
51125 
51126   QueryCapabilitiesResponse();
51127   ~QueryCapabilitiesResponse() override;
51128   QueryCapabilitiesResponse(QueryCapabilitiesResponse&&) noexcept;
51129   QueryCapabilitiesResponse& operator=(QueryCapabilitiesResponse&&);
51130   QueryCapabilitiesResponse(const QueryCapabilitiesResponse&);
51131   QueryCapabilitiesResponse& operator=(const QueryCapabilitiesResponse&);
51132   bool operator==(const QueryCapabilitiesResponse&) const;
51133   bool operator!=(const QueryCapabilitiesResponse& other) const { return !(*this == other); }
51134 
51135   bool ParseFromArray(const void*, size_t) override;
51136   std::string SerializeAsString() const override;
51137   std::vector<uint8_t> SerializeAsArray() const override;
51138   void Serialize(::protozero::Message*) const;
51139 
51140   bool has_capabilities() const { return _has_field_[1]; }
51141   const TracingServiceCapabilities& capabilities() const { return *capabilities_; }
51142   TracingServiceCapabilities* mutable_capabilities() { _has_field_.set(1); return capabilities_.get(); }
51143 
51144  private:
51145   ::protozero::CopyablePtr<TracingServiceCapabilities> capabilities_;
51146 
51147   // Allows to preserve unknown protobuf fields for compatibility
51148   // with future versions of .proto files.
51149   std::string unknown_fields_;
51150 
51151   std::bitset<2> _has_field_{};
51152 };
51153 
51154 
51155 class PERFETTO_EXPORT QueryCapabilitiesRequest : public ::protozero::CppMessageObj {
51156  public:
51157   enum FieldNumbers {
51158   };
51159 
51160   QueryCapabilitiesRequest();
51161   ~QueryCapabilitiesRequest() override;
51162   QueryCapabilitiesRequest(QueryCapabilitiesRequest&&) noexcept;
51163   QueryCapabilitiesRequest& operator=(QueryCapabilitiesRequest&&);
51164   QueryCapabilitiesRequest(const QueryCapabilitiesRequest&);
51165   QueryCapabilitiesRequest& operator=(const QueryCapabilitiesRequest&);
51166   bool operator==(const QueryCapabilitiesRequest&) const;
51167   bool operator!=(const QueryCapabilitiesRequest& other) const { return !(*this == other); }
51168 
51169   bool ParseFromArray(const void*, size_t) override;
51170   std::string SerializeAsString() const override;
51171   std::vector<uint8_t> SerializeAsArray() const override;
51172   void Serialize(::protozero::Message*) const;
51173 
51174  private:
51175 
51176   // Allows to preserve unknown protobuf fields for compatibility
51177   // with future versions of .proto files.
51178   std::string unknown_fields_;
51179 
51180   std::bitset<2> _has_field_{};
51181 };
51182 
51183 
51184 class PERFETTO_EXPORT QueryServiceStateResponse : public ::protozero::CppMessageObj {
51185  public:
51186   enum FieldNumbers {
51187     kServiceStateFieldNumber = 1,
51188   };
51189 
51190   QueryServiceStateResponse();
51191   ~QueryServiceStateResponse() override;
51192   QueryServiceStateResponse(QueryServiceStateResponse&&) noexcept;
51193   QueryServiceStateResponse& operator=(QueryServiceStateResponse&&);
51194   QueryServiceStateResponse(const QueryServiceStateResponse&);
51195   QueryServiceStateResponse& operator=(const QueryServiceStateResponse&);
51196   bool operator==(const QueryServiceStateResponse&) const;
51197   bool operator!=(const QueryServiceStateResponse& other) const { return !(*this == other); }
51198 
51199   bool ParseFromArray(const void*, size_t) override;
51200   std::string SerializeAsString() const override;
51201   std::vector<uint8_t> SerializeAsArray() const override;
51202   void Serialize(::protozero::Message*) const;
51203 
51204   bool has_service_state() const { return _has_field_[1]; }
51205   const TracingServiceState& service_state() const { return *service_state_; }
51206   TracingServiceState* mutable_service_state() { _has_field_.set(1); return service_state_.get(); }
51207 
51208  private:
51209   ::protozero::CopyablePtr<TracingServiceState> service_state_;
51210 
51211   // Allows to preserve unknown protobuf fields for compatibility
51212   // with future versions of .proto files.
51213   std::string unknown_fields_;
51214 
51215   std::bitset<2> _has_field_{};
51216 };
51217 
51218 
51219 class PERFETTO_EXPORT QueryServiceStateRequest : public ::protozero::CppMessageObj {
51220  public:
51221   enum FieldNumbers {
51222   };
51223 
51224   QueryServiceStateRequest();
51225   ~QueryServiceStateRequest() override;
51226   QueryServiceStateRequest(QueryServiceStateRequest&&) noexcept;
51227   QueryServiceStateRequest& operator=(QueryServiceStateRequest&&);
51228   QueryServiceStateRequest(const QueryServiceStateRequest&);
51229   QueryServiceStateRequest& operator=(const QueryServiceStateRequest&);
51230   bool operator==(const QueryServiceStateRequest&) const;
51231   bool operator!=(const QueryServiceStateRequest& other) const { return !(*this == other); }
51232 
51233   bool ParseFromArray(const void*, size_t) override;
51234   std::string SerializeAsString() const override;
51235   std::vector<uint8_t> SerializeAsArray() const override;
51236   void Serialize(::protozero::Message*) const;
51237 
51238  private:
51239 
51240   // Allows to preserve unknown protobuf fields for compatibility
51241   // with future versions of .proto files.
51242   std::string unknown_fields_;
51243 
51244   std::bitset<2> _has_field_{};
51245 };
51246 
51247 
51248 class PERFETTO_EXPORT ObserveEventsResponse : public ::protozero::CppMessageObj {
51249  public:
51250   enum FieldNumbers {
51251     kEventsFieldNumber = 1,
51252   };
51253 
51254   ObserveEventsResponse();
51255   ~ObserveEventsResponse() override;
51256   ObserveEventsResponse(ObserveEventsResponse&&) noexcept;
51257   ObserveEventsResponse& operator=(ObserveEventsResponse&&);
51258   ObserveEventsResponse(const ObserveEventsResponse&);
51259   ObserveEventsResponse& operator=(const ObserveEventsResponse&);
51260   bool operator==(const ObserveEventsResponse&) const;
51261   bool operator!=(const ObserveEventsResponse& other) const { return !(*this == other); }
51262 
51263   bool ParseFromArray(const void*, size_t) override;
51264   std::string SerializeAsString() const override;
51265   std::vector<uint8_t> SerializeAsArray() const override;
51266   void Serialize(::protozero::Message*) const;
51267 
51268   bool has_events() const { return _has_field_[1]; }
51269   const ObservableEvents& events() const { return *events_; }
51270   ObservableEvents* mutable_events() { _has_field_.set(1); return events_.get(); }
51271 
51272  private:
51273   ::protozero::CopyablePtr<ObservableEvents> events_;
51274 
51275   // Allows to preserve unknown protobuf fields for compatibility
51276   // with future versions of .proto files.
51277   std::string unknown_fields_;
51278 
51279   std::bitset<2> _has_field_{};
51280 };
51281 
51282 
51283 class PERFETTO_EXPORT ObserveEventsRequest : public ::protozero::CppMessageObj {
51284  public:
51285   enum FieldNumbers {
51286     kEventsToObserveFieldNumber = 1,
51287   };
51288 
51289   ObserveEventsRequest();
51290   ~ObserveEventsRequest() override;
51291   ObserveEventsRequest(ObserveEventsRequest&&) noexcept;
51292   ObserveEventsRequest& operator=(ObserveEventsRequest&&);
51293   ObserveEventsRequest(const ObserveEventsRequest&);
51294   ObserveEventsRequest& operator=(const ObserveEventsRequest&);
51295   bool operator==(const ObserveEventsRequest&) const;
51296   bool operator!=(const ObserveEventsRequest& other) const { return !(*this == other); }
51297 
51298   bool ParseFromArray(const void*, size_t) override;
51299   std::string SerializeAsString() const override;
51300   std::vector<uint8_t> SerializeAsArray() const override;
51301   void Serialize(::protozero::Message*) const;
51302 
51303   int events_to_observe_size() const { return static_cast<int>(events_to_observe_.size()); }
51304   const std::vector<ObservableEvents_Type>& events_to_observe() const { return events_to_observe_; }
51305   std::vector<ObservableEvents_Type>* mutable_events_to_observe() { return &events_to_observe_; }
51306   void clear_events_to_observe() { events_to_observe_.clear(); }
51307   void add_events_to_observe(ObservableEvents_Type value) { events_to_observe_.emplace_back(value); }
51308   ObservableEvents_Type* add_events_to_observe() { events_to_observe_.emplace_back(); return &events_to_observe_.back(); }
51309 
51310  private:
51311   std::vector<ObservableEvents_Type> events_to_observe_;
51312 
51313   // Allows to preserve unknown protobuf fields for compatibility
51314   // with future versions of .proto files.
51315   std::string unknown_fields_;
51316 
51317   std::bitset<2> _has_field_{};
51318 };
51319 
51320 
51321 class PERFETTO_EXPORT GetTraceStatsResponse : public ::protozero::CppMessageObj {
51322  public:
51323   enum FieldNumbers {
51324     kTraceStatsFieldNumber = 1,
51325   };
51326 
51327   GetTraceStatsResponse();
51328   ~GetTraceStatsResponse() override;
51329   GetTraceStatsResponse(GetTraceStatsResponse&&) noexcept;
51330   GetTraceStatsResponse& operator=(GetTraceStatsResponse&&);
51331   GetTraceStatsResponse(const GetTraceStatsResponse&);
51332   GetTraceStatsResponse& operator=(const GetTraceStatsResponse&);
51333   bool operator==(const GetTraceStatsResponse&) const;
51334   bool operator!=(const GetTraceStatsResponse& other) const { return !(*this == other); }
51335 
51336   bool ParseFromArray(const void*, size_t) override;
51337   std::string SerializeAsString() const override;
51338   std::vector<uint8_t> SerializeAsArray() const override;
51339   void Serialize(::protozero::Message*) const;
51340 
51341   bool has_trace_stats() const { return _has_field_[1]; }
51342   const TraceStats& trace_stats() const { return *trace_stats_; }
51343   TraceStats* mutable_trace_stats() { _has_field_.set(1); return trace_stats_.get(); }
51344 
51345  private:
51346   ::protozero::CopyablePtr<TraceStats> trace_stats_;
51347 
51348   // Allows to preserve unknown protobuf fields for compatibility
51349   // with future versions of .proto files.
51350   std::string unknown_fields_;
51351 
51352   std::bitset<2> _has_field_{};
51353 };
51354 
51355 
51356 class PERFETTO_EXPORT GetTraceStatsRequest : public ::protozero::CppMessageObj {
51357  public:
51358   enum FieldNumbers {
51359   };
51360 
51361   GetTraceStatsRequest();
51362   ~GetTraceStatsRequest() override;
51363   GetTraceStatsRequest(GetTraceStatsRequest&&) noexcept;
51364   GetTraceStatsRequest& operator=(GetTraceStatsRequest&&);
51365   GetTraceStatsRequest(const GetTraceStatsRequest&);
51366   GetTraceStatsRequest& operator=(const GetTraceStatsRequest&);
51367   bool operator==(const GetTraceStatsRequest&) const;
51368   bool operator!=(const GetTraceStatsRequest& other) const { return !(*this == other); }
51369 
51370   bool ParseFromArray(const void*, size_t) override;
51371   std::string SerializeAsString() const override;
51372   std::vector<uint8_t> SerializeAsArray() const override;
51373   void Serialize(::protozero::Message*) const;
51374 
51375  private:
51376 
51377   // Allows to preserve unknown protobuf fields for compatibility
51378   // with future versions of .proto files.
51379   std::string unknown_fields_;
51380 
51381   std::bitset<2> _has_field_{};
51382 };
51383 
51384 
51385 class PERFETTO_EXPORT AttachResponse : public ::protozero::CppMessageObj {
51386  public:
51387   enum FieldNumbers {
51388     kTraceConfigFieldNumber = 1,
51389   };
51390 
51391   AttachResponse();
51392   ~AttachResponse() override;
51393   AttachResponse(AttachResponse&&) noexcept;
51394   AttachResponse& operator=(AttachResponse&&);
51395   AttachResponse(const AttachResponse&);
51396   AttachResponse& operator=(const AttachResponse&);
51397   bool operator==(const AttachResponse&) const;
51398   bool operator!=(const AttachResponse& other) const { return !(*this == other); }
51399 
51400   bool ParseFromArray(const void*, size_t) override;
51401   std::string SerializeAsString() const override;
51402   std::vector<uint8_t> SerializeAsArray() const override;
51403   void Serialize(::protozero::Message*) const;
51404 
51405   bool has_trace_config() const { return _has_field_[1]; }
51406   const TraceConfig& trace_config() const { return *trace_config_; }
51407   TraceConfig* mutable_trace_config() { _has_field_.set(1); return trace_config_.get(); }
51408 
51409  private:
51410   ::protozero::CopyablePtr<TraceConfig> trace_config_;
51411 
51412   // Allows to preserve unknown protobuf fields for compatibility
51413   // with future versions of .proto files.
51414   std::string unknown_fields_;
51415 
51416   std::bitset<2> _has_field_{};
51417 };
51418 
51419 
51420 class PERFETTO_EXPORT AttachRequest : public ::protozero::CppMessageObj {
51421  public:
51422   enum FieldNumbers {
51423     kKeyFieldNumber = 1,
51424   };
51425 
51426   AttachRequest();
51427   ~AttachRequest() override;
51428   AttachRequest(AttachRequest&&) noexcept;
51429   AttachRequest& operator=(AttachRequest&&);
51430   AttachRequest(const AttachRequest&);
51431   AttachRequest& operator=(const AttachRequest&);
51432   bool operator==(const AttachRequest&) const;
51433   bool operator!=(const AttachRequest& other) const { return !(*this == other); }
51434 
51435   bool ParseFromArray(const void*, size_t) override;
51436   std::string SerializeAsString() const override;
51437   std::vector<uint8_t> SerializeAsArray() const override;
51438   void Serialize(::protozero::Message*) const;
51439 
51440   bool has_key() const { return _has_field_[1]; }
51441   const std::string& key() const { return key_; }
51442   void set_key(const std::string& value) { key_ = value; _has_field_.set(1); }
51443 
51444  private:
51445   std::string key_{};
51446 
51447   // Allows to preserve unknown protobuf fields for compatibility
51448   // with future versions of .proto files.
51449   std::string unknown_fields_;
51450 
51451   std::bitset<2> _has_field_{};
51452 };
51453 
51454 
51455 class PERFETTO_EXPORT DetachResponse : public ::protozero::CppMessageObj {
51456  public:
51457   enum FieldNumbers {
51458   };
51459 
51460   DetachResponse();
51461   ~DetachResponse() override;
51462   DetachResponse(DetachResponse&&) noexcept;
51463   DetachResponse& operator=(DetachResponse&&);
51464   DetachResponse(const DetachResponse&);
51465   DetachResponse& operator=(const DetachResponse&);
51466   bool operator==(const DetachResponse&) const;
51467   bool operator!=(const DetachResponse& other) const { return !(*this == other); }
51468 
51469   bool ParseFromArray(const void*, size_t) override;
51470   std::string SerializeAsString() const override;
51471   std::vector<uint8_t> SerializeAsArray() const override;
51472   void Serialize(::protozero::Message*) const;
51473 
51474  private:
51475 
51476   // Allows to preserve unknown protobuf fields for compatibility
51477   // with future versions of .proto files.
51478   std::string unknown_fields_;
51479 
51480   std::bitset<2> _has_field_{};
51481 };
51482 
51483 
51484 class PERFETTO_EXPORT DetachRequest : public ::protozero::CppMessageObj {
51485  public:
51486   enum FieldNumbers {
51487     kKeyFieldNumber = 1,
51488   };
51489 
51490   DetachRequest();
51491   ~DetachRequest() override;
51492   DetachRequest(DetachRequest&&) noexcept;
51493   DetachRequest& operator=(DetachRequest&&);
51494   DetachRequest(const DetachRequest&);
51495   DetachRequest& operator=(const DetachRequest&);
51496   bool operator==(const DetachRequest&) const;
51497   bool operator!=(const DetachRequest& other) const { return !(*this == other); }
51498 
51499   bool ParseFromArray(const void*, size_t) override;
51500   std::string SerializeAsString() const override;
51501   std::vector<uint8_t> SerializeAsArray() const override;
51502   void Serialize(::protozero::Message*) const;
51503 
51504   bool has_key() const { return _has_field_[1]; }
51505   const std::string& key() const { return key_; }
51506   void set_key(const std::string& value) { key_ = value; _has_field_.set(1); }
51507 
51508  private:
51509   std::string key_{};
51510 
51511   // Allows to preserve unknown protobuf fields for compatibility
51512   // with future versions of .proto files.
51513   std::string unknown_fields_;
51514 
51515   std::bitset<2> _has_field_{};
51516 };
51517 
51518 
51519 class PERFETTO_EXPORT FlushResponse : public ::protozero::CppMessageObj {
51520  public:
51521   enum FieldNumbers {
51522   };
51523 
51524   FlushResponse();
51525   ~FlushResponse() override;
51526   FlushResponse(FlushResponse&&) noexcept;
51527   FlushResponse& operator=(FlushResponse&&);
51528   FlushResponse(const FlushResponse&);
51529   FlushResponse& operator=(const FlushResponse&);
51530   bool operator==(const FlushResponse&) const;
51531   bool operator!=(const FlushResponse& other) const { return !(*this == other); }
51532 
51533   bool ParseFromArray(const void*, size_t) override;
51534   std::string SerializeAsString() const override;
51535   std::vector<uint8_t> SerializeAsArray() const override;
51536   void Serialize(::protozero::Message*) const;
51537 
51538  private:
51539 
51540   // Allows to preserve unknown protobuf fields for compatibility
51541   // with future versions of .proto files.
51542   std::string unknown_fields_;
51543 
51544   std::bitset<2> _has_field_{};
51545 };
51546 
51547 
51548 class PERFETTO_EXPORT FlushRequest : public ::protozero::CppMessageObj {
51549  public:
51550   enum FieldNumbers {
51551     kTimeoutMsFieldNumber = 1,
51552   };
51553 
51554   FlushRequest();
51555   ~FlushRequest() override;
51556   FlushRequest(FlushRequest&&) noexcept;
51557   FlushRequest& operator=(FlushRequest&&);
51558   FlushRequest(const FlushRequest&);
51559   FlushRequest& operator=(const FlushRequest&);
51560   bool operator==(const FlushRequest&) const;
51561   bool operator!=(const FlushRequest& other) const { return !(*this == other); }
51562 
51563   bool ParseFromArray(const void*, size_t) override;
51564   std::string SerializeAsString() const override;
51565   std::vector<uint8_t> SerializeAsArray() const override;
51566   void Serialize(::protozero::Message*) const;
51567 
51568   bool has_timeout_ms() const { return _has_field_[1]; }
51569   uint32_t timeout_ms() const { return timeout_ms_; }
51570   void set_timeout_ms(uint32_t value) { timeout_ms_ = value; _has_field_.set(1); }
51571 
51572  private:
51573   uint32_t timeout_ms_{};
51574 
51575   // Allows to preserve unknown protobuf fields for compatibility
51576   // with future versions of .proto files.
51577   std::string unknown_fields_;
51578 
51579   std::bitset<2> _has_field_{};
51580 };
51581 
51582 
51583 class PERFETTO_EXPORT FreeBuffersResponse : public ::protozero::CppMessageObj {
51584  public:
51585   enum FieldNumbers {
51586   };
51587 
51588   FreeBuffersResponse();
51589   ~FreeBuffersResponse() override;
51590   FreeBuffersResponse(FreeBuffersResponse&&) noexcept;
51591   FreeBuffersResponse& operator=(FreeBuffersResponse&&);
51592   FreeBuffersResponse(const FreeBuffersResponse&);
51593   FreeBuffersResponse& operator=(const FreeBuffersResponse&);
51594   bool operator==(const FreeBuffersResponse&) const;
51595   bool operator!=(const FreeBuffersResponse& other) const { return !(*this == other); }
51596 
51597   bool ParseFromArray(const void*, size_t) override;
51598   std::string SerializeAsString() const override;
51599   std::vector<uint8_t> SerializeAsArray() const override;
51600   void Serialize(::protozero::Message*) const;
51601 
51602  private:
51603 
51604   // Allows to preserve unknown protobuf fields for compatibility
51605   // with future versions of .proto files.
51606   std::string unknown_fields_;
51607 
51608   std::bitset<2> _has_field_{};
51609 };
51610 
51611 
51612 class PERFETTO_EXPORT FreeBuffersRequest : public ::protozero::CppMessageObj {
51613  public:
51614   enum FieldNumbers {
51615     kBufferIdsFieldNumber = 1,
51616   };
51617 
51618   FreeBuffersRequest();
51619   ~FreeBuffersRequest() override;
51620   FreeBuffersRequest(FreeBuffersRequest&&) noexcept;
51621   FreeBuffersRequest& operator=(FreeBuffersRequest&&);
51622   FreeBuffersRequest(const FreeBuffersRequest&);
51623   FreeBuffersRequest& operator=(const FreeBuffersRequest&);
51624   bool operator==(const FreeBuffersRequest&) const;
51625   bool operator!=(const FreeBuffersRequest& other) const { return !(*this == other); }
51626 
51627   bool ParseFromArray(const void*, size_t) override;
51628   std::string SerializeAsString() const override;
51629   std::vector<uint8_t> SerializeAsArray() const override;
51630   void Serialize(::protozero::Message*) const;
51631 
51632   int buffer_ids_size() const { return static_cast<int>(buffer_ids_.size()); }
51633   const std::vector<uint32_t>& buffer_ids() const { return buffer_ids_; }
51634   std::vector<uint32_t>* mutable_buffer_ids() { return &buffer_ids_; }
51635   void clear_buffer_ids() { buffer_ids_.clear(); }
51636   void add_buffer_ids(uint32_t value) { buffer_ids_.emplace_back(value); }
51637   uint32_t* add_buffer_ids() { buffer_ids_.emplace_back(); return &buffer_ids_.back(); }
51638 
51639  private:
51640   std::vector<uint32_t> buffer_ids_;
51641 
51642   // Allows to preserve unknown protobuf fields for compatibility
51643   // with future versions of .proto files.
51644   std::string unknown_fields_;
51645 
51646   std::bitset<2> _has_field_{};
51647 };
51648 
51649 
51650 class PERFETTO_EXPORT ReadBuffersResponse : public ::protozero::CppMessageObj {
51651  public:
51652   using Slice = ReadBuffersResponse_Slice;
51653   enum FieldNumbers {
51654     kSlicesFieldNumber = 2,
51655   };
51656 
51657   ReadBuffersResponse();
51658   ~ReadBuffersResponse() override;
51659   ReadBuffersResponse(ReadBuffersResponse&&) noexcept;
51660   ReadBuffersResponse& operator=(ReadBuffersResponse&&);
51661   ReadBuffersResponse(const ReadBuffersResponse&);
51662   ReadBuffersResponse& operator=(const ReadBuffersResponse&);
51663   bool operator==(const ReadBuffersResponse&) const;
51664   bool operator!=(const ReadBuffersResponse& other) const { return !(*this == other); }
51665 
51666   bool ParseFromArray(const void*, size_t) override;
51667   std::string SerializeAsString() const override;
51668   std::vector<uint8_t> SerializeAsArray() const override;
51669   void Serialize(::protozero::Message*) const;
51670 
51671   int slices_size() const { return static_cast<int>(slices_.size()); }
51672   const std::vector<ReadBuffersResponse_Slice>& slices() const { return slices_; }
51673   std::vector<ReadBuffersResponse_Slice>* mutable_slices() { return &slices_; }
51674   void clear_slices() { slices_.clear(); }
51675   ReadBuffersResponse_Slice* add_slices() { slices_.emplace_back(); return &slices_.back(); }
51676 
51677  private:
51678   std::vector<ReadBuffersResponse_Slice> slices_;
51679 
51680   // Allows to preserve unknown protobuf fields for compatibility
51681   // with future versions of .proto files.
51682   std::string unknown_fields_;
51683 
51684   std::bitset<3> _has_field_{};
51685 };
51686 
51687 
51688 class PERFETTO_EXPORT ReadBuffersResponse_Slice : public ::protozero::CppMessageObj {
51689  public:
51690   enum FieldNumbers {
51691     kDataFieldNumber = 1,
51692     kLastSliceForPacketFieldNumber = 2,
51693   };
51694 
51695   ReadBuffersResponse_Slice();
51696   ~ReadBuffersResponse_Slice() override;
51697   ReadBuffersResponse_Slice(ReadBuffersResponse_Slice&&) noexcept;
51698   ReadBuffersResponse_Slice& operator=(ReadBuffersResponse_Slice&&);
51699   ReadBuffersResponse_Slice(const ReadBuffersResponse_Slice&);
51700   ReadBuffersResponse_Slice& operator=(const ReadBuffersResponse_Slice&);
51701   bool operator==(const ReadBuffersResponse_Slice&) const;
51702   bool operator!=(const ReadBuffersResponse_Slice& other) const { return !(*this == other); }
51703 
51704   bool ParseFromArray(const void*, size_t) override;
51705   std::string SerializeAsString() const override;
51706   std::vector<uint8_t> SerializeAsArray() const override;
51707   void Serialize(::protozero::Message*) const;
51708 
51709   bool has_data() const { return _has_field_[1]; }
51710   const std::string& data() const { return data_; }
51711   void set_data(const std::string& value) { data_ = value; _has_field_.set(1); }
51712   void set_data(const void* p, size_t s) { data_.assign(reinterpret_cast<const char*>(p), s); _has_field_.set(1); }
51713 
51714   bool has_last_slice_for_packet() const { return _has_field_[2]; }
51715   bool last_slice_for_packet() const { return last_slice_for_packet_; }
51716   void set_last_slice_for_packet(bool value) { last_slice_for_packet_ = value; _has_field_.set(2); }
51717 
51718  private:
51719   std::string data_{};
51720   bool last_slice_for_packet_{};
51721 
51722   // Allows to preserve unknown protobuf fields for compatibility
51723   // with future versions of .proto files.
51724   std::string unknown_fields_;
51725 
51726   std::bitset<3> _has_field_{};
51727 };
51728 
51729 
51730 class PERFETTO_EXPORT ReadBuffersRequest : public ::protozero::CppMessageObj {
51731  public:
51732   enum FieldNumbers {
51733   };
51734 
51735   ReadBuffersRequest();
51736   ~ReadBuffersRequest() override;
51737   ReadBuffersRequest(ReadBuffersRequest&&) noexcept;
51738   ReadBuffersRequest& operator=(ReadBuffersRequest&&);
51739   ReadBuffersRequest(const ReadBuffersRequest&);
51740   ReadBuffersRequest& operator=(const ReadBuffersRequest&);
51741   bool operator==(const ReadBuffersRequest&) const;
51742   bool operator!=(const ReadBuffersRequest& other) const { return !(*this == other); }
51743 
51744   bool ParseFromArray(const void*, size_t) override;
51745   std::string SerializeAsString() const override;
51746   std::vector<uint8_t> SerializeAsArray() const override;
51747   void Serialize(::protozero::Message*) const;
51748 
51749  private:
51750 
51751   // Allows to preserve unknown protobuf fields for compatibility
51752   // with future versions of .proto files.
51753   std::string unknown_fields_;
51754 
51755   std::bitset<2> _has_field_{};
51756 };
51757 
51758 
51759 class PERFETTO_EXPORT DisableTracingResponse : public ::protozero::CppMessageObj {
51760  public:
51761   enum FieldNumbers {
51762   };
51763 
51764   DisableTracingResponse();
51765   ~DisableTracingResponse() override;
51766   DisableTracingResponse(DisableTracingResponse&&) noexcept;
51767   DisableTracingResponse& operator=(DisableTracingResponse&&);
51768   DisableTracingResponse(const DisableTracingResponse&);
51769   DisableTracingResponse& operator=(const DisableTracingResponse&);
51770   bool operator==(const DisableTracingResponse&) const;
51771   bool operator!=(const DisableTracingResponse& other) const { return !(*this == other); }
51772 
51773   bool ParseFromArray(const void*, size_t) override;
51774   std::string SerializeAsString() const override;
51775   std::vector<uint8_t> SerializeAsArray() const override;
51776   void Serialize(::protozero::Message*) const;
51777 
51778  private:
51779 
51780   // Allows to preserve unknown protobuf fields for compatibility
51781   // with future versions of .proto files.
51782   std::string unknown_fields_;
51783 
51784   std::bitset<2> _has_field_{};
51785 };
51786 
51787 
51788 class PERFETTO_EXPORT DisableTracingRequest : public ::protozero::CppMessageObj {
51789  public:
51790   enum FieldNumbers {
51791   };
51792 
51793   DisableTracingRequest();
51794   ~DisableTracingRequest() override;
51795   DisableTracingRequest(DisableTracingRequest&&) noexcept;
51796   DisableTracingRequest& operator=(DisableTracingRequest&&);
51797   DisableTracingRequest(const DisableTracingRequest&);
51798   DisableTracingRequest& operator=(const DisableTracingRequest&);
51799   bool operator==(const DisableTracingRequest&) const;
51800   bool operator!=(const DisableTracingRequest& other) const { return !(*this == other); }
51801 
51802   bool ParseFromArray(const void*, size_t) override;
51803   std::string SerializeAsString() const override;
51804   std::vector<uint8_t> SerializeAsArray() const override;
51805   void Serialize(::protozero::Message*) const;
51806 
51807  private:
51808 
51809   // Allows to preserve unknown protobuf fields for compatibility
51810   // with future versions of .proto files.
51811   std::string unknown_fields_;
51812 
51813   std::bitset<2> _has_field_{};
51814 };
51815 
51816 
51817 class PERFETTO_EXPORT ChangeTraceConfigResponse : public ::protozero::CppMessageObj {
51818  public:
51819   enum FieldNumbers {
51820   };
51821 
51822   ChangeTraceConfigResponse();
51823   ~ChangeTraceConfigResponse() override;
51824   ChangeTraceConfigResponse(ChangeTraceConfigResponse&&) noexcept;
51825   ChangeTraceConfigResponse& operator=(ChangeTraceConfigResponse&&);
51826   ChangeTraceConfigResponse(const ChangeTraceConfigResponse&);
51827   ChangeTraceConfigResponse& operator=(const ChangeTraceConfigResponse&);
51828   bool operator==(const ChangeTraceConfigResponse&) const;
51829   bool operator!=(const ChangeTraceConfigResponse& other) const { return !(*this == other); }
51830 
51831   bool ParseFromArray(const void*, size_t) override;
51832   std::string SerializeAsString() const override;
51833   std::vector<uint8_t> SerializeAsArray() const override;
51834   void Serialize(::protozero::Message*) const;
51835 
51836  private:
51837 
51838   // Allows to preserve unknown protobuf fields for compatibility
51839   // with future versions of .proto files.
51840   std::string unknown_fields_;
51841 
51842   std::bitset<2> _has_field_{};
51843 };
51844 
51845 
51846 class PERFETTO_EXPORT ChangeTraceConfigRequest : public ::protozero::CppMessageObj {
51847  public:
51848   enum FieldNumbers {
51849     kTraceConfigFieldNumber = 1,
51850   };
51851 
51852   ChangeTraceConfigRequest();
51853   ~ChangeTraceConfigRequest() override;
51854   ChangeTraceConfigRequest(ChangeTraceConfigRequest&&) noexcept;
51855   ChangeTraceConfigRequest& operator=(ChangeTraceConfigRequest&&);
51856   ChangeTraceConfigRequest(const ChangeTraceConfigRequest&);
51857   ChangeTraceConfigRequest& operator=(const ChangeTraceConfigRequest&);
51858   bool operator==(const ChangeTraceConfigRequest&) const;
51859   bool operator!=(const ChangeTraceConfigRequest& other) const { return !(*this == other); }
51860 
51861   bool ParseFromArray(const void*, size_t) override;
51862   std::string SerializeAsString() const override;
51863   std::vector<uint8_t> SerializeAsArray() const override;
51864   void Serialize(::protozero::Message*) const;
51865 
51866   bool has_trace_config() const { return _has_field_[1]; }
51867   const TraceConfig& trace_config() const { return *trace_config_; }
51868   TraceConfig* mutable_trace_config() { _has_field_.set(1); return trace_config_.get(); }
51869 
51870  private:
51871   ::protozero::CopyablePtr<TraceConfig> trace_config_;
51872 
51873   // Allows to preserve unknown protobuf fields for compatibility
51874   // with future versions of .proto files.
51875   std::string unknown_fields_;
51876 
51877   std::bitset<2> _has_field_{};
51878 };
51879 
51880 
51881 class PERFETTO_EXPORT StartTracingResponse : public ::protozero::CppMessageObj {
51882  public:
51883   enum FieldNumbers {
51884   };
51885 
51886   StartTracingResponse();
51887   ~StartTracingResponse() override;
51888   StartTracingResponse(StartTracingResponse&&) noexcept;
51889   StartTracingResponse& operator=(StartTracingResponse&&);
51890   StartTracingResponse(const StartTracingResponse&);
51891   StartTracingResponse& operator=(const StartTracingResponse&);
51892   bool operator==(const StartTracingResponse&) const;
51893   bool operator!=(const StartTracingResponse& other) const { return !(*this == other); }
51894 
51895   bool ParseFromArray(const void*, size_t) override;
51896   std::string SerializeAsString() const override;
51897   std::vector<uint8_t> SerializeAsArray() const override;
51898   void Serialize(::protozero::Message*) const;
51899 
51900  private:
51901 
51902   // Allows to preserve unknown protobuf fields for compatibility
51903   // with future versions of .proto files.
51904   std::string unknown_fields_;
51905 
51906   std::bitset<2> _has_field_{};
51907 };
51908 
51909 
51910 class PERFETTO_EXPORT StartTracingRequest : public ::protozero::CppMessageObj {
51911  public:
51912   enum FieldNumbers {
51913   };
51914 
51915   StartTracingRequest();
51916   ~StartTracingRequest() override;
51917   StartTracingRequest(StartTracingRequest&&) noexcept;
51918   StartTracingRequest& operator=(StartTracingRequest&&);
51919   StartTracingRequest(const StartTracingRequest&);
51920   StartTracingRequest& operator=(const StartTracingRequest&);
51921   bool operator==(const StartTracingRequest&) const;
51922   bool operator!=(const StartTracingRequest& other) const { return !(*this == other); }
51923 
51924   bool ParseFromArray(const void*, size_t) override;
51925   std::string SerializeAsString() const override;
51926   std::vector<uint8_t> SerializeAsArray() const override;
51927   void Serialize(::protozero::Message*) const;
51928 
51929  private:
51930 
51931   // Allows to preserve unknown protobuf fields for compatibility
51932   // with future versions of .proto files.
51933   std::string unknown_fields_;
51934 
51935   std::bitset<2> _has_field_{};
51936 };
51937 
51938 
51939 class PERFETTO_EXPORT EnableTracingResponse : public ::protozero::CppMessageObj {
51940  public:
51941   enum FieldNumbers {
51942     kDisabledFieldNumber = 1,
51943   };
51944 
51945   EnableTracingResponse();
51946   ~EnableTracingResponse() override;
51947   EnableTracingResponse(EnableTracingResponse&&) noexcept;
51948   EnableTracingResponse& operator=(EnableTracingResponse&&);
51949   EnableTracingResponse(const EnableTracingResponse&);
51950   EnableTracingResponse& operator=(const EnableTracingResponse&);
51951   bool operator==(const EnableTracingResponse&) const;
51952   bool operator!=(const EnableTracingResponse& other) const { return !(*this == other); }
51953 
51954   bool ParseFromArray(const void*, size_t) override;
51955   std::string SerializeAsString() const override;
51956   std::vector<uint8_t> SerializeAsArray() const override;
51957   void Serialize(::protozero::Message*) const;
51958 
51959   bool has_disabled() const { return _has_field_[1]; }
51960   bool disabled() const { return disabled_; }
51961   void set_disabled(bool value) { disabled_ = value; _has_field_.set(1); }
51962 
51963  private:
51964   bool disabled_{};
51965 
51966   // Allows to preserve unknown protobuf fields for compatibility
51967   // with future versions of .proto files.
51968   std::string unknown_fields_;
51969 
51970   std::bitset<2> _has_field_{};
51971 };
51972 
51973 
51974 class PERFETTO_EXPORT EnableTracingRequest : public ::protozero::CppMessageObj {
51975  public:
51976   enum FieldNumbers {
51977     kTraceConfigFieldNumber = 1,
51978     kAttachNotificationOnlyFieldNumber = 2,
51979   };
51980 
51981   EnableTracingRequest();
51982   ~EnableTracingRequest() override;
51983   EnableTracingRequest(EnableTracingRequest&&) noexcept;
51984   EnableTracingRequest& operator=(EnableTracingRequest&&);
51985   EnableTracingRequest(const EnableTracingRequest&);
51986   EnableTracingRequest& operator=(const EnableTracingRequest&);
51987   bool operator==(const EnableTracingRequest&) const;
51988   bool operator!=(const EnableTracingRequest& other) const { return !(*this == other); }
51989 
51990   bool ParseFromArray(const void*, size_t) override;
51991   std::string SerializeAsString() const override;
51992   std::vector<uint8_t> SerializeAsArray() const override;
51993   void Serialize(::protozero::Message*) const;
51994 
51995   bool has_trace_config() const { return _has_field_[1]; }
51996   const TraceConfig& trace_config() const { return *trace_config_; }
51997   TraceConfig* mutable_trace_config() { _has_field_.set(1); return trace_config_.get(); }
51998 
51999   bool has_attach_notification_only() const { return _has_field_[2]; }
52000   bool attach_notification_only() const { return attach_notification_only_; }
52001   void set_attach_notification_only(bool value) { attach_notification_only_ = value; _has_field_.set(2); }
52002 
52003  private:
52004   ::protozero::CopyablePtr<TraceConfig> trace_config_;
52005   bool attach_notification_only_{};
52006 
52007   // Allows to preserve unknown protobuf fields for compatibility
52008   // with future versions of .proto files.
52009   std::string unknown_fields_;
52010 
52011   std::bitset<3> _has_field_{};
52012 };
52013 
52014 }  // namespace perfetto
52015 }  // namespace protos
52016 }  // namespace gen
52017 
52018 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_IPC_CONSUMER_PORT_PROTO_CPP_H_
52019 // gen_amalgamated begin header: gen/protos/perfetto/ipc/producer_port.gen.h
52020 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
52021 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_IPC_PRODUCER_PORT_PROTO_CPP_H_
52022 #define PERFETTO_PROTOS_PROTOS_PERFETTO_IPC_PRODUCER_PORT_PROTO_CPP_H_
52023 
52024 #include <stdint.h>
52025 #include <bitset>
52026 #include <vector>
52027 #include <string>
52028 #include <type_traits>
52029 
52030 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
52031 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
52032 // gen_amalgamated expanded: #include "perfetto/base/export.h"
52033 
52034 namespace perfetto {
52035 namespace protos {
52036 namespace gen {
52037 class SyncResponse;
52038 class SyncRequest;
52039 class GetAsyncCommandResponse;
52040 class GetAsyncCommandResponse_ClearIncrementalState;
52041 class GetAsyncCommandResponse_Flush;
52042 class GetAsyncCommandResponse_StopDataSource;
52043 class GetAsyncCommandResponse_StartDataSource;
52044 class DataSourceConfig;
52045 class TestConfig;
52046 class TestConfig_DummyFields;
52047 class ChromeConfig;
52048 class GetAsyncCommandResponse_SetupDataSource;
52049 class GetAsyncCommandResponse_SetupTracing;
52050 class GetAsyncCommandRequest;
52051 class ActivateTriggersResponse;
52052 class ActivateTriggersRequest;
52053 class NotifyDataSourceStoppedResponse;
52054 class NotifyDataSourceStoppedRequest;
52055 class NotifyDataSourceStartedResponse;
52056 class NotifyDataSourceStartedRequest;
52057 class CommitDataResponse;
52058 class UnregisterTraceWriterResponse;
52059 class UnregisterTraceWriterRequest;
52060 class RegisterTraceWriterResponse;
52061 class RegisterTraceWriterRequest;
52062 class UnregisterDataSourceResponse;
52063 class UnregisterDataSourceRequest;
52064 class RegisterDataSourceResponse;
52065 class RegisterDataSourceRequest;
52066 class DataSourceDescriptor;
52067 class InitializeConnectionResponse;
52068 class InitializeConnectionRequest;
52069 enum InitializeConnectionRequest_ProducerSMBScrapingMode : int;
52070 enum InitializeConnectionRequest_ProducerBuildFlags : int;
52071 }  // namespace perfetto
52072 }  // namespace protos
52073 }  // namespace gen
52074 
52075 namespace protozero {
52076 class Message;
52077 }  // namespace protozero
52078 
52079 namespace perfetto {
52080 namespace protos {
52081 namespace gen {
52082 enum InitializeConnectionRequest_ProducerSMBScrapingMode : int {
52083   InitializeConnectionRequest_ProducerSMBScrapingMode_SMB_SCRAPING_UNSPECIFIED = 0,
52084   InitializeConnectionRequest_ProducerSMBScrapingMode_SMB_SCRAPING_ENABLED = 1,
52085   InitializeConnectionRequest_ProducerSMBScrapingMode_SMB_SCRAPING_DISABLED = 2,
52086 };
52087 enum InitializeConnectionRequest_ProducerBuildFlags : int {
52088   InitializeConnectionRequest_ProducerBuildFlags_BUILD_FLAGS_UNSPECIFIED = 0,
52089   InitializeConnectionRequest_ProducerBuildFlags_BUILD_FLAGS_DCHECKS_ON = 1,
52090   InitializeConnectionRequest_ProducerBuildFlags_BUILD_FLAGS_DCHECKS_OFF = 2,
52091 };
52092 
52093 class PERFETTO_EXPORT SyncResponse : public ::protozero::CppMessageObj {
52094  public:
52095   enum FieldNumbers {
52096   };
52097 
52098   SyncResponse();
52099   ~SyncResponse() override;
52100   SyncResponse(SyncResponse&&) noexcept;
52101   SyncResponse& operator=(SyncResponse&&);
52102   SyncResponse(const SyncResponse&);
52103   SyncResponse& operator=(const SyncResponse&);
52104   bool operator==(const SyncResponse&) const;
52105   bool operator!=(const SyncResponse& other) const { return !(*this == other); }
52106 
52107   bool ParseFromArray(const void*, size_t) override;
52108   std::string SerializeAsString() const override;
52109   std::vector<uint8_t> SerializeAsArray() const override;
52110   void Serialize(::protozero::Message*) const;
52111 
52112  private:
52113 
52114   // Allows to preserve unknown protobuf fields for compatibility
52115   // with future versions of .proto files.
52116   std::string unknown_fields_;
52117 
52118   std::bitset<2> _has_field_{};
52119 };
52120 
52121 
52122 class PERFETTO_EXPORT SyncRequest : public ::protozero::CppMessageObj {
52123  public:
52124   enum FieldNumbers {
52125   };
52126 
52127   SyncRequest();
52128   ~SyncRequest() override;
52129   SyncRequest(SyncRequest&&) noexcept;
52130   SyncRequest& operator=(SyncRequest&&);
52131   SyncRequest(const SyncRequest&);
52132   SyncRequest& operator=(const SyncRequest&);
52133   bool operator==(const SyncRequest&) const;
52134   bool operator!=(const SyncRequest& other) const { return !(*this == other); }
52135 
52136   bool ParseFromArray(const void*, size_t) override;
52137   std::string SerializeAsString() const override;
52138   std::vector<uint8_t> SerializeAsArray() const override;
52139   void Serialize(::protozero::Message*) const;
52140 
52141  private:
52142 
52143   // Allows to preserve unknown protobuf fields for compatibility
52144   // with future versions of .proto files.
52145   std::string unknown_fields_;
52146 
52147   std::bitset<2> _has_field_{};
52148 };
52149 
52150 
52151 class PERFETTO_EXPORT GetAsyncCommandResponse : public ::protozero::CppMessageObj {
52152  public:
52153   using SetupDataSource = GetAsyncCommandResponse_SetupDataSource;
52154   using StartDataSource = GetAsyncCommandResponse_StartDataSource;
52155   using StopDataSource = GetAsyncCommandResponse_StopDataSource;
52156   using SetupTracing = GetAsyncCommandResponse_SetupTracing;
52157   using Flush = GetAsyncCommandResponse_Flush;
52158   using ClearIncrementalState = GetAsyncCommandResponse_ClearIncrementalState;
52159   enum FieldNumbers {
52160     kSetupTracingFieldNumber = 3,
52161     kSetupDataSourceFieldNumber = 6,
52162     kStartDataSourceFieldNumber = 1,
52163     kStopDataSourceFieldNumber = 2,
52164     kFlushFieldNumber = 5,
52165     kClearIncrementalStateFieldNumber = 7,
52166   };
52167 
52168   GetAsyncCommandResponse();
52169   ~GetAsyncCommandResponse() override;
52170   GetAsyncCommandResponse(GetAsyncCommandResponse&&) noexcept;
52171   GetAsyncCommandResponse& operator=(GetAsyncCommandResponse&&);
52172   GetAsyncCommandResponse(const GetAsyncCommandResponse&);
52173   GetAsyncCommandResponse& operator=(const GetAsyncCommandResponse&);
52174   bool operator==(const GetAsyncCommandResponse&) const;
52175   bool operator!=(const GetAsyncCommandResponse& other) const { return !(*this == other); }
52176 
52177   bool ParseFromArray(const void*, size_t) override;
52178   std::string SerializeAsString() const override;
52179   std::vector<uint8_t> SerializeAsArray() const override;
52180   void Serialize(::protozero::Message*) const;
52181 
52182   bool has_setup_tracing() const { return _has_field_[3]; }
52183   const GetAsyncCommandResponse_SetupTracing& setup_tracing() const { return *setup_tracing_; }
52184   GetAsyncCommandResponse_SetupTracing* mutable_setup_tracing() { _has_field_.set(3); return setup_tracing_.get(); }
52185 
52186   bool has_setup_data_source() const { return _has_field_[6]; }
52187   const GetAsyncCommandResponse_SetupDataSource& setup_data_source() const { return *setup_data_source_; }
52188   GetAsyncCommandResponse_SetupDataSource* mutable_setup_data_source() { _has_field_.set(6); return setup_data_source_.get(); }
52189 
52190   bool has_start_data_source() const { return _has_field_[1]; }
52191   const GetAsyncCommandResponse_StartDataSource& start_data_source() const { return *start_data_source_; }
52192   GetAsyncCommandResponse_StartDataSource* mutable_start_data_source() { _has_field_.set(1); return start_data_source_.get(); }
52193 
52194   bool has_stop_data_source() const { return _has_field_[2]; }
52195   const GetAsyncCommandResponse_StopDataSource& stop_data_source() const { return *stop_data_source_; }
52196   GetAsyncCommandResponse_StopDataSource* mutable_stop_data_source() { _has_field_.set(2); return stop_data_source_.get(); }
52197 
52198   bool has_flush() const { return _has_field_[5]; }
52199   const GetAsyncCommandResponse_Flush& flush() const { return *flush_; }
52200   GetAsyncCommandResponse_Flush* mutable_flush() { _has_field_.set(5); return flush_.get(); }
52201 
52202   bool has_clear_incremental_state() const { return _has_field_[7]; }
52203   const GetAsyncCommandResponse_ClearIncrementalState& clear_incremental_state() const { return *clear_incremental_state_; }
52204   GetAsyncCommandResponse_ClearIncrementalState* mutable_clear_incremental_state() { _has_field_.set(7); return clear_incremental_state_.get(); }
52205 
52206  private:
52207   ::protozero::CopyablePtr<GetAsyncCommandResponse_SetupTracing> setup_tracing_;
52208   ::protozero::CopyablePtr<GetAsyncCommandResponse_SetupDataSource> setup_data_source_;
52209   ::protozero::CopyablePtr<GetAsyncCommandResponse_StartDataSource> start_data_source_;
52210   ::protozero::CopyablePtr<GetAsyncCommandResponse_StopDataSource> stop_data_source_;
52211   ::protozero::CopyablePtr<GetAsyncCommandResponse_Flush> flush_;
52212   ::protozero::CopyablePtr<GetAsyncCommandResponse_ClearIncrementalState> clear_incremental_state_;
52213 
52214   // Allows to preserve unknown protobuf fields for compatibility
52215   // with future versions of .proto files.
52216   std::string unknown_fields_;
52217 
52218   std::bitset<8> _has_field_{};
52219 };
52220 
52221 
52222 class PERFETTO_EXPORT GetAsyncCommandResponse_ClearIncrementalState : public ::protozero::CppMessageObj {
52223  public:
52224   enum FieldNumbers {
52225     kDataSourceIdsFieldNumber = 1,
52226   };
52227 
52228   GetAsyncCommandResponse_ClearIncrementalState();
52229   ~GetAsyncCommandResponse_ClearIncrementalState() override;
52230   GetAsyncCommandResponse_ClearIncrementalState(GetAsyncCommandResponse_ClearIncrementalState&&) noexcept;
52231   GetAsyncCommandResponse_ClearIncrementalState& operator=(GetAsyncCommandResponse_ClearIncrementalState&&);
52232   GetAsyncCommandResponse_ClearIncrementalState(const GetAsyncCommandResponse_ClearIncrementalState&);
52233   GetAsyncCommandResponse_ClearIncrementalState& operator=(const GetAsyncCommandResponse_ClearIncrementalState&);
52234   bool operator==(const GetAsyncCommandResponse_ClearIncrementalState&) const;
52235   bool operator!=(const GetAsyncCommandResponse_ClearIncrementalState& other) const { return !(*this == other); }
52236 
52237   bool ParseFromArray(const void*, size_t) override;
52238   std::string SerializeAsString() const override;
52239   std::vector<uint8_t> SerializeAsArray() const override;
52240   void Serialize(::protozero::Message*) const;
52241 
52242   int data_source_ids_size() const { return static_cast<int>(data_source_ids_.size()); }
52243   const std::vector<uint64_t>& data_source_ids() const { return data_source_ids_; }
52244   std::vector<uint64_t>* mutable_data_source_ids() { return &data_source_ids_; }
52245   void clear_data_source_ids() { data_source_ids_.clear(); }
52246   void add_data_source_ids(uint64_t value) { data_source_ids_.emplace_back(value); }
52247   uint64_t* add_data_source_ids() { data_source_ids_.emplace_back(); return &data_source_ids_.back(); }
52248 
52249  private:
52250   std::vector<uint64_t> data_source_ids_;
52251 
52252   // Allows to preserve unknown protobuf fields for compatibility
52253   // with future versions of .proto files.
52254   std::string unknown_fields_;
52255 
52256   std::bitset<2> _has_field_{};
52257 };
52258 
52259 
52260 class PERFETTO_EXPORT GetAsyncCommandResponse_Flush : public ::protozero::CppMessageObj {
52261  public:
52262   enum FieldNumbers {
52263     kDataSourceIdsFieldNumber = 1,
52264     kRequestIdFieldNumber = 2,
52265   };
52266 
52267   GetAsyncCommandResponse_Flush();
52268   ~GetAsyncCommandResponse_Flush() override;
52269   GetAsyncCommandResponse_Flush(GetAsyncCommandResponse_Flush&&) noexcept;
52270   GetAsyncCommandResponse_Flush& operator=(GetAsyncCommandResponse_Flush&&);
52271   GetAsyncCommandResponse_Flush(const GetAsyncCommandResponse_Flush&);
52272   GetAsyncCommandResponse_Flush& operator=(const GetAsyncCommandResponse_Flush&);
52273   bool operator==(const GetAsyncCommandResponse_Flush&) const;
52274   bool operator!=(const GetAsyncCommandResponse_Flush& other) const { return !(*this == other); }
52275 
52276   bool ParseFromArray(const void*, size_t) override;
52277   std::string SerializeAsString() const override;
52278   std::vector<uint8_t> SerializeAsArray() const override;
52279   void Serialize(::protozero::Message*) const;
52280 
52281   int data_source_ids_size() const { return static_cast<int>(data_source_ids_.size()); }
52282   const std::vector<uint64_t>& data_source_ids() const { return data_source_ids_; }
52283   std::vector<uint64_t>* mutable_data_source_ids() { return &data_source_ids_; }
52284   void clear_data_source_ids() { data_source_ids_.clear(); }
52285   void add_data_source_ids(uint64_t value) { data_source_ids_.emplace_back(value); }
52286   uint64_t* add_data_source_ids() { data_source_ids_.emplace_back(); return &data_source_ids_.back(); }
52287 
52288   bool has_request_id() const { return _has_field_[2]; }
52289   uint64_t request_id() const { return request_id_; }
52290   void set_request_id(uint64_t value) { request_id_ = value; _has_field_.set(2); }
52291 
52292  private:
52293   std::vector<uint64_t> data_source_ids_;
52294   uint64_t request_id_{};
52295 
52296   // Allows to preserve unknown protobuf fields for compatibility
52297   // with future versions of .proto files.
52298   std::string unknown_fields_;
52299 
52300   std::bitset<3> _has_field_{};
52301 };
52302 
52303 
52304 class PERFETTO_EXPORT GetAsyncCommandResponse_StopDataSource : public ::protozero::CppMessageObj {
52305  public:
52306   enum FieldNumbers {
52307     kInstanceIdFieldNumber = 1,
52308   };
52309 
52310   GetAsyncCommandResponse_StopDataSource();
52311   ~GetAsyncCommandResponse_StopDataSource() override;
52312   GetAsyncCommandResponse_StopDataSource(GetAsyncCommandResponse_StopDataSource&&) noexcept;
52313   GetAsyncCommandResponse_StopDataSource& operator=(GetAsyncCommandResponse_StopDataSource&&);
52314   GetAsyncCommandResponse_StopDataSource(const GetAsyncCommandResponse_StopDataSource&);
52315   GetAsyncCommandResponse_StopDataSource& operator=(const GetAsyncCommandResponse_StopDataSource&);
52316   bool operator==(const GetAsyncCommandResponse_StopDataSource&) const;
52317   bool operator!=(const GetAsyncCommandResponse_StopDataSource& other) const { return !(*this == other); }
52318 
52319   bool ParseFromArray(const void*, size_t) override;
52320   std::string SerializeAsString() const override;
52321   std::vector<uint8_t> SerializeAsArray() const override;
52322   void Serialize(::protozero::Message*) const;
52323 
52324   bool has_instance_id() const { return _has_field_[1]; }
52325   uint64_t instance_id() const { return instance_id_; }
52326   void set_instance_id(uint64_t value) { instance_id_ = value; _has_field_.set(1); }
52327 
52328  private:
52329   uint64_t instance_id_{};
52330 
52331   // Allows to preserve unknown protobuf fields for compatibility
52332   // with future versions of .proto files.
52333   std::string unknown_fields_;
52334 
52335   std::bitset<2> _has_field_{};
52336 };
52337 
52338 
52339 class PERFETTO_EXPORT GetAsyncCommandResponse_StartDataSource : public ::protozero::CppMessageObj {
52340  public:
52341   enum FieldNumbers {
52342     kNewInstanceIdFieldNumber = 1,
52343     kConfigFieldNumber = 2,
52344   };
52345 
52346   GetAsyncCommandResponse_StartDataSource();
52347   ~GetAsyncCommandResponse_StartDataSource() override;
52348   GetAsyncCommandResponse_StartDataSource(GetAsyncCommandResponse_StartDataSource&&) noexcept;
52349   GetAsyncCommandResponse_StartDataSource& operator=(GetAsyncCommandResponse_StartDataSource&&);
52350   GetAsyncCommandResponse_StartDataSource(const GetAsyncCommandResponse_StartDataSource&);
52351   GetAsyncCommandResponse_StartDataSource& operator=(const GetAsyncCommandResponse_StartDataSource&);
52352   bool operator==(const GetAsyncCommandResponse_StartDataSource&) const;
52353   bool operator!=(const GetAsyncCommandResponse_StartDataSource& other) const { return !(*this == other); }
52354 
52355   bool ParseFromArray(const void*, size_t) override;
52356   std::string SerializeAsString() const override;
52357   std::vector<uint8_t> SerializeAsArray() const override;
52358   void Serialize(::protozero::Message*) const;
52359 
52360   bool has_new_instance_id() const { return _has_field_[1]; }
52361   uint64_t new_instance_id() const { return new_instance_id_; }
52362   void set_new_instance_id(uint64_t value) { new_instance_id_ = value; _has_field_.set(1); }
52363 
52364   bool has_config() const { return _has_field_[2]; }
52365   const DataSourceConfig& config() const { return *config_; }
52366   DataSourceConfig* mutable_config() { _has_field_.set(2); return config_.get(); }
52367 
52368  private:
52369   uint64_t new_instance_id_{};
52370   ::protozero::CopyablePtr<DataSourceConfig> config_;
52371 
52372   // Allows to preserve unknown protobuf fields for compatibility
52373   // with future versions of .proto files.
52374   std::string unknown_fields_;
52375 
52376   std::bitset<3> _has_field_{};
52377 };
52378 
52379 
52380 class PERFETTO_EXPORT GetAsyncCommandResponse_SetupDataSource : public ::protozero::CppMessageObj {
52381  public:
52382   enum FieldNumbers {
52383     kNewInstanceIdFieldNumber = 1,
52384     kConfigFieldNumber = 2,
52385   };
52386 
52387   GetAsyncCommandResponse_SetupDataSource();
52388   ~GetAsyncCommandResponse_SetupDataSource() override;
52389   GetAsyncCommandResponse_SetupDataSource(GetAsyncCommandResponse_SetupDataSource&&) noexcept;
52390   GetAsyncCommandResponse_SetupDataSource& operator=(GetAsyncCommandResponse_SetupDataSource&&);
52391   GetAsyncCommandResponse_SetupDataSource(const GetAsyncCommandResponse_SetupDataSource&);
52392   GetAsyncCommandResponse_SetupDataSource& operator=(const GetAsyncCommandResponse_SetupDataSource&);
52393   bool operator==(const GetAsyncCommandResponse_SetupDataSource&) const;
52394   bool operator!=(const GetAsyncCommandResponse_SetupDataSource& other) const { return !(*this == other); }
52395 
52396   bool ParseFromArray(const void*, size_t) override;
52397   std::string SerializeAsString() const override;
52398   std::vector<uint8_t> SerializeAsArray() const override;
52399   void Serialize(::protozero::Message*) const;
52400 
52401   bool has_new_instance_id() const { return _has_field_[1]; }
52402   uint64_t new_instance_id() const { return new_instance_id_; }
52403   void set_new_instance_id(uint64_t value) { new_instance_id_ = value; _has_field_.set(1); }
52404 
52405   bool has_config() const { return _has_field_[2]; }
52406   const DataSourceConfig& config() const { return *config_; }
52407   DataSourceConfig* mutable_config() { _has_field_.set(2); return config_.get(); }
52408 
52409  private:
52410   uint64_t new_instance_id_{};
52411   ::protozero::CopyablePtr<DataSourceConfig> config_;
52412 
52413   // Allows to preserve unknown protobuf fields for compatibility
52414   // with future versions of .proto files.
52415   std::string unknown_fields_;
52416 
52417   std::bitset<3> _has_field_{};
52418 };
52419 
52420 
52421 class PERFETTO_EXPORT GetAsyncCommandResponse_SetupTracing : public ::protozero::CppMessageObj {
52422  public:
52423   enum FieldNumbers {
52424     kSharedBufferPageSizeKbFieldNumber = 1,
52425   };
52426 
52427   GetAsyncCommandResponse_SetupTracing();
52428   ~GetAsyncCommandResponse_SetupTracing() override;
52429   GetAsyncCommandResponse_SetupTracing(GetAsyncCommandResponse_SetupTracing&&) noexcept;
52430   GetAsyncCommandResponse_SetupTracing& operator=(GetAsyncCommandResponse_SetupTracing&&);
52431   GetAsyncCommandResponse_SetupTracing(const GetAsyncCommandResponse_SetupTracing&);
52432   GetAsyncCommandResponse_SetupTracing& operator=(const GetAsyncCommandResponse_SetupTracing&);
52433   bool operator==(const GetAsyncCommandResponse_SetupTracing&) const;
52434   bool operator!=(const GetAsyncCommandResponse_SetupTracing& other) const { return !(*this == other); }
52435 
52436   bool ParseFromArray(const void*, size_t) override;
52437   std::string SerializeAsString() const override;
52438   std::vector<uint8_t> SerializeAsArray() const override;
52439   void Serialize(::protozero::Message*) const;
52440 
52441   bool has_shared_buffer_page_size_kb() const { return _has_field_[1]; }
52442   uint32_t shared_buffer_page_size_kb() const { return shared_buffer_page_size_kb_; }
52443   void set_shared_buffer_page_size_kb(uint32_t value) { shared_buffer_page_size_kb_ = value; _has_field_.set(1); }
52444 
52445  private:
52446   uint32_t shared_buffer_page_size_kb_{};
52447 
52448   // Allows to preserve unknown protobuf fields for compatibility
52449   // with future versions of .proto files.
52450   std::string unknown_fields_;
52451 
52452   std::bitset<2> _has_field_{};
52453 };
52454 
52455 
52456 class PERFETTO_EXPORT GetAsyncCommandRequest : public ::protozero::CppMessageObj {
52457  public:
52458   enum FieldNumbers {
52459   };
52460 
52461   GetAsyncCommandRequest();
52462   ~GetAsyncCommandRequest() override;
52463   GetAsyncCommandRequest(GetAsyncCommandRequest&&) noexcept;
52464   GetAsyncCommandRequest& operator=(GetAsyncCommandRequest&&);
52465   GetAsyncCommandRequest(const GetAsyncCommandRequest&);
52466   GetAsyncCommandRequest& operator=(const GetAsyncCommandRequest&);
52467   bool operator==(const GetAsyncCommandRequest&) const;
52468   bool operator!=(const GetAsyncCommandRequest& other) const { return !(*this == other); }
52469 
52470   bool ParseFromArray(const void*, size_t) override;
52471   std::string SerializeAsString() const override;
52472   std::vector<uint8_t> SerializeAsArray() const override;
52473   void Serialize(::protozero::Message*) const;
52474 
52475  private:
52476 
52477   // Allows to preserve unknown protobuf fields for compatibility
52478   // with future versions of .proto files.
52479   std::string unknown_fields_;
52480 
52481   std::bitset<2> _has_field_{};
52482 };
52483 
52484 
52485 class PERFETTO_EXPORT ActivateTriggersResponse : public ::protozero::CppMessageObj {
52486  public:
52487   enum FieldNumbers {
52488   };
52489 
52490   ActivateTriggersResponse();
52491   ~ActivateTriggersResponse() override;
52492   ActivateTriggersResponse(ActivateTriggersResponse&&) noexcept;
52493   ActivateTriggersResponse& operator=(ActivateTriggersResponse&&);
52494   ActivateTriggersResponse(const ActivateTriggersResponse&);
52495   ActivateTriggersResponse& operator=(const ActivateTriggersResponse&);
52496   bool operator==(const ActivateTriggersResponse&) const;
52497   bool operator!=(const ActivateTriggersResponse& other) const { return !(*this == other); }
52498 
52499   bool ParseFromArray(const void*, size_t) override;
52500   std::string SerializeAsString() const override;
52501   std::vector<uint8_t> SerializeAsArray() const override;
52502   void Serialize(::protozero::Message*) const;
52503 
52504  private:
52505 
52506   // Allows to preserve unknown protobuf fields for compatibility
52507   // with future versions of .proto files.
52508   std::string unknown_fields_;
52509 
52510   std::bitset<2> _has_field_{};
52511 };
52512 
52513 
52514 class PERFETTO_EXPORT ActivateTriggersRequest : public ::protozero::CppMessageObj {
52515  public:
52516   enum FieldNumbers {
52517     kTriggerNamesFieldNumber = 1,
52518   };
52519 
52520   ActivateTriggersRequest();
52521   ~ActivateTriggersRequest() override;
52522   ActivateTriggersRequest(ActivateTriggersRequest&&) noexcept;
52523   ActivateTriggersRequest& operator=(ActivateTriggersRequest&&);
52524   ActivateTriggersRequest(const ActivateTriggersRequest&);
52525   ActivateTriggersRequest& operator=(const ActivateTriggersRequest&);
52526   bool operator==(const ActivateTriggersRequest&) const;
52527   bool operator!=(const ActivateTriggersRequest& other) const { return !(*this == other); }
52528 
52529   bool ParseFromArray(const void*, size_t) override;
52530   std::string SerializeAsString() const override;
52531   std::vector<uint8_t> SerializeAsArray() const override;
52532   void Serialize(::protozero::Message*) const;
52533 
52534   int trigger_names_size() const { return static_cast<int>(trigger_names_.size()); }
52535   const std::vector<std::string>& trigger_names() const { return trigger_names_; }
52536   std::vector<std::string>* mutable_trigger_names() { return &trigger_names_; }
52537   void clear_trigger_names() { trigger_names_.clear(); }
52538   void add_trigger_names(std::string value) { trigger_names_.emplace_back(value); }
52539   std::string* add_trigger_names() { trigger_names_.emplace_back(); return &trigger_names_.back(); }
52540 
52541  private:
52542   std::vector<std::string> trigger_names_;
52543 
52544   // Allows to preserve unknown protobuf fields for compatibility
52545   // with future versions of .proto files.
52546   std::string unknown_fields_;
52547 
52548   std::bitset<2> _has_field_{};
52549 };
52550 
52551 
52552 class PERFETTO_EXPORT NotifyDataSourceStoppedResponse : public ::protozero::CppMessageObj {
52553  public:
52554   enum FieldNumbers {
52555   };
52556 
52557   NotifyDataSourceStoppedResponse();
52558   ~NotifyDataSourceStoppedResponse() override;
52559   NotifyDataSourceStoppedResponse(NotifyDataSourceStoppedResponse&&) noexcept;
52560   NotifyDataSourceStoppedResponse& operator=(NotifyDataSourceStoppedResponse&&);
52561   NotifyDataSourceStoppedResponse(const NotifyDataSourceStoppedResponse&);
52562   NotifyDataSourceStoppedResponse& operator=(const NotifyDataSourceStoppedResponse&);
52563   bool operator==(const NotifyDataSourceStoppedResponse&) const;
52564   bool operator!=(const NotifyDataSourceStoppedResponse& other) const { return !(*this == other); }
52565 
52566   bool ParseFromArray(const void*, size_t) override;
52567   std::string SerializeAsString() const override;
52568   std::vector<uint8_t> SerializeAsArray() const override;
52569   void Serialize(::protozero::Message*) const;
52570 
52571  private:
52572 
52573   // Allows to preserve unknown protobuf fields for compatibility
52574   // with future versions of .proto files.
52575   std::string unknown_fields_;
52576 
52577   std::bitset<2> _has_field_{};
52578 };
52579 
52580 
52581 class PERFETTO_EXPORT NotifyDataSourceStoppedRequest : public ::protozero::CppMessageObj {
52582  public:
52583   enum FieldNumbers {
52584     kDataSourceIdFieldNumber = 1,
52585   };
52586 
52587   NotifyDataSourceStoppedRequest();
52588   ~NotifyDataSourceStoppedRequest() override;
52589   NotifyDataSourceStoppedRequest(NotifyDataSourceStoppedRequest&&) noexcept;
52590   NotifyDataSourceStoppedRequest& operator=(NotifyDataSourceStoppedRequest&&);
52591   NotifyDataSourceStoppedRequest(const NotifyDataSourceStoppedRequest&);
52592   NotifyDataSourceStoppedRequest& operator=(const NotifyDataSourceStoppedRequest&);
52593   bool operator==(const NotifyDataSourceStoppedRequest&) const;
52594   bool operator!=(const NotifyDataSourceStoppedRequest& other) const { return !(*this == other); }
52595 
52596   bool ParseFromArray(const void*, size_t) override;
52597   std::string SerializeAsString() const override;
52598   std::vector<uint8_t> SerializeAsArray() const override;
52599   void Serialize(::protozero::Message*) const;
52600 
52601   bool has_data_source_id() const { return _has_field_[1]; }
52602   uint64_t data_source_id() const { return data_source_id_; }
52603   void set_data_source_id(uint64_t value) { data_source_id_ = value; _has_field_.set(1); }
52604 
52605  private:
52606   uint64_t data_source_id_{};
52607 
52608   // Allows to preserve unknown protobuf fields for compatibility
52609   // with future versions of .proto files.
52610   std::string unknown_fields_;
52611 
52612   std::bitset<2> _has_field_{};
52613 };
52614 
52615 
52616 class PERFETTO_EXPORT NotifyDataSourceStartedResponse : public ::protozero::CppMessageObj {
52617  public:
52618   enum FieldNumbers {
52619   };
52620 
52621   NotifyDataSourceStartedResponse();
52622   ~NotifyDataSourceStartedResponse() override;
52623   NotifyDataSourceStartedResponse(NotifyDataSourceStartedResponse&&) noexcept;
52624   NotifyDataSourceStartedResponse& operator=(NotifyDataSourceStartedResponse&&);
52625   NotifyDataSourceStartedResponse(const NotifyDataSourceStartedResponse&);
52626   NotifyDataSourceStartedResponse& operator=(const NotifyDataSourceStartedResponse&);
52627   bool operator==(const NotifyDataSourceStartedResponse&) const;
52628   bool operator!=(const NotifyDataSourceStartedResponse& other) const { return !(*this == other); }
52629 
52630   bool ParseFromArray(const void*, size_t) override;
52631   std::string SerializeAsString() const override;
52632   std::vector<uint8_t> SerializeAsArray() const override;
52633   void Serialize(::protozero::Message*) const;
52634 
52635  private:
52636 
52637   // Allows to preserve unknown protobuf fields for compatibility
52638   // with future versions of .proto files.
52639   std::string unknown_fields_;
52640 
52641   std::bitset<2> _has_field_{};
52642 };
52643 
52644 
52645 class PERFETTO_EXPORT NotifyDataSourceStartedRequest : public ::protozero::CppMessageObj {
52646  public:
52647   enum FieldNumbers {
52648     kDataSourceIdFieldNumber = 1,
52649   };
52650 
52651   NotifyDataSourceStartedRequest();
52652   ~NotifyDataSourceStartedRequest() override;
52653   NotifyDataSourceStartedRequest(NotifyDataSourceStartedRequest&&) noexcept;
52654   NotifyDataSourceStartedRequest& operator=(NotifyDataSourceStartedRequest&&);
52655   NotifyDataSourceStartedRequest(const NotifyDataSourceStartedRequest&);
52656   NotifyDataSourceStartedRequest& operator=(const NotifyDataSourceStartedRequest&);
52657   bool operator==(const NotifyDataSourceStartedRequest&) const;
52658   bool operator!=(const NotifyDataSourceStartedRequest& other) const { return !(*this == other); }
52659 
52660   bool ParseFromArray(const void*, size_t) override;
52661   std::string SerializeAsString() const override;
52662   std::vector<uint8_t> SerializeAsArray() const override;
52663   void Serialize(::protozero::Message*) const;
52664 
52665   bool has_data_source_id() const { return _has_field_[1]; }
52666   uint64_t data_source_id() const { return data_source_id_; }
52667   void set_data_source_id(uint64_t value) { data_source_id_ = value; _has_field_.set(1); }
52668 
52669  private:
52670   uint64_t data_source_id_{};
52671 
52672   // Allows to preserve unknown protobuf fields for compatibility
52673   // with future versions of .proto files.
52674   std::string unknown_fields_;
52675 
52676   std::bitset<2> _has_field_{};
52677 };
52678 
52679 
52680 class PERFETTO_EXPORT CommitDataResponse : public ::protozero::CppMessageObj {
52681  public:
52682   enum FieldNumbers {
52683   };
52684 
52685   CommitDataResponse();
52686   ~CommitDataResponse() override;
52687   CommitDataResponse(CommitDataResponse&&) noexcept;
52688   CommitDataResponse& operator=(CommitDataResponse&&);
52689   CommitDataResponse(const CommitDataResponse&);
52690   CommitDataResponse& operator=(const CommitDataResponse&);
52691   bool operator==(const CommitDataResponse&) const;
52692   bool operator!=(const CommitDataResponse& other) const { return !(*this == other); }
52693 
52694   bool ParseFromArray(const void*, size_t) override;
52695   std::string SerializeAsString() const override;
52696   std::vector<uint8_t> SerializeAsArray() const override;
52697   void Serialize(::protozero::Message*) const;
52698 
52699  private:
52700 
52701   // Allows to preserve unknown protobuf fields for compatibility
52702   // with future versions of .proto files.
52703   std::string unknown_fields_;
52704 
52705   std::bitset<2> _has_field_{};
52706 };
52707 
52708 
52709 class PERFETTO_EXPORT UnregisterTraceWriterResponse : public ::protozero::CppMessageObj {
52710  public:
52711   enum FieldNumbers {
52712   };
52713 
52714   UnregisterTraceWriterResponse();
52715   ~UnregisterTraceWriterResponse() override;
52716   UnregisterTraceWriterResponse(UnregisterTraceWriterResponse&&) noexcept;
52717   UnregisterTraceWriterResponse& operator=(UnregisterTraceWriterResponse&&);
52718   UnregisterTraceWriterResponse(const UnregisterTraceWriterResponse&);
52719   UnregisterTraceWriterResponse& operator=(const UnregisterTraceWriterResponse&);
52720   bool operator==(const UnregisterTraceWriterResponse&) const;
52721   bool operator!=(const UnregisterTraceWriterResponse& other) const { return !(*this == other); }
52722 
52723   bool ParseFromArray(const void*, size_t) override;
52724   std::string SerializeAsString() const override;
52725   std::vector<uint8_t> SerializeAsArray() const override;
52726   void Serialize(::protozero::Message*) const;
52727 
52728  private:
52729 
52730   // Allows to preserve unknown protobuf fields for compatibility
52731   // with future versions of .proto files.
52732   std::string unknown_fields_;
52733 
52734   std::bitset<2> _has_field_{};
52735 };
52736 
52737 
52738 class PERFETTO_EXPORT UnregisterTraceWriterRequest : public ::protozero::CppMessageObj {
52739  public:
52740   enum FieldNumbers {
52741     kTraceWriterIdFieldNumber = 1,
52742   };
52743 
52744   UnregisterTraceWriterRequest();
52745   ~UnregisterTraceWriterRequest() override;
52746   UnregisterTraceWriterRequest(UnregisterTraceWriterRequest&&) noexcept;
52747   UnregisterTraceWriterRequest& operator=(UnregisterTraceWriterRequest&&);
52748   UnregisterTraceWriterRequest(const UnregisterTraceWriterRequest&);
52749   UnregisterTraceWriterRequest& operator=(const UnregisterTraceWriterRequest&);
52750   bool operator==(const UnregisterTraceWriterRequest&) const;
52751   bool operator!=(const UnregisterTraceWriterRequest& other) const { return !(*this == other); }
52752 
52753   bool ParseFromArray(const void*, size_t) override;
52754   std::string SerializeAsString() const override;
52755   std::vector<uint8_t> SerializeAsArray() const override;
52756   void Serialize(::protozero::Message*) const;
52757 
52758   bool has_trace_writer_id() const { return _has_field_[1]; }
52759   uint32_t trace_writer_id() const { return trace_writer_id_; }
52760   void set_trace_writer_id(uint32_t value) { trace_writer_id_ = value; _has_field_.set(1); }
52761 
52762  private:
52763   uint32_t trace_writer_id_{};
52764 
52765   // Allows to preserve unknown protobuf fields for compatibility
52766   // with future versions of .proto files.
52767   std::string unknown_fields_;
52768 
52769   std::bitset<2> _has_field_{};
52770 };
52771 
52772 
52773 class PERFETTO_EXPORT RegisterTraceWriterResponse : public ::protozero::CppMessageObj {
52774  public:
52775   enum FieldNumbers {
52776   };
52777 
52778   RegisterTraceWriterResponse();
52779   ~RegisterTraceWriterResponse() override;
52780   RegisterTraceWriterResponse(RegisterTraceWriterResponse&&) noexcept;
52781   RegisterTraceWriterResponse& operator=(RegisterTraceWriterResponse&&);
52782   RegisterTraceWriterResponse(const RegisterTraceWriterResponse&);
52783   RegisterTraceWriterResponse& operator=(const RegisterTraceWriterResponse&);
52784   bool operator==(const RegisterTraceWriterResponse&) const;
52785   bool operator!=(const RegisterTraceWriterResponse& other) const { return !(*this == other); }
52786 
52787   bool ParseFromArray(const void*, size_t) override;
52788   std::string SerializeAsString() const override;
52789   std::vector<uint8_t> SerializeAsArray() const override;
52790   void Serialize(::protozero::Message*) const;
52791 
52792  private:
52793 
52794   // Allows to preserve unknown protobuf fields for compatibility
52795   // with future versions of .proto files.
52796   std::string unknown_fields_;
52797 
52798   std::bitset<2> _has_field_{};
52799 };
52800 
52801 
52802 class PERFETTO_EXPORT RegisterTraceWriterRequest : public ::protozero::CppMessageObj {
52803  public:
52804   enum FieldNumbers {
52805     kTraceWriterIdFieldNumber = 1,
52806     kTargetBufferFieldNumber = 2,
52807   };
52808 
52809   RegisterTraceWriterRequest();
52810   ~RegisterTraceWriterRequest() override;
52811   RegisterTraceWriterRequest(RegisterTraceWriterRequest&&) noexcept;
52812   RegisterTraceWriterRequest& operator=(RegisterTraceWriterRequest&&);
52813   RegisterTraceWriterRequest(const RegisterTraceWriterRequest&);
52814   RegisterTraceWriterRequest& operator=(const RegisterTraceWriterRequest&);
52815   bool operator==(const RegisterTraceWriterRequest&) const;
52816   bool operator!=(const RegisterTraceWriterRequest& other) const { return !(*this == other); }
52817 
52818   bool ParseFromArray(const void*, size_t) override;
52819   std::string SerializeAsString() const override;
52820   std::vector<uint8_t> SerializeAsArray() const override;
52821   void Serialize(::protozero::Message*) const;
52822 
52823   bool has_trace_writer_id() const { return _has_field_[1]; }
52824   uint32_t trace_writer_id() const { return trace_writer_id_; }
52825   void set_trace_writer_id(uint32_t value) { trace_writer_id_ = value; _has_field_.set(1); }
52826 
52827   bool has_target_buffer() const { return _has_field_[2]; }
52828   uint32_t target_buffer() const { return target_buffer_; }
52829   void set_target_buffer(uint32_t value) { target_buffer_ = value; _has_field_.set(2); }
52830 
52831  private:
52832   uint32_t trace_writer_id_{};
52833   uint32_t target_buffer_{};
52834 
52835   // Allows to preserve unknown protobuf fields for compatibility
52836   // with future versions of .proto files.
52837   std::string unknown_fields_;
52838 
52839   std::bitset<3> _has_field_{};
52840 };
52841 
52842 
52843 class PERFETTO_EXPORT UnregisterDataSourceResponse : public ::protozero::CppMessageObj {
52844  public:
52845   enum FieldNumbers {
52846   };
52847 
52848   UnregisterDataSourceResponse();
52849   ~UnregisterDataSourceResponse() override;
52850   UnregisterDataSourceResponse(UnregisterDataSourceResponse&&) noexcept;
52851   UnregisterDataSourceResponse& operator=(UnregisterDataSourceResponse&&);
52852   UnregisterDataSourceResponse(const UnregisterDataSourceResponse&);
52853   UnregisterDataSourceResponse& operator=(const UnregisterDataSourceResponse&);
52854   bool operator==(const UnregisterDataSourceResponse&) const;
52855   bool operator!=(const UnregisterDataSourceResponse& other) const { return !(*this == other); }
52856 
52857   bool ParseFromArray(const void*, size_t) override;
52858   std::string SerializeAsString() const override;
52859   std::vector<uint8_t> SerializeAsArray() const override;
52860   void Serialize(::protozero::Message*) const;
52861 
52862  private:
52863 
52864   // Allows to preserve unknown protobuf fields for compatibility
52865   // with future versions of .proto files.
52866   std::string unknown_fields_;
52867 
52868   std::bitset<2> _has_field_{};
52869 };
52870 
52871 
52872 class PERFETTO_EXPORT UnregisterDataSourceRequest : public ::protozero::CppMessageObj {
52873  public:
52874   enum FieldNumbers {
52875     kDataSourceNameFieldNumber = 1,
52876   };
52877 
52878   UnregisterDataSourceRequest();
52879   ~UnregisterDataSourceRequest() override;
52880   UnregisterDataSourceRequest(UnregisterDataSourceRequest&&) noexcept;
52881   UnregisterDataSourceRequest& operator=(UnregisterDataSourceRequest&&);
52882   UnregisterDataSourceRequest(const UnregisterDataSourceRequest&);
52883   UnregisterDataSourceRequest& operator=(const UnregisterDataSourceRequest&);
52884   bool operator==(const UnregisterDataSourceRequest&) const;
52885   bool operator!=(const UnregisterDataSourceRequest& other) const { return !(*this == other); }
52886 
52887   bool ParseFromArray(const void*, size_t) override;
52888   std::string SerializeAsString() const override;
52889   std::vector<uint8_t> SerializeAsArray() const override;
52890   void Serialize(::protozero::Message*) const;
52891 
52892   bool has_data_source_name() const { return _has_field_[1]; }
52893   const std::string& data_source_name() const { return data_source_name_; }
52894   void set_data_source_name(const std::string& value) { data_source_name_ = value; _has_field_.set(1); }
52895 
52896  private:
52897   std::string data_source_name_{};
52898 
52899   // Allows to preserve unknown protobuf fields for compatibility
52900   // with future versions of .proto files.
52901   std::string unknown_fields_;
52902 
52903   std::bitset<2> _has_field_{};
52904 };
52905 
52906 
52907 class PERFETTO_EXPORT RegisterDataSourceResponse : public ::protozero::CppMessageObj {
52908  public:
52909   enum FieldNumbers {
52910     kErrorFieldNumber = 1,
52911   };
52912 
52913   RegisterDataSourceResponse();
52914   ~RegisterDataSourceResponse() override;
52915   RegisterDataSourceResponse(RegisterDataSourceResponse&&) noexcept;
52916   RegisterDataSourceResponse& operator=(RegisterDataSourceResponse&&);
52917   RegisterDataSourceResponse(const RegisterDataSourceResponse&);
52918   RegisterDataSourceResponse& operator=(const RegisterDataSourceResponse&);
52919   bool operator==(const RegisterDataSourceResponse&) const;
52920   bool operator!=(const RegisterDataSourceResponse& other) const { return !(*this == other); }
52921 
52922   bool ParseFromArray(const void*, size_t) override;
52923   std::string SerializeAsString() const override;
52924   std::vector<uint8_t> SerializeAsArray() const override;
52925   void Serialize(::protozero::Message*) const;
52926 
52927   bool has_error() const { return _has_field_[1]; }
52928   const std::string& error() const { return error_; }
52929   void set_error(const std::string& value) { error_ = value; _has_field_.set(1); }
52930 
52931  private:
52932   std::string error_{};
52933 
52934   // Allows to preserve unknown protobuf fields for compatibility
52935   // with future versions of .proto files.
52936   std::string unknown_fields_;
52937 
52938   std::bitset<2> _has_field_{};
52939 };
52940 
52941 
52942 class PERFETTO_EXPORT RegisterDataSourceRequest : public ::protozero::CppMessageObj {
52943  public:
52944   enum FieldNumbers {
52945     kDataSourceDescriptorFieldNumber = 1,
52946   };
52947 
52948   RegisterDataSourceRequest();
52949   ~RegisterDataSourceRequest() override;
52950   RegisterDataSourceRequest(RegisterDataSourceRequest&&) noexcept;
52951   RegisterDataSourceRequest& operator=(RegisterDataSourceRequest&&);
52952   RegisterDataSourceRequest(const RegisterDataSourceRequest&);
52953   RegisterDataSourceRequest& operator=(const RegisterDataSourceRequest&);
52954   bool operator==(const RegisterDataSourceRequest&) const;
52955   bool operator!=(const RegisterDataSourceRequest& other) const { return !(*this == other); }
52956 
52957   bool ParseFromArray(const void*, size_t) override;
52958   std::string SerializeAsString() const override;
52959   std::vector<uint8_t> SerializeAsArray() const override;
52960   void Serialize(::protozero::Message*) const;
52961 
52962   bool has_data_source_descriptor() const { return _has_field_[1]; }
52963   const DataSourceDescriptor& data_source_descriptor() const { return *data_source_descriptor_; }
52964   DataSourceDescriptor* mutable_data_source_descriptor() { _has_field_.set(1); return data_source_descriptor_.get(); }
52965 
52966  private:
52967   ::protozero::CopyablePtr<DataSourceDescriptor> data_source_descriptor_;
52968 
52969   // Allows to preserve unknown protobuf fields for compatibility
52970   // with future versions of .proto files.
52971   std::string unknown_fields_;
52972 
52973   std::bitset<2> _has_field_{};
52974 };
52975 
52976 
52977 class PERFETTO_EXPORT InitializeConnectionResponse : public ::protozero::CppMessageObj {
52978  public:
52979   enum FieldNumbers {
52980     kUsingShmemProvidedByProducerFieldNumber = 1,
52981   };
52982 
52983   InitializeConnectionResponse();
52984   ~InitializeConnectionResponse() override;
52985   InitializeConnectionResponse(InitializeConnectionResponse&&) noexcept;
52986   InitializeConnectionResponse& operator=(InitializeConnectionResponse&&);
52987   InitializeConnectionResponse(const InitializeConnectionResponse&);
52988   InitializeConnectionResponse& operator=(const InitializeConnectionResponse&);
52989   bool operator==(const InitializeConnectionResponse&) const;
52990   bool operator!=(const InitializeConnectionResponse& other) const { return !(*this == other); }
52991 
52992   bool ParseFromArray(const void*, size_t) override;
52993   std::string SerializeAsString() const override;
52994   std::vector<uint8_t> SerializeAsArray() const override;
52995   void Serialize(::protozero::Message*) const;
52996 
52997   bool has_using_shmem_provided_by_producer() const { return _has_field_[1]; }
52998   bool using_shmem_provided_by_producer() const { return using_shmem_provided_by_producer_; }
52999   void set_using_shmem_provided_by_producer(bool value) { using_shmem_provided_by_producer_ = value; _has_field_.set(1); }
53000 
53001  private:
53002   bool using_shmem_provided_by_producer_{};
53003 
53004   // Allows to preserve unknown protobuf fields for compatibility
53005   // with future versions of .proto files.
53006   std::string unknown_fields_;
53007 
53008   std::bitset<2> _has_field_{};
53009 };
53010 
53011 
53012 class PERFETTO_EXPORT InitializeConnectionRequest : public ::protozero::CppMessageObj {
53013  public:
53014   using ProducerSMBScrapingMode = InitializeConnectionRequest_ProducerSMBScrapingMode;
53015   static constexpr auto SMB_SCRAPING_UNSPECIFIED = InitializeConnectionRequest_ProducerSMBScrapingMode_SMB_SCRAPING_UNSPECIFIED;
53016   static constexpr auto SMB_SCRAPING_ENABLED = InitializeConnectionRequest_ProducerSMBScrapingMode_SMB_SCRAPING_ENABLED;
53017   static constexpr auto SMB_SCRAPING_DISABLED = InitializeConnectionRequest_ProducerSMBScrapingMode_SMB_SCRAPING_DISABLED;
53018   static constexpr auto ProducerSMBScrapingMode_MIN = InitializeConnectionRequest_ProducerSMBScrapingMode_SMB_SCRAPING_UNSPECIFIED;
53019   static constexpr auto ProducerSMBScrapingMode_MAX = InitializeConnectionRequest_ProducerSMBScrapingMode_SMB_SCRAPING_DISABLED;
53020   using ProducerBuildFlags = InitializeConnectionRequest_ProducerBuildFlags;
53021   static constexpr auto BUILD_FLAGS_UNSPECIFIED = InitializeConnectionRequest_ProducerBuildFlags_BUILD_FLAGS_UNSPECIFIED;
53022   static constexpr auto BUILD_FLAGS_DCHECKS_ON = InitializeConnectionRequest_ProducerBuildFlags_BUILD_FLAGS_DCHECKS_ON;
53023   static constexpr auto BUILD_FLAGS_DCHECKS_OFF = InitializeConnectionRequest_ProducerBuildFlags_BUILD_FLAGS_DCHECKS_OFF;
53024   static constexpr auto ProducerBuildFlags_MIN = InitializeConnectionRequest_ProducerBuildFlags_BUILD_FLAGS_UNSPECIFIED;
53025   static constexpr auto ProducerBuildFlags_MAX = InitializeConnectionRequest_ProducerBuildFlags_BUILD_FLAGS_DCHECKS_OFF;
53026   enum FieldNumbers {
53027     kSharedMemoryPageSizeHintBytesFieldNumber = 1,
53028     kSharedMemorySizeHintBytesFieldNumber = 2,
53029     kProducerNameFieldNumber = 3,
53030     kSmbScrapingModeFieldNumber = 4,
53031     kBuildFlagsFieldNumber = 5,
53032     kProducerProvidedShmemFieldNumber = 6,
53033   };
53034 
53035   InitializeConnectionRequest();
53036   ~InitializeConnectionRequest() override;
53037   InitializeConnectionRequest(InitializeConnectionRequest&&) noexcept;
53038   InitializeConnectionRequest& operator=(InitializeConnectionRequest&&);
53039   InitializeConnectionRequest(const InitializeConnectionRequest&);
53040   InitializeConnectionRequest& operator=(const InitializeConnectionRequest&);
53041   bool operator==(const InitializeConnectionRequest&) const;
53042   bool operator!=(const InitializeConnectionRequest& other) const { return !(*this == other); }
53043 
53044   bool ParseFromArray(const void*, size_t) override;
53045   std::string SerializeAsString() const override;
53046   std::vector<uint8_t> SerializeAsArray() const override;
53047   void Serialize(::protozero::Message*) const;
53048 
53049   bool has_shared_memory_page_size_hint_bytes() const { return _has_field_[1]; }
53050   uint32_t shared_memory_page_size_hint_bytes() const { return shared_memory_page_size_hint_bytes_; }
53051   void set_shared_memory_page_size_hint_bytes(uint32_t value) { shared_memory_page_size_hint_bytes_ = value; _has_field_.set(1); }
53052 
53053   bool has_shared_memory_size_hint_bytes() const { return _has_field_[2]; }
53054   uint32_t shared_memory_size_hint_bytes() const { return shared_memory_size_hint_bytes_; }
53055   void set_shared_memory_size_hint_bytes(uint32_t value) { shared_memory_size_hint_bytes_ = value; _has_field_.set(2); }
53056 
53057   bool has_producer_name() const { return _has_field_[3]; }
53058   const std::string& producer_name() const { return producer_name_; }
53059   void set_producer_name(const std::string& value) { producer_name_ = value; _has_field_.set(3); }
53060 
53061   bool has_smb_scraping_mode() const { return _has_field_[4]; }
53062   InitializeConnectionRequest_ProducerSMBScrapingMode smb_scraping_mode() const { return smb_scraping_mode_; }
53063   void set_smb_scraping_mode(InitializeConnectionRequest_ProducerSMBScrapingMode value) { smb_scraping_mode_ = value; _has_field_.set(4); }
53064 
53065   bool has_build_flags() const { return _has_field_[5]; }
53066   InitializeConnectionRequest_ProducerBuildFlags build_flags() const { return build_flags_; }
53067   void set_build_flags(InitializeConnectionRequest_ProducerBuildFlags value) { build_flags_ = value; _has_field_.set(5); }
53068 
53069   bool has_producer_provided_shmem() const { return _has_field_[6]; }
53070   bool producer_provided_shmem() const { return producer_provided_shmem_; }
53071   void set_producer_provided_shmem(bool value) { producer_provided_shmem_ = value; _has_field_.set(6); }
53072 
53073  private:
53074   uint32_t shared_memory_page_size_hint_bytes_{};
53075   uint32_t shared_memory_size_hint_bytes_{};
53076   std::string producer_name_{};
53077   InitializeConnectionRequest_ProducerSMBScrapingMode smb_scraping_mode_{};
53078   InitializeConnectionRequest_ProducerBuildFlags build_flags_{};
53079   bool producer_provided_shmem_{};
53080 
53081   // Allows to preserve unknown protobuf fields for compatibility
53082   // with future versions of .proto files.
53083   std::string unknown_fields_;
53084 
53085   std::bitset<7> _has_field_{};
53086 };
53087 
53088 }  // namespace perfetto
53089 }  // namespace protos
53090 }  // namespace gen
53091 
53092 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_IPC_PRODUCER_PORT_PROTO_CPP_H_
53093 // gen_amalgamated begin header: gen/protos/perfetto/ipc/wire_protocol.gen.h
53094 // DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
53095 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_IPC_WIRE_PROTOCOL_PROTO_CPP_H_
53096 #define PERFETTO_PROTOS_PROTOS_PERFETTO_IPC_WIRE_PROTOCOL_PROTO_CPP_H_
53097 
53098 #include <stdint.h>
53099 #include <bitset>
53100 #include <vector>
53101 #include <string>
53102 #include <type_traits>
53103 
53104 // gen_amalgamated expanded: #include "perfetto/protozero/cpp_message_obj.h"
53105 // gen_amalgamated expanded: #include "perfetto/protozero/copyable_ptr.h"
53106 // gen_amalgamated expanded: #include "perfetto/base/export.h"
53107 
53108 namespace perfetto {
53109 namespace protos {
53110 namespace gen {
53111 class IPCFrame;
53112 class IPCFrame_RequestError;
53113 class IPCFrame_InvokeMethodReply;
53114 class IPCFrame_InvokeMethod;
53115 class IPCFrame_BindServiceReply;
53116 class IPCFrame_BindServiceReply_MethodInfo;
53117 class IPCFrame_BindService;
53118 }  // namespace perfetto
53119 }  // namespace protos
53120 }  // namespace gen
53121 
53122 namespace protozero {
53123 class Message;
53124 }  // namespace protozero
53125 
53126 namespace perfetto {
53127 namespace protos {
53128 namespace gen {
53129 
53130 class PERFETTO_EXPORT IPCFrame : public ::protozero::CppMessageObj {
53131  public:
53132   using BindService = IPCFrame_BindService;
53133   using BindServiceReply = IPCFrame_BindServiceReply;
53134   using InvokeMethod = IPCFrame_InvokeMethod;
53135   using InvokeMethodReply = IPCFrame_InvokeMethodReply;
53136   using RequestError = IPCFrame_RequestError;
53137   enum FieldNumbers {
53138     kRequestIdFieldNumber = 2,
53139     kMsgBindServiceFieldNumber = 3,
53140     kMsgBindServiceReplyFieldNumber = 4,
53141     kMsgInvokeMethodFieldNumber = 5,
53142     kMsgInvokeMethodReplyFieldNumber = 6,
53143     kMsgRequestErrorFieldNumber = 7,
53144     kDataForTestingFieldNumber = 1,
53145   };
53146 
53147   IPCFrame();
53148   ~IPCFrame() override;
53149   IPCFrame(IPCFrame&&) noexcept;
53150   IPCFrame& operator=(IPCFrame&&);
53151   IPCFrame(const IPCFrame&);
53152   IPCFrame& operator=(const IPCFrame&);
53153   bool operator==(const IPCFrame&) const;
53154   bool operator!=(const IPCFrame& other) const { return !(*this == other); }
53155 
53156   bool ParseFromArray(const void*, size_t) override;
53157   std::string SerializeAsString() const override;
53158   std::vector<uint8_t> SerializeAsArray() const override;
53159   void Serialize(::protozero::Message*) const;
53160 
53161   bool has_request_id() const { return _has_field_[2]; }
53162   uint64_t request_id() const { return request_id_; }
53163   void set_request_id(uint64_t value) { request_id_ = value; _has_field_.set(2); }
53164 
53165   bool has_msg_bind_service() const { return _has_field_[3]; }
53166   const IPCFrame_BindService& msg_bind_service() const { return *msg_bind_service_; }
53167   IPCFrame_BindService* mutable_msg_bind_service() { _has_field_.set(3); return msg_bind_service_.get(); }
53168 
53169   bool has_msg_bind_service_reply() const { return _has_field_[4]; }
53170   const IPCFrame_BindServiceReply& msg_bind_service_reply() const { return *msg_bind_service_reply_; }
53171   IPCFrame_BindServiceReply* mutable_msg_bind_service_reply() { _has_field_.set(4); return msg_bind_service_reply_.get(); }
53172 
53173   bool has_msg_invoke_method() const { return _has_field_[5]; }
53174   const IPCFrame_InvokeMethod& msg_invoke_method() const { return *msg_invoke_method_; }
53175   IPCFrame_InvokeMethod* mutable_msg_invoke_method() { _has_field_.set(5); return msg_invoke_method_.get(); }
53176 
53177   bool has_msg_invoke_method_reply() const { return _has_field_[6]; }
53178   const IPCFrame_InvokeMethodReply& msg_invoke_method_reply() const { return *msg_invoke_method_reply_; }
53179   IPCFrame_InvokeMethodReply* mutable_msg_invoke_method_reply() { _has_field_.set(6); return msg_invoke_method_reply_.get(); }
53180 
53181   bool has_msg_request_error() const { return _has_field_[7]; }
53182   const IPCFrame_RequestError& msg_request_error() const { return *msg_request_error_; }
53183   IPCFrame_RequestError* mutable_msg_request_error() { _has_field_.set(7); return msg_request_error_.get(); }
53184 
53185   int data_for_testing_size() const { return static_cast<int>(data_for_testing_.size()); }
53186   const std::vector<std::string>& data_for_testing() const { return data_for_testing_; }
53187   std::vector<std::string>* mutable_data_for_testing() { return &data_for_testing_; }
53188   void clear_data_for_testing() { data_for_testing_.clear(); }
53189   void add_data_for_testing(std::string value) { data_for_testing_.emplace_back(value); }
53190   std::string* add_data_for_testing() { data_for_testing_.emplace_back(); return &data_for_testing_.back(); }
53191 
53192  private:
53193   uint64_t request_id_{};
53194   ::protozero::CopyablePtr<IPCFrame_BindService> msg_bind_service_;
53195   ::protozero::CopyablePtr<IPCFrame_BindServiceReply> msg_bind_service_reply_;
53196   ::protozero::CopyablePtr<IPCFrame_InvokeMethod> msg_invoke_method_;
53197   ::protozero::CopyablePtr<IPCFrame_InvokeMethodReply> msg_invoke_method_reply_;
53198   ::protozero::CopyablePtr<IPCFrame_RequestError> msg_request_error_;
53199   std::vector<std::string> data_for_testing_;
53200 
53201   // Allows to preserve unknown protobuf fields for compatibility
53202   // with future versions of .proto files.
53203   std::string unknown_fields_;
53204 
53205   std::bitset<8> _has_field_{};
53206 };
53207 
53208 
53209 class PERFETTO_EXPORT IPCFrame_RequestError : public ::protozero::CppMessageObj {
53210  public:
53211   enum FieldNumbers {
53212     kErrorFieldNumber = 1,
53213   };
53214 
53215   IPCFrame_RequestError();
53216   ~IPCFrame_RequestError() override;
53217   IPCFrame_RequestError(IPCFrame_RequestError&&) noexcept;
53218   IPCFrame_RequestError& operator=(IPCFrame_RequestError&&);
53219   IPCFrame_RequestError(const IPCFrame_RequestError&);
53220   IPCFrame_RequestError& operator=(const IPCFrame_RequestError&);
53221   bool operator==(const IPCFrame_RequestError&) const;
53222   bool operator!=(const IPCFrame_RequestError& other) const { return !(*this == other); }
53223 
53224   bool ParseFromArray(const void*, size_t) override;
53225   std::string SerializeAsString() const override;
53226   std::vector<uint8_t> SerializeAsArray() const override;
53227   void Serialize(::protozero::Message*) const;
53228 
53229   bool has_error() const { return _has_field_[1]; }
53230   const std::string& error() const { return error_; }
53231   void set_error(const std::string& value) { error_ = value; _has_field_.set(1); }
53232 
53233  private:
53234   std::string error_{};
53235 
53236   // Allows to preserve unknown protobuf fields for compatibility
53237   // with future versions of .proto files.
53238   std::string unknown_fields_;
53239 
53240   std::bitset<2> _has_field_{};
53241 };
53242 
53243 
53244 class PERFETTO_EXPORT IPCFrame_InvokeMethodReply : public ::protozero::CppMessageObj {
53245  public:
53246   enum FieldNumbers {
53247     kSuccessFieldNumber = 1,
53248     kHasMoreFieldNumber = 2,
53249     kReplyProtoFieldNumber = 3,
53250   };
53251 
53252   IPCFrame_InvokeMethodReply();
53253   ~IPCFrame_InvokeMethodReply() override;
53254   IPCFrame_InvokeMethodReply(IPCFrame_InvokeMethodReply&&) noexcept;
53255   IPCFrame_InvokeMethodReply& operator=(IPCFrame_InvokeMethodReply&&);
53256   IPCFrame_InvokeMethodReply(const IPCFrame_InvokeMethodReply&);
53257   IPCFrame_InvokeMethodReply& operator=(const IPCFrame_InvokeMethodReply&);
53258   bool operator==(const IPCFrame_InvokeMethodReply&) const;
53259   bool operator!=(const IPCFrame_InvokeMethodReply& other) const { return !(*this == other); }
53260 
53261   bool ParseFromArray(const void*, size_t) override;
53262   std::string SerializeAsString() const override;
53263   std::vector<uint8_t> SerializeAsArray() const override;
53264   void Serialize(::protozero::Message*) const;
53265 
53266   bool has_success() const { return _has_field_[1]; }
53267   bool success() const { return success_; }
53268   void set_success(bool value) { success_ = value; _has_field_.set(1); }
53269 
53270   bool has_has_more() const { return _has_field_[2]; }
53271   bool has_more() const { return has_more_; }
53272   void set_has_more(bool value) { has_more_ = value; _has_field_.set(2); }
53273 
53274   bool has_reply_proto() const { return _has_field_[3]; }
53275   const std::string& reply_proto() const { return reply_proto_; }
53276   void set_reply_proto(const std::string& value) { reply_proto_ = value; _has_field_.set(3); }
53277   void set_reply_proto(const void* p, size_t s) { reply_proto_.assign(reinterpret_cast<const char*>(p), s); _has_field_.set(3); }
53278 
53279  private:
53280   bool success_{};
53281   bool has_more_{};
53282   std::string reply_proto_{};
53283 
53284   // Allows to preserve unknown protobuf fields for compatibility
53285   // with future versions of .proto files.
53286   std::string unknown_fields_;
53287 
53288   std::bitset<4> _has_field_{};
53289 };
53290 
53291 
53292 class PERFETTO_EXPORT IPCFrame_InvokeMethod : public ::protozero::CppMessageObj {
53293  public:
53294   enum FieldNumbers {
53295     kServiceIdFieldNumber = 1,
53296     kMethodIdFieldNumber = 2,
53297     kArgsProtoFieldNumber = 3,
53298     kDropReplyFieldNumber = 4,
53299   };
53300 
53301   IPCFrame_InvokeMethod();
53302   ~IPCFrame_InvokeMethod() override;
53303   IPCFrame_InvokeMethod(IPCFrame_InvokeMethod&&) noexcept;
53304   IPCFrame_InvokeMethod& operator=(IPCFrame_InvokeMethod&&);
53305   IPCFrame_InvokeMethod(const IPCFrame_InvokeMethod&);
53306   IPCFrame_InvokeMethod& operator=(const IPCFrame_InvokeMethod&);
53307   bool operator==(const IPCFrame_InvokeMethod&) const;
53308   bool operator!=(const IPCFrame_InvokeMethod& other) const { return !(*this == other); }
53309 
53310   bool ParseFromArray(const void*, size_t) override;
53311   std::string SerializeAsString() const override;
53312   std::vector<uint8_t> SerializeAsArray() const override;
53313   void Serialize(::protozero::Message*) const;
53314 
53315   bool has_service_id() const { return _has_field_[1]; }
53316   uint32_t service_id() const { return service_id_; }
53317   void set_service_id(uint32_t value) { service_id_ = value; _has_field_.set(1); }
53318 
53319   bool has_method_id() const { return _has_field_[2]; }
53320   uint32_t method_id() const { return method_id_; }
53321   void set_method_id(uint32_t value) { method_id_ = value; _has_field_.set(2); }
53322 
53323   bool has_args_proto() const { return _has_field_[3]; }
53324   const std::string& args_proto() const { return args_proto_; }
53325   void set_args_proto(const std::string& value) { args_proto_ = value; _has_field_.set(3); }
53326   void set_args_proto(const void* p, size_t s) { args_proto_.assign(reinterpret_cast<const char*>(p), s); _has_field_.set(3); }
53327 
53328   bool has_drop_reply() const { return _has_field_[4]; }
53329   bool drop_reply() const { return drop_reply_; }
53330   void set_drop_reply(bool value) { drop_reply_ = value; _has_field_.set(4); }
53331 
53332  private:
53333   uint32_t service_id_{};
53334   uint32_t method_id_{};
53335   std::string args_proto_{};
53336   bool drop_reply_{};
53337 
53338   // Allows to preserve unknown protobuf fields for compatibility
53339   // with future versions of .proto files.
53340   std::string unknown_fields_;
53341 
53342   std::bitset<5> _has_field_{};
53343 };
53344 
53345 
53346 class PERFETTO_EXPORT IPCFrame_BindServiceReply : public ::protozero::CppMessageObj {
53347  public:
53348   using MethodInfo = IPCFrame_BindServiceReply_MethodInfo;
53349   enum FieldNumbers {
53350     kSuccessFieldNumber = 1,
53351     kServiceIdFieldNumber = 2,
53352     kMethodsFieldNumber = 3,
53353   };
53354 
53355   IPCFrame_BindServiceReply();
53356   ~IPCFrame_BindServiceReply() override;
53357   IPCFrame_BindServiceReply(IPCFrame_BindServiceReply&&) noexcept;
53358   IPCFrame_BindServiceReply& operator=(IPCFrame_BindServiceReply&&);
53359   IPCFrame_BindServiceReply(const IPCFrame_BindServiceReply&);
53360   IPCFrame_BindServiceReply& operator=(const IPCFrame_BindServiceReply&);
53361   bool operator==(const IPCFrame_BindServiceReply&) const;
53362   bool operator!=(const IPCFrame_BindServiceReply& other) const { return !(*this == other); }
53363 
53364   bool ParseFromArray(const void*, size_t) override;
53365   std::string SerializeAsString() const override;
53366   std::vector<uint8_t> SerializeAsArray() const override;
53367   void Serialize(::protozero::Message*) const;
53368 
53369   bool has_success() const { return _has_field_[1]; }
53370   bool success() const { return success_; }
53371   void set_success(bool value) { success_ = value; _has_field_.set(1); }
53372 
53373   bool has_service_id() const { return _has_field_[2]; }
53374   uint32_t service_id() const { return service_id_; }
53375   void set_service_id(uint32_t value) { service_id_ = value; _has_field_.set(2); }
53376 
53377   int methods_size() const { return static_cast<int>(methods_.size()); }
53378   const std::vector<IPCFrame_BindServiceReply_MethodInfo>& methods() const { return methods_; }
53379   std::vector<IPCFrame_BindServiceReply_MethodInfo>* mutable_methods() { return &methods_; }
53380   void clear_methods() { methods_.clear(); }
53381   IPCFrame_BindServiceReply_MethodInfo* add_methods() { methods_.emplace_back(); return &methods_.back(); }
53382 
53383  private:
53384   bool success_{};
53385   uint32_t service_id_{};
53386   std::vector<IPCFrame_BindServiceReply_MethodInfo> methods_;
53387 
53388   // Allows to preserve unknown protobuf fields for compatibility
53389   // with future versions of .proto files.
53390   std::string unknown_fields_;
53391 
53392   std::bitset<4> _has_field_{};
53393 };
53394 
53395 
53396 class PERFETTO_EXPORT IPCFrame_BindServiceReply_MethodInfo : public ::protozero::CppMessageObj {
53397  public:
53398   enum FieldNumbers {
53399     kIdFieldNumber = 1,
53400     kNameFieldNumber = 2,
53401   };
53402 
53403   IPCFrame_BindServiceReply_MethodInfo();
53404   ~IPCFrame_BindServiceReply_MethodInfo() override;
53405   IPCFrame_BindServiceReply_MethodInfo(IPCFrame_BindServiceReply_MethodInfo&&) noexcept;
53406   IPCFrame_BindServiceReply_MethodInfo& operator=(IPCFrame_BindServiceReply_MethodInfo&&);
53407   IPCFrame_BindServiceReply_MethodInfo(const IPCFrame_BindServiceReply_MethodInfo&);
53408   IPCFrame_BindServiceReply_MethodInfo& operator=(const IPCFrame_BindServiceReply_MethodInfo&);
53409   bool operator==(const IPCFrame_BindServiceReply_MethodInfo&) const;
53410   bool operator!=(const IPCFrame_BindServiceReply_MethodInfo& other) const { return !(*this == other); }
53411 
53412   bool ParseFromArray(const void*, size_t) override;
53413   std::string SerializeAsString() const override;
53414   std::vector<uint8_t> SerializeAsArray() const override;
53415   void Serialize(::protozero::Message*) const;
53416 
53417   bool has_id() const { return _has_field_[1]; }
53418   uint32_t id() const { return id_; }
53419   void set_id(uint32_t value) { id_ = value; _has_field_.set(1); }
53420 
53421   bool has_name() const { return _has_field_[2]; }
53422   const std::string& name() const { return name_; }
53423   void set_name(const std::string& value) { name_ = value; _has_field_.set(2); }
53424 
53425  private:
53426   uint32_t id_{};
53427   std::string name_{};
53428 
53429   // Allows to preserve unknown protobuf fields for compatibility
53430   // with future versions of .proto files.
53431   std::string unknown_fields_;
53432 
53433   std::bitset<3> _has_field_{};
53434 };
53435 
53436 
53437 class PERFETTO_EXPORT IPCFrame_BindService : public ::protozero::CppMessageObj {
53438  public:
53439   enum FieldNumbers {
53440     kServiceNameFieldNumber = 1,
53441   };
53442 
53443   IPCFrame_BindService();
53444   ~IPCFrame_BindService() override;
53445   IPCFrame_BindService(IPCFrame_BindService&&) noexcept;
53446   IPCFrame_BindService& operator=(IPCFrame_BindService&&);
53447   IPCFrame_BindService(const IPCFrame_BindService&);
53448   IPCFrame_BindService& operator=(const IPCFrame_BindService&);
53449   bool operator==(const IPCFrame_BindService&) const;
53450   bool operator!=(const IPCFrame_BindService& other) const { return !(*this == other); }
53451 
53452   bool ParseFromArray(const void*, size_t) override;
53453   std::string SerializeAsString() const override;
53454   std::vector<uint8_t> SerializeAsArray() const override;
53455   void Serialize(::protozero::Message*) const;
53456 
53457   bool has_service_name() const { return _has_field_[1]; }
53458   const std::string& service_name() const { return service_name_; }
53459   void set_service_name(const std::string& value) { service_name_ = value; _has_field_.set(1); }
53460 
53461  private:
53462   std::string service_name_{};
53463 
53464   // Allows to preserve unknown protobuf fields for compatibility
53465   // with future versions of .proto files.
53466   std::string unknown_fields_;
53467 
53468   std::bitset<2> _has_field_{};
53469 };
53470 
53471 }  // namespace perfetto
53472 }  // namespace protos
53473 }  // namespace gen
53474 
53475 #endif  // PERFETTO_PROTOS_PROTOS_PERFETTO_IPC_WIRE_PROTOCOL_PROTO_CPP_H_
53476 // gen_amalgamated begin header: include/perfetto/protozero/contiguous_memory_range.h
53477 /*
53478  * Copyright (C) 2017 The Android Open Source Project
53479  *
53480  * Licensed under the Apache License, Version 2.0 (the "License");
53481  * you may not use this file except in compliance with the License.
53482  * You may obtain a copy of the License at
53483  *
53484  *      http://www.apache.org/licenses/LICENSE-2.0
53485  *
53486  * Unless required by applicable law or agreed to in writing, software
53487  * distributed under the License is distributed on an "AS IS" BASIS,
53488  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
53489  * See the License for the specific language governing permissions and
53490  * limitations under the License.
53491  */
53492 
53493 #ifndef INCLUDE_PERFETTO_PROTOZERO_CONTIGUOUS_MEMORY_RANGE_H_
53494 #define INCLUDE_PERFETTO_PROTOZERO_CONTIGUOUS_MEMORY_RANGE_H_
53495 
53496 #include <assert.h>
53497 #include <stddef.h>
53498 #include <stdint.h>
53499 
53500 namespace protozero {
53501 
53502 // Keep this struct trivially constructible (no ctors, no default initializers).
53503 struct ContiguousMemoryRange {
53504   uint8_t* begin;
53505   uint8_t* end;  // STL style: one byte past the end of the buffer.
53506 
53507   inline bool is_valid() const { return begin != nullptr; }
53508   inline void reset() { begin = nullptr; }
53509   inline size_t size() const { return static_cast<size_t>(end - begin); }
53510 };
53511 
53512 }  // namespace protozero
53513 
53514 #endif  // INCLUDE_PERFETTO_PROTOZERO_CONTIGUOUS_MEMORY_RANGE_H_
53515 // gen_amalgamated begin header: include/perfetto/protozero/copyable_ptr.h
53516 /*
53517  * Copyright (C) 2019 The Android Open Source Project
53518  *
53519  * Licensed under the Apache License, Version 2.0 (the "License");
53520  * you may not use this file except in compliance with the License.
53521  * You may obtain a copy of the License at
53522  *
53523  *      http://www.apache.org/licenses/LICENSE-2.0
53524  *
53525  * Unless required by applicable law or agreed to in writing, software
53526  * distributed under the License is distributed on an "AS IS" BASIS,
53527  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
53528  * See the License for the specific language governing permissions and
53529  * limitations under the License.
53530  */
53531 
53532 #ifndef INCLUDE_PERFETTO_PROTOZERO_COPYABLE_PTR_H_
53533 #define INCLUDE_PERFETTO_PROTOZERO_COPYABLE_PTR_H_
53534 
53535 #include <memory>
53536 
53537 namespace protozero {
53538 
53539 // This class is essentially a std::vector<T> of fixed size = 1.
53540 // It's a pointer wrapper with deep copying and deep equality comparison.
53541 // At all effects this wrapper behaves like the underlying T, with the exception
53542 // of the heap indirection.
53543 // Conversely to a std::unique_ptr, the pointer will be always valid, never
53544 // null. The problem it solves is the following: when generating C++ classes
53545 // from proto files, we want to keep each header hermetic (i.e. not #include
53546 // headers of dependent types). As such we can't directly instantiate T
53547 // field members but we can instead rely on pointers, so only the .cc file needs
53548 // to see the actual definition of T. If the generated classes were move-only we
53549 // could just use a unique_ptr there. But they aren't, hence this wrapper.
53550 // Converesely to unique_ptr, this wrapper:
53551 // - Default constructs the T instance in its constructor.
53552 // - Implements deep comparison in operator== instead of pointer comparison.
53553 template <typename T>
53554 class CopyablePtr {
53555  public:
53556   CopyablePtr() : ptr_(new T()) {}
53557   ~CopyablePtr() = default;
53558 
53559   // Copy operators.
53560   CopyablePtr(const CopyablePtr& other) : ptr_(new T(*other.ptr_)) {}
53561   CopyablePtr& operator=(const CopyablePtr& other) {
53562     *ptr_ = *other.ptr_;
53563     return *this;
53564   }
53565 
53566   // Move operators.
53567   CopyablePtr(CopyablePtr&& other) noexcept : ptr_(std::move(other.ptr_)) {
53568     other.ptr_.reset(new T());
53569   }
53570 
53571   CopyablePtr& operator=(CopyablePtr&& other) {
53572     ptr_ = std::move(other.ptr_);
53573     other.ptr_.reset(new T());
53574     return *this;
53575   }
53576 
53577   T* get() { return ptr_.get(); }
53578   const T* get() const { return ptr_.get(); }
53579 
53580   T* operator->() { return ptr_.get(); }
53581   const T* operator->() const { return ptr_.get(); }
53582 
53583   T& operator*() { return *ptr_; }
53584   const T& operator*() const { return *ptr_; }
53585 
53586   friend bool operator==(const CopyablePtr& lhs, const CopyablePtr& rhs) {
53587     return *lhs == *rhs;
53588   }
53589 
53590   friend bool operator!=(const CopyablePtr& lhs, const CopyablePtr& rhs) {
53591     // In theory the underlying type might have a special operator!=
53592     // implementation which is not just !(x == y). Respect that.
53593     return *lhs != *rhs;
53594   }
53595 
53596  private:
53597   std::unique_ptr<T> ptr_;
53598 };
53599 
53600 }  // namespace protozero
53601 
53602 #endif  // INCLUDE_PERFETTO_PROTOZERO_COPYABLE_PTR_H_
53603 // gen_amalgamated begin header: include/perfetto/protozero/cpp_message_obj.h
53604 /*
53605  * Copyright (C) 2019 The Android Open Source Project
53606  *
53607  * Licensed under the Apache License, Version 2.0 (the "License");
53608  * you may not use this file except in compliance with the License.
53609  * You may obtain a copy of the License at
53610  *
53611  *      http://www.apache.org/licenses/LICENSE-2.0
53612  *
53613  * Unless required by applicable law or agreed to in writing, software
53614  * distributed under the License is distributed on an "AS IS" BASIS,
53615  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
53616  * See the License for the specific language governing permissions and
53617  * limitations under the License.
53618  */
53619 
53620 #ifndef INCLUDE_PERFETTO_PROTOZERO_CPP_MESSAGE_OBJ_H_
53621 #define INCLUDE_PERFETTO_PROTOZERO_CPP_MESSAGE_OBJ_H_
53622 
53623 #include <stdint.h>
53624 
53625 #include <string>
53626 #include <vector>
53627 
53628 // gen_amalgamated expanded: #include "perfetto/base/export.h"
53629 
53630 namespace protozero {
53631 
53632 // Base class for generated .gen.h classes, which are full C++ objects that
53633 // support both ser and deserialization (but are not zero-copy).
53634 // This is only used by the "cpp" targets not the "pbzero" ones.
53635 class PERFETTO_EXPORT CppMessageObj {
53636  public:
53637   virtual ~CppMessageObj();
53638   virtual std::string SerializeAsString() const = 0;
53639   virtual std::vector<uint8_t> SerializeAsArray() const = 0;
53640   virtual bool ParseFromArray(const void*, size_t) = 0;
53641 
53642   bool ParseFromString(const std::string& str) {
53643     return ParseFromArray(str.data(), str.size());
53644   }
53645 };
53646 
53647 }  // namespace protozero
53648 
53649 #endif  // INCLUDE_PERFETTO_PROTOZERO_CPP_MESSAGE_OBJ_H_
53650 // gen_amalgamated begin header: include/perfetto/protozero/field.h
53651 /*
53652  * Copyright (C) 2019 The Android Open Source Project
53653  *
53654  * Licensed under the Apache License, Version 2.0 (the "License");
53655  * you may not use this file except in compliance with the License.
53656  * You may obtain a copy of the License at
53657  *
53658  *      http://www.apache.org/licenses/LICENSE-2.0
53659  *
53660  * Unless required by applicable law or agreed to in writing, software
53661  * distributed under the License is distributed on an "AS IS" BASIS,
53662  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
53663  * See the License for the specific language governing permissions and
53664  * limitations under the License.
53665  */
53666 
53667 #ifndef INCLUDE_PERFETTO_PROTOZERO_FIELD_H_
53668 #define INCLUDE_PERFETTO_PROTOZERO_FIELD_H_
53669 
53670 #include <stdint.h>
53671 
53672 #include <string>
53673 #include <vector>
53674 
53675 // gen_amalgamated expanded: #include "perfetto/base/logging.h"
53676 // gen_amalgamated expanded: #include "perfetto/protozero/contiguous_memory_range.h"
53677 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
53678 
53679 namespace protozero {
53680 
53681 struct ConstBytes {
53682   std::string ToStdString() const {
53683     return std::string(reinterpret_cast<const char*>(data), size);
53684   }
53685 
53686   const uint8_t* data;
53687   size_t size;
53688 };
53689 
53690 struct ConstChars {
53691   // Allow implicit conversion to perfetto's base::StringView without depending
53692   // on perfetto/base or viceversa.
53693   static constexpr bool kConvertibleToStringView = true;
53694   std::string ToStdString() const { return std::string(data, size); }
53695 
53696   const char* data;
53697   size_t size;
53698 };
53699 
53700 // A protobuf field decoded by the protozero proto decoders. It exposes
53701 // convenience accessors with minimal debug checks.
53702 // This class is used both by the iterator-based ProtoDecoder and by the
53703 // one-shot TypedProtoDecoder.
53704 // If the field is not valid the accessors consistently return zero-integers or
53705 // null strings.
53706 class Field {
53707  public:
53708   bool valid() const { return id_ != 0; }
53709   uint16_t id() const { return id_; }
53710   explicit operator bool() const { return valid(); }
53711 
53712   proto_utils::ProtoWireType type() const {
53713     auto res = static_cast<proto_utils::ProtoWireType>(type_);
53714     PERFETTO_DCHECK(res == proto_utils::ProtoWireType::kVarInt ||
53715                     res == proto_utils::ProtoWireType::kLengthDelimited ||
53716                     res == proto_utils::ProtoWireType::kFixed32 ||
53717                     res == proto_utils::ProtoWireType::kFixed64);
53718     return res;
53719   }
53720 
53721   bool as_bool() const {
53722     PERFETTO_DCHECK(!valid() || type() == proto_utils::ProtoWireType::kVarInt);
53723     return static_cast<bool>(int_value_);
53724   }
53725 
53726   uint32_t as_uint32() const {
53727     PERFETTO_DCHECK(!valid() || type() == proto_utils::ProtoWireType::kVarInt ||
53728                     type() == proto_utils::ProtoWireType::kFixed32);
53729     return static_cast<uint32_t>(int_value_);
53730   }
53731 
53732   int32_t as_int32() const {
53733     PERFETTO_DCHECK(!valid() || type() == proto_utils::ProtoWireType::kVarInt ||
53734                     type() == proto_utils::ProtoWireType::kFixed32);
53735     return static_cast<int32_t>(int_value_);
53736   }
53737 
53738   int32_t as_sint32() const {
53739     PERFETTO_DCHECK(!valid() || type() == proto_utils::ProtoWireType::kVarInt);
53740     return proto_utils::ZigZagDecode(static_cast<uint32_t>(int_value_));
53741   }
53742 
53743   uint64_t as_uint64() const {
53744     PERFETTO_DCHECK(!valid() || type() == proto_utils::ProtoWireType::kVarInt ||
53745                     type() == proto_utils::ProtoWireType::kFixed32 ||
53746                     type() == proto_utils::ProtoWireType::kFixed64);
53747     return int_value_;
53748   }
53749 
53750   int64_t as_int64() const {
53751     PERFETTO_DCHECK(!valid() || type() == proto_utils::ProtoWireType::kVarInt ||
53752                     type() == proto_utils::ProtoWireType::kFixed32 ||
53753                     type() == proto_utils::ProtoWireType::kFixed64);
53754     return static_cast<int64_t>(int_value_);
53755   }
53756 
53757   int64_t as_sint64() const {
53758     PERFETTO_DCHECK(!valid() || type() == proto_utils::ProtoWireType::kVarInt);
53759     return proto_utils::ZigZagDecode(static_cast<uint64_t>(int_value_));
53760   }
53761 
53762   float as_float() const {
53763     PERFETTO_DCHECK(!valid() || type() == proto_utils::ProtoWireType::kFixed32);
53764     float res;
53765     uint32_t value32 = static_cast<uint32_t>(int_value_);
53766     memcpy(&res, &value32, sizeof(res));
53767     return res;
53768   }
53769 
53770   double as_double() const {
53771     PERFETTO_DCHECK(!valid() || type() == proto_utils::ProtoWireType::kFixed64);
53772     double res;
53773     memcpy(&res, &int_value_, sizeof(res));
53774     return res;
53775   }
53776 
53777   ConstChars as_string() const {
53778     PERFETTO_DCHECK(!valid() ||
53779                     type() == proto_utils::ProtoWireType::kLengthDelimited);
53780     return ConstChars{reinterpret_cast<const char*>(data()), size_};
53781   }
53782 
53783   std::string as_std_string() const { return as_string().ToStdString(); }
53784 
53785   ConstBytes as_bytes() const {
53786     PERFETTO_DCHECK(!valid() ||
53787                     type() == proto_utils::ProtoWireType::kLengthDelimited);
53788     return ConstBytes{data(), size_};
53789   }
53790 
53791   const uint8_t* data() const {
53792     PERFETTO_DCHECK(!valid() ||
53793                     type() == proto_utils::ProtoWireType::kLengthDelimited);
53794     return reinterpret_cast<const uint8_t*>(int_value_);
53795   }
53796 
53797   size_t size() const {
53798     PERFETTO_DCHECK(!valid() ||
53799                     type() == proto_utils::ProtoWireType::kLengthDelimited);
53800     return size_;
53801   }
53802 
53803   uint64_t raw_int_value() const { return int_value_; }
53804 
53805   void initialize(uint16_t id,
53806                   uint8_t type,
53807                   uint64_t int_value,
53808                   uint32_t size) {
53809     id_ = id;
53810     type_ = type;
53811     int_value_ = int_value;
53812     size_ = size;
53813   }
53814 
53815   // For use with templates. This is used by RepeatedFieldIterator::operator*().
53816   void get(bool* val) const { *val = as_bool(); }
53817   void get(uint32_t* val) const { *val = as_uint32(); }
53818   void get(int32_t* val) const { *val = as_int32(); }
53819   void get(uint64_t* val) const { *val = as_uint64(); }
53820   void get(int64_t* val) const { *val = as_int64(); }
53821   void get(float* val) const { *val = as_float(); }
53822   void get(double* val) const { *val = as_double(); }
53823   void get(std::string* val) const { *val = as_std_string(); }
53824   void get(ConstChars* val) const { *val = as_string(); }
53825   void get(ConstBytes* val) const { *val = as_bytes(); }
53826   void get_signed(int32_t* val) const { *val = as_sint32(); }
53827   void get_signed(int64_t* val) const { *val = as_sint64(); }
53828 
53829   // For enum types.
53830   template <typename T,
53831             typename = typename std::enable_if<std::is_enum<T>::value, T>::type>
53832   void get(T* val) const {
53833     *val = static_cast<T>(as_int32());
53834   }
53835 
53836   // Serializes the field back into a proto-encoded byte stream and appends it
53837   // to |dst|. |dst| is resized accordingly.
53838   void SerializeAndAppendTo(std::string* dst) const;
53839 
53840   // Serializes the field back into a proto-encoded byte stream and appends it
53841   // to |dst|. |dst| is resized accordingly.
53842   void SerializeAndAppendTo(std::vector<uint8_t>* dst) const;
53843 
53844  private:
53845   template <typename Container>
53846   void SerializeAndAppendToInternal(Container* dst) const;
53847 
53848   // Fields are deliberately not initialized to keep the class trivially
53849   // constructible. It makes a large perf difference for ProtoDecoder.
53850 
53851   uint64_t int_value_;  // In kLengthDelimited this contains the data() addr.
53852   uint32_t size_;       // Only valid when when type == kLengthDelimited.
53853   uint16_t id_;         // Proto field ordinal.
53854   uint8_t type_;        // proto_utils::ProtoWireType.
53855 };
53856 
53857 // The Field struct is used in a lot of perf-sensitive contexts.
53858 static_assert(sizeof(Field) == 16, "Field struct too big");
53859 
53860 }  // namespace protozero
53861 
53862 #endif  // INCLUDE_PERFETTO_PROTOZERO_FIELD_H_
53863 // gen_amalgamated begin header: include/perfetto/protozero/message.h
53864 /*
53865  * Copyright (C) 2017 The Android Open Source Project
53866  *
53867  * Licensed under the Apache License, Version 2.0 (the "License");
53868  * you may not use this file except in compliance with the License.
53869  * You may obtain a copy of the License at
53870  *
53871  *      http://www.apache.org/licenses/LICENSE-2.0
53872  *
53873  * Unless required by applicable law or agreed to in writing, software
53874  * distributed under the License is distributed on an "AS IS" BASIS,
53875  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
53876  * See the License for the specific language governing permissions and
53877  * limitations under the License.
53878  */
53879 
53880 #ifndef INCLUDE_PERFETTO_PROTOZERO_MESSAGE_H_
53881 #define INCLUDE_PERFETTO_PROTOZERO_MESSAGE_H_
53882 
53883 #include <assert.h>
53884 #include <stdint.h>
53885 #include <string.h>
53886 
53887 #include <string>
53888 #include <type_traits>
53889 
53890 // gen_amalgamated expanded: #include "perfetto/base/export.h"
53891 // gen_amalgamated expanded: #include "perfetto/base/logging.h"
53892 // gen_amalgamated expanded: #include "perfetto/protozero/contiguous_memory_range.h"
53893 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
53894 // gen_amalgamated expanded: #include "perfetto/protozero/scattered_stream_writer.h"
53895 
53896 namespace perfetto {
53897 namespace shm_fuzz {
53898 class FakeProducer;
53899 }  // namespace shm_fuzz
53900 }  // namespace perfetto
53901 
53902 namespace protozero {
53903 
53904 class MessageArena;
53905 class MessageHandleBase;
53906 
53907 // Base class extended by the proto C++ stubs generated by the ProtoZero
53908 // compiler. This class provides the minimal runtime required to support
53909 // append-only operations and is designed for performance. None of the methods
53910 // require any dynamic memory allocation, unless more than 16 nested messages
53911 // are created via BeginNestedMessage() calls.
53912 class PERFETTO_EXPORT Message {
53913  public:
53914   friend class MessageHandleBase;
53915 
53916   // The ctor is deliberately a no-op to avoid forwarding args from all
53917   // subclasses. The real initialization is performed by Reset().
53918   // Nested messages are allocated via placement new by MessageArena and
53919   // implictly destroyed when the RootMessage's arena goes away. This is
53920   // fine as long as all the fields are PODs, which is checked by the
53921   // static_assert()s in the Reset() method.
53922   Message() = default;
53923 
53924   // Clears up the state, allowing the message to be reused as a fresh one.
53925   void Reset(ScatteredStreamWriter*, MessageArena*);
53926 
53927   // Commits all the changes to the buffer (backfills the size field of this and
53928   // all nested messages) and seals the message. Returns the size of the message
53929   // (and all nested sub-messages), without taking into account any chunking.
53930   // Finalize is idempotent and can be called several times w/o side effects.
53931   uint32_t Finalize();
53932 
53933   // Optional. If is_valid() == true, the corresponding memory region (its
53934   // length == proto_utils::kMessageLengthFieldSize) is backfilled with the size
53935   // of this message (minus |size_already_written| below). This is the mechanism
53936   // used by messages to backfill their corresponding size field in the parent
53937   // message.
53938   uint8_t* size_field() const { return size_field_; }
53939   void set_size_field(uint8_t* size_field) { size_field_ = size_field; }
53940 
53941   // This is to deal with case of backfilling the size of a root (non-nested)
53942   // message which is split into multiple chunks. Upon finalization only the
53943   // partial size that lies in the last chunk has to be backfilled.
53944   void inc_size_already_written(uint32_t sz) { size_already_written_ += sz; }
53945 
53946   Message* nested_message() { return nested_message_; }
53947 
53948   bool is_finalized() const { return finalized_; }
53949 
53950 #if PERFETTO_DCHECK_IS_ON()
53951   void set_handle(MessageHandleBase* handle) { handle_ = handle; }
53952 #endif
53953 
53954   // Proto types: uint64, uint32, int64, int32, bool, enum.
53955   template <typename T>
53956   void AppendVarInt(uint32_t field_id, T value) {
53957     if (nested_message_)
53958       EndNestedMessage();
53959 
53960     uint8_t buffer[proto_utils::kMaxSimpleFieldEncodedSize];
53961     uint8_t* pos = buffer;
53962 
53963     pos = proto_utils::WriteVarInt(proto_utils::MakeTagVarInt(field_id), pos);
53964     // WriteVarInt encodes signed values in two's complement form.
53965     pos = proto_utils::WriteVarInt(value, pos);
53966     WriteToStream(buffer, pos);
53967   }
53968 
53969   // Proto types: sint64, sint32.
53970   template <typename T>
53971   void AppendSignedVarInt(uint32_t field_id, T value) {
53972     AppendVarInt(field_id, proto_utils::ZigZagEncode(value));
53973   }
53974 
53975   // Proto types: bool, enum (small).
53976   // Faster version of AppendVarInt for tiny numbers.
53977   void AppendTinyVarInt(uint32_t field_id, int32_t value) {
53978     PERFETTO_DCHECK(0 <= value && value < 0x80);
53979     if (nested_message_)
53980       EndNestedMessage();
53981 
53982     uint8_t buffer[proto_utils::kMaxSimpleFieldEncodedSize];
53983     uint8_t* pos = buffer;
53984     // MakeTagVarInt gets super optimized here for constexpr.
53985     pos = proto_utils::WriteVarInt(proto_utils::MakeTagVarInt(field_id), pos);
53986     *pos++ = static_cast<uint8_t>(value);
53987     WriteToStream(buffer, pos);
53988   }
53989 
53990   // Proto types: fixed64, sfixed64, fixed32, sfixed32, double, float.
53991   template <typename T>
53992   void AppendFixed(uint32_t field_id, T value) {
53993     if (nested_message_)
53994       EndNestedMessage();
53995 
53996     uint8_t buffer[proto_utils::kMaxSimpleFieldEncodedSize];
53997     uint8_t* pos = buffer;
53998 
53999     pos = proto_utils::WriteVarInt(proto_utils::MakeTagFixed<T>(field_id), pos);
54000     memcpy(pos, &value, sizeof(T));
54001     pos += sizeof(T);
54002     // TODO: Optimize memcpy performance, see http://crbug.com/624311 .
54003     WriteToStream(buffer, pos);
54004   }
54005 
54006   void AppendString(uint32_t field_id, const char* str);
54007 
54008   void AppendString(uint32_t field_id, const std::string& str) {
54009     AppendBytes(field_id, str.data(), str.size());
54010   }
54011 
54012   void AppendBytes(uint32_t field_id, const void* value, size_t size);
54013 
54014   // Append raw bytes for a field, using the supplied |ranges| to
54015   // copy from |num_ranges| individual buffers.
54016   size_t AppendScatteredBytes(uint32_t field_id,
54017                               ContiguousMemoryRange* ranges,
54018                               size_t num_ranges);
54019 
54020   // Begins a nested message. The returned object is owned by the MessageArena
54021   // of the root message. The nested message ends either when Finalize() is
54022   // called or when any other Append* method is called in the parent class.
54023   // The template argument T is supposed to be a stub class auto generated from
54024   // a .proto, hence a subclass of Message.
54025   template <class T>
54026   T* BeginNestedMessage(uint32_t field_id) {
54027     // This is to prevent subclasses (which should be autogenerated, though), to
54028     // introduce extra state fields (which wouldn't be initialized by Reset()).
54029     static_assert(std::is_base_of<Message, T>::value,
54030                   "T must be a subclass of Message");
54031     static_assert(sizeof(T) == sizeof(Message),
54032                   "Message subclasses cannot introduce extra state.");
54033     return static_cast<T*>(BeginNestedMessageInternal(field_id));
54034   }
54035 
54036   ScatteredStreamWriter* stream_writer_for_testing() { return stream_writer_; }
54037 
54038   // Appends some raw bytes to the message. The use-case for this is preserving
54039   // unknown fields in the decode -> re-encode path of xxx.gen.cc classes
54040   // generated by the cppgen_plugin.cc.
54041   // The caller needs to guarantee that the appended data is properly
54042   // proto-encoded and each field has a proto preamble.
54043   void AppendRawProtoBytes(const void* data, size_t size) {
54044     const uint8_t* src = reinterpret_cast<const uint8_t*>(data);
54045     WriteToStream(src, src + size);
54046   }
54047 
54048  private:
54049   Message(const Message&) = delete;
54050   Message& operator=(const Message&) = delete;
54051 
54052   Message* BeginNestedMessageInternal(uint32_t field_id);
54053 
54054   // Called by Finalize and Append* methods.
54055   void EndNestedMessage();
54056 
54057   void WriteToStream(const uint8_t* src_begin, const uint8_t* src_end) {
54058     PERFETTO_DCHECK(!finalized_);
54059     PERFETTO_DCHECK(src_begin <= src_end);
54060     const uint32_t size = static_cast<uint32_t>(src_end - src_begin);
54061     stream_writer_->WriteBytes(src_begin, size);
54062     size_ += size;
54063   }
54064 
54065   // Only POD fields are allowed. This class's dtor is never called.
54066   // See the comment on the static_assert in the corresponding .cc file.
54067 
54068   // The stream writer interface used for the serialization.
54069   ScatteredStreamWriter* stream_writer_;
54070 
54071   // The storage used to allocate nested Message objects.
54072   // This is owned by RootMessage<T>.
54073   MessageArena* arena_;
54074 
54075   // Pointer to the last child message created through BeginNestedMessage(), if
54076   // any, nullptr otherwise. There is no need to keep track of more than one
54077   // message per nesting level as the proto-zero API contract mandates that
54078   // nested fields can be filled only in a stacked fashion. In other words,
54079   // nested messages are finalized and sealed when any other field is set in the
54080   // parent message (or the parent message itself is finalized) and cannot be
54081   // accessed anymore afterwards.
54082   Message* nested_message_;
54083 
54084   // [optional] Pointer to a non-aligned pre-reserved var-int slot of
54085   // kMessageLengthFieldSize bytes. When set, the Finalize() method will write
54086   // the size of proto-encoded message in the pointed memory region.
54087   uint8_t* size_field_;
54088 
54089   // Keeps track of the size of the current message.
54090   uint32_t size_;
54091 
54092   // See comment for inc_size_already_written().
54093   uint32_t size_already_written_;
54094 
54095   // When true, no more changes to the message are allowed. This is to DCHECK
54096   // attempts of writing to a message which has been Finalize()-d.
54097   bool finalized_;
54098 
54099 #if PERFETTO_DCHECK_IS_ON()
54100   // Current generation of message. Incremented on Reset.
54101   // Used to detect stale handles.
54102   uint32_t generation_;
54103 
54104   MessageHandleBase* handle_;
54105 #endif
54106 };
54107 
54108 }  // namespace protozero
54109 
54110 #endif  // INCLUDE_PERFETTO_PROTOZERO_MESSAGE_H_
54111 // gen_amalgamated begin header: include/perfetto/protozero/message_arena.h
54112 /*
54113  * Copyright (C) 2020 The Android Open Source Project
54114  *
54115  * Licensed under the Apache License, Version 2.0 (the "License");
54116  * you may not use this file except in compliance with the License.
54117  * You may obtain a copy of the License at
54118  *
54119  *      http://www.apache.org/licenses/LICENSE-2.0
54120  *
54121  * Unless required by applicable law or agreed to in writing, software
54122  * distributed under the License is distributed on an "AS IS" BASIS,
54123  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
54124  * See the License for the specific language governing permissions and
54125  * limitations under the License.
54126  */
54127 
54128 #ifndef INCLUDE_PERFETTO_PROTOZERO_MESSAGE_ARENA_H_
54129 #define INCLUDE_PERFETTO_PROTOZERO_MESSAGE_ARENA_H_
54130 
54131 #include <stdint.h>
54132 
54133 #include <list>
54134 #include <type_traits>
54135 
54136 // gen_amalgamated expanded: #include "perfetto/base/export.h"
54137 // gen_amalgamated expanded: #include "perfetto/base/logging.h"
54138 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
54139 
54140 namespace protozero {
54141 
54142 class Message;
54143 
54144 // Object allocator for fixed-sized protozero::Message objects.
54145 // It's a simple bump-pointer allocator which leverages the stack-alike
54146 // usage pattern of protozero nested messages. It avoids hitting the system
54147 // allocator in most cases, by reusing the same block, and falls back on
54148 // allocating new blocks only when using deeply nested messages (which are
54149 // extremely rare).
54150 // This is used by RootMessage<T> to handle the storage for root-level messages.
54151 class PERFETTO_EXPORT MessageArena {
54152  public:
54153   MessageArena();
54154   ~MessageArena();
54155 
54156   // Strictly no copies or moves as this is used to hand out pointers.
54157   MessageArena(const MessageArena&) = delete;
54158   MessageArena& operator=(const MessageArena&) = delete;
54159   MessageArena(MessageArena&&) = delete;
54160   MessageArena& operator=(MessageArena&&) = delete;
54161 
54162   // Allocates a new Message object.
54163   Message* NewMessage();
54164 
54165   // Deletes the last message allocated. The |msg| argument is used only for
54166   // DCHECKs, it MUST be the pointer obtained by the last NewMessage() call.
54167   void DeleteLastMessage(Message* msg) {
54168     PERFETTO_DCHECK(!blocks_.empty() && blocks_.back().entries > 0);
54169     PERFETTO_DCHECK(&blocks_.back().storage[blocks_.back().entries - 1] ==
54170                     static_cast<void*>(msg));
54171     DeleteLastMessageInternal();
54172   }
54173 
54174   // Resets the state of the arena, clearing up all but one block. This is used
54175   // to avoid leaking outstanding unfinished sub-messages while recycling the
54176   // RootMessage object (this is extremely rare due to the RAII scoped handles
54177   // but could happen if some client does some overly clever std::move() trick).
54178   void Reset() {
54179     PERFETTO_DCHECK(!blocks_.empty());
54180     blocks_.resize(1);
54181     auto& block = blocks_.back();
54182     block.entries = 0;
54183     PERFETTO_ASAN_POISON(block.storage, sizeof(block.storage));
54184   }
54185 
54186  private:
54187   void DeleteLastMessageInternal();
54188 
54189   struct Block {
54190     static constexpr size_t kCapacity = 16;
54191 
54192     Block() { PERFETTO_ASAN_POISON(storage, sizeof(storage)); }
54193 
54194     std::aligned_storage<sizeof(Message), alignof(Message)>::type
54195         storage[kCapacity];
54196     uint32_t entries = 0;  // # Message entries used (<= kCapacity).
54197   };
54198 
54199   // blocks are used to hand out pointers and must not be moved. Hence why
54200   // std::list rather than std::vector.
54201   std::list<Block> blocks_;
54202 };
54203 
54204 }  // namespace protozero
54205 
54206 #endif  // INCLUDE_PERFETTO_PROTOZERO_MESSAGE_ARENA_H_
54207 // gen_amalgamated begin header: include/perfetto/protozero/message_handle.h
54208 /*
54209  * Copyright (C) 2017 The Android Open Source Project
54210  *
54211  * Licensed under the Apache License, Version 2.0 (the "License");
54212  * you may not use this file except in compliance with the License.
54213  * You may obtain a copy of the License at
54214  *
54215  *      http://www.apache.org/licenses/LICENSE-2.0
54216  *
54217  * Unless required by applicable law or agreed to in writing, software
54218  * distributed under the License is distributed on an "AS IS" BASIS,
54219  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
54220  * See the License for the specific language governing permissions and
54221  * limitations under the License.
54222  */
54223 
54224 #ifndef INCLUDE_PERFETTO_PROTOZERO_MESSAGE_HANDLE_H_
54225 #define INCLUDE_PERFETTO_PROTOZERO_MESSAGE_HANDLE_H_
54226 
54227 #include <functional>
54228 
54229 // gen_amalgamated expanded: #include "perfetto/base/export.h"
54230 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
54231 
54232 namespace protozero {
54233 
54234 class Message;
54235 
54236 // MessageHandle allows to decouple the lifetime of a proto message
54237 // from the underlying storage. It gives the following guarantees:
54238 // - The underlying message is finalized (if still alive) if the handle goes
54239 //   out of scope.
54240 // - In Debug / DCHECK_ALWAYS_ON builds, the handle becomes null once the
54241 //   message is finalized. This is to enforce the append-only API. For instance
54242 //   when adding two repeated messages, the addition of the 2nd one forces
54243 //   the finalization of the first.
54244 // Think about this as a WeakPtr<Message> which calls
54245 // Message::Finalize() when going out of scope.
54246 
54247 class PERFETTO_EXPORT MessageHandleBase {
54248  public:
54249   ~MessageHandleBase();
54250 
54251   // Move-only type.
54252   MessageHandleBase(MessageHandleBase&&) noexcept;
54253   MessageHandleBase& operator=(MessageHandleBase&&);
54254   explicit operator bool() const {
54255 #if PERFETTO_DCHECK_IS_ON()
54256     PERFETTO_DCHECK(!message_ || generation_ == message_->generation_);
54257 #endif
54258     return !!message_;
54259   }
54260 
54261  protected:
54262   explicit MessageHandleBase(Message* = nullptr);
54263   Message* operator->() const {
54264 #if PERFETTO_DCHECK_IS_ON()
54265     PERFETTO_DCHECK(!message_ || generation_ == message_->generation_);
54266 #endif
54267     return message_;
54268   }
54269   Message& operator*() const { return *(operator->()); }
54270 
54271  private:
54272   friend class Message;
54273   MessageHandleBase(const MessageHandleBase&) = delete;
54274   MessageHandleBase& operator=(const MessageHandleBase&) = delete;
54275 
54276   void reset_message() {
54277     // This is called by Message::Finalize().
54278     PERFETTO_DCHECK(message_->is_finalized());
54279     message_ = nullptr;
54280   }
54281 
54282   void Move(MessageHandleBase&&);
54283 
54284   void FinalizeMessage() { message_->Finalize(); }
54285 
54286   Message* message_;
54287 #if PERFETTO_DCHECK_IS_ON()
54288   uint32_t generation_;
54289 #endif
54290 };
54291 
54292 template <typename T>
54293 class MessageHandle : public MessageHandleBase {
54294  public:
54295   MessageHandle() : MessageHandle(nullptr) {}
54296   explicit MessageHandle(T* message) : MessageHandleBase(message) {}
54297 
54298   explicit operator bool() const { return MessageHandleBase::operator bool(); }
54299 
54300   T& operator*() const {
54301     return static_cast<T&>(MessageHandleBase::operator*());
54302   }
54303 
54304   T* operator->() const {
54305     return static_cast<T*>(MessageHandleBase::operator->());
54306   }
54307 
54308   T* get() const { return static_cast<T*>(MessageHandleBase::operator->()); }
54309 };
54310 
54311 }  // namespace protozero
54312 
54313 #endif  // INCLUDE_PERFETTO_PROTOZERO_MESSAGE_HANDLE_H_
54314 // gen_amalgamated begin header: include/perfetto/protozero/packed_repeated_fields.h
54315 /*
54316  * Copyright (C) 2019 The Android Open Source Project
54317  *
54318  * Licensed under the Apache License, Version 2.0 (the "License");
54319  * you may not use this file except in compliance with the License.
54320  * You may obtain a copy of the License at
54321  *
54322  *      http://www.apache.org/licenses/LICENSE-2.0
54323  *
54324  * Unless required by applicable law or agreed to in writing, software
54325  * distributed under the License is distributed on an "AS IS" BASIS,
54326  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
54327  * See the License for the specific language governing permissions and
54328  * limitations under the License.
54329  */
54330 
54331 #ifndef INCLUDE_PERFETTO_PROTOZERO_PACKED_REPEATED_FIELDS_H_
54332 #define INCLUDE_PERFETTO_PROTOZERO_PACKED_REPEATED_FIELDS_H_
54333 
54334 #include <stdint.h>
54335 
54336 #include <array>
54337 #include <memory>
54338 #include <type_traits>
54339 
54340 // gen_amalgamated expanded: #include "perfetto/base/logging.h"
54341 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
54342 
54343 namespace protozero {
54344 
54345 // This file contains classes used when encoding packed repeated fields.
54346 // To encode such a field, the caller is first expected to accumulate all of the
54347 // values in one of the following types (depending on the wire type of the
54348 // individual elements), defined below:
54349 // * protozero::PackedVarInt
54350 // * protozero::PackedFixedSizeInt</*element_type=*/ uint32_t>
54351 // Then that buffer is passed to the protozero-generated setters as an argument.
54352 // After calling the setter, the buffer can be destroyed.
54353 //
54354 // An example of encoding a packed field:
54355 //   protozero::HeapBuffered<protozero::Message> msg;
54356 //   protozero::PackedVarInt buf;
54357 //   buf.Append(42);
54358 //   buf.Append(-1);
54359 //   msg->set_fieldname(buf);
54360 //   msg.SerializeAsString();
54361 
54362 class PackedBufferBase {
54363  public:
54364   PackedBufferBase() { Reset(); }
54365 
54366   // Copy or move is disabled due to pointers to stack addresses.
54367   PackedBufferBase(const PackedBufferBase&) = delete;
54368   PackedBufferBase(PackedBufferBase&&) = delete;
54369   PackedBufferBase& operator=(const PackedBufferBase&) = delete;
54370   PackedBufferBase& operator=(PackedBufferBase&&) = delete;
54371 
54372   void Reset();
54373 
54374   const uint8_t* data() const { return storage_begin_; }
54375 
54376   size_t size() const {
54377     return static_cast<size_t>(write_ptr_ - storage_begin_);
54378   }
54379 
54380  protected:
54381   void GrowIfNeeded() {
54382     PERFETTO_DCHECK(write_ptr_ >= storage_begin_ && write_ptr_ <= storage_end_);
54383     if (PERFETTO_UNLIKELY(write_ptr_ + kMaxElementSize > storage_end_)) {
54384       GrowSlowpath();
54385     }
54386   }
54387 
54388   void GrowSlowpath();
54389 
54390   // max(uint64_t varint encoding, biggest fixed type (uint64)).
54391   static constexpr size_t kMaxElementSize = 10;
54392 
54393   // So sizeof(this) == 8k.
54394   static constexpr size_t kOnStackStorageSize = 8192 - 32;
54395 
54396   uint8_t* storage_begin_;
54397   uint8_t* storage_end_;
54398   uint8_t* write_ptr_;
54399   std::unique_ptr<uint8_t[]> heap_buf_;
54400   alignas(uint64_t) uint8_t stack_buf_[kOnStackStorageSize];
54401 };
54402 
54403 class PackedVarInt : public PackedBufferBase {
54404  public:
54405   template <typename T>
54406   void Append(T value) {
54407     GrowIfNeeded();
54408     write_ptr_ = proto_utils::WriteVarInt(value, write_ptr_);
54409   }
54410 };
54411 
54412 template <typename T /* e.g. uint32_t for Fixed32 */>
54413 class PackedFixedSizeInt : public PackedBufferBase {
54414  public:
54415   void Append(T value) {
54416     static_assert(sizeof(T) == 4 || sizeof(T) == 8,
54417                   "PackedFixedSizeInt should be used only with 32/64-bit ints");
54418     static_assert(sizeof(T) <= kMaxElementSize,
54419                   "kMaxElementSize needs to be updated");
54420     GrowIfNeeded();
54421     PERFETTO_DCHECK(reinterpret_cast<size_t>(write_ptr_) % alignof(T) == 0);
54422     memcpy(reinterpret_cast<T*>(write_ptr_), &value, sizeof(T));
54423     write_ptr_ += sizeof(T);
54424   }
54425 };
54426 
54427 }  // namespace protozero
54428 
54429 #endif  // INCLUDE_PERFETTO_PROTOZERO_PACKED_REPEATED_FIELDS_H_
54430 // gen_amalgamated begin header: include/perfetto/protozero/proto_decoder.h
54431 /*
54432  * Copyright (C) 2018 The Android Open Source Project
54433  *
54434  * Licensed under the Apache License, Version 2.0 (the "License");
54435  * you may not use this file except in compliance with the License.
54436  * You may obtain a copy of the License at
54437  *
54438  *      http://www.apache.org/licenses/LICENSE-2.0
54439  *
54440  * Unless required by applicable law or agreed to in writing, software
54441  * distributed under the License is distributed on an "AS IS" BASIS,
54442  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
54443  * See the License for the specific language governing permissions and
54444  * limitations under the License.
54445  */
54446 
54447 #ifndef INCLUDE_PERFETTO_PROTOZERO_PROTO_DECODER_H_
54448 #define INCLUDE_PERFETTO_PROTOZERO_PROTO_DECODER_H_
54449 
54450 #include <stdint.h>
54451 #include <array>
54452 #include <memory>
54453 #include <vector>
54454 
54455 // gen_amalgamated expanded: #include "perfetto/base/compiler.h"
54456 // gen_amalgamated expanded: #include "perfetto/base/logging.h"
54457 // gen_amalgamated expanded: #include "perfetto/protozero/field.h"
54458 // gen_amalgamated expanded: #include "perfetto/protozero/proto_utils.h"
54459 
54460 namespace protozero {
54461 
54462 // A generic protobuf decoder. Doesn't require any knowledge about the proto
54463 // schema. It tokenizes fields, retrieves their ID and type and exposes
54464 // accessors to retrieve its values.
54465 // It does NOT recurse in nested submessages, instead it just computes their
54466 // boundaries, recursion is left to the caller.
54467 // This class is designed to be used in perf-sensitive contexts. It does not
54468 // allocate and does not perform any proto semantic checks (e.g. repeated /
54469 // required / optional). It's supposedly safe wrt out-of-bounds memory accesses
54470 // (see proto_decoder_fuzzer.cc).
54471 // This class serves also as a building block for TypedProtoDecoder, used when
54472 // the schema is known at compile time.
54473 class PERFETTO_EXPORT ProtoDecoder {
54474  public:
54475   // Creates a ProtoDecoder using the given |buffer| with size |length| bytes.
54476   ProtoDecoder(const void* buffer, size_t length)
54477       : begin_(reinterpret_cast<const uint8_t*>(buffer)),
54478         end_(begin_ + length),
54479         read_ptr_(begin_) {}
54480   ProtoDecoder(const std::string& str) : ProtoDecoder(str.data(), str.size()) {}
54481   ProtoDecoder(const ConstBytes& cb) : ProtoDecoder(cb.data, cb.size) {}
54482 
54483   // Reads the next field from the buffer and advances the read cursor. If a
54484   // full field cannot be read, the returned Field will be invalid (i.e.
54485   // field.valid() == false).
54486   Field ReadField();
54487 
54488   // Finds the first field with the given id. Doesn't affect the read cursor.
54489   Field FindField(uint32_t field_id);
54490 
54491   // Resets the read cursor to the start of the buffer.
54492   void Reset() { read_ptr_ = begin_; }
54493 
54494   // Resets the read cursor to the given position (must be within the buffer).
54495   void Reset(const uint8_t* pos) {
54496     PERFETTO_DCHECK(pos >= begin_ && pos < end_);
54497     read_ptr_ = pos;
54498   }
54499 
54500   // Returns the position of read cursor, relative to the start of the buffer.
54501   size_t read_offset() const { return static_cast<size_t>(read_ptr_ - begin_); }
54502 
54503   size_t bytes_left() const {
54504     PERFETTO_DCHECK(read_ptr_ <= end_);
54505     return static_cast<size_t>(end_ - read_ptr_);
54506   }
54507 
54508   const uint8_t* begin() const { return begin_; }
54509   const uint8_t* end() const { return end_; }
54510 
54511  protected:
54512   const uint8_t* const begin_;
54513   const uint8_t* const end_;
54514   const uint8_t* read_ptr_ = nullptr;
54515 };
54516 
54517 // An iterator-like class used to iterate through repeated fields. Used by
54518 // TypedProtoDecoder. The iteration sequence is a bit counter-intuitive due to
54519 // the fact that fields_[field_id] holds the *last* value of the field, not the
54520 // first, but the remaining storage holds repeated fields in FIFO order.
54521 // Assume that we push the 10,11,12 into a repeated field with ID=1.
54522 //
54523 // Decoder memory layout:  [  fields storage  ] [ repeated fields storage ]
54524 // 1st iteration:           10
54525 // 2nd iteration:           11                   10
54526 // 3rd iteration:           12                   10 11
54527 //
54528 // We start the iteration @ fields_[num_fields], which is the start of the
54529 // repeated fields storage, proceed until the end and lastly jump @ fields_[id].
54530 template <typename T>
54531 class RepeatedFieldIterator {
54532  public:
54533   RepeatedFieldIterator(uint32_t field_id,
54534                         const Field* begin,
54535                         const Field* end,
54536                         const Field* last)
54537       : field_id_(field_id), iter_(begin), end_(end), last_(last) {
54538     FindNextMatchingId();
54539   }
54540 
54541   // Constructs an invalid iterator.
54542   RepeatedFieldIterator()
54543       : field_id_(0u), iter_(nullptr), end_(nullptr), last_(nullptr) {}
54544 
54545   explicit operator bool() const { return iter_ != end_; }
54546   const Field& field() const { return *iter_; }
54547 
54548   T operator*() const {
54549     T val{};
54550     iter_->get(&val);
54551     return val;
54552   }
54553   const Field* operator->() const { return iter_; }
54554 
54555   RepeatedFieldIterator& operator++() {
54556     PERFETTO_DCHECK(iter_ != end_);
54557     if (iter_ == last_) {
54558       iter_ = end_;
54559       return *this;
54560     }
54561     ++iter_;
54562     FindNextMatchingId();
54563     return *this;
54564   }
54565 
54566   RepeatedFieldIterator operator++(int) {
54567     PERFETTO_DCHECK(iter_ != end_);
54568     RepeatedFieldIterator it(*this);
54569     ++(*this);
54570     return it;
54571   }
54572 
54573  private:
54574   void FindNextMatchingId() {
54575     PERFETTO_DCHECK(iter_ != last_);
54576     for (; iter_ != end_; ++iter_) {
54577       if (iter_->id() == field_id_)
54578         return;
54579     }
54580     iter_ = last_->valid() ? last_ : end_;
54581   }
54582 
54583   uint32_t field_id_;
54584 
54585   // Initially points to the beginning of the repeated field storage, then is
54586   // incremented as we call operator++().
54587   const Field* iter_;
54588 
54589   // Always points to fields_[size_], i.e. past the end of the storage.
54590   const Field* end_;
54591 
54592   // Always points to fields_[field_id].
54593   const Field* last_;
54594 };
54595 
54596 // As RepeatedFieldIterator, but allows iterating over a packed repeated field
54597 // (which will be initially stored as a single length-delimited field).
54598 // See |GetPackedRepeatedField| for details.
54599 //
54600 // Assumes little endianness, and that the input buffers are well formed -
54601 // containing an exact multiple of encoded elements.
54602 template <proto_utils::ProtoWireType wire_type, typename CppType>
54603 class PackedRepeatedFieldIterator {
54604  public:
54605   PackedRepeatedFieldIterator(const uint8_t* data_begin,
54606                               size_t size,
54607                               bool* parse_error_ptr)
54608       : data_end_(data_begin ? data_begin + size : nullptr),
54609         read_ptr_(data_begin),
54610         parse_error_(parse_error_ptr) {
54611     using proto_utils::ProtoWireType;
54612     static_assert(wire_type == ProtoWireType::kVarInt ||
54613                       wire_type == ProtoWireType::kFixed32 ||
54614                       wire_type == ProtoWireType::kFixed64,
54615                   "invalid type");
54616 
54617     PERFETTO_DCHECK(parse_error_ptr);
54618 
54619     // Either the field is unset (and there are no data pointer), or the field
54620     // is set with a zero length payload. Mark the iterator as invalid in both
54621     // cases.
54622     if (size == 0) {
54623       curr_value_valid_ = false;
54624       return;
54625     }
54626 
54627     if ((wire_type == ProtoWireType::kFixed32 && (size % 4) != 0) ||
54628         (wire_type == ProtoWireType::kFixed64 && (size % 8) != 0)) {
54629       *parse_error_ = true;
54630       curr_value_valid_ = false;
54631       return;
54632     }
54633 
54634     ++(*this);
54635   }
54636 
54637   const CppType operator*() const { return curr_value_; }
54638   explicit operator bool() const { return curr_value_valid_; }
54639 
54640   PackedRepeatedFieldIterator& operator++() {
54641     using proto_utils::ProtoWireType;
54642 
54643     if (PERFETTO_UNLIKELY(!curr_value_valid_))
54644       return *this;
54645 
54646     if (PERFETTO_UNLIKELY(read_ptr_ == data_end_)) {
54647       curr_value_valid_ = false;
54648       return *this;
54649     }
54650 
54651     if (wire_type == ProtoWireType::kVarInt) {
54652       uint64_t new_value = 0;
54653       const uint8_t* new_pos =
54654           proto_utils::ParseVarInt(read_ptr_, data_end_, &new_value);
54655 
54656       if (PERFETTO_UNLIKELY(new_pos == read_ptr_)) {
54657         // Failed to decode the varint (probably incomplete buffer).
54658         *parse_error_ = true;
54659         curr_value_valid_ = false;
54660       } else {
54661         read_ptr_ = new_pos;
54662         curr_value_ = static_cast<CppType>(new_value);
54663       }
54664     } else {  // kFixed32 or kFixed64
54665       constexpr size_t kStep = wire_type == ProtoWireType::kFixed32 ? 4 : 8;
54666 
54667       // NB: the raw buffer is not guaranteed to be aligned, so neither are
54668       // these copies.
54669       memcpy(&curr_value_, read_ptr_, sizeof(CppType));
54670       read_ptr_ += kStep;
54671     }
54672 
54673     return *this;
54674   }
54675 
54676   PackedRepeatedFieldIterator operator++(int) {
54677     PackedRepeatedFieldIterator it(*this);
54678     ++(*this);
54679     return it;
54680   }
54681 
54682  private:
54683   // Might be null if the backing proto field isn't set.
54684   const uint8_t* const data_end_;
54685 
54686   // The iterator looks ahead by an element, so |curr_value| holds the value
54687   // to be returned when the caller dereferences the iterator, and |read_ptr_|
54688   // points at the start of the next element to be decoded.
54689   // |read_ptr_| might be null if the backing proto field isn't set.
54690   const uint8_t* read_ptr_;
54691   CppType curr_value_ = 0;
54692 
54693   // Set to false once we've exhausted the iterator, or encountered an error.
54694   bool curr_value_valid_ = true;
54695 
54696   // Where to set parsing errors, supplied by the caller.
54697   bool* const parse_error_;
54698 };
54699 
54700 // This decoder loads all fields upfront, without recursing in nested messages.
54701 // It is used as a base class for typed decoders generated by the pbzero plugin.
54702 // The split between TypedProtoDecoderBase and TypedProtoDecoder<> is to have
54703 // unique definition of functions like ParseAllFields() and ExpandHeapStorage().
54704 // The storage (either on-stack or on-heap) for this class is organized as
54705 // follows:
54706 // |-------------------------- fields_ ----------------------|
54707 // [ field 0 (invalid) ] [ fields 1 .. N ] [ repeated fields ]
54708 //                                        ^                  ^
54709 //                                        num_fields_        size_
54710 class PERFETTO_EXPORT TypedProtoDecoderBase : public ProtoDecoder {
54711  public:
54712   // If the field |id| is known at compile time, prefer the templated
54713   // specialization at<kFieldNumber>().
54714   const Field& Get(uint32_t id) const {
54715     return PERFETTO_LIKELY(id < num_fields_) ? fields_[id] : fields_[0];
54716   }
54717 
54718   // Returns an object that allows to iterate over all instances of a repeated
54719   // field given its id. Example usage:
54720   //   for (auto it = decoder.GetRepeated<int32_t>(N); it; ++it) { ... }
54721   template <typename T>
54722   RepeatedFieldIterator<T> GetRepeated(uint32_t field_id) const {
54723     return RepeatedFieldIterator<T>(field_id, &fields_[num_fields_],
54724                                     &fields_[size_], &fields_[field_id]);
54725   }
54726 
54727   // Returns an objects that allows to iterate over all entries of a packed
54728   // repeated field given its id and type. The |wire_type| is necessary for
54729   // decoding the packed field, the |cpp_type| is for convenience & stronger
54730   // typing.
54731   //
54732   // The caller must also supply a pointer to a bool that is set to true if the
54733   // packed buffer is found to be malformed while iterating (so you need to
54734   // exhaust the iterator if you want to check the full extent of the buffer).
54735   //
54736   // Note that unlike standard protobuf parsers, protozero does not allow
54737   // treating of packed repeated fields as non-packed and vice-versa (therefore
54738   // not making the packed option forwards and backwards compatible). So
54739   // the caller needs to use the right accessor for correct results.
54740   template <proto_utils::ProtoWireType wire_type, typename cpp_type>
54741   PackedRepeatedFieldIterator<wire_type, cpp_type> GetPackedRepeated(
54742       uint32_t field_id,
54743       bool* parse_error_location) const {
54744     const Field& field = Get(field_id);
54745     if (field.valid()) {
54746       return PackedRepeatedFieldIterator<wire_type, cpp_type>(
54747           field.data(), field.size(), parse_error_location);
54748     } else {
54749       return PackedRepeatedFieldIterator<wire_type, cpp_type>(
54750           nullptr, 0, parse_error_location);
54751     }
54752   }
54753 
54754  protected:
54755   TypedProtoDecoderBase(Field* storage,
54756                         uint32_t num_fields,
54757                         uint32_t capacity,
54758                         const uint8_t* buffer,
54759                         size_t length)
54760       : ProtoDecoder(buffer, length),
54761         fields_(storage),
54762         num_fields_(num_fields),
54763         size_(num_fields),
54764         capacity_(capacity) {
54765     // The reason why Field needs to be trivially de/constructible is to avoid
54766     // implicit initializers on all the ~1000 entries. We need it to initialize
54767     // only on the first |max_field_id| fields, the remaining capacity doesn't
54768     // require initialization.
54769     static_assert(std::is_trivially_constructible<Field>::value &&
54770                       std::is_trivially_destructible<Field>::value &&
54771                       std::is_trivial<Field>::value,
54772                   "Field must be a trivial aggregate type");
54773     memset(fields_, 0, sizeof(Field) * num_fields_);
54774   }
54775 
54776   void ParseAllFields();
54777 
54778   // Called when the default on-stack storage is exhausted and new repeated
54779   // fields need to be pushed.
54780   void ExpandHeapStorage();
54781 
54782   // Used only in presence of a large number of repeated fields, when the
54783   // default on-stack storage is exhausted.
54784   std::unique_ptr<Field[]> heap_storage_;
54785 
54786   // Points to the storage, either on-stack (default, provided by the template
54787   // specialization) or |heap_storage_| after ExpandHeapStorage() is called, in
54788   // case of a large number of repeated fields.
54789   Field* fields_;
54790 
54791   // Number of fields without accounting repeated storage. This is equal to
54792   // MAX_FIELD_ID + 1 (to account for the invalid 0th field).
54793   // This value is always <= size_ (and hence <= capacity);
54794   uint32_t num_fields_;
54795 
54796   // Number of active |fields_| entries. This is initially equal to the highest
54797   // number of fields for the message (num_fields_ == MAX_FIELD_ID + 1) and can
54798   // grow up to |capacity_| in the case of repeated fields.
54799   uint32_t size_;
54800 
54801   // Initially equal to kFieldsCapacity of the TypedProtoDecoder
54802   // specialization. Can grow when falling back on heap-based storage, in which
54803   // case it represents the size (#fields with each entry of a repeated field
54804   // counted individually) of the |heap_storage_| array.
54805   uint32_t capacity_;
54806 };
54807 
54808 // Template class instantiated by the auto-generated decoder classes declared in
54809 // xxx.pbzero.h files.
54810 template <int MAX_FIELD_ID, bool HAS_NONPACKED_REPEATED_FIELDS>
54811 class TypedProtoDecoder : public TypedProtoDecoderBase {
54812  public:
54813   TypedProtoDecoder(const uint8_t* buffer, size_t length)
54814       : TypedProtoDecoderBase(on_stack_storage_,
54815                               /*num_fields=*/MAX_FIELD_ID + 1,
54816                               kCapacity,
54817                               buffer,
54818                               length) {
54819     static_assert(MAX_FIELD_ID <= kMaxDecoderFieldId, "Field ordinal too high");
54820     TypedProtoDecoderBase::ParseAllFields();
54821   }
54822 
54823   template <uint32_t FIELD_ID>
54824   const Field& at() const {
54825     static_assert(FIELD_ID <= MAX_FIELD_ID, "FIELD_ID > MAX_FIELD_ID");
54826     return fields_[FIELD_ID];
54827   }
54828 
54829   TypedProtoDecoder(TypedProtoDecoder&& other) noexcept
54830       : TypedProtoDecoderBase(std::move(other)) {
54831     // If the moved-from decoder was using on-stack storage, we need to update
54832     // our pointer to point to this decoder's on-stack storage.
54833     if (fields_ == other.on_stack_storage_) {
54834       fields_ = on_stack_storage_;
54835       memcpy(on_stack_storage_, other.on_stack_storage_,
54836              sizeof(on_stack_storage_));
54837     }
54838   }
54839 
54840  private:
54841   // In the case of non-repeated fields, this constant defines the highest field
54842   // id we are able to decode. This is to limit the on-stack storage.
54843   // In the case of repeated fields, this constant defines the max number of
54844   // repeated fields that we'll be able to store before falling back on the
54845   // heap. Keep this value in sync with the one in protozero_generator.cc.
54846   static constexpr size_t kMaxDecoderFieldId = 999;
54847 
54848   // If we the message has no repeated fields we need at most N Field entries
54849   // in the on-stack storage, where N is the highest field id.
54850   // Otherwise we need some room to store repeated fields.
54851   static constexpr size_t kCapacity =
54852       1 + (HAS_NONPACKED_REPEATED_FIELDS ? kMaxDecoderFieldId : MAX_FIELD_ID);
54853 
54854   Field on_stack_storage_[kCapacity];
54855 };
54856 
54857 }  // namespace protozero
54858 
54859 #endif  // INCLUDE_PERFETTO_PROTOZERO_PROTO_DECODER_H_
54860 // gen_amalgamated begin header: include/perfetto/protozero/proto_utils.h
54861 /*
54862  * Copyright (C) 2017 The Android Open Source Project
54863  *
54864  * Licensed under the Apache License, Version 2.0 (the "License");
54865  * you may not use this file except in compliance with the License.
54866  * You may obtain a copy of the License at
54867  *
54868  *      http://www.apache.org/licenses/LICENSE-2.0
54869  *
54870  * Unless required by applicable law or agreed to in writing, software
54871  * distributed under the License is distributed on an "AS IS" BASIS,
54872  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
54873  * See the License for the specific language governing permissions and
54874  * limitations under the License.
54875  */
54876 
54877 #ifndef INCLUDE_PERFETTO_PROTOZERO_PROTO_UTILS_H_
54878 #define INCLUDE_PERFETTO_PROTOZERO_PROTO_UTILS_H_
54879 
54880 #include <inttypes.h>
54881 #include <stddef.h>
54882 
54883 #include <type_traits>
54884 
54885 // gen_amalgamated expanded: #include "perfetto/base/logging.h"
54886 
54887 namespace protozero {
54888 namespace proto_utils {
54889 
54890 // See https://developers.google.com/protocol-buffers/docs/encoding wire types.
54891 // This is a type encoded into the proto that provides just enough info to
54892 // find the length of the following value.
54893 enum class ProtoWireType : uint32_t {
54894   kVarInt = 0,
54895   kFixed64 = 1,
54896   kLengthDelimited = 2,
54897   kFixed32 = 5,
54898 };
54899 
54900 // This is the type defined in the proto for each field. This information
54901 // is used to decide the translation strategy when writing the trace.
54902 enum class ProtoSchemaType {
54903   kUnknown = 0,
54904   kDouble,
54905   kFloat,
54906   kInt64,
54907   kUint64,
54908   kInt32,
54909   kFixed64,
54910   kFixed32,
54911   kBool,
54912   kString,
54913   kGroup,  // Deprecated (proto2 only)
54914   kMessage,
54915   kBytes,
54916   kUint32,
54917   kEnum,
54918   kSfixed32,
54919   kSfixed64,
54920   kSint32,
54921   kSint64,
54922 };
54923 
54924 inline const char* ProtoSchemaToString(ProtoSchemaType v) {
54925   switch (v) {
54926     case ProtoSchemaType::kUnknown:
54927       return "unknown";
54928     case ProtoSchemaType::kDouble:
54929       return "double";
54930     case ProtoSchemaType::kFloat:
54931       return "float";
54932     case ProtoSchemaType::kInt64:
54933       return "int64";
54934     case ProtoSchemaType::kUint64:
54935       return "uint64";
54936     case ProtoSchemaType::kInt32:
54937       return "int32";
54938     case ProtoSchemaType::kFixed64:
54939       return "fixed64";
54940     case ProtoSchemaType::kFixed32:
54941       return "fixed32";
54942     case ProtoSchemaType::kBool:
54943       return "bool";
54944     case ProtoSchemaType::kString:
54945       return "string";
54946     case ProtoSchemaType::kGroup:
54947       return "group";
54948     case ProtoSchemaType::kMessage:
54949       return "message";
54950     case ProtoSchemaType::kBytes:
54951       return "bytes";
54952     case ProtoSchemaType::kUint32:
54953       return "uint32";
54954     case ProtoSchemaType::kEnum:
54955       return "enum";
54956     case ProtoSchemaType::kSfixed32:
54957       return "sfixed32";
54958     case ProtoSchemaType::kSfixed64:
54959       return "sfixed64";
54960     case ProtoSchemaType::kSint32:
54961       return "sint32";
54962     case ProtoSchemaType::kSint64:
54963       return "sint64";
54964   }
54965   // For gcc:
54966   PERFETTO_DCHECK(false);
54967   return "";
54968 }
54969 
54970 // Maximum message size supported: 256 MiB (4 x 7-bit due to varint encoding).
54971 constexpr size_t kMessageLengthFieldSize = 4;
54972 constexpr size_t kMaxMessageLength = (1u << (kMessageLengthFieldSize * 7)) - 1;
54973 
54974 // Field tag is encoded as 32-bit varint (5 bytes at most).
54975 // Largest value of simple (not length-delimited) field is 64-bit varint
54976 // (10 bytes at most). 15 bytes buffer is enough to store a simple field.
54977 constexpr size_t kMaxTagEncodedSize = 5;
54978 constexpr size_t kMaxSimpleFieldEncodedSize = kMaxTagEncodedSize + 10;
54979 
54980 // Proto types: (int|uint|sint)(32|64), bool, enum.
54981 constexpr uint32_t MakeTagVarInt(uint32_t field_id) {
54982   return (field_id << 3) | static_cast<uint32_t>(ProtoWireType::kVarInt);
54983 }
54984 
54985 // Proto types: fixed64, sfixed64, fixed32, sfixed32, double, float.
54986 template <typename T>
54987 constexpr uint32_t MakeTagFixed(uint32_t field_id) {
54988   static_assert(sizeof(T) == 8 || sizeof(T) == 4, "Value must be 4 or 8 bytes");
54989   return (field_id << 3) |
54990          static_cast<uint32_t>((sizeof(T) == 8 ? ProtoWireType::kFixed64
54991                                                : ProtoWireType::kFixed32));
54992 }
54993 
54994 // Proto types: string, bytes, embedded messages.
54995 constexpr uint32_t MakeTagLengthDelimited(uint32_t field_id) {
54996   return (field_id << 3) |
54997          static_cast<uint32_t>(ProtoWireType::kLengthDelimited);
54998 }
54999 
55000 // Proto types: sint64, sint32.
55001 template <typename T>
55002 inline typename std::make_unsigned<T>::type ZigZagEncode(T value) {
55003   using UnsignedType = typename std::make_unsigned<T>::type;
55004 
55005   // Right-shift of negative values is implementation specific.
55006   // Assert the implementation does what we expect, which is that shifting any
55007   // positive value by sizeof(T) * 8 - 1 gives an all 0 bitmap, and a negative
55008   // value gives and all 1 bitmap.
55009   constexpr uint64_t kUnsignedZero = 0u;
55010   constexpr int64_t kNegativeOne = -1;
55011   constexpr int64_t kPositiveOne = 1;
55012   static_assert(static_cast<uint64_t>(kNegativeOne >> 63) == ~kUnsignedZero,
55013                 "implementation does not support assumed rightshift");
55014   static_assert(static_cast<uint64_t>(kPositiveOne >> 63) == kUnsignedZero,
55015                 "implementation does not support assumed rightshift");
55016 
55017   return (static_cast<UnsignedType>(value) << 1) ^
55018          static_cast<UnsignedType>(value >> (sizeof(T) * 8 - 1));
55019 }
55020 
55021 // Proto types: sint64, sint32.
55022 template <typename T>
55023 inline typename std::make_signed<T>::type ZigZagDecode(T value) {
55024   using UnsignedType = typename std::make_unsigned<T>::type;
55025   auto u_value = static_cast<UnsignedType>(value);
55026   return static_cast<typename std::make_signed<T>::type>(
55027       ((u_value >> 1) ^ -(u_value & 1)));
55028 }
55029 
55030 template <typename T>
55031 inline uint8_t* WriteVarInt(T value, uint8_t* target) {
55032   // If value is <= 0 we must first sign extend to int64_t (see [1]).
55033   // Finally we always cast to an unsigned value to to avoid arithmetic
55034   // (sign expanding) shifts in the while loop.
55035   // [1]: "If you use int32 or int64 as the type for a negative number, the
55036   // resulting varint is always ten bytes long".
55037   // - developers.google.com/protocol-buffers/docs/encoding
55038   // So for each input type we do the following casts:
55039   // uintX_t -> uintX_t -> uintX_t
55040   // int8_t  -> int64_t -> uint64_t
55041   // int16_t -> int64_t -> uint64_t
55042   // int32_t -> int64_t -> uint64_t
55043   // int64_t -> int64_t -> uint64_t
55044   using MaybeExtendedType =
55045       typename std::conditional<std::is_unsigned<T>::value, T, int64_t>::type;
55046   using UnsignedType = typename std::make_unsigned<MaybeExtendedType>::type;
55047 
55048   MaybeExtendedType extended_value = static_cast<MaybeExtendedType>(value);
55049   UnsignedType unsigned_value = static_cast<UnsignedType>(extended_value);
55050 
55051   while (unsigned_value >= 0x80) {
55052     *target++ = static_cast<uint8_t>(unsigned_value) | 0x80;
55053     unsigned_value >>= 7;
55054   }
55055   *target = static_cast<uint8_t>(unsigned_value);
55056   return target + 1;
55057 }
55058 
55059 // Writes a fixed-size redundant encoding of the given |value|. This is
55060 // used to backfill fixed-size reservations for the length field using a
55061 // non-canonical varint encoding (e.g. \x81\x80\x80\x00 instead of \x01).
55062 // See https://github.com/google/protobuf/issues/1530.
55063 // In particular, this is used for nested messages. The size of a nested message
55064 // is not known until all its field have been written. |kMessageLengthFieldSize|
55065 // bytes are reserved to encode the size field and backfilled at the end.
55066 inline void WriteRedundantVarInt(uint32_t value, uint8_t* buf) {
55067   for (size_t i = 0; i < kMessageLengthFieldSize; ++i) {
55068     const uint8_t msb = (i < kMessageLengthFieldSize - 1) ? 0x80 : 0;
55069     buf[i] = static_cast<uint8_t>(value) | msb;
55070     value >>= 7;
55071   }
55072 }
55073 
55074 template <uint32_t field_id>
55075 void StaticAssertSingleBytePreamble() {
55076   static_assert(field_id < 16,
55077                 "Proto field id too big to fit in a single byte preamble");
55078 }
55079 
55080 // Parses a VarInt from the encoded buffer [start, end). |end| is STL-style and
55081 // points one byte past the end of buffer.
55082 // The parsed int value is stored in the output arg |value|. Returns a pointer
55083 // to the next unconsumed byte (so start < retval <= end) or |start| if the
55084 // VarInt could not be fully parsed because there was not enough space in the
55085 // buffer.
55086 inline const uint8_t* ParseVarInt(const uint8_t* start,
55087                                   const uint8_t* end,
55088                                   uint64_t* out_value) {
55089   const uint8_t* pos = start;
55090   uint64_t value = 0;
55091   for (uint32_t shift = 0; pos < end && shift < 64u; shift += 7) {
55092     // Cache *pos into |cur_byte| to prevent that the compiler dereferences the
55093     // pointer twice (here and in the if() below) due to char* aliasing rules.
55094     uint8_t cur_byte = *pos++;
55095     value |= static_cast<uint64_t>(cur_byte & 0x7f) << shift;
55096     if ((cur_byte & 0x80) == 0) {
55097       // In valid cases we get here.
55098       *out_value = value;
55099       return pos;
55100     }
55101   }
55102   *out_value = 0;
55103   return start;
55104 }
55105 
55106 }  // namespace proto_utils
55107 }  // namespace protozero
55108 
55109 #endif  // INCLUDE_PERFETTO_PROTOZERO_PROTO_UTILS_H_
55110 // gen_amalgamated begin header: include/perfetto/protozero/root_message.h
55111 /*
55112  * Copyright (C) 2020 The Android Open Source Project
55113  *
55114  * Licensed under the Apache License, Version 2.0 (the "License");
55115  * you may not use this file except in compliance with the License.
55116  * You may obtain a copy of the License at
55117  *
55118  *      http://www.apache.org/licenses/LICENSE-2.0
55119  *
55120  * Unless required by applicable law or agreed to in writing, software
55121  * distributed under the License is distributed on an "AS IS" BASIS,
55122  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
55123  * See the License for the specific language governing permissions and
55124  * limitations under the License.
55125  */
55126 
55127 #ifndef INCLUDE_PERFETTO_PROTOZERO_ROOT_MESSAGE_H_
55128 #define INCLUDE_PERFETTO_PROTOZERO_ROOT_MESSAGE_H_
55129 
55130 // gen_amalgamated expanded: #include "perfetto/protozero/message.h"
55131 // gen_amalgamated expanded: #include "perfetto/protozero/message_arena.h"
55132 
55133 namespace protozero {
55134 
55135 // Helper class to hand out messages using the default MessageArena.
55136 // Usage:
55137 // RootMessage<perfetto::protos::zero::MyMessage> msg;
55138 // msg.Reset(stream_writer);
55139 // msg.set_foo(...);
55140 // auto* nested = msg.set_nested();
55141 template <typename T = Message>
55142 class RootMessage : public T {
55143  public:
55144   RootMessage() { T::Reset(nullptr, &root_arena_); }
55145 
55146   // Disallow copy and move.
55147   RootMessage(const RootMessage&) = delete;
55148   RootMessage& operator=(const RootMessage&) = delete;
55149   RootMessage(RootMessage&&) = delete;
55150   RootMessage& operator=(RootMessage&&) = delete;
55151 
55152   void Reset(ScatteredStreamWriter* writer) {
55153     root_arena_.Reset();
55154     Message::Reset(writer, &root_arena_);
55155   }
55156 
55157  private:
55158   MessageArena root_arena_;
55159 };
55160 
55161 }  // namespace protozero
55162 
55163 #endif  // INCLUDE_PERFETTO_PROTOZERO_ROOT_MESSAGE_H_
55164 // gen_amalgamated begin header: include/perfetto/protozero/scattered_heap_buffer.h
55165 /*
55166  * Copyright (C) 2017 The Android Open Source Project
55167  *
55168  * Licensed under the Apache License, Version 2.0 (the "License");
55169  * you may not use this file except in compliance with the License.
55170  * You may obtain a copy of the License at
55171  *
55172  *      http://www.apache.org/licenses/LICENSE-2.0
55173  *
55174  * Unless required by applicable law or agreed to in writing, software
55175  * distributed under the License is distributed on an "AS IS" BASIS,
55176  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
55177  * See the License for the specific language governing permissions and
55178  * limitations under the License.
55179  */
55180 
55181 #ifndef INCLUDE_PERFETTO_PROTOZERO_SCATTERED_HEAP_BUFFER_H_
55182 #define INCLUDE_PERFETTO_PROTOZERO_SCATTERED_HEAP_BUFFER_H_
55183 
55184 #include <memory>
55185 #include <string>
55186 #include <vector>
55187 
55188 // gen_amalgamated expanded: #include "perfetto/base/export.h"
55189 // gen_amalgamated expanded: #include "perfetto/base/logging.h"
55190 // gen_amalgamated expanded: #include "perfetto/protozero/root_message.h"
55191 // gen_amalgamated expanded: #include "perfetto/protozero/scattered_stream_writer.h"
55192 
55193 namespace protozero {
55194 
55195 class Message;
55196 
55197 class PERFETTO_EXPORT ScatteredHeapBuffer
55198     : public protozero::ScatteredStreamWriter::Delegate {
55199  public:
55200   class PERFETTO_EXPORT Slice {
55201    public:
55202     Slice();
55203     explicit Slice(size_t size);
55204     Slice(Slice&& slice) noexcept;
55205     ~Slice();
55206     Slice& operator=(Slice&&);
55207 
55208     inline protozero::ContiguousMemoryRange GetTotalRange() const {
55209       return {buffer_.get(), buffer_.get() + size_};
55210     }
55211 
55212     inline protozero::ContiguousMemoryRange GetUsedRange() const {
55213       return {buffer_.get(), buffer_.get() + size_ - unused_bytes_};
55214     }
55215 
55216     uint8_t* start() const { return buffer_.get(); }
55217     size_t size() const { return size_; }
55218     size_t unused_bytes() const { return unused_bytes_; }
55219     void set_unused_bytes(size_t unused_bytes) {
55220       PERFETTO_DCHECK(unused_bytes_ <= size_);
55221       unused_bytes_ = unused_bytes;
55222     }
55223 
55224     void Clear();
55225 
55226    private:
55227     std::unique_ptr<uint8_t[]> buffer_;
55228     size_t size_;
55229     size_t unused_bytes_;
55230   };
55231 
55232   ScatteredHeapBuffer(size_t initial_slice_size_bytes = 128,
55233                       size_t maximum_slice_size_bytes = 128 * 1024);
55234   ~ScatteredHeapBuffer() override;
55235 
55236   // protozero::ScatteredStreamWriter::Delegate implementation.
55237   protozero::ContiguousMemoryRange GetNewBuffer() override;
55238 
55239   // Stitch all the slices into a single contiguous buffer.
55240   std::vector<uint8_t> StitchSlices();
55241 
55242   // Note that the returned ranges point back to this buffer and thus cannot
55243   // outlive it.
55244   std::vector<protozero::ContiguousMemoryRange> GetRanges();
55245 
55246   const std::vector<Slice>& slices() const { return slices_; }
55247 
55248   void set_writer(protozero::ScatteredStreamWriter* writer) {
55249     writer_ = writer;
55250   }
55251 
55252   // Update unused_bytes() of the current |Slice| based on the writer's state.
55253   void AdjustUsedSizeOfCurrentSlice();
55254 
55255   // Returns the total size the slices occupy in heap memory (including unused).
55256   size_t GetTotalSize();
55257 
55258   // Reset the contents of this buffer but retain one slice allocation (if it
55259   // exists) to be reused for future writes.
55260   void Reset();
55261 
55262  private:
55263   size_t next_slice_size_;
55264   const size_t maximum_slice_size_;
55265   protozero::ScatteredStreamWriter* writer_ = nullptr;
55266   std::vector<Slice> slices_;
55267 
55268   // Used to keep an allocated slice around after this buffer is reset.
55269   Slice cached_slice_;
55270 };
55271 
55272 // Helper function to create heap-based protozero messages in one line.
55273 // Useful when manually serializing a protozero message (primarily in
55274 // tests/utilities). So instead of the following:
55275 //   protozero::MyMessage msg;
55276 //   protozero::ScatteredHeapBuffer shb;
55277 //   protozero::ScatteredStreamWriter writer(&shb);
55278 //   shb.set_writer(&writer);
55279 //   msg.Reset(&writer);
55280 //   ...
55281 // You can write:
55282 //   protozero::HeapBuffered<protozero::MyMessage> msg;
55283 //   msg->set_stuff(...);
55284 //   msg.SerializeAsString();
55285 template <typename T = ::protozero::Message>
55286 class HeapBuffered {
55287  public:
55288   HeapBuffered() : HeapBuffered(4096, 4096) {}
55289   HeapBuffered(size_t initial_slice_size_bytes, size_t maximum_slice_size_bytes)
55290       : shb_(initial_slice_size_bytes, maximum_slice_size_bytes),
55291         writer_(&shb_) {
55292     shb_.set_writer(&writer_);
55293     msg_.Reset(&writer_);
55294   }
55295 
55296   // This can't be neither copied nor moved because Message hands out pointers
55297   // to itself when creating submessages.
55298   HeapBuffered(const HeapBuffered&) = delete;
55299   HeapBuffered& operator=(const HeapBuffered&) = delete;
55300   HeapBuffered(HeapBuffered&&) = delete;
55301   HeapBuffered& operator=(HeapBuffered&&) = delete;
55302 
55303   T* get() { return &msg_; }
55304   T* operator->() { return &msg_; }
55305 
55306   bool empty() const { return shb_.slices().empty(); }
55307 
55308   std::vector<uint8_t> SerializeAsArray() {
55309     msg_.Finalize();
55310     return shb_.StitchSlices();
55311   }
55312 
55313   std::string SerializeAsString() {
55314     auto vec = SerializeAsArray();
55315     return std::string(reinterpret_cast<const char*>(vec.data()), vec.size());
55316   }
55317 
55318   std::vector<protozero::ContiguousMemoryRange> GetRanges() {
55319     msg_.Finalize();
55320     return shb_.GetRanges();
55321   }
55322 
55323   void Reset() {
55324     shb_.Reset();
55325     writer_.Reset(protozero::ContiguousMemoryRange{});
55326     msg_.Reset(&writer_);
55327     PERFETTO_DCHECK(empty());
55328   }
55329 
55330  private:
55331   ScatteredHeapBuffer shb_;
55332   ScatteredStreamWriter writer_;
55333   RootMessage<T> msg_;
55334 };
55335 
55336 }  // namespace protozero
55337 
55338 #endif  // INCLUDE_PERFETTO_PROTOZERO_SCATTERED_HEAP_BUFFER_H_
55339 // gen_amalgamated begin header: include/perfetto/protozero/scattered_stream_null_delegate.h
55340 /*
55341  * Copyright (C) 2018 The Android Open Source Project
55342  *
55343  * Licensed under the Apache License, Version 2.0 (the "License");
55344  * you may not use this file except in compliance with the License.
55345  * You may obtain a copy of the License at
55346  *
55347  *      http://www.apache.org/licenses/LICENSE-2.0
55348  *
55349  * Unless required by applicable law or agreed to in writing, software
55350  * distributed under the License is distributed on an "AS IS" BASIS,
55351  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
55352  * See the License for the specific language governing permissions and
55353  * limitations under the License.
55354  */
55355 
55356 #ifndef INCLUDE_PERFETTO_PROTOZERO_SCATTERED_STREAM_NULL_DELEGATE_H_
55357 #define INCLUDE_PERFETTO_PROTOZERO_SCATTERED_STREAM_NULL_DELEGATE_H_
55358 
55359 #include <memory>
55360 #include <vector>
55361 
55362 // gen_amalgamated expanded: #include "perfetto/base/export.h"
55363 // gen_amalgamated expanded: #include "perfetto/base/logging.h"
55364 // gen_amalgamated expanded: #include "perfetto/protozero/contiguous_memory_range.h"
55365 // gen_amalgamated expanded: #include "perfetto/protozero/scattered_stream_writer.h"
55366 
55367 namespace protozero {
55368 
55369 class PERFETTO_EXPORT ScatteredStreamWriterNullDelegate
55370     : public ScatteredStreamWriter::Delegate {
55371  public:
55372   explicit ScatteredStreamWriterNullDelegate(size_t chunk_size);
55373   ~ScatteredStreamWriterNullDelegate() override;
55374 
55375   // protozero::ScatteredStreamWriter::Delegate implementation.
55376   ContiguousMemoryRange GetNewBuffer() override;
55377 
55378  private:
55379   const size_t chunk_size_;
55380   std::unique_ptr<uint8_t[]> chunk_;
55381 };
55382 
55383 }  // namespace protozero
55384 
55385 #endif  // INCLUDE_PERFETTO_PROTOZERO_SCATTERED_STREAM_NULL_DELEGATE_H_
55386 // gen_amalgamated begin header: include/perfetto/protozero/scattered_stream_writer.h
55387 /*
55388  * Copyright (C) 2017 The Android Open Source Project
55389  *
55390  * Licensed under the Apache License, Version 2.0 (the "License");
55391  * you may not use this file except in compliance with the License.
55392  * You may obtain a copy of the License at
55393  *
55394  *      http://www.apache.org/licenses/LICENSE-2.0
55395  *
55396  * Unless required by applicable law or agreed to in writing, software
55397  * distributed under the License is distributed on an "AS IS" BASIS,
55398  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
55399  * See the License for the specific language governing permissions and
55400  * limitations under the License.
55401  */
55402 
55403 #ifndef INCLUDE_PERFETTO_PROTOZERO_SCATTERED_STREAM_WRITER_H_
55404 #define INCLUDE_PERFETTO_PROTOZERO_SCATTERED_STREAM_WRITER_H_
55405 
55406 #include <assert.h>
55407 #include <stddef.h>
55408 #include <stdint.h>
55409 #include <string.h>
55410 
55411 // gen_amalgamated expanded: #include "perfetto/base/compiler.h"
55412 // gen_amalgamated expanded: #include "perfetto/base/export.h"
55413 // gen_amalgamated expanded: #include "perfetto/protozero/contiguous_memory_range.h"
55414 
55415 namespace protozero {
55416 
55417 // This class deals with the following problem: append-only proto messages want
55418 // to write a stream of bytes, without caring about the implementation of the
55419 // underlying buffer (which concretely will be either the trace ring buffer
55420 // or a heap-allocated buffer). The main deal is: proto messages don't know in
55421 // advance what their size will be.
55422 // Due to the tracing buffer being split into fixed-size chunks, on some
55423 // occasions, these writes need to be spread over two (or more) non-contiguous
55424 // chunks of memory. Similarly, when the buffer is backed by the heap, we want
55425 // to avoid realloc() calls, as they might cause a full copy of the contents
55426 // of the buffer.
55427 // The purpose of this class is to abstract away the non-contiguous write logic.
55428 // This class knows how to deal with writes as long as they fall in the same
55429 // ContiguousMemoryRange and defers the chunk-chaining logic to the Delegate.
55430 class PERFETTO_EXPORT ScatteredStreamWriter {
55431  public:
55432   class PERFETTO_EXPORT Delegate {
55433    public:
55434     virtual ~Delegate();
55435     virtual ContiguousMemoryRange GetNewBuffer() = 0;
55436   };
55437 
55438   explicit ScatteredStreamWriter(Delegate* delegate);
55439   ~ScatteredStreamWriter();
55440 
55441   inline void WriteByte(uint8_t value) {
55442     if (write_ptr_ >= cur_range_.end)
55443       Extend();
55444     *write_ptr_++ = value;
55445   }
55446 
55447   // Assumes that the caller checked that there is enough headroom.
55448   // TODO(primiano): perf optimization, this is a tracing hot path. The
55449   // compiler can make strong optimization on memcpy if the size arg is a
55450   // constexpr. Make a templated variant of this for fixed-size writes.
55451   // TODO(primiano): restrict / noalias might also help.
55452   inline void WriteBytesUnsafe(const uint8_t* src, size_t size) {
55453     uint8_t* const end = write_ptr_ + size;
55454     assert(end <= cur_range_.end);
55455     memcpy(write_ptr_, src, size);
55456     write_ptr_ = end;
55457   }
55458 
55459   inline void WriteBytes(const uint8_t* src, size_t size) {
55460     uint8_t* const end = write_ptr_ + size;
55461     if (PERFETTO_LIKELY(end <= cur_range_.end))
55462       return WriteBytesUnsafe(src, size);
55463     WriteBytesSlowPath(src, size);
55464   }
55465 
55466   void WriteBytesSlowPath(const uint8_t* src, size_t size);
55467 
55468   // Reserves a fixed amount of bytes to be backfilled later. The reserved range
55469   // is guaranteed to be contiguous and not span across chunks. |size| has to be
55470   // <= than the size of a new buffer returned by the Delegate::GetNewBuffer().
55471   uint8_t* ReserveBytes(size_t size);
55472 
55473   // Fast (but unsafe) version of the above. The caller must have previously
55474   // checked that there are at least |size| contiguous bytes available.
55475   // Returns only the start pointer of the reservation.
55476   uint8_t* ReserveBytesUnsafe(size_t size) {
55477     uint8_t* begin = write_ptr_;
55478     write_ptr_ += size;
55479     assert(write_ptr_ <= cur_range_.end);
55480     return begin;
55481   }
55482 
55483   // Resets the buffer boundaries and the write pointer to the given |range|.
55484   // Subsequent WriteByte(s) will write into |range|.
55485   void Reset(ContiguousMemoryRange range);
55486 
55487   // Number of contiguous free bytes in |cur_range_| that can be written without
55488   // requesting a new buffer.
55489   size_t bytes_available() const {
55490     return static_cast<size_t>(cur_range_.end - write_ptr_);
55491   }
55492 
55493   uint8_t* write_ptr() const { return write_ptr_; }
55494 
55495   uint64_t written() const {
55496     return written_previously_ +
55497            static_cast<uint64_t>(write_ptr_ - cur_range_.begin);
55498   }
55499 
55500  private:
55501   ScatteredStreamWriter(const ScatteredStreamWriter&) = delete;
55502   ScatteredStreamWriter& operator=(const ScatteredStreamWriter&) = delete;
55503 
55504   void Extend();
55505 
55506   Delegate* const delegate_;
55507   ContiguousMemoryRange cur_range_;
55508   uint8_t* write_ptr_;
55509   uint64_t written_previously_ = 0;
55510 };
55511 
55512 }  // namespace protozero
55513 
55514 #endif  // INCLUDE_PERFETTO_PROTOZERO_SCATTERED_STREAM_WRITER_H_
55515 // gen_amalgamated begin header: include/perfetto/protozero/static_buffer.h
55516 /*
55517  * Copyright (C) 2019 The Android Open Source Project
55518  *
55519  * Licensed under the Apache License, Version 2.0 (the "License");
55520  * you may not use this file except in compliance with the License.
55521  * You may obtain a copy of the License at
55522  *
55523  *      http://www.apache.org/licenses/LICENSE-2.0
55524  *
55525  * Unless required by applicable law or agreed to in writing, software
55526  * distributed under the License is distributed on an "AS IS" BASIS,
55527  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
55528  * See the License for the specific language governing permissions and
55529  * limitations under the License.
55530  */
55531 
55532 #ifndef INCLUDE_PERFETTO_PROTOZERO_STATIC_BUFFER_H_
55533 #define INCLUDE_PERFETTO_PROTOZERO_STATIC_BUFFER_H_
55534 
55535 #include <memory>
55536 #include <string>
55537 #include <vector>
55538 
55539 // gen_amalgamated expanded: #include "perfetto/base/export.h"
55540 // gen_amalgamated expanded: #include "perfetto/protozero/root_message.h"
55541 // gen_amalgamated expanded: #include "perfetto/protozero/scattered_stream_writer.h"
55542 
55543 namespace protozero {
55544 
55545 class Message;
55546 
55547 // A simple implementation of ScatteredStreamWriter::Delegate backed by a
55548 // fixed-size buffer. It doesn't support expansion. The caller needs to ensure
55549 // to never write more than the size of the buffer. Will CHECK() otherwise.
55550 class PERFETTO_EXPORT StaticBufferDelegate
55551     : public ScatteredStreamWriter::Delegate {
55552  public:
55553   StaticBufferDelegate(uint8_t* buf, size_t len) : range_{buf, buf + len} {}
55554   ~StaticBufferDelegate() override;
55555 
55556   // ScatteredStreamWriter::Delegate implementation.
55557   ContiguousMemoryRange GetNewBuffer() override;
55558 
55559   ContiguousMemoryRange const range_;
55560   bool get_new_buffer_called_once_ = false;
55561 };
55562 
55563 // Helper function to create protozero messages backed by a fixed-size buffer
55564 // in one line. You can write:
55565 //   protozero::Static<protozero::MyMessage> msg(buf.data(), buf.size());
55566 //   msg->set_stuff(...);
55567 //   size_t bytes_encoded = msg.Finalize();
55568 template <typename T /* protozero::Message */>
55569 class StaticBuffered {
55570  public:
55571   StaticBuffered(void* buf, size_t len)
55572       : delegate_(reinterpret_cast<uint8_t*>(buf), len), writer_(&delegate_) {
55573     msg_.Reset(&writer_);
55574   }
55575 
55576   // This can't be neither copied nor moved because Message hands out pointers
55577   // to itself when creating submessages.
55578   StaticBuffered(const StaticBuffered&) = delete;
55579   StaticBuffered& operator=(const StaticBuffered&) = delete;
55580   StaticBuffered(StaticBuffered&&) = delete;
55581   StaticBuffered& operator=(StaticBuffered&&) = delete;
55582 
55583   T* get() { return &msg_; }
55584   T* operator->() { return &msg_; }
55585 
55586   // The lack of a size() method is deliberate. It's to prevent that one
55587   // accidentally calls size() before Finalize().
55588 
55589   // Returns the number of encoded bytes (<= the size passed in the ctor).
55590   size_t Finalize() {
55591     msg_.Finalize();
55592     return static_cast<size_t>(writer_.write_ptr() - delegate_.range_.begin);
55593   }
55594 
55595  private:
55596   StaticBufferDelegate delegate_;
55597   ScatteredStreamWriter writer_;
55598   RootMessage<T> msg_;
55599 };
55600 
55601 // Helper function to create stack-based protozero messages in one line.
55602 // You can write:
55603 //   protozero::StackBuffered<protozero::MyMessage, 16> msg;
55604 //   msg->set_stuff(...);
55605 //   size_t bytes_encoded = msg.Finalize();
55606 template <typename T /* protozero::Message */, size_t N>
55607 class StackBuffered : public StaticBuffered<T> {
55608  public:
55609   StackBuffered() : StaticBuffered<T>(&buf_[0], N) {}
55610 
55611  private:
55612   uint8_t buf_[N];  // Deliberately not initialized.
55613 };
55614 
55615 }  // namespace protozero
55616 
55617 #endif  // INCLUDE_PERFETTO_PROTOZERO_STATIC_BUFFER_H_
55618 
55619