#include "base/trace_event/memory_allocator_dump.h"
#include <string.h>
#include "base/format_macros.h"
#include "base/memory/ptr_util.h"
#include "base/notreached.h"
#include "base/strings/stringprintf.h"
#include "base/trace_event/memory_dump_manager.h"
#include "base/trace_event/memory_dump_provider.h"
#include "base/trace_event/process_memory_dump.h"
#include "base/trace_event/traced_value.h"
#include "base/values.h"
#include "third_party/perfetto/protos/perfetto/trace/memory_graph.pbzero.h"
#include "third_party/perfetto/protos/perfetto/trace/trace_packet.pbzero.h"
namespace base {
namespace trace_event {
const char MemoryAllocatorDump::kNameSize[] = …;
const char MemoryAllocatorDump::kNameObjectCount[] = …;
const char MemoryAllocatorDump::kTypeScalar[] = …;
const char MemoryAllocatorDump::kTypeString[] = …;
const char MemoryAllocatorDump::kUnitsBytes[] = …;
const char MemoryAllocatorDump::kUnitsObjects[] = …;
MemoryAllocatorDump::MemoryAllocatorDump(
const std::string& absolute_name,
MemoryDumpLevelOfDetail level_of_detail,
const MemoryAllocatorDumpGuid& guid)
: … { … }
MemoryAllocatorDump::~MemoryAllocatorDump() = default;
void MemoryAllocatorDump::AddScalar(const char* name,
const char* units,
uint64_t value) { … }
void MemoryAllocatorDump::AddString(const char* name,
const char* units,
const std::string& value) { … }
void MemoryAllocatorDump::AsValueInto(TracedValue* value) const { … }
void MemoryAllocatorDump::AsProtoInto(
perfetto::protos::pbzero::MemoryTrackerSnapshot::ProcessSnapshot::
MemoryNode* memory_node) const { … }
uint64_t MemoryAllocatorDump::GetSizeInternal() const { … }
MemoryAllocatorDump::Entry::Entry() : … { … }
MemoryAllocatorDump::Entry::Entry(MemoryAllocatorDump::Entry&&) noexcept =
default;
MemoryAllocatorDump::Entry& MemoryAllocatorDump::Entry::operator=(
MemoryAllocatorDump::Entry&&) = default;
MemoryAllocatorDump::Entry::Entry(std::string name,
std::string units,
uint64_t value)
: … { … }
MemoryAllocatorDump::Entry::Entry(std::string name,
std::string units,
std::string value)
: … { … }
bool MemoryAllocatorDump::Entry::operator==(const Entry& rhs) const { … }
void PrintTo(const MemoryAllocatorDump::Entry& entry, std::ostream* out) { … }
}
}