Skip to content

Commit

Permalink
Remove rendering stats API
Browse files Browse the repository at this point in the history
The rendering stats API is not used anymore, since all benchmarks and tests
have been switch to use tracing instead.

This patch removes:
- the rendering stats API in GpuBenchmarkingExtension
- GpuRenderingStats and code that collects it
- BrowserRenderingStats (latency info) and code that collects it

R=nduca@chromium.org,miletus@chromium.org,kbr@chromium.org,jamesr@chromium.org
BUG=310452

Review URL: https://codereview.chromium.org/132373005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@248687 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
ernstm@chromium.org committed Feb 4, 2014
1 parent 6e068ea commit e2d1f7d
Show file tree
Hide file tree
Showing 25 changed files with 0 additions and 640 deletions.
20 changes: 0 additions & 20 deletions cc/debug/rendering_stats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,26 +51,6 @@ void ImplThreadRenderingStats::Add(const ImplThreadRenderingStats& other) {
rasterized_pixel_count += other.rasterized_pixel_count;
}

void RenderingStats::EnumerateFields(Enumerator* enumerator) const {
enumerator->AddInt64("frameCount",
main_stats.frame_count + impl_stats.frame_count);
enumerator->AddDouble("paintTime",
main_stats.paint_time.InSecondsF());
enumerator->AddInt64("paintedPixelCount",
main_stats.painted_pixel_count);
enumerator->AddDouble("recordTime",
main_stats.record_time.InSecondsF());
enumerator->AddInt64("recordedPixelCount",
main_stats.recorded_pixel_count);
// Combine rasterization and analysis time as a precursor to combining
// them in the same step internally.
enumerator->AddDouble("rasterizeTime",
impl_stats.rasterize_time.InSecondsF() +
impl_stats.analysis_time.InSecondsF());
enumerator->AddInt64("rasterizedPixelCount",
impl_stats.rasterized_pixel_count);
}

void RenderingStats::Add(const RenderingStats& other) {
main_stats.Add(other.main_stats);
impl_stats.Add(other.impl_stats);
Expand Down
21 changes: 0 additions & 21 deletions cc/debug/rendering_stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,6 @@

namespace cc {

// In conjunction with EnumerateFields, this allows the embedder to
// enumerate the values in this structure without
// having to embed references to its specific member variables. This
// simplifies the addition of new fields to this type.
class RenderingStatsEnumerator {
public:
virtual void AddInt64(const char* name, int64 value) = 0;
virtual void AddDouble(const char* name, double value) = 0;
virtual void AddInt(const char* name, int value) = 0;
virtual void AddTimeDeltaInSecondsF(const char* name,
const base::TimeDelta& value) = 0;

protected:
virtual ~RenderingStatsEnumerator() {}
};

struct CC_EXPORT MainThreadRenderingStats {
// Note: when adding new members, please remember to update EnumerateFields
// and Add in rendering_stats.cc.
Expand Down Expand Up @@ -58,14 +42,9 @@ struct CC_EXPORT ImplThreadRenderingStats {
};

struct CC_EXPORT RenderingStats {
typedef RenderingStatsEnumerator Enumerator;

MainThreadRenderingStats main_stats;
ImplThreadRenderingStats impl_stats;

// Outputs the fields in this structure to the provided enumerator.
void EnumerateFields(Enumerator* enumerator) const;

// Add fields of |other| to the fields in this structure.
void Add(const RenderingStats& other);
};
Expand Down
5 changes: 0 additions & 5 deletions cc/trees/layer_tree_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -507,11 +507,6 @@ void LayerTreeHost::SetNeedsDisplayOnAllLayers() {
}
}

void LayerTreeHost::CollectRenderingStats(RenderingStats* stats) const {
CHECK(debug_state_.RecordRenderingStats());
*stats = rendering_stats_instrumentation_->GetRenderingStats();
}

const RendererCapabilities& LayerTreeHost::GetRendererCapabilities() const {
return proxy_->GetRendererCapabilities();
}
Expand Down
21 changes: 0 additions & 21 deletions content/browser/renderer_host/render_widget_host_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2385,8 +2385,6 @@ void RenderWidgetHostImpl::ComputeTouchLatency(

base::TimeDelta ui_delta =
rwh_component.event_time - ui_component.event_time;
rendering_stats_.touch_ui_count++;
rendering_stats_.total_touch_ui_latency += ui_delta;
UMA_HISTOGRAM_CUSTOM_COUNTS(
"Event.Latency.Browser.TouchUI",
ui_delta.InMicroseconds(),
Expand All @@ -2400,19 +2398,13 @@ void RenderWidgetHostImpl::ComputeTouchLatency(
DCHECK(acked_component.event_count == 1);
base::TimeDelta acked_delta =
acked_component.event_time - rwh_component.event_time;
rendering_stats_.touch_acked_count++;
rendering_stats_.total_touch_acked_latency += acked_delta;
UMA_HISTOGRAM_CUSTOM_COUNTS(
"Event.Latency.Browser.TouchAcked",
acked_delta.InMicroseconds(),
0,
1000000,
100);
}

if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableGpuBenchmarking))
Send(new ViewMsg_SetBrowserRenderingStats(routing_id_, rendering_stats_));
}

void RenderWidgetHostImpl::FrameSwapped(const ui::LatencyInfo& latency_info) {
Expand All @@ -2435,11 +2427,6 @@ void RenderWidgetHostImpl::FrameSwapped(const ui::LatencyInfo& latency_info) {
return;
}

rendering_stats_.input_event_count += rwh_component.event_count;
rendering_stats_.total_input_latency +=
rwh_component.event_count *
(swap_component.event_time - rwh_component.event_time);

ui::LatencyInfo::LatencyComponent original_component;
if (latency_info.FindLatency(
ui::INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL_COMPONENT,
Expand All @@ -2458,15 +2445,7 @@ void RenderWidgetHostImpl::FrameSwapped(const ui::LatencyInfo& latency_info) {
1000000,
100);
}
rendering_stats_.scroll_update_count += original_component.event_count;
rendering_stats_.total_scroll_update_latency +=
original_component.event_count *
(swap_component.event_time - original_component.event_time);
}

if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableGpuBenchmarking))
Send(new ViewMsg_SetBrowserRenderingStats(routing_id_, rendering_stats_));
}

void RenderWidgetHostImpl::DidReceiveRendererFrame() {
Expand Down
3 changes: 0 additions & 3 deletions content/browser/renderer_host/render_widget_host_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include "build/build_config.h"
#include "content/browser/renderer_host/input/input_ack_handler.h"
#include "content/browser/renderer_host/input/input_router_client.h"
#include "content/common/browser_rendering_stats.h"
#include "content/common/input/synthetic_gesture_packet.h"
#include "content/common/view_message_enums.h"
#include "content/port/browser/event_with_latency_info.h"
Expand Down Expand Up @@ -932,8 +931,6 @@ class CONTENT_EXPORT RenderWidgetHostImpl : virtual public RenderWidgetHost,

int64 last_input_number_;

BrowserRenderingStats rendering_stats_;

DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl);
};

Expand Down
36 changes: 0 additions & 36 deletions content/common/browser_rendering_stats.cc

This file was deleted.

37 changes: 0 additions & 37 deletions content/common/browser_rendering_stats.h

This file was deleted.

8 changes: 0 additions & 8 deletions content/common/gpu/client/gpu_channel_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,6 @@ void GpuChannelHost::DestroyCommandBuffer(
delete command_buffer;
}

bool GpuChannelHost::CollectRenderingStatsForSurface(
int surface_id, GpuRenderingStats* stats) {
TRACE_EVENT0("gpu", "GpuChannelHost::CollectRenderingStats");

return Send(new GpuChannelMsg_CollectRenderingStatsForSurface(surface_id,
stats));
}

void GpuChannelHost::AddRoute(
int route_id, base::WeakPtr<IPC::Listener> listener) {
DCHECK(MessageLoopProxy::current().get());
Expand Down
5 changes: 0 additions & 5 deletions content/common/gpu/client/gpu_channel_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ class SyncMessageFilter;
namespace content {
class CommandBufferProxyImpl;
class GpuChannelHost;
struct GpuRenderingStats;

struct GpuListenerInfo {
GpuListenerInfo();
Expand Down Expand Up @@ -140,10 +139,6 @@ class GpuChannelHost : public IPC::Sender,
// Destroy a command buffer created by this channel.
void DestroyCommandBuffer(CommandBufferProxyImpl* command_buffer);

// Collect rendering stats from GPU process.
bool CollectRenderingStatsForSurface(
int surface_id, GpuRenderingStats* stats);

// Add a route for the current message loop.
void AddRoute(int route_id, base::WeakPtr<IPC::Listener> listener);
void RemoveRoute(int route_id);
Expand Down
31 changes: 0 additions & 31 deletions content/common/gpu/gpu_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -757,9 +757,6 @@ bool GpuChannel::OnControlMessageReceived(const IPC::Message& msg) {
OnDevToolsStartEventsRecording)
IPC_MESSAGE_HANDLER(GpuChannelMsg_DevToolsStopEventsRecording,
OnDevToolsStopEventsRecording)
IPC_MESSAGE_HANDLER(
GpuChannelMsg_CollectRenderingStatsForSurface,
OnCollectRenderingStatsForSurface)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
DCHECK(handled) << msg.type();
Expand Down Expand Up @@ -918,34 +915,6 @@ void GpuChannel::OnDevToolsStopEventsRecording() {
devtools_gpu_agent_->StopEventsRecording();
}

void GpuChannel::OnCollectRenderingStatsForSurface(
int32 surface_id, GpuRenderingStats* stats) {
for (StubMap::Iterator<GpuCommandBufferStub> it(&stubs_);
!it.IsAtEnd(); it.Advance()) {
int texture_upload_count =
it.GetCurrentValue()->decoder()->GetTextureUploadCount();
base::TimeDelta total_texture_upload_time =
it.GetCurrentValue()->decoder()->GetTotalTextureUploadTime();
base::TimeDelta total_processing_commands_time =
it.GetCurrentValue()->decoder()->GetTotalProcessingCommandsTime();

stats->global_texture_upload_count += texture_upload_count;
stats->global_total_texture_upload_time += total_texture_upload_time;
stats->global_total_processing_commands_time +=
total_processing_commands_time;
if (it.GetCurrentValue()->surface_id() == surface_id) {
stats->texture_upload_count += texture_upload_count;
stats->total_texture_upload_time += total_texture_upload_time;
stats->total_processing_commands_time += total_processing_commands_time;
}
}

GPUVideoMemoryUsageStats usage_stats;
gpu_channel_manager_->gpu_memory_manager()->GetVideoMemoryUsageStats(
&usage_stats);
stats->global_video_memory_bytes_allocated = usage_stats.bytes_allocated;
}

void GpuChannel::MessageProcessed() {
messages_processed_++;
if (preempting_flag_.get()) {
Expand Down
5 changes: 0 additions & 5 deletions content/common/gpu/gpu_channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ namespace content {
class DevToolsGpuAgent;
class GpuChannelManager;
class GpuChannelMessageFilter;
struct GpuRenderingStats;
class GpuVideoEncodeAccelerator;
class GpuWatchdog;

Expand Down Expand Up @@ -172,10 +171,6 @@ class GpuChannel : public IPC::Listener,
void OnDevToolsStartEventsRecording(int32* route_id);
void OnDevToolsStopEventsRecording();

// Collect rendering stats.
void OnCollectRenderingStatsForSurface(
int32 surface_id, GpuRenderingStats* stats);

// Decrement the count of unhandled IPC messages and defer preemption.
void MessageProcessed();

Expand Down
16 changes: 0 additions & 16 deletions content/common/gpu/gpu_messages.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "content/common/content_export.h"
#include "content/common/gpu/gpu_memory_uma_stats.h"
#include "content/common/gpu/gpu_process_launch_causes.h"
#include "content/common/gpu/gpu_rendering_stats.h"
#include "content/public/common/common_param_traits.h"
#include "content/public/common/gpu_memory_stats.h"
#include "gpu/command_buffer/common/capabilities.h"
Expand Down Expand Up @@ -223,16 +222,6 @@ IPC_ENUM_TRAITS(gpu::error::ContextLostReason)

IPC_ENUM_TRAITS(media::VideoCodecProfile)

IPC_STRUCT_TRAITS_BEGIN(content::GpuRenderingStats)
IPC_STRUCT_TRAITS_MEMBER(global_texture_upload_count)
IPC_STRUCT_TRAITS_MEMBER(global_total_texture_upload_time)
IPC_STRUCT_TRAITS_MEMBER(texture_upload_count)
IPC_STRUCT_TRAITS_MEMBER(total_texture_upload_time)
IPC_STRUCT_TRAITS_MEMBER(global_total_processing_commands_time)
IPC_STRUCT_TRAITS_MEMBER(total_processing_commands_time)
IPC_STRUCT_TRAITS_MEMBER(global_video_memory_bytes_allocated)
IPC_STRUCT_TRAITS_END()

IPC_ENUM_TRAITS(media::VideoFrame::Format)

IPC_ENUM_TRAITS(media::VideoEncodeAccelerator::Error)
Expand Down Expand Up @@ -481,11 +470,6 @@ IPC_SYNC_MESSAGE_CONTROL0_1(GpuChannelMsg_CreateVideoEncoder,

IPC_MESSAGE_CONTROL1(GpuChannelMsg_DestroyVideoEncoder, int32 /* route_id */)

// Tells the GPU process to collect rendering stats.
IPC_SYNC_MESSAGE_CONTROL1_1(GpuChannelMsg_CollectRenderingStatsForSurface,
int32 /* surface_id */,
content::GpuRenderingStats /* stats */)

// Sent by DevTools agent in the inspected renderer process to initiate GPU
// instrumentation events recording.
IPC_SYNC_MESSAGE_CONTROL0_1(GpuChannelMsg_DevToolsStartEventsRecording,
Expand Down
35 changes: 0 additions & 35 deletions content/common/gpu/gpu_rendering_stats.cc

This file was deleted.

Loading

0 comments on commit e2d1f7d

Please sign in to comment.