#include "services/resource_coordinator/public/cpp/memory_instrumentation/tracing_observer.h"
#include "services/tracing/public/cpp/perfetto/perfetto_producer.h"
#include "base/files/file_path.h"
#include "base/format_macros.h"
#include "base/trace_event/memory_dump_manager.h"
#include "base/trace_event/traced_value.h"
#include "build/build_config.h"
namespace memory_instrumentation {
TracedValue;
ProcessMemoryDump;
namespace {
}
TracingObserver::TracingObserver()
: … { … }
TracingObserver::~TracingObserver() = default;
void TracingObserver::StartTracingImpl(
tracing::PerfettoProducer* producer,
const perfetto::DataSourceConfig& data_source_config) { … }
void TracingObserver::StopTracingImpl(
base::OnceClosure stop_complete_callback) { … }
void TracingObserver::Flush(base::RepeatingClosure flush_complete_callback) { … }
bool TracingObserver::AddChromeDumpToTraceIfEnabled(
const base::trace_event::MemoryDumpRequestArgs&,
const base::ProcessId pid,
const base::trace_event::ProcessMemoryDump*,
const base::TimeTicks& timestamp) { … }
bool TracingObserver::AddOsDumpToTraceIfEnabled(
const base::trace_event::MemoryDumpRequestArgs& args,
const base::ProcessId pid,
const mojom::OSMemDump& os_dump,
const std::vector<mojom::VmRegionPtr>& memory_maps,
const base::TimeTicks& timestamp) { … }
bool TracingObserver::ShouldAddToTrace(
const base::trace_event::MemoryDumpRequestArgs& args) { … }
std::string TracingObserver::ApplyPathFiltering(
const std::string& file,
bool is_argument_filtering_enabled) { … }
bool TracingObserver::IsDumpModeAllowed(
base::trace_event::MemoryDumpLevelOfDetail dump_mode) const { … }
bool TracingObserver::IsMemoryInfraTracingEnabled() const { … }
}