Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
profile_packet.pbzero.h
Go to the documentation of this file.
1// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
2// for details. All rights reserved. Use of this source code is governed by a
3// BSD-style license that can be found in the LICENSE file.
4
5// IMPORTANT: This file should only ever be modified by modifying the
6// corresponding .proto file and then running
7// `dart runtime/vm/protos/tools/compile_perfetto_protos.dart` from the SDK root
8// directory.
9// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
10
11#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PROFILING_PROFILE_PACKET_PROTO_H_
12#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PROFILING_PROFILE_PACKET_PROTO_H_
13
14#include <stddef.h>
15#include <stdint.h>
16
17#include "perfetto/protozero/field_writer.h"
18#include "perfetto/protozero/message.h"
19#include "perfetto/protozero/packed_repeated_fields.h"
20#include "perfetto/protozero/proto_decoder.h"
21#include "perfetto/protozero/proto_utils.h"
22
23namespace perfetto {
24namespace protos {
25namespace pbzero {
26
27class PerfSample_Decoder : public ::protozero::TypedProtoDecoder<
28 /*MAX_FIELD_ID=*/4,
29 /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
30 public:
31 PerfSample_Decoder(const uint8_t* data, size_t len)
32 : TypedProtoDecoder(data, len) {}
33 explicit PerfSample_Decoder(const std::string& raw)
34 : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()),
35 raw.size()) {}
36 explicit PerfSample_Decoder(const ::protozero::ConstBytes& raw)
37 : TypedProtoDecoder(raw.data, raw.size) {}
38 bool has_cpu() const { return at<1>().valid(); }
39 uint32_t cpu() const { return at<1>().as_uint32(); }
40 bool has_pid() const { return at<2>().valid(); }
41 uint32_t pid() const { return at<2>().as_uint32(); }
42 bool has_tid() const { return at<3>().valid(); }
43 uint32_t tid() const { return at<3>().as_uint32(); }
44 bool has_callstack_iid() const { return at<4>().valid(); }
45 uint64_t callstack_iid() const { return at<4>().as_uint64(); }
46};
47
48class PerfSample : public ::protozero::Message {
49 public:
51 enum : int32_t {
56 };
57 static constexpr const char* GetName() {
58 return ".perfetto.protos.PerfSample";
59 }
60
61 using FieldMetadata_Cpu = ::protozero::proto_utils::FieldMetadata<
62 1,
63 ::protozero::proto_utils::RepetitionType::kNotRepeated,
64 ::protozero::proto_utils::ProtoSchemaType::kUint32,
65 uint32_t,
67
68 // Ceci n'est pas une pipe.
69 // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
70 // type (and users are expected to use it as such, hence kCamelCase name).
71 // It is declared as a function to keep protozero bindings header-only as
72 // inline constexpr variables are not available until C++17 (while inline
73 // functions are).
74 // TODO(altimin): Use inline variable instead after adopting C++17.
75 static constexpr FieldMetadata_Cpu kCpu() { return {}; }
76 void set_cpu(uint32_t value) {
77 static constexpr uint32_t field_id = FieldMetadata_Cpu::kFieldId;
78 // Call the appropriate protozero::Message::Append(field_id, ...)
79 // method based on the type of the field.
80 ::protozero::internal::FieldWriter<
81 ::protozero::proto_utils::ProtoSchemaType::kUint32>::Append(*this,
82 field_id,
83 value);
84 }
85
86 using FieldMetadata_Pid = ::protozero::proto_utils::FieldMetadata<
87 2,
88 ::protozero::proto_utils::RepetitionType::kNotRepeated,
89 ::protozero::proto_utils::ProtoSchemaType::kUint32,
90 uint32_t,
92
93 // Ceci n'est pas une pipe.
94 // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
95 // type (and users are expected to use it as such, hence kCamelCase name).
96 // It is declared as a function to keep protozero bindings header-only as
97 // inline constexpr variables are not available until C++17 (while inline
98 // functions are).
99 // TODO(altimin): Use inline variable instead after adopting C++17.
100 static constexpr FieldMetadata_Pid kPid() { return {}; }
101 void set_pid(uint32_t value) {
102 static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
103 // Call the appropriate protozero::Message::Append(field_id, ...)
104 // method based on the type of the field.
105 ::protozero::internal::FieldWriter<
106 ::protozero::proto_utils::ProtoSchemaType::kUint32>::Append(*this,
107 field_id,
108 value);
109 }
110
111 using FieldMetadata_Tid = ::protozero::proto_utils::FieldMetadata<
112 3,
113 ::protozero::proto_utils::RepetitionType::kNotRepeated,
114 ::protozero::proto_utils::ProtoSchemaType::kUint32,
115 uint32_t,
116 PerfSample>;
117
118 // Ceci n'est pas une pipe.
119 // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
120 // type (and users are expected to use it as such, hence kCamelCase name).
121 // It is declared as a function to keep protozero bindings header-only as
122 // inline constexpr variables are not available until C++17 (while inline
123 // functions are).
124 // TODO(altimin): Use inline variable instead after adopting C++17.
125 static constexpr FieldMetadata_Tid kTid() { return {}; }
126 void set_tid(uint32_t value) {
127 static constexpr uint32_t field_id = FieldMetadata_Tid::kFieldId;
128 // Call the appropriate protozero::Message::Append(field_id, ...)
129 // method based on the type of the field.
130 ::protozero::internal::FieldWriter<
131 ::protozero::proto_utils::ProtoSchemaType::kUint32>::Append(*this,
132 field_id,
133 value);
134 }
135
136 using FieldMetadata_CallstackIid = ::protozero::proto_utils::FieldMetadata<
137 4,
138 ::protozero::proto_utils::RepetitionType::kNotRepeated,
139 ::protozero::proto_utils::ProtoSchemaType::kUint64,
140 uint64_t,
141 PerfSample>;
142
143 // Ceci n'est pas une pipe.
144 // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
145 // type (and users are expected to use it as such, hence kCamelCase name).
146 // It is declared as a function to keep protozero bindings header-only as
147 // inline constexpr variables are not available until C++17 (while inline
148 // functions are).
149 // TODO(altimin): Use inline variable instead after adopting C++17.
150 static constexpr FieldMetadata_CallstackIid kCallstackIid() { return {}; }
151 void set_callstack_iid(uint64_t value) {
152 static constexpr uint32_t field_id = FieldMetadata_CallstackIid::kFieldId;
153 // Call the appropriate protozero::Message::Append(field_id, ...)
154 // method based on the type of the field.
155 ::protozero::internal::FieldWriter<
156 ::protozero::proto_utils::ProtoSchemaType::kUint64>::Append(*this,
157 field_id,
158 value);
159 }
160};
161
162} // namespace pbzero
163} // namespace protos
164} // namespace perfetto
165#endif // Include guard.
PerfSample_Decoder(const uint8_t *data, size_t len)
PerfSample_Decoder(const ::protozero::ConstBytes &raw)
static constexpr FieldMetadata_Cpu kCpu()
static constexpr FieldMetadata_Tid kTid()
::protozero::proto_utils::FieldMetadata< 1, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kUint32, uint32_t, PerfSample > FieldMetadata_Cpu
::protozero::proto_utils::FieldMetadata< 3, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kUint32, uint32_t, PerfSample > FieldMetadata_Tid
::protozero::proto_utils::FieldMetadata< 4, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kUint64, uint64_t, PerfSample > FieldMetadata_CallstackIid
::protozero::proto_utils::FieldMetadata< 2, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kUint32, uint32_t, PerfSample > FieldMetadata_Pid
static constexpr FieldMetadata_CallstackIid kCallstackIid()
static constexpr const char * GetName()
static constexpr FieldMetadata_Pid kPid()
uint8_t value