Coverage Report

Created: 2025-07-23 06:46

/src/perfetto/include/perfetto/protozero/proto_utils.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * Copyright (C) 2017 The Android Open Source Project
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *      http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
17
#ifndef INCLUDE_PERFETTO_PROTOZERO_PROTO_UTILS_H_
18
#define INCLUDE_PERFETTO_PROTOZERO_PROTO_UTILS_H_
19
20
#include <stddef.h>
21
22
#include <cinttypes>
23
#include <type_traits>
24
25
#include "perfetto/base/logging.h"
26
#include "perfetto/public/pb_utils.h"
27
28
// Helper macro for the constexpr functions containing
29
// the switch statement: if C++14 is supported, this macro
30
// resolves to `constexpr` and just `inline` otherwise.
31
#if __cpp_constexpr >= 201304
32
#define PERFETTO_PROTOZERO_CONSTEXPR14_OR_INLINE constexpr
33
#else
34
#define PERFETTO_PROTOZERO_CONSTEXPR14_OR_INLINE inline
35
#endif
36
37
namespace protozero {
38
namespace proto_utils {
39
40
// See https://developers.google.com/protocol-buffers/docs/encoding wire types.
41
// This is a type encoded into the proto that provides just enough info to
42
// find the length of the following value.
43
enum class ProtoWireType : uint32_t {
44
  kVarInt = 0,
45
  kFixed64 = 1,
46
  kLengthDelimited = 2,
47
  kFixed32 = 5,
48
};
49
50
// This is the type defined in the proto for each field. This information
51
// is used to decide the translation strategy when writing the trace.
52
enum class ProtoSchemaType {
53
  kUnknown = 0,
54
  kDouble,
55
  kFloat,
56
  kInt64,
57
  kUint64,
58
  kInt32,
59
  kFixed64,
60
  kFixed32,
61
  kBool,
62
  kString,
63
  kGroup,  // Deprecated (proto2 only)
64
  kMessage,
65
  kBytes,
66
  kUint32,
67
  kEnum,
68
  kSfixed32,
69
  kSfixed64,
70
  kSint32,
71
  kSint64,
72
};
73
74
0
inline const char* ProtoSchemaToString(ProtoSchemaType v) {
75
0
  switch (v) {
76
0
    case ProtoSchemaType::kUnknown:
77
0
      return "unknown";
78
0
    case ProtoSchemaType::kDouble:
79
0
      return "double";
80
0
    case ProtoSchemaType::kFloat:
81
0
      return "float";
82
0
    case ProtoSchemaType::kInt64:
83
0
      return "int64";
84
0
    case ProtoSchemaType::kUint64:
85
0
      return "uint64";
86
0
    case ProtoSchemaType::kInt32:
87
0
      return "int32";
88
0
    case ProtoSchemaType::kFixed64:
89
0
      return "fixed64";
90
0
    case ProtoSchemaType::kFixed32:
91
0
      return "fixed32";
92
0
    case ProtoSchemaType::kBool:
93
0
      return "bool";
94
0
    case ProtoSchemaType::kString:
95
0
      return "string";
96
0
    case ProtoSchemaType::kGroup:
97
0
      return "group";
98
0
    case ProtoSchemaType::kMessage:
99
0
      return "message";
100
0
    case ProtoSchemaType::kBytes:
101
0
      return "bytes";
102
0
    case ProtoSchemaType::kUint32:
103
0
      return "uint32";
104
0
    case ProtoSchemaType::kEnum:
105
0
      return "enum";
106
0
    case ProtoSchemaType::kSfixed32:
107
0
      return "sfixed32";
108
0
    case ProtoSchemaType::kSfixed64:
109
0
      return "sfixed64";
110
0
    case ProtoSchemaType::kSint32:
111
0
      return "sint32";
112
0
    case ProtoSchemaType::kSint64:
113
0
      return "sint64";
114
0
  }
115
0
  // For gcc:
116
0
  PERFETTO_DCHECK(false);
117
0
  return "";
118
0
}
119
120
// Maximum message size supported: 256 MiB (4 x 7-bit due to varint encoding).
121
constexpr size_t kMessageLengthFieldSize = 4;
122
constexpr size_t kMaxMessageLength = (1u << (kMessageLengthFieldSize * 7)) - 1;
123
constexpr size_t kMaxOneByteMessageLength = (1 << 7) - 1;
124
125
// Field tag is encoded as 32-bit varint (5 bytes at most).
126
// Largest value of simple (not length-delimited) field is 64-bit varint
127
// (10 bytes at most). 15 bytes buffer is enough to store a simple field.
128
constexpr size_t kMaxTagEncodedSize = 5;
129
constexpr size_t kMaxSimpleFieldEncodedSize = kMaxTagEncodedSize + 10;
130
131
// Proto types: (int|uint|sint)(32|64), bool, enum.
132
434k
constexpr uint32_t MakeTagVarInt(uint32_t field_id) {
133
434k
  return (field_id << 3) | static_cast<uint32_t>(ProtoWireType::kVarInt);
134
434k
}
135
136
// Proto types: fixed64, sfixed64, fixed32, sfixed32, double, float.
137
template <typename T>
138
35.1k
constexpr uint32_t MakeTagFixed(uint32_t field_id) {
139
35.1k
  static_assert(sizeof(T) == 8 || sizeof(T) == 4, "Value must be 4 or 8 bytes");
140
35.1k
  return (field_id << 3) |
141
35.1k
         static_cast<uint32_t>((sizeof(T) == 8 ? ProtoWireType::kFixed64
142
35.1k
                                               : ProtoWireType::kFixed32));
143
35.1k
}
unsigned int protozero::proto_utils::MakeTagFixed<unsigned int>(unsigned int)
Line
Count
Source
138
20.0k
constexpr uint32_t MakeTagFixed(uint32_t field_id) {
139
20.0k
  static_assert(sizeof(T) == 8 || sizeof(T) == 4, "Value must be 4 or 8 bytes");
140
20.0k
  return (field_id << 3) |
141
20.0k
         static_cast<uint32_t>((sizeof(T) == 8 ? ProtoWireType::kFixed64
142
20.0k
                                               : ProtoWireType::kFixed32));
143
20.0k
}
unsigned int protozero::proto_utils::MakeTagFixed<unsigned long>(unsigned int)
Line
Count
Source
138
15.0k
constexpr uint32_t MakeTagFixed(uint32_t field_id) {
139
15.0k
  static_assert(sizeof(T) == 8 || sizeof(T) == 4, "Value must be 4 or 8 bytes");
140
15.0k
  return (field_id << 3) |
141
15.0k
         static_cast<uint32_t>((sizeof(T) == 8 ? ProtoWireType::kFixed64
142
15.0k
                                               : ProtoWireType::kFixed32));
143
15.0k
}
Unexecuted instantiation: unsigned int protozero::proto_utils::MakeTagFixed<double>(unsigned int)
Unexecuted instantiation: unsigned int protozero::proto_utils::MakeTagFixed<float>(unsigned int)
Unexecuted instantiation: unsigned int protozero::proto_utils::MakeTagFixed<long>(unsigned int)
Unexecuted instantiation: unsigned int protozero::proto_utils::MakeTagFixed<int>(unsigned int)
144
145
// Proto types: string, bytes, embedded messages.
146
206k
constexpr uint32_t MakeTagLengthDelimited(uint32_t field_id) {
147
206k
  return (field_id << 3) |
148
206k
         static_cast<uint32_t>(ProtoWireType::kLengthDelimited);
149
206k
}
150
151
// Proto types: sint64, sint32.
152
template <typename T>
153
0
inline typename std::make_unsigned<T>::type ZigZagEncode(T value) {
154
0
  using UnsignedType = typename std::make_unsigned<T>::type;
155
156
  // Right-shift of negative values is implementation specific.
157
  // Assert the implementation does what we expect, which is that shifting any
158
  // positive value by sizeof(T) * 8 - 1 gives an all 0 bitmap, and a negative
159
  // value gives an all 1 bitmap.
160
0
  constexpr uint64_t kUnsignedZero = 0u;
161
0
  constexpr int64_t kNegativeOne = -1;
162
0
  constexpr int64_t kPositiveOne = 1;
163
0
  static_assert(static_cast<uint64_t>(kNegativeOne >> 63) == ~kUnsignedZero,
164
0
                "implementation does not support assumed rightshift");
165
0
  static_assert(static_cast<uint64_t>(kPositiveOne >> 63) == kUnsignedZero,
166
0
                "implementation does not support assumed rightshift");
167
168
0
  return (static_cast<UnsignedType>(value) << 1) ^
169
0
         static_cast<UnsignedType>(value >> (sizeof(T) * 8 - 1));
170
0
}
Unexecuted instantiation: std::__1::make_unsigned<int>::type protozero::proto_utils::ZigZagEncode<int>(int)
Unexecuted instantiation: std::__1::make_unsigned<long>::type protozero::proto_utils::ZigZagEncode<long>(long)
171
172
// Proto types: sint64, sint32.
173
template <typename T>
174
0
inline typename std::make_signed<T>::type ZigZagDecode(T value) {
175
0
  using UnsignedType = typename std::make_unsigned<T>::type;
176
0
  using SignedType = typename std::make_signed<T>::type;
177
0
  auto u_value = static_cast<UnsignedType>(value);
178
0
  auto mask = static_cast<UnsignedType>(-static_cast<SignedType>(u_value & 1));
179
0
  return static_cast<SignedType>((u_value >> 1) ^ mask);
180
0
}
Unexecuted instantiation: std::__1::make_signed<unsigned int>::type protozero::proto_utils::ZigZagDecode<unsigned int>(unsigned int)
Unexecuted instantiation: std::__1::make_signed<unsigned long>::type protozero::proto_utils::ZigZagDecode<unsigned long>(unsigned long)
Unexecuted instantiation: std::__1::make_signed<long>::type protozero::proto_utils::ZigZagDecode<long>(long)
181
182
template <typename T>
183
auto ExtendValueForVarIntSerialization(T value) -> typename std::make_unsigned<
184
    typename std::conditional<std::is_unsigned<T>::value, T, int64_t>::type>::
185
6.60M
    type {
186
  // If value is <= 0 we must first sign extend to int64_t (see [1]).
187
  // Finally we always cast to an unsigned value to to avoid arithmetic
188
  // (sign expanding) shifts in the while loop.
189
  // [1]: "If you use int32 or int64 as the type for a negative number, the
190
  // resulting varint is always ten bytes long".
191
  // - developers.google.com/protocol-buffers/docs/encoding
192
  // So for each input type we do the following casts:
193
  // uintX_t -> uintX_t -> uintX_t
194
  // int8_t  -> int64_t -> uint64_t
195
  // int16_t -> int64_t -> uint64_t
196
  // int32_t -> int64_t -> uint64_t
197
  // int64_t -> int64_t -> uint64_t
198
6.60M
  using MaybeExtendedType =
199
6.60M
      typename std::conditional<std::is_unsigned<T>::value, T, int64_t>::type;
200
6.60M
  using UnsignedType = typename std::make_unsigned<MaybeExtendedType>::type;
201
202
6.60M
  MaybeExtendedType extended_value = static_cast<MaybeExtendedType>(value);
203
6.60M
  UnsignedType unsigned_value = static_cast<UnsignedType>(extended_value);
204
205
6.60M
  return unsigned_value;
206
6.60M
}
_ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIjEENSt3__113make_unsignedINS2_11conditionalIXsr3std11is_unsignedIT_EE5valueES5_lE4typeEE4typeES5_
Line
Count
Source
185
6.16M
    type {
186
  // If value is <= 0 we must first sign extend to int64_t (see [1]).
187
  // Finally we always cast to an unsigned value to to avoid arithmetic
188
  // (sign expanding) shifts in the while loop.
189
  // [1]: "If you use int32 or int64 as the type for a negative number, the
190
  // resulting varint is always ten bytes long".
191
  // - developers.google.com/protocol-buffers/docs/encoding
192
  // So for each input type we do the following casts:
193
  // uintX_t -> uintX_t -> uintX_t
194
  // int8_t  -> int64_t -> uint64_t
195
  // int16_t -> int64_t -> uint64_t
196
  // int32_t -> int64_t -> uint64_t
197
  // int64_t -> int64_t -> uint64_t
198
6.16M
  using MaybeExtendedType =
199
6.16M
      typename std::conditional<std::is_unsigned<T>::value, T, int64_t>::type;
200
6.16M
  using UnsignedType = typename std::make_unsigned<MaybeExtendedType>::type;
201
202
6.16M
  MaybeExtendedType extended_value = static_cast<MaybeExtendedType>(value);
203
6.16M
  UnsignedType unsigned_value = static_cast<UnsignedType>(extended_value);
204
205
6.16M
  return unsigned_value;
206
6.16M
}
_ZN9protozero11proto_utils33ExtendValueForVarIntSerializationImEENSt3__113make_unsignedINS2_11conditionalIXsr3std11is_unsignedIT_EE5valueES5_lE4typeEE4typeES5_
Line
Count
Source
185
396k
    type {
186
  // If value is <= 0 we must first sign extend to int64_t (see [1]).
187
  // Finally we always cast to an unsigned value to to avoid arithmetic
188
  // (sign expanding) shifts in the while loop.
189
  // [1]: "If you use int32 or int64 as the type for a negative number, the
190
  // resulting varint is always ten bytes long".
191
  // - developers.google.com/protocol-buffers/docs/encoding
192
  // So for each input type we do the following casts:
193
  // uintX_t -> uintX_t -> uintX_t
194
  // int8_t  -> int64_t -> uint64_t
195
  // int16_t -> int64_t -> uint64_t
196
  // int32_t -> int64_t -> uint64_t
197
  // int64_t -> int64_t -> uint64_t
198
396k
  using MaybeExtendedType =
199
396k
      typename std::conditional<std::is_unsigned<T>::value, T, int64_t>::type;
200
396k
  using UnsignedType = typename std::make_unsigned<MaybeExtendedType>::type;
201
202
396k
  MaybeExtendedType extended_value = static_cast<MaybeExtendedType>(value);
203
396k
  UnsignedType unsigned_value = static_cast<UnsignedType>(extended_value);
204
205
396k
  return unsigned_value;
206
396k
}
_ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIiEENSt3__113make_unsignedINS2_11conditionalIXsr3std11is_unsignedIT_EE5valueES5_lE4typeEE4typeES5_
Line
Count
Source
185
26.7k
    type {
186
  // If value is <= 0 we must first sign extend to int64_t (see [1]).
187
  // Finally we always cast to an unsigned value to to avoid arithmetic
188
  // (sign expanding) shifts in the while loop.
189
  // [1]: "If you use int32 or int64 as the type for a negative number, the
190
  // resulting varint is always ten bytes long".
191
  // - developers.google.com/protocol-buffers/docs/encoding
192
  // So for each input type we do the following casts:
193
  // uintX_t -> uintX_t -> uintX_t
194
  // int8_t  -> int64_t -> uint64_t
195
  // int16_t -> int64_t -> uint64_t
196
  // int32_t -> int64_t -> uint64_t
197
  // int64_t -> int64_t -> uint64_t
198
26.7k
  using MaybeExtendedType =
199
26.7k
      typename std::conditional<std::is_unsigned<T>::value, T, int64_t>::type;
200
26.7k
  using UnsignedType = typename std::make_unsigned<MaybeExtendedType>::type;
201
202
26.7k
  MaybeExtendedType extended_value = static_cast<MaybeExtendedType>(value);
203
26.7k
  UnsignedType unsigned_value = static_cast<UnsignedType>(extended_value);
204
205
26.7k
  return unsigned_value;
206
26.7k
}
_ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIlEENSt3__113make_unsignedINS2_11conditionalIXsr3std11is_unsignedIT_EE5valueES5_lE4typeEE4typeES5_
Line
Count
Source
185
13.4k
    type {
186
  // If value is <= 0 we must first sign extend to int64_t (see [1]).
187
  // Finally we always cast to an unsigned value to to avoid arithmetic
188
  // (sign expanding) shifts in the while loop.
189
  // [1]: "If you use int32 or int64 as the type for a negative number, the
190
  // resulting varint is always ten bytes long".
191
  // - developers.google.com/protocol-buffers/docs/encoding
192
  // So for each input type we do the following casts:
193
  // uintX_t -> uintX_t -> uintX_t
194
  // int8_t  -> int64_t -> uint64_t
195
  // int16_t -> int64_t -> uint64_t
196
  // int32_t -> int64_t -> uint64_t
197
  // int64_t -> int64_t -> uint64_t
198
13.4k
  using MaybeExtendedType =
199
13.4k
      typename std::conditional<std::is_unsigned<T>::value, T, int64_t>::type;
200
13.4k
  using UnsignedType = typename std::make_unsigned<MaybeExtendedType>::type;
201
202
13.4k
  MaybeExtendedType extended_value = static_cast<MaybeExtendedType>(value);
203
13.4k
  UnsignedType unsigned_value = static_cast<UnsignedType>(extended_value);
204
205
13.4k
  return unsigned_value;
206
13.4k
}
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero11FtraceClockEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
_ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero17FtraceParseStatusEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Line
Count
Source
185
1.09k
    type {
186
  // If value is <= 0 we must first sign extend to int64_t (see [1]).
187
  // Finally we always cast to an unsigned value to to avoid arithmetic
188
  // (sign expanding) shifts in the while loop.
189
  // [1]: "If you use int32 or int64 as the type for a negative number, the
190
  // resulting varint is always ten bytes long".
191
  // - developers.google.com/protocol-buffers/docs/encoding
192
  // So for each input type we do the following casts:
193
  // uintX_t -> uintX_t -> uintX_t
194
  // int8_t  -> int64_t -> uint64_t
195
  // int16_t -> int64_t -> uint64_t
196
  // int32_t -> int64_t -> uint64_t
197
  // int64_t -> int64_t -> uint64_t
198
1.09k
  using MaybeExtendedType =
199
1.09k
      typename std::conditional<std::is_unsigned<T>::value, T, int64_t>::type;
200
1.09k
  using UnsignedType = typename std::make_unsigned<MaybeExtendedType>::type;
201
202
1.09k
  MaybeExtendedType extended_value = static_cast<MaybeExtendedType>(value);
203
1.09k
  UnsignedType unsigned_value = static_cast<UnsignedType>(extended_value);
204
205
1.09k
  return unsigned_value;
206
1.09k
}
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero32perfetto_pbzero_enum_KprobeEvent10KprobeTypeEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero32perfetto_pbzero_enum_FtraceStats5PhaseEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIhEENSt3__113make_unsignedINS2_11conditionalIXsr3std11is_unsignedIT_EE5valueES5_lE4typeEE4typeES5_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationItEENSt3__113make_unsignedINS2_11conditionalIXsr3std11is_unsignedIT_EE5valueES5_lE4typeEE4typeES5_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIaEENSt3__113make_unsignedINS2_11conditionalIXsr3std11is_unsignedIT_EE5valueES5_lE4typeEE4typeES5_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIsEENSt3__113make_unsignedINS2_11conditionalIXsr3std11is_unsignedIT_EE5valueES5_lE4typeEE4typeES5_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen27FtraceConfig_KsymsMemPolicyEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen35FtraceConfig_KprobeEvent_KprobeTypeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen26FieldDescriptorProto_LabelEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen25FieldDescriptorProto_TypeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen32GpuCounterDescriptor_MeasureUnitEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen36GpuCounterDescriptor_GpuCounterGroupEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen40ObservableEvents_DataSourceInstanceStateEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen18PerfEvents_CounterEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen20PerfEvents_PerfClockEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
_ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen28TraceStats_FinalFlushOutcomeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Line
Count
Source
185
454
    type {
186
  // If value is <= 0 we must first sign extend to int64_t (see [1]).
187
  // Finally we always cast to an unsigned value to to avoid arithmetic
188
  // (sign expanding) shifts in the while loop.
189
  // [1]: "If you use int32 or int64 as the type for a negative number, the
190
  // resulting varint is always ten bytes long".
191
  // - developers.google.com/protocol-buffers/docs/encoding
192
  // So for each input type we do the following casts:
193
  // uintX_t -> uintX_t -> uintX_t
194
  // int8_t  -> int64_t -> uint64_t
195
  // int16_t -> int64_t -> uint64_t
196
  // int32_t -> int64_t -> uint64_t
197
  // int64_t -> int64_t -> uint64_t
198
454
  using MaybeExtendedType =
199
454
      typename std::conditional<std::is_unsigned<T>::value, T, int64_t>::type;
200
454
  using UnsignedType = typename std::make_unsigned<MaybeExtendedType>::type;
201
202
454
  MaybeExtendedType extended_value = static_cast<MaybeExtendedType>(value);
203
454
  UnsignedType unsigned_value = static_cast<UnsignedType>(extended_value);
204
205
454
  return unsigned_value;
206
454
}
_ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen21ObservableEvents_TypeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Line
Count
Source
185
454
    type {
186
  // If value is <= 0 we must first sign extend to int64_t (see [1]).
187
  // Finally we always cast to an unsigned value to to avoid arithmetic
188
  // (sign expanding) shifts in the while loop.
189
  // [1]: "If you use int32 or int64 as the type for a negative number, the
190
  // resulting varint is always ten bytes long".
191
  // - developers.google.com/protocol-buffers/docs/encoding
192
  // So for each input type we do the following casts:
193
  // uintX_t -> uintX_t -> uintX_t
194
  // int8_t  -> int64_t -> uint64_t
195
  // int16_t -> int64_t -> uint64_t
196
  // int32_t -> int64_t -> uint64_t
197
  // int64_t -> int64_t -> uint64_t
198
454
  using MaybeExtendedType =
199
454
      typename std::conditional<std::is_unsigned<T>::value, T, int64_t>::type;
200
454
  using UnsignedType = typename std::make_unsigned<MaybeExtendedType>::type;
201
202
454
  MaybeExtendedType extended_value = static_cast<MaybeExtendedType>(value);
203
454
  UnsignedType unsigned_value = static_cast<UnsignedType>(extended_value);
204
205
454
  return unsigned_value;
206
454
}
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen27ChromeConfig_ClientPriorityEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
_ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen33DataSourceConfig_SessionInitiatorEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Line
Count
Source
185
908
    type {
186
  // If value is <= 0 we must first sign extend to int64_t (see [1]).
187
  // Finally we always cast to an unsigned value to to avoid arithmetic
188
  // (sign expanding) shifts in the while loop.
189
  // [1]: "If you use int32 or int64 as the type for a negative number, the
190
  // resulting varint is always ten bytes long".
191
  // - developers.google.com/protocol-buffers/docs/encoding
192
  // So for each input type we do the following casts:
193
  // uintX_t -> uintX_t -> uintX_t
194
  // int8_t  -> int64_t -> uint64_t
195
  // int16_t -> int64_t -> uint64_t
196
  // int32_t -> int64_t -> uint64_t
197
  // int64_t -> int64_t -> uint64_t
198
908
  using MaybeExtendedType =
199
908
      typename std::conditional<std::is_unsigned<T>::value, T, int64_t>::type;
200
908
  using UnsignedType = typename std::make_unsigned<MaybeExtendedType>::type;
201
202
908
  MaybeExtendedType extended_value = static_cast<MaybeExtendedType>(value);
203
908
  UnsignedType unsigned_value = static_cast<UnsignedType>(extended_value);
204
205
908
  return unsigned_value;
206
908
}
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen20EtwConfig_KernelFlagEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen33TraceConfig_LockdownModeOperationEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen27TraceConfig_CompressionTypeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen25TraceConfig_StatsdLoggingEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen42TraceConfig_TraceFilter_StringFilterPolicyEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen37TraceConfig_TriggerConfig_TriggerModeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen12BuiltinClockEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen35TraceConfig_BufferConfig_FillPolicyEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen33AndroidInputEventConfig_TraceModeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen34AndroidInputEventConfig_TraceLevelEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen12AndroidLogIdEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen18AndroidLogPriorityEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen27PixelModemConfig_EventGroupEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen13ProtoLogLevelEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen26ProtoLogConfig_TracingModeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen31SurfaceFlingerLayersConfig_ModeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen36SurfaceFlingerLayersConfig_TraceFlagEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen37SurfaceFlingerTransactionsConfig_ModeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen32WindowManagerConfig_LogFrequencyEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen28WindowManagerConfig_LogLevelEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen20ConsoleConfig_OutputEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen34AndroidPowerConfig_BatteryCountersEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen25ProcessStatsConfig_QuirksEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen26PerfEventConfig_UnwindModeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen6AtomIdEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen15MeminfoCountersEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen14VmstatCountersEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen27SysStatsConfig_StatCountersEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen49ChromeApplicationStateInfo_ChromeApplicationStateEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen33BeginFrameArgs_BeginFrameArgsTypeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen24BeginImplFrameArgs_StateEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen52ChromeCompositorStateMachine_MinorState_TreePriorityEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen58ChromeCompositorStateMachine_MinorState_ScrollHandlerStateEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen31ChromeCompositorSchedulerActionEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen59ChromeCompositorStateMachine_MajorState_BeginImplFrameStateEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen59ChromeCompositorStateMachine_MajorState_BeginMainFrameStateEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen63ChromeCompositorStateMachine_MajorState_LayerTreeFrameSinkStateEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen66ChromeCompositorStateMachine_MajorState_ForcedRedrawOnTimeoutStateEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen57ChromeCompositorSchedulerState_BeginImplFrameDeadlineModeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen25ChromeFrameReporter_StateEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen35ChromeFrameReporter_FrameDropReasonEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen31ChromeFrameReporter_ScrollStateEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen29ChromeFrameReporter_FrameTypeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen22ChromeLatencyInfo_StepEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen27ChromeLatencyInfo_InputTypeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen38ChromeLatencyInfo_LatencyComponentTypeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen28ChromeLegacyIpc_MessageClassEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen35ChromeProcessDescriptor_ProcessTypeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen14ChromeRAILModeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen33ChromeThreadDescriptor_ThreadTypeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen36CounterDescriptor_BuiltinCounterTypeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen22CounterDescriptor_UnitEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen38DebugAnnotation_NestedValue_NestedTypeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen19LogMessage_PriorityEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen35ProcessDescriptor_ChromeProcessTypeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen33ThreadDescriptor_ChromeThreadTypeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen35TrackDescriptor_ChildTracksOrderingEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen15TrackEvent_TypeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen36TrackEvent_LegacyEvent_FlowDirectionEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen40TrackEvent_LegacyEvent_InstantEventScopeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero39perfetto_pbzero_enum_InodeFileMap_Entry4TypeEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen35MemoryTrackerSnapshot_LevelOfDetailEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen70MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry_UnitsEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen24BluetoothTracePacketTypeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen43AndroidCameraFrameEvent_CaptureResultStatusEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen30FrameTimelineEvent_PresentTypeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen33FrameTimelineEvent_PredictionTypeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen35FrameTimelineEvent_JankSeverityTypeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen34GraphicsFrameEvent_BufferEventTypeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen32KernelWakelockData_Wakelock_TypeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen16TrafficDirectionEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen18HwcCompositionTypeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen14TrustedOverlayEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen24LayerState_DropInputModeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen33LayerState_BufferData_PixelFormatEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen49BackgroundTracingMetadata_TriggerRule_TriggerTypeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen57BackgroundTracingMetadata_TriggerRule_NamedRule_EventTypeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen31ChromeLegacyJsonTrace_TraceTypeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen28ChromeTracedValue_NestedTypeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen15V8WasmCode_TierEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen19V8InternalCode_TypeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen13V8JsCode_TierEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen25InternedV8JsFunction_KindEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen23InternedV8JsScript_TypeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen32ReadyThreadEtwEvent_AdjustReasonEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen29ReadyThreadEtwEvent_TraceFlagEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen35CSwitchEtwEvent_OldThreadWaitReasonEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen33CSwitchEtwEvent_OldThreadWaitModeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen30CSwitchEtwEvent_OldThreadStateEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen23InodeFileMap_Entry_TypeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen11FtraceClockEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen17FtraceParseStatusEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen17FtraceStats_PhaseEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen22KprobeEvent_KprobeTypeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen15GpuLog_SeverityEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen55InternedGpuRenderStageSpecification_RenderStageCategoryEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen27InternedGraphicsContext_ApiEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen24VulkanMemoryEvent_SourceEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen27VulkanMemoryEvent_OperationEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen33VulkanMemoryEvent_AllocationScopeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen18HeapGraphType_KindEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen18HeapGraphRoot_TypeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen24HeapGraphObject_HeapTypeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen17Profiling_CpuModeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen26Profiling_StackUnwindErrorEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen27PerfSample_SampleSkipReasonEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen45PerfSample_ProducerEvent_DataSourceStopReasonEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen44ProfilePacket_ProcessHeapSamples_ClientErrorEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen30SysStats_PsiSample_PsiResourceEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen51InitializeConnectionRequest_ProducerSMBScrapingModeEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos3gen22SyncClockRequest_PhaseEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
_ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero12BuiltinClockEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Line
Count
Source
185
908
    type {
186
  // If value is <= 0 we must first sign extend to int64_t (see [1]).
187
  // Finally we always cast to an unsigned value to to avoid arithmetic
188
  // (sign expanding) shifts in the while loop.
189
  // [1]: "If you use int32 or int64 as the type for a negative number, the
190
  // resulting varint is always ten bytes long".
191
  // - developers.google.com/protocol-buffers/docs/encoding
192
  // So for each input type we do the following casts:
193
  // uintX_t -> uintX_t -> uintX_t
194
  // int8_t  -> int64_t -> uint64_t
195
  // int16_t -> int64_t -> uint64_t
196
  // int32_t -> int64_t -> uint64_t
197
  // int64_t -> int64_t -> uint64_t
198
908
  using MaybeExtendedType =
199
908
      typename std::conditional<std::is_unsigned<T>::value, T, int64_t>::type;
200
908
  using UnsignedType = typename std::make_unsigned<MaybeExtendedType>::type;
201
202
908
  MaybeExtendedType extended_value = static_cast<MaybeExtendedType>(value);
203
908
  UnsignedType unsigned_value = static_cast<UnsignedType>(extended_value);
204
205
908
  return unsigned_value;
206
908
}
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero31perfetto_pbzero_enum_TraceStats17FinalFlushOutcomeEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero32perfetto_pbzero_enum_TraceConfig21LockdownModeOperationEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero32perfetto_pbzero_enum_TraceConfig15CompressionTypeEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero32perfetto_pbzero_enum_TraceConfig13StatsdLoggingEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero44perfetto_pbzero_enum_TraceConfig_TraceFilter18StringFilterPolicyEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero46perfetto_pbzero_enum_TraceConfig_TriggerConfig11TriggerModeEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero45perfetto_pbzero_enum_TraceConfig_BufferConfig10FillPolicyEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero39perfetto_pbzero_enum_SysStats_PsiSample11PsiResourceEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero14VmstatCountersEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero15MeminfoCountersEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero48perfetto_pbzero_enum_KernelWakelockData_Wakelock4TypeEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero12AndroidLogIdEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero18AndroidLogPriorityEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero39perfetto_pbzero_enum_AndroidPowerConfig15BatteryCountersEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero39perfetto_pbzero_enum_ProcessStatsConfig6QuirksEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero6AtomIdEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero35perfetto_pbzero_enum_SysStatsConfig12StatCountersEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero30perfetto_pbzero_enum_Profiling7CpuModeEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero30perfetto_pbzero_enum_Profiling16StackUnwindErrorEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero31perfetto_pbzero_enum_PerfSample16SampleSkipReasonEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero45perfetto_pbzero_enum_PerfSample_ProducerEvent20DataSourceStopReasonEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero53perfetto_pbzero_enum_ProfilePacket_ProcessHeapSamples11ClientErrorEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero37perfetto_pbzero_enum_ThreadDescriptor16ChromeThreadTypeEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero31perfetto_pbzero_enum_TrackEvent4TypeEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero43perfetto_pbzero_enum_TrackEvent_LegacyEvent13FlowDirectionEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero43perfetto_pbzero_enum_TrackEvent_LegacyEvent17InstantEventScopeEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero48perfetto_pbzero_enum_DebugAnnotation_NestedValue10NestedTypeEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero41perfetto_pbzero_enum_FieldDescriptorProto5LabelEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero41perfetto_pbzero_enum_FieldDescriptorProto4TypeEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero44perfetto_pbzero_enum_ResetTraceProcessorArgs24DropTrackEventDataBeforeEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero44perfetto_pbzero_enum_ResetTraceProcessorArgs11ParsingModeEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero19MetatraceCategoriesEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero38perfetto_pbzero_enum_ComputeMetricArgs12ResultFormatEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero38perfetto_pbzero_enum_TraceProcessorRpc20TraceProcessorMethodEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero36perfetto_pbzero_enum_ChromeLegacyIpc12MessageClassEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero44perfetto_pbzero_enum_ChromeProcessDescriptor11ProcessTypeEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero43perfetto_pbzero_enum_ChromeThreadDescriptor10ThreadTypeEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero42perfetto_pbzero_enum_MemoryTrackerSnapshot13LevelOfDetailEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero85perfetto_pbzero_enum_MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry5UnitsEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero58perfetto_pbzero_enum_BackgroundTracingMetadata_TriggerRule11TriggerTypeEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero68perfetto_pbzero_enum_BackgroundTracingMetadata_TriggerRule_NamedRule9EventTypeEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero16TrafficDirectionEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero31perfetto_pbzero_enum_PerfEvents7CounterEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero31perfetto_pbzero_enum_PerfEvents9PerfClockEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero42perfetto_pbzero_enum_ChromeLegacyJsonTrace9TraceTypeEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero38perfetto_pbzero_enum_ChromeTracedValue10NestedTypeEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero38perfetto_pbzero_enum_CounterDescriptor18BuiltinCounterTypeEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero38perfetto_pbzero_enum_CounterDescriptor4UnitEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero39perfetto_pbzero_enum_BeginImplFrameArgs5StateEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero35perfetto_pbzero_enum_BeginFrameArgs18BeginFrameArgsTypeEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero60perfetto_pbzero_enum_ChromeCompositorStateMachine_MinorState12TreePriorityEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero60perfetto_pbzero_enum_ChromeCompositorStateMachine_MinorState18ScrollHandlerStateEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero31ChromeCompositorSchedulerActionEEENSt3__113make_unsignedINS6_11conditionalIXsr3std11is_unsignedIT_EE5valueES9_lE4typeEE4typeES9_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero60perfetto_pbzero_enum_ChromeCompositorStateMachine_MajorState19BeginImplFrameStateEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero60perfetto_pbzero_enum_ChromeCompositorStateMachine_MajorState19BeginMainFrameStateEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero60perfetto_pbzero_enum_ChromeCompositorStateMachine_MajorState23LayerTreeFrameSinkStateEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero60perfetto_pbzero_enum_ChromeCompositorStateMachine_MajorState26ForcedRedrawOnTimeoutStateEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero51perfetto_pbzero_enum_ChromeCompositorSchedulerState26BeginImplFrameDeadlineModeEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero31perfetto_pbzero_enum_LogMessage8PriorityEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero38perfetto_pbzero_enum_ProcessDescriptor17ChromeProcessTypeEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
Unexecuted instantiation: _ZN9protozero11proto_utils33ExtendValueForVarIntSerializationIN8perfetto6protos6pbzero36perfetto_pbzero_enum_TrackDescriptor19ChildTracksOrderingEEENSt3__113make_unsignedINS7_11conditionalIXsr3std11is_unsignedIT_EE5valueESA_lE4typeEE4typeESA_
207
208
template <typename T>
209
6.40M
inline uint8_t* WriteVarInt(T value, uint8_t* target) {
210
6.40M
  auto unsigned_value = ExtendValueForVarIntSerialization(value);
211
212
19.9M
  while (unsigned_value >= 0x80) {
213
13.5M
    *target++ = static_cast<uint8_t>(unsigned_value) | 0x80;
214
13.5M
    unsigned_value >>= 7;
215
13.5M
  }
216
6.40M
  *target = static_cast<uint8_t>(unsigned_value);
217
6.40M
  return target + 1;
218
6.40M
}
unsigned char* protozero::proto_utils::WriteVarInt<unsigned int>(unsigned int, unsigned char*)
Line
Count
Source
209
5.98M
inline uint8_t* WriteVarInt(T value, uint8_t* target) {
210
5.98M
  auto unsigned_value = ExtendValueForVarIntSerialization(value);
211
212
19.2M
  while (unsigned_value >= 0x80) {
213
13.2M
    *target++ = static_cast<uint8_t>(unsigned_value) | 0x80;
214
13.2M
    unsigned_value >>= 7;
215
13.2M
  }
216
5.98M
  *target = static_cast<uint8_t>(unsigned_value);
217
5.98M
  return target + 1;
218
5.98M
}
unsigned char* protozero::proto_utils::WriteVarInt<unsigned long>(unsigned long, unsigned char*)
Line
Count
Source
209
376k
inline uint8_t* WriteVarInt(T value, uint8_t* target) {
210
376k
  auto unsigned_value = ExtendValueForVarIntSerialization(value);
211
212
513k
  while (unsigned_value >= 0x80) {
213
137k
    *target++ = static_cast<uint8_t>(unsigned_value) | 0x80;
214
137k
    unsigned_value >>= 7;
215
137k
  }
216
376k
  *target = static_cast<uint8_t>(unsigned_value);
217
376k
  return target + 1;
218
376k
}
unsigned char* protozero::proto_utils::WriteVarInt<int>(int, unsigned char*)
Line
Count
Source
209
26.7k
inline uint8_t* WriteVarInt(T value, uint8_t* target) {
210
26.7k
  auto unsigned_value = ExtendValueForVarIntSerialization(value);
211
212
149k
  while (unsigned_value >= 0x80) {
213
122k
    *target++ = static_cast<uint8_t>(unsigned_value) | 0x80;
214
122k
    unsigned_value >>= 7;
215
122k
  }
216
26.7k
  *target = static_cast<uint8_t>(unsigned_value);
217
26.7k
  return target + 1;
218
26.7k
}
unsigned char* protozero::proto_utils::WriteVarInt<long>(long, unsigned char*)
Line
Count
Source
209
8.93k
inline uint8_t* WriteVarInt(T value, uint8_t* target) {
210
8.93k
  auto unsigned_value = ExtendValueForVarIntSerialization(value);
211
212
38.1k
  while (unsigned_value >= 0x80) {
213
29.1k
    *target++ = static_cast<uint8_t>(unsigned_value) | 0x80;
214
29.1k
    unsigned_value >>= 7;
215
29.1k
  }
216
8.93k
  *target = static_cast<uint8_t>(unsigned_value);
217
8.93k
  return target + 1;
218
8.93k
}
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::FtraceClock>(perfetto::protos::pbzero::FtraceClock, unsigned char*)
unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::FtraceParseStatus>(perfetto::protos::pbzero::FtraceParseStatus, unsigned char*)
Line
Count
Source
209
1.09k
inline uint8_t* WriteVarInt(T value, uint8_t* target) {
210
1.09k
  auto unsigned_value = ExtendValueForVarIntSerialization(value);
211
212
1.09k
  while (unsigned_value >= 0x80) {
213
0
    *target++ = static_cast<uint8_t>(unsigned_value) | 0x80;
214
0
    unsigned_value >>= 7;
215
0
  }
216
1.09k
  *target = static_cast<uint8_t>(unsigned_value);
217
1.09k
  return target + 1;
218
1.09k
}
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_KprobeEvent::KprobeType>(perfetto::protos::pbzero::perfetto_pbzero_enum_KprobeEvent::KprobeType, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_FtraceStats::Phase>(perfetto::protos::pbzero::perfetto_pbzero_enum_FtraceStats::Phase, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<unsigned char>(unsigned char, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<unsigned short>(unsigned short, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<signed char>(signed char, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<short>(short, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_InodeFileMap_Entry::Type>(perfetto::protos::pbzero::perfetto_pbzero_enum_InodeFileMap_Entry::Type, unsigned char*)
unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::BuiltinClock>(perfetto::protos::pbzero::BuiltinClock, unsigned char*)
Line
Count
Source
209
908
inline uint8_t* WriteVarInt(T value, uint8_t* target) {
210
908
  auto unsigned_value = ExtendValueForVarIntSerialization(value);
211
212
908
  while (unsigned_value >= 0x80) {
213
0
    *target++ = static_cast<uint8_t>(unsigned_value) | 0x80;
214
0
    unsigned_value >>= 7;
215
0
  }
216
908
  *target = static_cast<uint8_t>(unsigned_value);
217
908
  return target + 1;
218
908
}
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_TraceStats::FinalFlushOutcome>(perfetto::protos::pbzero::perfetto_pbzero_enum_TraceStats::FinalFlushOutcome, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_TraceConfig::LockdownModeOperation>(perfetto::protos::pbzero::perfetto_pbzero_enum_TraceConfig::LockdownModeOperation, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_TraceConfig::CompressionType>(perfetto::protos::pbzero::perfetto_pbzero_enum_TraceConfig::CompressionType, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_TraceConfig::StatsdLogging>(perfetto::protos::pbzero::perfetto_pbzero_enum_TraceConfig::StatsdLogging, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_TraceConfig_TraceFilter::StringFilterPolicy>(perfetto::protos::pbzero::perfetto_pbzero_enum_TraceConfig_TraceFilter::StringFilterPolicy, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_TraceConfig_TriggerConfig::TriggerMode>(perfetto::protos::pbzero::perfetto_pbzero_enum_TraceConfig_TriggerConfig::TriggerMode, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_TraceConfig_BufferConfig::FillPolicy>(perfetto::protos::pbzero::perfetto_pbzero_enum_TraceConfig_BufferConfig::FillPolicy, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_SysStats_PsiSample::PsiResource>(perfetto::protos::pbzero::perfetto_pbzero_enum_SysStats_PsiSample::PsiResource, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::VmstatCounters>(perfetto::protos::pbzero::VmstatCounters, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::MeminfoCounters>(perfetto::protos::pbzero::MeminfoCounters, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_KernelWakelockData_Wakelock::Type>(perfetto::protos::pbzero::perfetto_pbzero_enum_KernelWakelockData_Wakelock::Type, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::AndroidLogId>(perfetto::protos::pbzero::AndroidLogId, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::AndroidLogPriority>(perfetto::protos::pbzero::AndroidLogPriority, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_AndroidPowerConfig::BatteryCounters>(perfetto::protos::pbzero::perfetto_pbzero_enum_AndroidPowerConfig::BatteryCounters, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_ProcessStatsConfig::Quirks>(perfetto::protos::pbzero::perfetto_pbzero_enum_ProcessStatsConfig::Quirks, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::AtomId>(perfetto::protos::pbzero::AtomId, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_SysStatsConfig::StatCounters>(perfetto::protos::pbzero::perfetto_pbzero_enum_SysStatsConfig::StatCounters, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_Profiling::CpuMode>(perfetto::protos::pbzero::perfetto_pbzero_enum_Profiling::CpuMode, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_Profiling::StackUnwindError>(perfetto::protos::pbzero::perfetto_pbzero_enum_Profiling::StackUnwindError, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_PerfSample::SampleSkipReason>(perfetto::protos::pbzero::perfetto_pbzero_enum_PerfSample::SampleSkipReason, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_PerfSample_ProducerEvent::DataSourceStopReason>(perfetto::protos::pbzero::perfetto_pbzero_enum_PerfSample_ProducerEvent::DataSourceStopReason, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_ProfilePacket_ProcessHeapSamples::ClientError>(perfetto::protos::pbzero::perfetto_pbzero_enum_ProfilePacket_ProcessHeapSamples::ClientError, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_ThreadDescriptor::ChromeThreadType>(perfetto::protos::pbzero::perfetto_pbzero_enum_ThreadDescriptor::ChromeThreadType, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_TrackEvent::Type>(perfetto::protos::pbzero::perfetto_pbzero_enum_TrackEvent::Type, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_TrackEvent_LegacyEvent::FlowDirection>(perfetto::protos::pbzero::perfetto_pbzero_enum_TrackEvent_LegacyEvent::FlowDirection, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_TrackEvent_LegacyEvent::InstantEventScope>(perfetto::protos::pbzero::perfetto_pbzero_enum_TrackEvent_LegacyEvent::InstantEventScope, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_DebugAnnotation_NestedValue::NestedType>(perfetto::protos::pbzero::perfetto_pbzero_enum_DebugAnnotation_NestedValue::NestedType, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_FieldDescriptorProto::Label>(perfetto::protos::pbzero::perfetto_pbzero_enum_FieldDescriptorProto::Label, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_FieldDescriptorProto::Type>(perfetto::protos::pbzero::perfetto_pbzero_enum_FieldDescriptorProto::Type, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_ResetTraceProcessorArgs::DropTrackEventDataBefore>(perfetto::protos::pbzero::perfetto_pbzero_enum_ResetTraceProcessorArgs::DropTrackEventDataBefore, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_ResetTraceProcessorArgs::ParsingMode>(perfetto::protos::pbzero::perfetto_pbzero_enum_ResetTraceProcessorArgs::ParsingMode, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::MetatraceCategories>(perfetto::protos::pbzero::MetatraceCategories, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_ComputeMetricArgs::ResultFormat>(perfetto::protos::pbzero::perfetto_pbzero_enum_ComputeMetricArgs::ResultFormat, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_TraceProcessorRpc::TraceProcessorMethod>(perfetto::protos::pbzero::perfetto_pbzero_enum_TraceProcessorRpc::TraceProcessorMethod, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_ChromeLegacyIpc::MessageClass>(perfetto::protos::pbzero::perfetto_pbzero_enum_ChromeLegacyIpc::MessageClass, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_ChromeProcessDescriptor::ProcessType>(perfetto::protos::pbzero::perfetto_pbzero_enum_ChromeProcessDescriptor::ProcessType, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_ChromeThreadDescriptor::ThreadType>(perfetto::protos::pbzero::perfetto_pbzero_enum_ChromeThreadDescriptor::ThreadType, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_MemoryTrackerSnapshot::LevelOfDetail>(perfetto::protos::pbzero::perfetto_pbzero_enum_MemoryTrackerSnapshot::LevelOfDetail, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry::Units>(perfetto::protos::pbzero::perfetto_pbzero_enum_MemoryTrackerSnapshot_ProcessSnapshot_MemoryNode_MemoryNodeEntry::Units, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_BackgroundTracingMetadata_TriggerRule::TriggerType>(perfetto::protos::pbzero::perfetto_pbzero_enum_BackgroundTracingMetadata_TriggerRule::TriggerType, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_BackgroundTracingMetadata_TriggerRule_NamedRule::EventType>(perfetto::protos::pbzero::perfetto_pbzero_enum_BackgroundTracingMetadata_TriggerRule_NamedRule::EventType, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::TrafficDirection>(perfetto::protos::pbzero::TrafficDirection, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_PerfEvents::Counter>(perfetto::protos::pbzero::perfetto_pbzero_enum_PerfEvents::Counter, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_PerfEvents::PerfClock>(perfetto::protos::pbzero::perfetto_pbzero_enum_PerfEvents::PerfClock, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_ChromeLegacyJsonTrace::TraceType>(perfetto::protos::pbzero::perfetto_pbzero_enum_ChromeLegacyJsonTrace::TraceType, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_ChromeTracedValue::NestedType>(perfetto::protos::pbzero::perfetto_pbzero_enum_ChromeTracedValue::NestedType, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_CounterDescriptor::BuiltinCounterType>(perfetto::protos::pbzero::perfetto_pbzero_enum_CounterDescriptor::BuiltinCounterType, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_CounterDescriptor::Unit>(perfetto::protos::pbzero::perfetto_pbzero_enum_CounterDescriptor::Unit, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_BeginImplFrameArgs::State>(perfetto::protos::pbzero::perfetto_pbzero_enum_BeginImplFrameArgs::State, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_BeginFrameArgs::BeginFrameArgsType>(perfetto::protos::pbzero::perfetto_pbzero_enum_BeginFrameArgs::BeginFrameArgsType, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_ChromeCompositorStateMachine_MinorState::TreePriority>(perfetto::protos::pbzero::perfetto_pbzero_enum_ChromeCompositorStateMachine_MinorState::TreePriority, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_ChromeCompositorStateMachine_MinorState::ScrollHandlerState>(perfetto::protos::pbzero::perfetto_pbzero_enum_ChromeCompositorStateMachine_MinorState::ScrollHandlerState, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::ChromeCompositorSchedulerAction>(perfetto::protos::pbzero::ChromeCompositorSchedulerAction, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_ChromeCompositorStateMachine_MajorState::BeginImplFrameState>(perfetto::protos::pbzero::perfetto_pbzero_enum_ChromeCompositorStateMachine_MajorState::BeginImplFrameState, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_ChromeCompositorStateMachine_MajorState::BeginMainFrameState>(perfetto::protos::pbzero::perfetto_pbzero_enum_ChromeCompositorStateMachine_MajorState::BeginMainFrameState, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_ChromeCompositorStateMachine_MajorState::LayerTreeFrameSinkState>(perfetto::protos::pbzero::perfetto_pbzero_enum_ChromeCompositorStateMachine_MajorState::LayerTreeFrameSinkState, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_ChromeCompositorStateMachine_MajorState::ForcedRedrawOnTimeoutState>(perfetto::protos::pbzero::perfetto_pbzero_enum_ChromeCompositorStateMachine_MajorState::ForcedRedrawOnTimeoutState, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_ChromeCompositorSchedulerState::BeginImplFrameDeadlineMode>(perfetto::protos::pbzero::perfetto_pbzero_enum_ChromeCompositorSchedulerState::BeginImplFrameDeadlineMode, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_LogMessage::Priority>(perfetto::protos::pbzero::perfetto_pbzero_enum_LogMessage::Priority, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_ProcessDescriptor::ChromeProcessType>(perfetto::protos::pbzero::perfetto_pbzero_enum_ProcessDescriptor::ChromeProcessType, unsigned char*)
Unexecuted instantiation: unsigned char* protozero::proto_utils::WriteVarInt<perfetto::protos::pbzero::perfetto_pbzero_enum_TrackDescriptor::ChildTracksOrdering>(perfetto::protos::pbzero::perfetto_pbzero_enum_TrackDescriptor::ChildTracksOrdering, unsigned char*)
219
220
// Writes a fixed-size redundant encoding of the given |value|. This is
221
// used to backfill fixed-size reservations for the length field using a
222
// non-canonical varint encoding (e.g. \x81\x80\x80\x00 instead of \x01).
223
// See https://github.com/google/protobuf/issues/1530.
224
// This is used mainly in two cases:
225
// 1) At trace writing time, when starting a nested messages. The size of a
226
//    nested message is not known until all its field have been written.
227
//    |kMessageLengthFieldSize| bytes are reserved to encode the size field and
228
//    backfilled at the end.
229
// 2) When rewriting a message at trace filtering time, in protozero/filtering.
230
//    At that point we know only the upper bound of the length (a filtered
231
//    message is <= the original one) and we backfill after the message has been
232
//    filtered.
233
inline void WriteRedundantVarInt(uint32_t value,
234
                                 uint8_t* buf,
235
60.5k
                                 size_t size = kMessageLengthFieldSize) {
236
272k
  for (size_t i = 0; i < size; ++i) {
237
211k
    const uint8_t msb = (i < size - 1) ? 0x80 : 0;
238
211k
    buf[i] = static_cast<uint8_t>(value) | msb;
239
211k
    value >>= 7;
240
211k
  }
241
60.5k
}
242
243
template <uint32_t field_id>
244
void StaticAssertSingleBytePreamble() {
245
  static_assert(field_id < 16,
246
                "Proto field id too big to fit in a single byte preamble");
247
}
248
249
// Parses a VarInt from the encoded buffer [start, end). |end| is STL-style and
250
// points one byte past the end of buffer.
251
// The parsed int value is stored in the output arg |value|. Returns a pointer
252
// to the next unconsumed byte (so start < retval <= end) or |start| if the
253
// VarInt could not be fully parsed because there was not enough space in the
254
// buffer.
255
inline const uint8_t* ParseVarInt(const uint8_t* start,
256
                                  const uint8_t* end,
257
203M
                                  uint64_t* out_value) {
258
203M
  return PerfettoPbParseVarInt(start, end, out_value);
259
203M
}
260
261
enum class RepetitionType {
262
  kNotRepeated,
263
  kRepeatedPacked,
264
  kRepeatedNotPacked,
265
};
266
267
// Provide a common base struct for all templated FieldMetadata types to allow
268
// simple checks if a given type is a FieldMetadata or not.
269
struct FieldMetadataBase {
270
  constexpr FieldMetadataBase() = default;
271
};
272
273
template <uint32_t field_id,
274
          RepetitionType repetition_type,
275
          ProtoSchemaType proto_schema_type,
276
          typename CppFieldType,
277
          typename MessageType>
278
struct FieldMetadata : public FieldMetadataBase {
279
  constexpr FieldMetadata() = default;
280
281
  static constexpr int kFieldId = field_id;
282
  // Whether this field is repeated, packed (repeated [packed-true]) or not
283
  // (optional).
284
  static constexpr RepetitionType kRepetitionType = repetition_type;
285
  // Proto type of this field (e.g. int64, fixed32 or nested message).
286
  static constexpr ProtoSchemaType kProtoFieldType = proto_schema_type;
287
  // C++ type of this field (for nested messages - C++ protozero class).
288
  using cpp_field_type = CppFieldType;
289
  // Protozero message which this field belongs to.
290
  using message_type = MessageType;
291
};
292
293
}  // namespace proto_utils
294
}  // namespace protozero
295
296
#endif  // INCLUDE_PERFETTO_PROTOZERO_PROTO_UTILS_H_