diff options
author | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-18 02:28:15 +0000 |
---|---|---|
committer | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-18 02:28:15 +0000 |
commit | d13f35da2d73cca3d7de8ca35b9a8cb4d668264a (patch) | |
tree | 64981e6fc6b35ba94b29d6c239aa83c3b36da246 /content/common | |
parent | 92059432cf8f8b2ae19c07494efdd859955ff38b (diff) | |
download | chromium_src-d13f35da2d73cca3d7de8ca35b9a8cb4d668264a.zip chromium_src-d13f35da2d73cca3d7de8ca35b9a8cb4d668264a.tar.gz chromium_src-d13f35da2d73cca3d7de8ca35b9a8cb4d668264a.tar.bz2 |
Add trace events to measure GPU process startup timing and time to first present.
Review URL: https://chromiumcodereview.appspot.com/10386185
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137802 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/common')
-rw-r--r-- | content/common/gpu/client/gpu_channel_host.cc | 10 | ||||
-rw-r--r-- | content/common/gpu/gpu_channel.cc | 10 |
2 files changed, 18 insertions, 2 deletions
diff --git a/content/common/gpu/client/gpu_channel_host.cc b/content/common/gpu/client/gpu_channel_host.cc index 19a87df..6d688c6 100644 --- a/content/common/gpu/client/gpu_channel_host.cc +++ b/content/common/gpu/client/gpu_channel_host.cc @@ -5,6 +5,7 @@ #include "content/common/gpu/client/gpu_channel_host.h" #include "base/bind.h" +#include "base/debug/trace_event.h" #include "base/message_loop.h" #include "base/message_loop_proxy.h" #include "base/threading/thread_restrictions.h" @@ -112,6 +113,11 @@ CommandBufferProxy* GpuChannelHost::CreateViewCommandBuffer( const std::vector<int32>& attribs, const GURL& active_url, gfx::GpuPreference gpu_preference) { + TRACE_EVENT1("gpu", + "GpuChannelHost::CreateViewCommandBuffer", + "surface_id", + surface_id); + #if defined(ENABLE_GPU) AutoLock lock(context_lock_); // An error occurred. Need to get the host again to reinitialize it. @@ -146,6 +152,8 @@ CommandBufferProxy* GpuChannelHost::CreateOffscreenCommandBuffer( const std::vector<int32>& attribs, const GURL& active_url, gfx::GpuPreference gpu_preference) { + TRACE_EVENT0("gpu", "GpuChannelHost::CreateOffscreenCommandBuffer"); + #if defined(ENABLE_GPU) AutoLock lock(context_lock_); // An error occurred. Need to get the host again to reinitialize it. @@ -192,6 +200,8 @@ GpuVideoDecodeAcceleratorHost* GpuChannelHost::CreateVideoDecoder( void GpuChannelHost::DestroyCommandBuffer( CommandBufferProxy* command_buffer) { + TRACE_EVENT0("gpu", "GpuChannelHost::DestroyCommandBuffer"); + #if defined(ENABLE_GPU) AutoLock lock(context_lock_); int route_id = command_buffer->GetRouteID(); diff --git a/content/common/gpu/gpu_channel.cc b/content/common/gpu/gpu_channel.cc index a228305..41d86ba 100644 --- a/content/common/gpu/gpu_channel.cc +++ b/content/common/gpu/gpu_channel.cc @@ -179,6 +179,11 @@ void GpuChannel::CreateViewCommandBuffer( int32 surface_id, const GPUCreateCommandBufferConfig& init_params, int32* route_id) { + TRACE_EVENT1("gpu", + "GpuChannel::CreateViewCommandBuffer", + "surface_id", + surface_id); + *route_id = MSG_ROUTING_NONE; content::GetContentClient()->SetActiveURL(init_params.active_url); @@ -336,6 +341,8 @@ void GpuChannel::OnCreateOffscreenCommandBuffer( const gfx::Size& size, const GPUCreateCommandBufferConfig& init_params, IPC::Message* reply_message) { + TRACE_EVENT0("gpu", "GpuChannel::OnCreateOffscreenCommandBuffer"); + int32 route_id = MSG_ROUTING_NONE; content::GetContentClient()->SetActiveURL(init_params.active_url); @@ -373,9 +380,9 @@ void GpuChannel::OnCreateOffscreenCommandBuffer( void GpuChannel::OnDestroyCommandBuffer(int32 route_id, IPC::Message* reply_message) { -#if defined(ENABLE_GPU) TRACE_EVENT1("gpu", "GpuChannel::OnDestroyCommandBuffer", "route_id", route_id); + if (router_.ResolveRoute(route_id)) { GpuCommandBufferStub* stub = stubs_.Lookup(route_id); bool need_reschedule = (stub && !stub->IsScheduled()); @@ -389,7 +396,6 @@ void GpuChannel::OnDestroyCommandBuffer(int32 route_id, OnScheduled(); DidDestroyCommandBuffer(gpu_preference); } -#endif if (reply_message) Send(reply_message); |