Enumerations

enum ProtoWireType
Name Value
kVarInt 0
kFixed64 1
kLengthDelimited 2
kFixed32 5

See https://developers.google.com/protocol-buffers/docs/encoding wire types.

This is a type encoded into the proto that provides just enough info to

find the length of the following value.

Defined at line 43 of file ../../third_party/perfetto/include/perfetto/protozero/proto_utils.h

enum ProtoSchemaType
Name Value
kUnknown 0
kDouble 1
kFloat 2
kInt64 3
kUint64 4
kInt32 5
kFixed64 6
kFixed32 7
kBool 8
kString 9
kGroup 10
kMessage 11
kBytes 12
kUint32 13
kEnum 14
kSfixed32 15
kSfixed64 16
kSint32 17
kSint64 18

This is the type defined in the proto for each field. This information

is used to decide the translation strategy when writing the trace.

Defined at line 52 of file ../../third_party/perfetto/include/perfetto/protozero/proto_utils.h

enum RepetitionType
Name Value
kNotRepeated 0
kRepeatedPacked 1
kRepeatedNotPacked 2

Defined at line 276 of file ../../third_party/perfetto/include/perfetto/protozero/proto_utils.h

Records

Functions

  • const char * ProtoSchemaToString (ProtoSchemaType v)

    Defined at line 74 of file ../../third_party/perfetto/include/perfetto/protozero/proto_utils.h

  • uint64_t GetTagFieldId (uint64_t tag)

    Defined at line 133 of file ../../third_party/perfetto/include/perfetto/protozero/proto_utils.h

  • uint64_t GetTagFieldType (uint64_t tag)

    Defined at line 139 of file ../../third_party/perfetto/include/perfetto/protozero/proto_utils.h

  • uint32_t MakeTagVarInt (uint32_t field_id)

    Proto types: (int|uint|sint)(32|64), bool, enum.

    Defined at line 147 of file ../../third_party/perfetto/include/perfetto/protozero/proto_utils.h

  • template <typename T>
    uint32_t MakeTagFixed (uint32_t field_id)

    Proto types: fixed64, sfixed64, fixed32, sfixed32, double, float.

    Defined at line 153 of file ../../third_party/perfetto/include/perfetto/protozero/proto_utils.h

  • uint32_t MakeTagLengthDelimited (uint32_t field_id)

    Proto types: string, bytes, embedded messages.

    Defined at line 161 of file ../../third_party/perfetto/include/perfetto/protozero/proto_utils.h

  • template <typename T>
    typename std::make_unsigned<T>::type ZigZagEncode (T value)

    Proto types: sint64, sint32.

    Defined at line 168 of file ../../third_party/perfetto/include/perfetto/protozero/proto_utils.h

  • template <typename T>
    typename std::make_signed<T>::type ZigZagDecode (T value)

    Proto types: sint64, sint32.

    Defined at line 189 of file ../../third_party/perfetto/include/perfetto/protozero/proto_utils.h

  • template <typename T>
    typename std::make_unsigned<typename std::conditional<std::is_unsigned<T>::value, T, int64_t>::type>::type ExtendValueForVarIntSerialization (T value)

    Defined at line 198 of file ../../third_party/perfetto/include/perfetto/protozero/proto_utils.h

  • template <typename T>
    uint8_t * WriteVarInt (T value, uint8_t * target)

    Defined at line 224 of file ../../third_party/perfetto/include/perfetto/protozero/proto_utils.h

  • void WriteRedundantVarInt (uint32_t value, uint8_t * buf, size_t size)

    Writes a fixed-size redundant encoding of the given |value|. This is

    used to backfill fixed-size reservations for the length field using a

    non-canonical varint encoding (e.g.

    instead of

    ).

    See https://github.com/google/protobuf/issues/1530.

    This is used mainly in two cases:

    1) At trace writing time, when starting a nested messages. The size of a

    nested message is not known until all its field have been written.

    |kMessageLengthFieldSize| bytes are reserved to encode the size field and

    backfilled at the end.

    2) When rewriting a message at trace filtering time, in protozero/filtering.

    At that point we know only the upper bound of the length (a filtered

    message is

    <

    = the original one) and we backfill after the message has been

    filtered.

    Defined at line 248 of file ../../third_party/perfetto/include/perfetto/protozero/proto_utils.h

  • template <uint32_t field_id>
    void StaticAssertSingleBytePreamble ()

    Defined at line 259 of file ../../third_party/perfetto/include/perfetto/protozero/proto_utils.h

  • const uint8_t * ParseVarInt (const uint8_t * startconst uint8_t * enduint64_t * out_value)

    Parses a VarInt from the encoded buffer [start, end). |end| is STL-style and

    points one byte past the end of buffer.

    The parsed int value is stored in the output arg |value|. Returns a pointer

    to the next unconsumed byte (so start

    <

    retval

    <

    = end) or |start| if the

    VarInt could not be fully parsed because there was not enough space in the

    buffer.

    Defined at line 270 of file ../../third_party/perfetto/include/perfetto/protozero/proto_utils.h