#include "cc/metrics/event_latency_tracing_recorder.h"
#include "base/feature_list.h"
#include "base/notreached.h"
#include "base/ranges/algorithm.h"
#include "base/time/time.h"
#include "base/trace_event/trace_id_helper.h"
#include "base/trace_event/typed_macros.h"
#include "base/tracing/protos/chrome_track_event.pbzero.h"
#include "cc/base/features.h"
#include "cc/metrics/event_metrics.h"
#include "third_party/perfetto/include/perfetto/tracing/track.h"
namespace cc {
namespace {
constexpr char kTracingCategory[] = …;
bool IsTracingEnabled() { … }
constexpr base::TimeDelta high_latency_threshold = …;
constexpr perfetto::protos::pbzero::EventLatency::EventType ToProtoEnum(
EventMetrics::EventType event_type) { … }
const char* GetVizBreakdownToPresentationName(
CompositorFrameReporter::VizBreakdown breakdown) { … }
}
const char* EventLatencyTracingRecorder::GetDispatchBreakdownName(
EventMetrics::DispatchStage start_stage,
EventMetrics::DispatchStage end_stage) { … }
const char* EventLatencyTracingRecorder::GetDispatchToCompositorBreakdownName(
EventMetrics::DispatchStage dispatch_stage,
CompositorFrameReporter::StageType compositor_stage) { … }
const char* EventLatencyTracingRecorder::GetDispatchToTerminationBreakdownName(
EventMetrics::DispatchStage dispatch_stage) { … }
void EventLatencyTracingRecorder::RecordEventLatencyTraceEvent(
EventMetrics* event_metrics,
base::TimeTicks termination_time,
base::TimeDelta vsync_interval,
const std::vector<CompositorFrameReporter::StageData>* stage_history,
const CompositorFrameReporter::ProcessedVizBreakdown* viz_breakdown) { … }
bool EventLatencyTracingRecorder::IsEventLatencyTracingEnabled() { … }
void EventLatencyTracingRecorder::RecordEventLatencyTraceEventInternal(
const EventMetrics* event_metrics,
base::TimeTicks termination_time,
base::TimeDelta vsync_interval,
const std::vector<CompositorFrameReporter::StageData>* stage_history,
const CompositorFrameReporter::ProcessedVizBreakdown* viz_breakdown) { … }
}