Commit 4a59b217 authored by Jonathan Ross's avatar Jonathan Ross Committed by Commit Bot

cc: Remove some deprecated metrics.

The various GraphicsPipeline.* metrics are deprecated, replaced by the
newer CompositorLatency.* metrics, which have more breakdowns from cc
and blink.

BUG=884851, 1088832

Change-Id: Ice3cd0cf07db8def51263bb080bfacebbaf9aa35
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2120362
Commit-Queue: Jonathan Ross <jonross@chromium.org>
Auto-Submit: Sadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: default avatarWeilun Shi <sweilun@chromium.org>
Reviewed-by: default avatarIlya Sherman <isherman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#823818}
parent 9ea29652
......@@ -8,7 +8,6 @@
#include "base/bind.h"
#include "base/metrics/histogram.h"
#include "base/metrics/histogram_base.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/trace_event/trace_event.h"
......@@ -19,45 +18,9 @@
#include "components/viz/common/hit_test/hit_test_region_list.h"
#include "components/viz/common/quads/compositor_frame.h"
namespace {
base::HistogramBase* GetHistogramNamed(const char* histogram_name_format,
const char* client_name) {
if (!client_name)
return nullptr;
return base::LinearHistogram::FactoryMicrosecondsTimeGet(
base::StringPrintf(histogram_name_format, client_name),
base::TimeDelta::FromMicroseconds(1),
base::TimeDelta::FromMilliseconds(200), 50,
base::HistogramBase::kUmaTargetedHistogramFlag);
}
} // namespace
namespace cc {
namespace mojo_embedder {
AsyncLayerTreeFrameSink::PipelineReporting::PipelineReporting(
const viz::BeginFrameArgs args,
base::TimeTicks now,
base::HistogramBase* submit_begin_frame_histogram)
: trace_id_(args.trace_id),
frame_time_(now),
submit_begin_frame_histogram_(submit_begin_frame_histogram) {}
AsyncLayerTreeFrameSink::PipelineReporting::~PipelineReporting() = default;
void AsyncLayerTreeFrameSink::PipelineReporting::Report() {
TRACE_EVENT_WITH_FLOW1("viz,benchmark", "Graphics.Pipeline",
TRACE_ID_GLOBAL(trace_id_),
TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT,
"step", "SubmitCompositorFrame");
auto report_time = base::TimeTicks::Now() - frame_time_;
if (submit_begin_frame_histogram_)
submit_begin_frame_histogram_->AddTimeMicrosecondsGranularity(report_time);
}
AsyncLayerTreeFrameSink::InitParams::InitParams() = default;
AsyncLayerTreeFrameSink::InitParams::~InitParams() = default;
......@@ -84,13 +47,8 @@ AsyncLayerTreeFrameSink::AsyncLayerTreeFrameSink(
synthetic_begin_frame_source_(
std::move(params->synthetic_begin_frame_source)),
pipes_(std::move(params->pipes)),
wants_animate_only_begin_frames_(params->wants_animate_only_begin_frames),
receive_begin_frame_histogram_(
GetHistogramNamed("GraphicsPipeline.%s.ReceivedBeginFrame",
params->client_name)),
submit_begin_frame_histogram_(GetHistogramNamed(
"GraphicsPipeline.%s.SubmitCompositorFrameAfterBeginFrame",
params->client_name)) {
wants_animate_only_begin_frames_(
params->wants_animate_only_begin_frames) {
DETACH_FROM_THREAD(thread_checker_);
}
......@@ -165,14 +123,11 @@ void AsyncLayerTreeFrameSink::SubmitCompositorFrame(
DCHECK(frame.metadata.begin_frame_ack.has_damage);
DCHECK(frame.metadata.begin_frame_ack.frame_id.IsSequenceValid());
// It's possible to request an immediate composite from cc which will bypass
// BeginFrame. In that case, we cannot collect full graphics pipeline data.
auto it = pipeline_reporting_frame_times_.find(
frame.metadata.begin_frame_ack.trace_id);
if (it != pipeline_reporting_frame_times_.end()) {
it->second.Report();
pipeline_reporting_frame_times_.erase(it);
}
TRACE_EVENT_WITH_FLOW1(
"viz,benchmark", "Graphics.Pipeline",
TRACE_ID_GLOBAL(frame.metadata.begin_frame_ack.trace_id),
TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, "step",
"SubmitCompositorFrame");
if (local_surface_id_ == last_submitted_local_surface_id_) {
DCHECK_EQ(last_submitted_device_scale_factor_, frame.device_scale_factor());
......@@ -250,18 +205,11 @@ void AsyncLayerTreeFrameSink::DidNotProduceFrame(
DCHECK(compositor_frame_sink_ptr_);
DCHECK(!ack.has_damage);
DCHECK(ack.frame_id.IsSequenceValid());
// TODO(yiyix): Remove duplicated calls of DidNotProduceFrame from the same
// BeginFrames. https://crbug.com/881949
auto it = pipeline_reporting_frame_times_.find(ack.trace_id);
if (it != pipeline_reporting_frame_times_.end()) {
TRACE_EVENT_WITH_FLOW1("viz,benchmark", "Graphics.Pipeline",
TRACE_ID_GLOBAL(ack.trace_id),
TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT,
"step", "DidNotProduceFrame");
compositor_frame_sink_ptr_->DidNotProduceFrame(ack);
pipeline_reporting_frame_times_.erase(it);
}
TRACE_EVENT_WITH_FLOW1("viz,benchmark", "Graphics.Pipeline",
TRACE_ID_GLOBAL(ack.trace_id),
TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT,
"step", "DidNotProduceFrame");
compositor_frame_sink_ptr_->DidNotProduceFrame(ack);
}
void AsyncLayerTreeFrameSink::DidAllocateSharedBitmap(
......@@ -291,23 +239,6 @@ void AsyncLayerTreeFrameSink::OnBeginFrame(
client_->DidPresentCompositorFrame(pair.first, pair.second);
}
DCHECK_LE(pipeline_reporting_frame_times_.size(), 25u);
if (args.trace_id != -1) {
base::TimeTicks current_time = base::TimeTicks::Now();
PipelineReporting report(args, current_time, submit_begin_frame_histogram_);
pipeline_reporting_frame_times_.emplace(args.trace_id, report);
// Missed BeginFrames use the frame time of the last received BeginFrame
// which is bogus from a reporting perspective if nothing has been updating
// on screen for a while.
if (args.type != viz::BeginFrameArgs::MISSED) {
base::TimeDelta frame_difference = current_time - args.frame_time;
if (receive_begin_frame_histogram_) {
receive_begin_frame_histogram_->AddTimeMicrosecondsGranularity(
frame_difference);
}
}
}
if (!needs_begin_frames_) {
TRACE_EVENT_WITH_FLOW1("viz,benchmark", "Graphics.Pipeline",
TRACE_ID_GLOBAL(args.trace_id),
......
......@@ -27,10 +27,6 @@
#include "mojo/public/cpp/bindings/remote.h"
#include "services/viz/public/mojom/compositing/compositor_frame_sink.mojom.h"
namespace base {
class HistogramBase;
} // namespace base
namespace cc {
namespace mojo_embedder {
......@@ -42,32 +38,6 @@ class CC_MOJO_EMBEDDER_EXPORT AsyncLayerTreeFrameSink
public viz::mojom::CompositorFrameSinkClient,
public viz::ExternalBeginFrameSourceClient {
public:
// This class is used to handle the graphics pipeline related metrics
// reporting.
class PipelineReporting {
public:
PipelineReporting(viz::BeginFrameArgs args,
base::TimeTicks now,
base::HistogramBase* submit_begin_frame_histogram);
~PipelineReporting();
void Report();
int64_t trace_id() const { return trace_id_; }
private:
// The trace id of a BeginFrame which is used to track its progress on the
// client side.
int64_t trace_id_;
// The time stamp for the begin frame to arrive on client side.
base::TimeTicks frame_time_;
// Histogram metrics used to record
// GraphicsPipeline.ClientName.SubmitCompositorFrameAfterBeginFrame
base::HistogramBase* submit_begin_frame_histogram_;
};
struct CC_MOJO_EMBEDDER_EXPORT UnboundMessagePipes {
UnboundMessagePipes();
~UnboundMessagePipes();
......@@ -169,16 +139,7 @@ class CC_MOJO_EMBEDDER_EXPORT AsyncLayerTreeFrameSink
viz::LocalSurfaceId last_submitted_local_surface_id_;
float last_submitted_device_scale_factor_ = 1.f;
gfx::Size last_submitted_size_in_pixels_;
// Use this map to record the time when client received the BeginFrameArgs.
base::flat_map<int64_t, PipelineReporting> pipeline_reporting_frame_times_;
// Histogram metrics used to record
// GraphicsPipeline.ClientName.ReceivedBeginFrame
base::HistogramBase* const receive_begin_frame_histogram_;
// Histogram metrics used to record
// GraphicsPipeline.ClientName.SubmitCompositorFrameAfterBeginFrame
base::HistogramBase* const submit_begin_frame_histogram_;
base::WeakPtrFactory<AsyncLayerTreeFrameSink> weak_factory_{this};
};
......
......@@ -5940,6 +5940,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram name="GraphicsPipeline.ReceivedBeginFrame" units="microseconds"
expires_after="M85">
<obsolete>
Expired in M85.
</obsolete>
<owner>yiyix@chromium.org</owner>
<owner>chrome-gpu-metrics@google.com</owner>
<summary>
......@@ -5953,6 +5956,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram name="GraphicsPipeline.SubmitCompositorFrameAfterBeginFrame"
units="microseconds" expires_after="M85">
<obsolete>
Expired in M85.
</obsolete>
<owner>yiyix@chromium.org</owner>
<owner>chrome-gpu-metrics@google.com</owner>
<summary>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment