summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-24 10:55:32 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-24 10:55:32 +0000
commit3551cb20ae0d809fb2daffe1ece5f3947e037f3c (patch)
tree7d0fafbd954048640d956e3c4758ba82e005935e
parentabe5fedb266ae81e25813aec4291da36a2d023df (diff)
downloadchromium_src-3551cb20ae0d809fb2daffe1ece5f3947e037f3c.zip
chromium_src-3551cb20ae0d809fb2daffe1ece5f3947e037f3c.tar.gz
chromium_src-3551cb20ae0d809fb2daffe1ece5f3947e037f3c.tar.bz2
Add more trace events to GPU process.
Review URL: https://chromiumcodereview.appspot.com/10447002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138762 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/common/gpu/gpu_command_buffer_stub.cc17
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.cc1
-rw-r--r--ui/gl/gl_context_linux.cc2
-rw-r--r--ui/gl/gl_context_mac.mm2
-rw-r--r--ui/gl/gl_context_win.cc2
-rw-r--r--ui/gl/gl_surface_linux.cc3
-rw-r--r--ui/gl/gl_surface_mac.cc3
-rw-r--r--ui/gl/gl_surface_win.cc3
8 files changed, 33 insertions, 0 deletions
diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc
index 89b7ae5..4c57e47 100644
--- a/content/common/gpu/gpu_command_buffer_stub.cc
+++ b/content/common/gpu/gpu_command_buffer_stub.cc
@@ -236,6 +236,7 @@ void GpuCommandBufferStub::OnInitializeFailed(IPC::Message* reply_message) {
void GpuCommandBufferStub::OnInitialize(
IPC::Message* reply_message) {
+ TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnInitialize");
DCHECK(!command_buffer_.get());
command_buffer_.reset(new gpu::CommandBufferService);
@@ -358,6 +359,7 @@ void GpuCommandBufferStub::OnInitialize(
void GpuCommandBufferStub::OnSetGetBuffer(
int32 shm_id, IPC::Message* reply_message) {
+ TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnSetGetBuffer");
if (command_buffer_.get()) {
command_buffer_->SetGetBuffer(shm_id);
} else {
@@ -369,6 +371,7 @@ void GpuCommandBufferStub::OnSetGetBuffer(
void GpuCommandBufferStub::OnSetSharedStateBuffer(
int32 shm_id, IPC::Message* reply_message) {
+ TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnSetSharedStateBuffer");
if (command_buffer_.get()) {
command_buffer_->SetSharedStateBuffer(shm_id);
} else {
@@ -381,6 +384,7 @@ void GpuCommandBufferStub::OnSetSharedStateBuffer(
void GpuCommandBufferStub::OnSetParent(int32 parent_route_id,
uint32 parent_texture_id,
IPC::Message* reply_message) {
+ TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnSetParent");
GpuCommandBufferStub* parent_stub = NULL;
if (parent_route_id != MSG_ROUTING_NONE) {
parent_stub = channel_->LookupCommandBuffer(parent_route_id);
@@ -404,6 +408,7 @@ void GpuCommandBufferStub::OnSetParent(int32 parent_route_id,
}
void GpuCommandBufferStub::OnGetState(IPC::Message* reply_message) {
+ TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnGetState");
if (command_buffer_.get()) {
gpu::CommandBuffer::State state = command_buffer_->GetState();
if (state.error == gpu::error::kLostContext &&
@@ -469,6 +474,7 @@ void GpuCommandBufferStub::OnRescheduled() {
void GpuCommandBufferStub::OnCreateTransferBuffer(int32 size,
int32 id_request,
IPC::Message* reply_message) {
+ TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnCreateTransferBuffer");
if (command_buffer_.get()) {
int32 id = command_buffer_->CreateTransferBuffer(size, id_request);
GpuCommandBufferMsg_CreateTransferBuffer::WriteReplyParams(
@@ -484,6 +490,7 @@ void GpuCommandBufferStub::OnRegisterTransferBuffer(
size_t size,
int32 id_request,
IPC::Message* reply_message) {
+ TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnRegisterTransferBuffer");
base::SharedMemory shared_memory(transfer_buffer, false);
if (command_buffer_.get()) {
@@ -502,6 +509,7 @@ void GpuCommandBufferStub::OnRegisterTransferBuffer(
void GpuCommandBufferStub::OnDestroyTransferBuffer(
int32 id,
IPC::Message* reply_message) {
+ TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnDestroyTransferBuffer");
if (command_buffer_.get()) {
command_buffer_->DestroyTransferBuffer(id);
} else {
@@ -513,6 +521,7 @@ void GpuCommandBufferStub::OnDestroyTransferBuffer(
void GpuCommandBufferStub::OnGetTransferBuffer(
int32 id,
IPC::Message* reply_message) {
+ TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnGetTransferBuffer");
if (command_buffer_.get()) {
base::SharedMemoryHandle transfer_buffer = base::SharedMemoryHandle();
uint32 size = 0;
@@ -559,6 +568,7 @@ void GpuCommandBufferStub::ReportState() {
void GpuCommandBufferStub::OnCreateVideoDecoder(
media::VideoCodecProfile profile,
IPC::Message* reply_message) {
+ TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnCreateVideoDecoder");
int decoder_route_id = channel_->GenerateRouteID();
GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(
reply_message, decoder_route_id);
@@ -570,11 +580,13 @@ void GpuCommandBufferStub::OnCreateVideoDecoder(
}
void GpuCommandBufferStub::OnDestroyVideoDecoder(int decoder_route_id) {
+ TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnDestroyVideoDecoder");
channel_->RemoveRoute(decoder_route_id);
video_decoders_.Remove(decoder_route_id);
}
void GpuCommandBufferStub::OnSetSurfaceVisible(bool visible) {
+ TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnSetSurfaceVisible");
DCHECK(surface_state_.get());
surface_state_->visible = visible;
surface_state_->last_used_time = base::TimeTicks::Now();
@@ -582,12 +594,14 @@ void GpuCommandBufferStub::OnSetSurfaceVisible(bool visible) {
}
void GpuCommandBufferStub::OnDiscardBackbuffer() {
+ TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnDiscardBackbuffer");
if (!surface_)
return;
surface_->SetBackbufferAllocation(false);
}
void GpuCommandBufferStub::OnEnsureBackbuffer() {
+ TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnEnsureBackbuffer");
if (!surface_)
return;
surface_->SetBackbufferAllocation(true);
@@ -595,6 +609,9 @@ void GpuCommandBufferStub::OnEnsureBackbuffer() {
void GpuCommandBufferStub::OnSetClientHasMemoryAllocationChangedCallback(
bool has_callback) {
+ TRACE_EVENT0(
+ "gpu",
+ "GpuCommandBufferStub::OnSetClientHasMemoryAllocationChangedCallback");
client_has_memory_allocation_changed_callback_ = has_callback;
channel_->gpu_channel_manager()->gpu_memory_manager()->ScheduleManage();
}
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 1c79b39b..d67fe8c 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -1985,6 +1985,7 @@ bool GLES2DecoderImpl::Initialize(
const DisallowedFeatures& disallowed_features,
const char* allowed_extensions,
const std::vector<int32>& attribs) {
+ TRACE_EVENT0("gpu", "GLES2DecoderImpl::Initialize");
DCHECK(context->IsCurrent(surface.get()));
DCHECK(!context_.get());
diff --git a/ui/gl/gl_context_linux.cc b/ui/gl/gl_context_linux.cc
index 2b5d16f..667df48 100644
--- a/ui/gl/gl_context_linux.cc
+++ b/ui/gl/gl_context_linux.cc
@@ -4,6 +4,7 @@
#include "ui/gl/gl_context.h"
+#include "base/debug/trace_event.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "third_party/mesa/MesaLib/include/GL/osmesa.h"
@@ -26,6 +27,7 @@ scoped_refptr<GLContext> GLContext::CreateGLContext(
GLShareGroup* share_group,
GLSurface* compatible_surface,
GpuPreference gpu_preference) {
+ TRACE_EVENT0("gpu", "GLContext::CreateGLContext");
switch (GetGLImplementation()) {
case kGLImplementationOSMesaGL: {
scoped_refptr<GLContext> context(new GLContextOSMesa(share_group));
diff --git a/ui/gl/gl_context_mac.mm b/ui/gl/gl_context_mac.mm
index 06829be..0a8d096 100644
--- a/ui/gl/gl_context_mac.mm
+++ b/ui/gl/gl_context_mac.mm
@@ -4,6 +4,7 @@
#include "base/basictypes.h"
#include "base/command_line.h"
+#include "base/debug/trace_event.h"
#include "base/logging.h"
#include "base/mac/mac_util.h"
#include "base/memory/scoped_generic_obj.h"
@@ -41,6 +42,7 @@ scoped_refptr<GLContext> GLContext::CreateGLContext(
GLShareGroup* share_group,
GLSurface* compatible_surface,
GpuPreference gpu_preference) {
+ TRACE_EVENT0("gpu", "GLContext::CreateGLContext");
switch (GetGLImplementation()) {
case kGLImplementationDesktopGL:
case kGLImplementationAppleGL: {
diff --git a/ui/gl/gl_context_win.cc b/ui/gl/gl_context_win.cc
index c42daa9..d2aaf85 100644
--- a/ui/gl/gl_context_win.cc
+++ b/ui/gl/gl_context_win.cc
@@ -4,6 +4,7 @@
#include "ui/gl/gl_context.h"
+#include "base/debug/trace_event.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "third_party/mesa/MesaLib/include/GL/osmesa.h"
@@ -24,6 +25,7 @@ scoped_refptr<GLContext> GLContext::CreateGLContext(
GLShareGroup* share_group,
GLSurface* compatible_surface,
GpuPreference gpu_preference) {
+ TRACE_EVENT0("gpu", "GLContext::CreateGLContext");
switch (GetGLImplementation()) {
case kGLImplementationOSMesaGL: {
scoped_refptr<GLContext> context(new GLContextOSMesa(share_group));
diff --git a/ui/gl/gl_surface_linux.cc b/ui/gl/gl_surface_linux.cc
index d657605..03ab514 100644
--- a/ui/gl/gl_surface_linux.cc
+++ b/ui/gl/gl_surface_linux.cc
@@ -4,6 +4,7 @@
#include "ui/gl/gl_surface.h"
+#include "base/debug/trace_event.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop.h"
@@ -265,6 +266,7 @@ NativeViewGLSurfaceOSMesa::~NativeViewGLSurfaceOSMesa() {
scoped_refptr<GLSurface> GLSurface::CreateViewGLSurface(
bool software,
gfx::AcceleratedWidget window) {
+ TRACE_EVENT0("gpu", "GLSurface::CreateViewGLSurface");
if (software)
return NULL;
@@ -304,6 +306,7 @@ scoped_refptr<GLSurface> GLSurface::CreateViewGLSurface(
scoped_refptr<GLSurface> GLSurface::CreateOffscreenGLSurface(
bool software,
const gfx::Size& size) {
+ TRACE_EVENT0("gpu", "GLSurface::CreateOffscreenGLSurface");
if (software)
return NULL;
diff --git a/ui/gl/gl_surface_mac.cc b/ui/gl/gl_surface_mac.cc
index 0431628..df542a1 100644
--- a/ui/gl/gl_surface_mac.cc
+++ b/ui/gl/gl_surface_mac.cc
@@ -4,6 +4,7 @@
#include "ui/gl/gl_surface.h"
+#include "base/debug/trace_event.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "third_party/mesa/MesaLib/include/GL/osmesa.h"
@@ -37,6 +38,7 @@ bool GLSurface::InitializeOneOffInternal() {
scoped_refptr<GLSurface> GLSurface::CreateViewGLSurface(
bool software,
gfx::AcceleratedWidget window) {
+ TRACE_EVENT0("gpu", "GLSurface::CreateViewGLSurface");
#if defined(USE_AURA)
if (software)
return NULL;
@@ -64,6 +66,7 @@ scoped_refptr<GLSurface> GLSurface::CreateViewGLSurface(
scoped_refptr<GLSurface> GLSurface::CreateOffscreenGLSurface(
bool software,
const gfx::Size& size) {
+ TRACE_EVENT0("gpu", "GLSurface::CreateOffscreenGLSurface");
if (software)
return NULL;
diff --git a/ui/gl/gl_surface_win.cc b/ui/gl/gl_surface_win.cc
index ae55568..b07dff4 100644
--- a/ui/gl/gl_surface_win.cc
+++ b/ui/gl/gl_surface_win.cc
@@ -4,6 +4,7 @@
#include "ui/gl/gl_surface.h"
+#include "base/debug/trace_event.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "third_party/mesa/MesaLib/include/GL/osmesa.h"
@@ -174,6 +175,7 @@ bool NativeViewGLSurfaceOSMesa::PostSubBuffer(
scoped_refptr<GLSurface> GLSurface::CreateViewGLSurface(
bool software,
gfx::AcceleratedWidget window) {
+ TRACE_EVENT0("gpu", "GLSurface::CreateViewGLSurface");
switch (GetGLImplementation()) {
case kGLImplementationOSMesaGL: {
scoped_refptr<GLSurface> surface(
@@ -212,6 +214,7 @@ scoped_refptr<GLSurface> GLSurface::CreateViewGLSurface(
scoped_refptr<GLSurface> GLSurface::CreateOffscreenGLSurface(
bool software,
const gfx::Size& size) {
+ TRACE_EVENT0("gpu", "GLSurface::CreateOffscreenGLSurface");
switch (GetGLImplementation()) {
case kGLImplementationOSMesaGL: {
scoped_refptr<GLSurface> surface(new GLSurfaceOSMesa(OSMESA_RGBA,