blob: 7d0c13d6923c45bc8a074776ba80110f879ded9c [file] [log] [blame]
// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PROFILING_HEAP_GRAPH_PROTO_H_
#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PROFILING_HEAP_GRAPH_PROTO_H_
#include <stddef.h>
#include <stdint.h>
#include "perfetto/protozero/field_writer.h"
#include "perfetto/protozero/message.h"
#include "perfetto/protozero/packed_repeated_fields.h"
#include "perfetto/protozero/proto_decoder.h"
#include "perfetto/protozero/proto_utils.h"
#include "protos/perfetto/trace/profiling/deobfuscation.pbzero.h"
namespace perfetto {
namespace protos {
namespace pbzero {
class HeapGraphObject;
class HeapGraphRoot;
class HeapGraphType;
class InternedString;
enum HeapGraphRoot_Type : int32_t;
enum HeapGraphType_Kind : int32_t;
enum HeapGraphType_Kind : int32_t {
HeapGraphType_Kind_KIND_UNKNOWN = 0,
HeapGraphType_Kind_KIND_NORMAL = 1,
HeapGraphType_Kind_KIND_NOREFERENCES = 2,
HeapGraphType_Kind_KIND_STRING = 3,
HeapGraphType_Kind_KIND_ARRAY = 4,
HeapGraphType_Kind_KIND_CLASS = 5,
HeapGraphType_Kind_KIND_CLASSLOADER = 6,
HeapGraphType_Kind_KIND_DEXCACHE = 7,
HeapGraphType_Kind_KIND_SOFT_REFERENCE = 8,
HeapGraphType_Kind_KIND_WEAK_REFERENCE = 9,
HeapGraphType_Kind_KIND_FINALIZER_REFERENCE = 10,
HeapGraphType_Kind_KIND_PHANTOM_REFERENCE = 11,
};
const HeapGraphType_Kind HeapGraphType_Kind_MIN = HeapGraphType_Kind_KIND_UNKNOWN;
const HeapGraphType_Kind HeapGraphType_Kind_MAX = HeapGraphType_Kind_KIND_PHANTOM_REFERENCE;
enum HeapGraphRoot_Type : int32_t {
HeapGraphRoot_Type_ROOT_UNKNOWN = 0,
HeapGraphRoot_Type_ROOT_JNI_GLOBAL = 1,
HeapGraphRoot_Type_ROOT_JNI_LOCAL = 2,
HeapGraphRoot_Type_ROOT_JAVA_FRAME = 3,
HeapGraphRoot_Type_ROOT_NATIVE_STACK = 4,
HeapGraphRoot_Type_ROOT_STICKY_CLASS = 5,
HeapGraphRoot_Type_ROOT_THREAD_BLOCK = 6,
HeapGraphRoot_Type_ROOT_MONITOR_USED = 7,
HeapGraphRoot_Type_ROOT_THREAD_OBJECT = 8,
HeapGraphRoot_Type_ROOT_INTERNED_STRING = 9,
HeapGraphRoot_Type_ROOT_FINALIZING = 10,
HeapGraphRoot_Type_ROOT_DEBUGGER = 11,
HeapGraphRoot_Type_ROOT_REFERENCE_CLEANUP = 12,
HeapGraphRoot_Type_ROOT_VM_INTERNAL = 13,
HeapGraphRoot_Type_ROOT_JNI_MONITOR = 14,
};
const HeapGraphRoot_Type HeapGraphRoot_Type_MIN = HeapGraphRoot_Type_ROOT_UNKNOWN;
const HeapGraphRoot_Type HeapGraphRoot_Type_MAX = HeapGraphRoot_Type_ROOT_JNI_MONITOR;
class HeapGraph_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/9, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
public:
HeapGraph_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
explicit HeapGraph_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
explicit HeapGraph_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
bool has_pid() const { return at<1>().valid(); }
int32_t pid() const { return at<1>().as_int32(); }
bool has_objects() const { return at<2>().valid(); }
::protozero::RepeatedFieldIterator<::protozero::ConstBytes> objects() const { return GetRepeated<::protozero::ConstBytes>(2); }
bool has_roots() const { return at<7>().valid(); }
::protozero::RepeatedFieldIterator<::protozero::ConstBytes> roots() const { return GetRepeated<::protozero::ConstBytes>(7); }
bool has_types() const { return at<9>().valid(); }
::protozero::RepeatedFieldIterator<::protozero::ConstBytes> types() const { return GetRepeated<::protozero::ConstBytes>(9); }
bool has_field_names() const { return at<4>().valid(); }
::protozero::RepeatedFieldIterator<::protozero::ConstBytes> field_names() const { return GetRepeated<::protozero::ConstBytes>(4); }
bool has_location_names() const { return at<8>().valid(); }
::protozero::RepeatedFieldIterator<::protozero::ConstBytes> location_names() const { return GetRepeated<::protozero::ConstBytes>(8); }
bool has_continued() const { return at<5>().valid(); }
bool continued() const { return at<5>().as_bool(); }
bool has_index() const { return at<6>().valid(); }
uint64_t index() const { return at<6>().as_uint64(); }
};
class HeapGraph : public ::protozero::Message {
public:
using Decoder = HeapGraph_Decoder;
enum : int32_t {
kPidFieldNumber = 1,
kObjectsFieldNumber = 2,
kRootsFieldNumber = 7,
kTypesFieldNumber = 9,
kFieldNamesFieldNumber = 4,
kLocationNamesFieldNumber = 8,
kContinuedFieldNumber = 5,
kIndexFieldNumber = 6,
};
using FieldMetadata_Pid =
::protozero::proto_utils::FieldMetadata<
1,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kInt32,
int32_t,
HeapGraph>;
// Ceci n'est pas une pipe.
// This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
// type (and users are expected to use it as such, hence kCamelCase name).
// It is declared as a function to keep protozero bindings header-only as
// inline constexpr variables are not available until C++17 (while inline
// functions are).
// TODO(altimin): Use inline variable instead after adopting C++17.
static constexpr FieldMetadata_Pid kPid() { return {}; }
void set_pid(int32_t value) {
static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
// Call the appropriate protozero::Message::Append(field_id, ...)
// method based on the type of the field.
::protozero::internal::FieldWriter<
::protozero::proto_utils::ProtoSchemaType::kInt32>
::Append(*this, field_id, value);
}
using FieldMetadata_Objects =
::protozero::proto_utils::FieldMetadata<
2,
::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
::protozero::proto_utils::ProtoSchemaType::kMessage,
HeapGraphObject,
HeapGraph>;
// Ceci n'est pas une pipe.
// This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
// type (and users are expected to use it as such, hence kCamelCase name).
// It is declared as a function to keep protozero bindings header-only as
// inline constexpr variables are not available until C++17 (while inline
// functions are).
// TODO(altimin): Use inline variable instead after adopting C++17.
static constexpr FieldMetadata_Objects kObjects() { return {}; }
template <typename T = HeapGraphObject> T* add_objects() {
return BeginNestedMessage<T>(2);
}
using FieldMetadata_Roots =
::protozero::proto_utils::FieldMetadata<
7,
::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
::protozero::proto_utils::ProtoSchemaType::kMessage,
HeapGraphRoot,
HeapGraph>;
// Ceci n'est pas une pipe.
// This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
// type (and users are expected to use it as such, hence kCamelCase name).
// It is declared as a function to keep protozero bindings header-only as
// inline constexpr variables are not available until C++17 (while inline
// functions are).
// TODO(altimin): Use inline variable instead after adopting C++17.
static constexpr FieldMetadata_Roots kRoots() { return {}; }
template <typename T = HeapGraphRoot> T* add_roots() {
return BeginNestedMessage<T>(7);
}
using FieldMetadata_Types =
::protozero::proto_utils::FieldMetadata<
9,
::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
::protozero::proto_utils::ProtoSchemaType::kMessage,
HeapGraphType,
HeapGraph>;
// Ceci n'est pas une pipe.
// This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
// type (and users are expected to use it as such, hence kCamelCase name).
// It is declared as a function to keep protozero bindings header-only as
// inline constexpr variables are not available until C++17 (while inline
// functions are).
// TODO(altimin): Use inline variable instead after adopting C++17.
static constexpr FieldMetadata_Types kTypes() { return {}; }
template <typename T = HeapGraphType> T* add_types() {
return BeginNestedMessage<T>(9);
}
using FieldMetadata_FieldNames =
::protozero::proto_utils::FieldMetadata<
4,
::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
::protozero::proto_utils::ProtoSchemaType::kMessage,
InternedString,
HeapGraph>;
// Ceci n'est pas une pipe.
// This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
// type (and users are expected to use it as such, hence kCamelCase name).
// It is declared as a function to keep protozero bindings header-only as
// inline constexpr variables are not available until C++17 (while inline
// functions are).
// TODO(altimin): Use inline variable instead after adopting C++17.
static constexpr FieldMetadata_FieldNames kFieldNames() { return {}; }
template <typename T = InternedString> T* add_field_names() {
return BeginNestedMessage<T>(4);
}
using FieldMetadata_LocationNames =
::protozero::proto_utils::FieldMetadata<
8,
::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
::protozero::proto_utils::ProtoSchemaType::kMessage,
InternedString,
HeapGraph>;
// Ceci n'est pas une pipe.
// This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
// type (and users are expected to use it as such, hence kCamelCase name).
// It is declared as a function to keep protozero bindings header-only as
// inline constexpr variables are not available until C++17 (while inline
// functions are).
// TODO(altimin): Use inline variable instead after adopting C++17.
static constexpr FieldMetadata_LocationNames kLocationNames() { return {}; }
template <typename T = InternedString> T* add_location_names() {
return BeginNestedMessage<T>(8);
}
using FieldMetadata_Continued =
::protozero::proto_utils::FieldMetadata<
5,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kBool,
bool,
HeapGraph>;
// Ceci n'est pas une pipe.
// This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
// type (and users are expected to use it as such, hence kCamelCase name).
// It is declared as a function to keep protozero bindings header-only as
// inline constexpr variables are not available until C++17 (while inline
// functions are).
// TODO(altimin): Use inline variable instead after adopting C++17.
static constexpr FieldMetadata_Continued kContinued() { return {}; }
void set_continued(bool value) {
static constexpr uint32_t field_id = FieldMetadata_Continued::kFieldId;
// Call the appropriate protozero::Message::Append(field_id, ...)
// method based on the type of the field.
::protozero::internal::FieldWriter<
::protozero::proto_utils::ProtoSchemaType::kBool>
::Append(*this, field_id, value);
}
using FieldMetadata_Index =
::protozero::proto_utils::FieldMetadata<
6,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kUint64,
uint64_t,
HeapGraph>;
// Ceci n'est pas une pipe.
// This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
// type (and users are expected to use it as such, hence kCamelCase name).
// It is declared as a function to keep protozero bindings header-only as
// inline constexpr variables are not available until C++17 (while inline
// functions are).
// TODO(altimin): Use inline variable instead after adopting C++17.
static constexpr FieldMetadata_Index kIndex() { return {}; }
void set_index(uint64_t value) {
static constexpr uint32_t field_id = FieldMetadata_Index::kFieldId;
// Call the appropriate protozero::Message::Append(field_id, ...)
// method based on the type of the field.
::protozero::internal::FieldWriter<
::protozero::proto_utils::ProtoSchemaType::kUint64>
::Append(*this, field_id, value);
}
};
class HeapGraphObject_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/7, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
public:
HeapGraphObject_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
explicit HeapGraphObject_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
explicit HeapGraphObject_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
bool has_id() const { return at<1>().valid(); }
uint64_t id() const { return at<1>().as_uint64(); }
bool has_id_delta() const { return at<7>().valid(); }
uint64_t id_delta() const { return at<7>().as_uint64(); }
bool has_type_id() const { return at<2>().valid(); }
uint64_t type_id() const { return at<2>().as_uint64(); }
bool has_self_size() const { return at<3>().valid(); }
uint64_t self_size() const { return at<3>().as_uint64(); }
bool has_reference_field_id_base() const { return at<6>().valid(); }
uint64_t reference_field_id_base() const { return at<6>().as_uint64(); }
bool has_reference_field_id() const { return at<4>().valid(); }
::protozero::PackedRepeatedFieldIterator<::protozero::proto_utils::ProtoWireType::kVarInt, uint64_t> reference_field_id(bool* parse_error_ptr) const { return GetPackedRepeated<::protozero::proto_utils::ProtoWireType::kVarInt, uint64_t>(4, parse_error_ptr); }
bool has_reference_object_id() const { return at<5>().valid(); }
::protozero::PackedRepeatedFieldIterator<::protozero::proto_utils::ProtoWireType::kVarInt, uint64_t> reference_object_id(bool* parse_error_ptr) const { return GetPackedRepeated<::protozero::proto_utils::ProtoWireType::kVarInt, uint64_t>(5, parse_error_ptr); }
};
class HeapGraphObject : public ::protozero::Message {
public:
using Decoder = HeapGraphObject_Decoder;
enum : int32_t {
kIdFieldNumber = 1,
kIdDeltaFieldNumber = 7,
kTypeIdFieldNumber = 2,
kSelfSizeFieldNumber = 3,
kReferenceFieldIdBaseFieldNumber = 6,
kReferenceFieldIdFieldNumber = 4,
kReferenceObjectIdFieldNumber = 5,
};
using FieldMetadata_Id =
::protozero::proto_utils::FieldMetadata<
1,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kUint64,
uint64_t,
HeapGraphObject>;
// Ceci n'est pas une pipe.
// This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
// type (and users are expected to use it as such, hence kCamelCase name).
// It is declared as a function to keep protozero bindings header-only as
// inline constexpr variables are not available until C++17 (while inline
// functions are).
// TODO(altimin): Use inline variable instead after adopting C++17.
static constexpr FieldMetadata_Id kId() { return {}; }
void set_id(uint64_t value) {
static constexpr uint32_t field_id = FieldMetadata_Id::kFieldId;
// Call the appropriate protozero::Message::Append(field_id, ...)
// method based on the type of the field.
::protozero::internal::FieldWriter<
::protozero::proto_utils::ProtoSchemaType::kUint64>
::Append(*this, field_id, value);
}
using FieldMetadata_IdDelta =
::protozero::proto_utils::FieldMetadata<
7,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kUint64,
uint64_t,
HeapGraphObject>;
// Ceci n'est pas une pipe.
// This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
// type (and users are expected to use it as such, hence kCamelCase name).
// It is declared as a function to keep protozero bindings header-only as
// inline constexpr variables are not available until C++17 (while inline
// functions are).
// TODO(altimin): Use inline variable instead after adopting C++17.
static constexpr FieldMetadata_IdDelta kIdDelta() { return {}; }
void set_id_delta(uint64_t value) {
static constexpr uint32_t field_id = FieldMetadata_IdDelta::kFieldId;
// Call the appropriate protozero::Message::Append(field_id, ...)
// method based on the type of the field.
::protozero::internal::FieldWriter<
::protozero::proto_utils::ProtoSchemaType::kUint64>
::Append(*this, field_id, value);
}
using FieldMetadata_TypeId =
::protozero::proto_utils::FieldMetadata<
2,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kUint64,
uint64_t,
HeapGraphObject>;
// Ceci n'est pas une pipe.
// This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
// type (and users are expected to use it as such, hence kCamelCase name).
// It is declared as a function to keep protozero bindings header-only as
// inline constexpr variables are not available until C++17 (while inline
// functions are).
// TODO(altimin): Use inline variable instead after adopting C++17.
static constexpr FieldMetadata_TypeId kTypeId() { return {}; }
void set_type_id(uint64_t value) {
static constexpr uint32_t field_id = FieldMetadata_TypeId::kFieldId;
// Call the appropriate protozero::Message::Append(field_id, ...)
// method based on the type of the field.
::protozero::internal::FieldWriter<
::protozero::proto_utils::ProtoSchemaType::kUint64>
::Append(*this, field_id, value);
}
using FieldMetadata_SelfSize =
::protozero::proto_utils::FieldMetadata<
3,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kUint64,
uint64_t,
HeapGraphObject>;
// Ceci n'est pas une pipe.
// This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
// type (and users are expected to use it as such, hence kCamelCase name).
// It is declared as a function to keep protozero bindings header-only as
// inline constexpr variables are not available until C++17 (while inline
// functions are).
// TODO(altimin): Use inline variable instead after adopting C++17.
static constexpr FieldMetadata_SelfSize kSelfSize() { return {}; }
void set_self_size(uint64_t value) {
static constexpr uint32_t field_id = FieldMetadata_SelfSize::kFieldId;
// Call the appropriate protozero::Message::Append(field_id, ...)
// method based on the type of the field.
::protozero::internal::FieldWriter<
::protozero::proto_utils::ProtoSchemaType::kUint64>
::Append(*this, field_id, value);
}
using FieldMetadata_ReferenceFieldIdBase =
::protozero::proto_utils::FieldMetadata<
6,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kUint64,
uint64_t,
HeapGraphObject>;
// Ceci n'est pas une pipe.
// This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
// type (and users are expected to use it as such, hence kCamelCase name).
// It is declared as a function to keep protozero bindings header-only as
// inline constexpr variables are not available until C++17 (while inline
// functions are).
// TODO(altimin): Use inline variable instead after adopting C++17.
static constexpr FieldMetadata_ReferenceFieldIdBase kReferenceFieldIdBase() { return {}; }
void set_reference_field_id_base(uint64_t value) {
static constexpr uint32_t field_id = FieldMetadata_ReferenceFieldIdBase::kFieldId;
// Call the appropriate protozero::Message::Append(field_id, ...)
// method based on the type of the field.
::protozero::internal::FieldWriter<
::protozero::proto_utils::ProtoSchemaType::kUint64>
::Append(*this, field_id, value);
}
using FieldMetadata_ReferenceFieldId =
::protozero::proto_utils::FieldMetadata<
4,
::protozero::proto_utils::RepetitionType::kRepeatedPacked,
::protozero::proto_utils::ProtoSchemaType::kUint64,
uint64_t,
HeapGraphObject>;
// Ceci n'est pas une pipe.
// This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
// type (and users are expected to use it as such, hence kCamelCase name).
// It is declared as a function to keep protozero bindings header-only as
// inline constexpr variables are not available until C++17 (while inline
// functions are).
// TODO(altimin): Use inline variable instead after adopting C++17.
static constexpr FieldMetadata_ReferenceFieldId kReferenceFieldId() { return {}; }
void set_reference_field_id(const ::protozero::PackedVarInt& packed_buffer) {
AppendBytes(FieldMetadata_ReferenceFieldId::kFieldId, packed_buffer.data(),
packed_buffer.size());
}
using FieldMetadata_ReferenceObjectId =
::protozero::proto_utils::FieldMetadata<
5,
::protozero::proto_utils::RepetitionType::kRepeatedPacked,
::protozero::proto_utils::ProtoSchemaType::kUint64,
uint64_t,
HeapGraphObject>;
// Ceci n'est pas une pipe.
// This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
// type (and users are expected to use it as such, hence kCamelCase name).
// It is declared as a function to keep protozero bindings header-only as
// inline constexpr variables are not available until C++17 (while inline
// functions are).
// TODO(altimin): Use inline variable instead after adopting C++17.
static constexpr FieldMetadata_ReferenceObjectId kReferenceObjectId() { return {}; }
void set_reference_object_id(const ::protozero::PackedVarInt& packed_buffer) {
AppendBytes(FieldMetadata_ReferenceObjectId::kFieldId, packed_buffer.data(),
packed_buffer.size());
}
};
class HeapGraphType_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/8, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
public:
HeapGraphType_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
explicit HeapGraphType_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
explicit HeapGraphType_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
bool has_id() const { return at<1>().valid(); }
uint64_t id() const { return at<1>().as_uint64(); }
bool has_location_id() const { return at<2>().valid(); }
uint64_t location_id() const { return at<2>().as_uint64(); }
bool has_class_name() const { return at<3>().valid(); }
::protozero::ConstChars class_name() const { return at<3>().as_string(); }
bool has_object_size() const { return at<4>().valid(); }
uint64_t object_size() const { return at<4>().as_uint64(); }
bool has_superclass_id() const { return at<5>().valid(); }
uint64_t superclass_id() const { return at<5>().as_uint64(); }
bool has_reference_field_id() const { return at<6>().valid(); }
::protozero::PackedRepeatedFieldIterator<::protozero::proto_utils::ProtoWireType::kVarInt, uint64_t> reference_field_id(bool* parse_error_ptr) const { return GetPackedRepeated<::protozero::proto_utils::ProtoWireType::kVarInt, uint64_t>(6, parse_error_ptr); }
bool has_kind() const { return at<7>().valid(); }
int32_t kind() const { return at<7>().as_int32(); }
bool has_classloader_id() const { return at<8>().valid(); }
uint64_t classloader_id() const { return at<8>().as_uint64(); }
};
class HeapGraphType : public ::protozero::Message {
public:
using Decoder = HeapGraphType_Decoder;
enum : int32_t {
kIdFieldNumber = 1,
kLocationIdFieldNumber = 2,
kClassNameFieldNumber = 3,
kObjectSizeFieldNumber = 4,
kSuperclassIdFieldNumber = 5,
kReferenceFieldIdFieldNumber = 6,
kKindFieldNumber = 7,
kClassloaderIdFieldNumber = 8,
};
using Kind = ::perfetto::protos::pbzero::HeapGraphType_Kind;
static const Kind KIND_UNKNOWN = HeapGraphType_Kind_KIND_UNKNOWN;
static const Kind KIND_NORMAL = HeapGraphType_Kind_KIND_NORMAL;
static const Kind KIND_NOREFERENCES = HeapGraphType_Kind_KIND_NOREFERENCES;
static const Kind KIND_STRING = HeapGraphType_Kind_KIND_STRING;
static const Kind KIND_ARRAY = HeapGraphType_Kind_KIND_ARRAY;
static const Kind KIND_CLASS = HeapGraphType_Kind_KIND_CLASS;
static const Kind KIND_CLASSLOADER = HeapGraphType_Kind_KIND_CLASSLOADER;
static const Kind KIND_DEXCACHE = HeapGraphType_Kind_KIND_DEXCACHE;
static const Kind KIND_SOFT_REFERENCE = HeapGraphType_Kind_KIND_SOFT_REFERENCE;
static const Kind KIND_WEAK_REFERENCE = HeapGraphType_Kind_KIND_WEAK_REFERENCE;
static const Kind KIND_FINALIZER_REFERENCE = HeapGraphType_Kind_KIND_FINALIZER_REFERENCE;
static const Kind KIND_PHANTOM_REFERENCE = HeapGraphType_Kind_KIND_PHANTOM_REFERENCE;
using FieldMetadata_Id =
::protozero::proto_utils::FieldMetadata<
1,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kUint64,
uint64_t,
HeapGraphType>;
// Ceci n'est pas une pipe.
// This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
// type (and users are expected to use it as such, hence kCamelCase name).
// It is declared as a function to keep protozero bindings header-only as
// inline constexpr variables are not available until C++17 (while inline
// functions are).
// TODO(altimin): Use inline variable instead after adopting C++17.
static constexpr FieldMetadata_Id kId() { return {}; }
void set_id(uint64_t value) {
static constexpr uint32_t field_id = FieldMetadata_Id::kFieldId;
// Call the appropriate protozero::Message::Append(field_id, ...)
// method based on the type of the field.
::protozero::internal::FieldWriter<
::protozero::proto_utils::ProtoSchemaType::kUint64>
::Append(*this, field_id, value);
}
using FieldMetadata_LocationId =
::protozero::proto_utils::FieldMetadata<
2,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kUint64,
uint64_t,
HeapGraphType>;
// Ceci n'est pas une pipe.
// This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
// type (and users are expected to use it as such, hence kCamelCase name).
// It is declared as a function to keep protozero bindings header-only as
// inline constexpr variables are not available until C++17 (while inline
// functions are).
// TODO(altimin): Use inline variable instead after adopting C++17.
static constexpr FieldMetadata_LocationId kLocationId() { return {}; }
void set_location_id(uint64_t value) {
static constexpr uint32_t field_id = FieldMetadata_LocationId::kFieldId;
// Call the appropriate protozero::Message::Append(field_id, ...)
// method based on the type of the field.
::protozero::internal::FieldWriter<
::protozero::proto_utils::ProtoSchemaType::kUint64>
::Append(*this, field_id, value);
}
using FieldMetadata_ClassName =
::protozero::proto_utils::FieldMetadata<
3,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kString,
std::string,
HeapGraphType>;
// Ceci n'est pas une pipe.
// This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
// type (and users are expected to use it as such, hence kCamelCase name).
// It is declared as a function to keep protozero bindings header-only as
// inline constexpr variables are not available until C++17 (while inline
// functions are).
// TODO(altimin): Use inline variable instead after adopting C++17.
static constexpr FieldMetadata_ClassName kClassName() { return {}; }
void set_class_name(const char* data, size_t size) {
AppendBytes(FieldMetadata_ClassName::kFieldId, data, size);
}
void set_class_name(std::string value) {
static constexpr uint32_t field_id = FieldMetadata_ClassName::kFieldId;
// Call the appropriate protozero::Message::Append(field_id, ...)
// method based on the type of the field.
::protozero::internal::FieldWriter<
::protozero::proto_utils::ProtoSchemaType::kString>
::Append(*this, field_id, value);
}
using FieldMetadata_ObjectSize =
::protozero::proto_utils::FieldMetadata<
4,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kUint64,
uint64_t,
HeapGraphType>;
// Ceci n'est pas une pipe.
// This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
// type (and users are expected to use it as such, hence kCamelCase name).
// It is declared as a function to keep protozero bindings header-only as
// inline constexpr variables are not available until C++17 (while inline
// functions are).
// TODO(altimin): Use inline variable instead after adopting C++17.
static constexpr FieldMetadata_ObjectSize kObjectSize() { return {}; }
void set_object_size(uint64_t value) {
static constexpr uint32_t field_id = FieldMetadata_ObjectSize::kFieldId;
// Call the appropriate protozero::Message::Append(field_id, ...)
// method based on the type of the field.
::protozero::internal::FieldWriter<
::protozero::proto_utils::ProtoSchemaType::kUint64>
::Append(*this, field_id, value);
}
using FieldMetadata_SuperclassId =
::protozero::proto_utils::FieldMetadata<
5,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kUint64,
uint64_t,
HeapGraphType>;
// Ceci n'est pas une pipe.
// This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
// type (and users are expected to use it as such, hence kCamelCase name).
// It is declared as a function to keep protozero bindings header-only as
// inline constexpr variables are not available until C++17 (while inline
// functions are).
// TODO(altimin): Use inline variable instead after adopting C++17.
static constexpr FieldMetadata_SuperclassId kSuperclassId() { return {}; }
void set_superclass_id(uint64_t value) {
static constexpr uint32_t field_id = FieldMetadata_SuperclassId::kFieldId;
// Call the appropriate protozero::Message::Append(field_id, ...)
// method based on the type of the field.
::protozero::internal::FieldWriter<
::protozero::proto_utils::ProtoSchemaType::kUint64>
::Append(*this, field_id, value);
}
using FieldMetadata_ReferenceFieldId =
::protozero::proto_utils::FieldMetadata<
6,
::protozero::proto_utils::RepetitionType::kRepeatedPacked,
::protozero::proto_utils::ProtoSchemaType::kUint64,
uint64_t,
HeapGraphType>;
// Ceci n'est pas une pipe.
// This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
// type (and users are expected to use it as such, hence kCamelCase name).
// It is declared as a function to keep protozero bindings header-only as
// inline constexpr variables are not available until C++17 (while inline
// functions are).
// TODO(altimin): Use inline variable instead after adopting C++17.
static constexpr FieldMetadata_ReferenceFieldId kReferenceFieldId() { return {}; }
void set_reference_field_id(const ::protozero::PackedVarInt& packed_buffer) {
AppendBytes(FieldMetadata_ReferenceFieldId::kFieldId, packed_buffer.data(),
packed_buffer.size());
}
using FieldMetadata_Kind =
::protozero::proto_utils::FieldMetadata<
7,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kEnum,
::perfetto::protos::pbzero::HeapGraphType_Kind,
HeapGraphType>;
// Ceci n'est pas une pipe.
// This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
// type (and users are expected to use it as such, hence kCamelCase name).
// It is declared as a function to keep protozero bindings header-only as
// inline constexpr variables are not available until C++17 (while inline
// functions are).
// TODO(altimin): Use inline variable instead after adopting C++17.
static constexpr FieldMetadata_Kind kKind() { return {}; }
void set_kind(::perfetto::protos::pbzero::HeapGraphType_Kind value) {
static constexpr uint32_t field_id = FieldMetadata_Kind::kFieldId;
// Call the appropriate protozero::Message::Append(field_id, ...)
// method based on the type of the field.
::protozero::internal::FieldWriter<
::protozero::proto_utils::ProtoSchemaType::kEnum>
::Append(*this, field_id, value);
}
using FieldMetadata_ClassloaderId =
::protozero::proto_utils::FieldMetadata<
8,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kUint64,
uint64_t,
HeapGraphType>;
// Ceci n'est pas une pipe.
// This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
// type (and users are expected to use it as such, hence kCamelCase name).
// It is declared as a function to keep protozero bindings header-only as
// inline constexpr variables are not available until C++17 (while inline
// functions are).
// TODO(altimin): Use inline variable instead after adopting C++17.
static constexpr FieldMetadata_ClassloaderId kClassloaderId() { return {}; }
void set_classloader_id(uint64_t value) {
static constexpr uint32_t field_id = FieldMetadata_ClassloaderId::kFieldId;
// Call the appropriate protozero::Message::Append(field_id, ...)
// method based on the type of the field.
::protozero::internal::FieldWriter<
::protozero::proto_utils::ProtoSchemaType::kUint64>
::Append(*this, field_id, value);
}
};
class HeapGraphRoot_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
public:
HeapGraphRoot_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
explicit HeapGraphRoot_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
explicit HeapGraphRoot_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
bool has_object_ids() const { return at<1>().valid(); }
::protozero::PackedRepeatedFieldIterator<::protozero::proto_utils::ProtoWireType::kVarInt, uint64_t> object_ids(bool* parse_error_ptr) const { return GetPackedRepeated<::protozero::proto_utils::ProtoWireType::kVarInt, uint64_t>(1, parse_error_ptr); }
bool has_root_type() const { return at<2>().valid(); }
int32_t root_type() const { return at<2>().as_int32(); }
};
class HeapGraphRoot : public ::protozero::Message {
public:
using Decoder = HeapGraphRoot_Decoder;
enum : int32_t {
kObjectIdsFieldNumber = 1,
kRootTypeFieldNumber = 2,
};
using Type = ::perfetto::protos::pbzero::HeapGraphRoot_Type;
static const Type ROOT_UNKNOWN = HeapGraphRoot_Type_ROOT_UNKNOWN;
static const Type ROOT_JNI_GLOBAL = HeapGraphRoot_Type_ROOT_JNI_GLOBAL;
static const Type ROOT_JNI_LOCAL = HeapGraphRoot_Type_ROOT_JNI_LOCAL;
static const Type ROOT_JAVA_FRAME = HeapGraphRoot_Type_ROOT_JAVA_FRAME;
static const Type ROOT_NATIVE_STACK = HeapGraphRoot_Type_ROOT_NATIVE_STACK;
static const Type ROOT_STICKY_CLASS = HeapGraphRoot_Type_ROOT_STICKY_CLASS;
static const Type ROOT_THREAD_BLOCK = HeapGraphRoot_Type_ROOT_THREAD_BLOCK;
static const Type ROOT_MONITOR_USED = HeapGraphRoot_Type_ROOT_MONITOR_USED;
static const Type ROOT_THREAD_OBJECT = HeapGraphRoot_Type_ROOT_THREAD_OBJECT;
static const Type ROOT_INTERNED_STRING = HeapGraphRoot_Type_ROOT_INTERNED_STRING;
static const Type ROOT_FINALIZING = HeapGraphRoot_Type_ROOT_FINALIZING;
static const Type ROOT_DEBUGGER = HeapGraphRoot_Type_ROOT_DEBUGGER;
static const Type ROOT_REFERENCE_CLEANUP = HeapGraphRoot_Type_ROOT_REFERENCE_CLEANUP;
static const Type ROOT_VM_INTERNAL = HeapGraphRoot_Type_ROOT_VM_INTERNAL;
static const Type ROOT_JNI_MONITOR = HeapGraphRoot_Type_ROOT_JNI_MONITOR;
using FieldMetadata_ObjectIds =
::protozero::proto_utils::FieldMetadata<
1,
::protozero::proto_utils::RepetitionType::kRepeatedPacked,
::protozero::proto_utils::ProtoSchemaType::kUint64,
uint64_t,
HeapGraphRoot>;
// Ceci n'est pas une pipe.
// This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
// type (and users are expected to use it as such, hence kCamelCase name).
// It is declared as a function to keep protozero bindings header-only as
// inline constexpr variables are not available until C++17 (while inline
// functions are).
// TODO(altimin): Use inline variable instead after adopting C++17.
static constexpr FieldMetadata_ObjectIds kObjectIds() { return {}; }
void set_object_ids(const ::protozero::PackedVarInt& packed_buffer) {
AppendBytes(FieldMetadata_ObjectIds::kFieldId, packed_buffer.data(),
packed_buffer.size());
}
using FieldMetadata_RootType =
::protozero::proto_utils::FieldMetadata<
2,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kEnum,
::perfetto::protos::pbzero::HeapGraphRoot_Type,
HeapGraphRoot>;
// Ceci n'est pas une pipe.
// This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
// type (and users are expected to use it as such, hence kCamelCase name).
// It is declared as a function to keep protozero bindings header-only as
// inline constexpr variables are not available until C++17 (while inline
// functions are).
// TODO(altimin): Use inline variable instead after adopting C++17.
static constexpr FieldMetadata_RootType kRootType() { return {}; }
void set_root_type(::perfetto::protos::pbzero::HeapGraphRoot_Type value) {
static constexpr uint32_t field_id = FieldMetadata_RootType::kFieldId;
// Call the appropriate protozero::Message::Append(field_id, ...)
// method based on the type of the field.
::protozero::internal::FieldWriter<
::protozero::proto_utils::ProtoSchemaType::kEnum>
::Append(*this, field_id, value);
}
};
} // Namespace.
} // Namespace.
} // Namespace.
#endif // Include guard.