diff options
author | dyen <dyen@chromium.org> | 2015-07-21 16:40:10 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-21 23:41:56 +0000 |
commit | 2b089f9f3c4cdeb163aa81b35911ba3d1c53ed9a (patch) | |
tree | 0a07dad6a745b47701cb498c84455d643ad22bb1 | |
parent | c0299ae3c8a93f9d19d2367e4cc7568231f708bb (diff) | |
download | chromium_src-2b089f9f3c4cdeb163aa81b35911ba3d1c53ed9a.zip chromium_src-2b089f9f3c4cdeb163aa81b35911ba3d1c53ed9a.tar.gz chromium_src-2b089f9f3c4cdeb163aa81b35911ba3d1c53ed9a.tar.bz2 |
Merge Group Markers into Chromium Traces.
In a previous CL top level group markers were converted to using
chromium traces:
https://codereview.chromium.org/780653007/
The initial thought was that we would standardize on a single trace
type. This is a transitional step which moves the debug marker
manager to be set in the chromium traces, and also makes the group
marker calls mimic the chromium trace calls. Eventually the group
marker calls should be deprecated.
R=sievers@chromium.org, vmiura@chromium.org
BUG=242999, 503166
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1132283003
Cr-Commit-Position: refs/heads/master@{#339781}
-rw-r--r-- | cc/raster/scoped_gpu_raster.cc | 4 | ||||
-rw-r--r-- | content/browser/android/in_process/context_provider_in_process.cc | 2 | ||||
-rw-r--r-- | content/renderer/pepper/video_decoder_shim.cc | 9 | ||||
-rw-r--r-- | gpu/command_buffer/service/gles2_cmd_decoder.cc | 15 | ||||
-rw-r--r-- | gpu/command_buffer/service/gpu_tracer.cc | 7 | ||||
-rw-r--r-- | gpu/command_buffer/service/gpu_tracer.h | 1 | ||||
-rw-r--r-- | gpu/command_buffer/service/gpu_tracer_unittest.cc | 6 | ||||
-rw-r--r-- | ppapi/shared_impl/ppb_graphics_3d_shared.cc | 2 |
8 files changed, 18 insertions, 28 deletions
diff --git a/cc/raster/scoped_gpu_raster.cc b/cc/raster/scoped_gpu_raster.cc index f548515..e6dcf23 100644 --- a/cc/raster/scoped_gpu_raster.cc +++ b/cc/raster/scoped_gpu_raster.cc @@ -27,7 +27,7 @@ void ScopedGpuRaster::BeginGpuRaster() { // TODO(alokp): Use a trace macro to push/pop markers. // Using push/pop functions directly incurs cost to evaluate function // arguments even when tracing is disabled. - gl->PushGroupMarkerEXT(0, "GpuRasterization"); + gl->TraceBeginCHROMIUM("ScopedGpuRaster", "GpuRasterization"); class GrContext* gr_context = context_provider_->GrContext(); gr_context->resetContext(); @@ -45,7 +45,7 @@ void ScopedGpuRaster::EndGpuRaster() { // TODO(alokp): Use a trace macro to push/pop markers. // Using push/pop functions directly incurs cost to evaluate function // arguments even when tracing is disabled. - gl->PopGroupMarkerEXT(); + gl->TraceEndCHROMIUM(); } } // namespace cc diff --git a/content/browser/android/in_process/context_provider_in_process.cc b/content/browser/android/in_process/context_provider_in_process.cc index f9ab90e..5fea00f 100644 --- a/content/browser/android/in_process/context_provider_in_process.cc +++ b/content/browser/android/in_process/context_provider_in_process.cc @@ -83,7 +83,7 @@ bool ContextProviderInProcess::BindToCurrentThread() { InitializeCapabilities(); - std::string unique_context_name = + const std::string unique_context_name = base::StringPrintf("%s-%p", debug_name_.c_str(), context3d_.get()); context3d_->traceBeginCHROMIUM("gpu_toplevel", unique_context_name.c_str()); diff --git a/content/renderer/pepper/video_decoder_shim.cc b/content/renderer/pepper/video_decoder_shim.cc index 471d2c5..5122117 100644 --- a/content/renderer/pepper/video_decoder_shim.cc +++ b/content/renderer/pepper/video_decoder_shim.cc @@ -312,8 +312,7 @@ bool VideoDecoderShim::YUVConverter::Initialize() { return false; } - gl_->PushGroupMarkerEXT(0, "YUVConverterContext"); - + gl_->TraceBeginCHROMIUM("YUVConverter", "YUVConverterContext"); gl_->GenFramebuffers(1, &frame_buffer_); y_texture_ = CreateTexture(); @@ -332,7 +331,7 @@ bool VideoDecoderShim::YUVConverter::Initialize() { program_ = CreateShader(); - gl_->PopGroupMarkerEXT(); + gl_->TraceEndCHROMIUM(); context_provider_->InvalidateGrContext(kGrInvalidateState); @@ -414,7 +413,7 @@ void VideoDecoderShim::YUVConverter::Convert( y_width_ = y_height_ = 0; } - gl_->PushGroupMarkerEXT(0, "YUVConverterContext"); + gl_->TraceBeginCHROMIUM("YUVConverter", "YUVConverterContext"); uint32_t ywidth = frame->coded_size().width(); uint32_t yheight = frame->coded_size().height(); @@ -565,7 +564,7 @@ void VideoDecoderShim::YUVConverter::Convert( gl_->BindTexture(GL_TEXTURE_2D, 0); gl_->PixelStorei(GL_UNPACK_ROW_LENGTH, 0); - gl_->PopGroupMarkerEXT(); + gl_->TraceEndCHROMIUM(); context_provider_->InvalidateGrContext(kGrInvalidateState); } diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index 174b787..c25024f 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc @@ -11051,7 +11051,7 @@ void GLES2DecoderImpl::DoSwapBuffers() { } ScopedGPUTrace scoped_gpu_trace(gpu_tracer_.get(), kTraceDecoder, - "gpu_toplevel", "SwapBuffer"); + "GLES2Decoder", "SwapBuffer"); bool is_tracing; TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("gpu.debug"), @@ -13171,19 +13171,10 @@ void GLES2DecoderImpl::DoInsertEventMarkerEXT( } void GLES2DecoderImpl::DoPushGroupMarkerEXT( - GLsizei length, const GLchar* marker) { - if (!marker) { - marker = ""; - } - std::string name = length ? std::string(marker, length) : std::string(marker); - debug_marker_manager_.PushGroup(name); - gpu_tracer_->Begin(TRACE_DISABLED_BY_DEFAULT("gpu_group_marker"), name, - kTraceGroupMarker); + GLsizei /*length*/, const GLchar* /*marker*/) { } void GLES2DecoderImpl::DoPopGroupMarkerEXT(void) { - debug_marker_manager_.PopGroup(); - gpu_tracer_->End(kTraceGroupMarker); } void GLES2DecoderImpl::DoBindTexImage2DCHROMIUM( @@ -13292,6 +13283,7 @@ error::Error GLES2DecoderImpl::HandleTraceBeginCHROMIUM( return error::kInvalidArguments; } + debug_marker_manager_.PushGroup(trace_name); if (!gpu_tracer_->Begin(category_name, trace_name, kTraceCHROMIUM)) { LOCAL_SET_GL_ERROR( GL_INVALID_OPERATION, @@ -13302,6 +13294,7 @@ error::Error GLES2DecoderImpl::HandleTraceBeginCHROMIUM( } void GLES2DecoderImpl::DoTraceEndCHROMIUM() { + debug_marker_manager_.PopGroup(); if (!gpu_tracer_->End(kTraceCHROMIUM)) { LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glTraceEndCHROMIUM", "no trace begin found"); diff --git a/gpu/command_buffer/service/gpu_tracer.cc b/gpu/command_buffer/service/gpu_tracer.cc index 868c5ec..5e6cd63 100644 --- a/gpu/command_buffer/service/gpu_tracer.cc +++ b/gpu/command_buffer/service/gpu_tracer.cc @@ -26,10 +26,9 @@ namespace gles2 { static const unsigned int kProcessInterval = 16; static const char* kGpuTraceSourceNames[] = { - "GroupMarker", // kTraceGroupMarker = 0, - "TraceCHROMIUM", // kTraceCHROMIUM = 1, - "TraceCmd", // kTraceDecoder = 2, - "Disjoint", // kTraceDisjoint = 3, // Used internally. + "TraceCHROMIUM", // kTraceCHROMIUM, + "TraceCmd", // kTraceDecoder, + "Disjoint", // kTraceDisjoint, // Used internally. }; static_assert(NUM_TRACER_SOURCES == arraysize(kGpuTraceSourceNames), "Trace source names must match enumeration."); diff --git a/gpu/command_buffer/service/gpu_tracer.h b/gpu/command_buffer/service/gpu_tracer.h index 610af9d..596e60b 100644 --- a/gpu/command_buffer/service/gpu_tracer.h +++ b/gpu/command_buffer/service/gpu_tracer.h @@ -33,7 +33,6 @@ class GPUTrace; enum GpuTracerSource { kTraceGroupInvalid = -1, - kTraceGroupMarker, kTraceCHROMIUM, kTraceDecoder, kTraceDisjoint, // Used internally. diff --git a/gpu/command_buffer/service/gpu_tracer_unittest.cc b/gpu/command_buffer/service/gpu_tracer_unittest.cc index 9bb5998..f636edd9 100644 --- a/gpu/command_buffer/service/gpu_tracer_unittest.cc +++ b/gpu/command_buffer/service/gpu_tracer_unittest.cc @@ -227,7 +227,7 @@ class BaseGpuTraceTest : public BaseGpuTest { void DoTraceTest(bool tracing_service, bool tracing_device) { // Expected results - const GpuTracerSource tracer_source = kTraceGroupMarker; + const GpuTracerSource tracer_source = kTraceCHROMIUM; const std::string category_name("trace_category"); const std::string trace_name("trace_test"); const int64 offset_time = 3231; @@ -766,11 +766,11 @@ TEST_F(GPUTracerTest, TraceDuringDecodeTest) { const std::string trace_name("trace_test"); EXPECT_FALSE( - tracer_tester_->Begin(category_name, trace_name, kTraceGroupMarker)); + tracer_tester_->Begin(category_name, trace_name, kTraceCHROMIUM)); ASSERT_TRUE(tracer_tester_->BeginDecoding()); EXPECT_TRUE( - tracer_tester_->Begin(category_name, trace_name, kTraceGroupMarker)); + tracer_tester_->Begin(category_name, trace_name, kTraceCHROMIUM)); ASSERT_TRUE(tracer_tester_->EndDecoding()); } diff --git a/ppapi/shared_impl/ppb_graphics_3d_shared.cc b/ppapi/shared_impl/ppb_graphics_3d_shared.cc index 32eebe6..854bf51 100644 --- a/ppapi/shared_impl/ppb_graphics_3d_shared.cc +++ b/ppapi/shared_impl/ppb_graphics_3d_shared.cc @@ -139,7 +139,7 @@ bool PPB_Graphics3D_Shared::CreateGLES2Impl( return false; } - gles2_impl_->PushGroupMarkerEXT(0, "PPAPIContext"); + gles2_impl_->TraceBeginCHROMIUM("gpu_toplevel", "PPAPIContext"); return true; } |