Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1176)

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 813573003: Fixed GPU tracing so the categories do not get mixed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/debug/trace_event.h ('k') | gpu/command_buffer/service/gpu_tracer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index f97710e86a61009ce7b6b54517f63040d5f8cb3b..0a0efc913a97fc2f0dbb2a358ce14822f6d52041 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -1873,7 +1873,6 @@ class GLES2DecoderImpl : public GLES2Decoder,
scoped_ptr<GPUStateTracer> gpu_state_tracer_;
const unsigned char* cb_command_trace_category_;
const unsigned char* gpu_decoder_category_;
- const unsigned char* gpu_group_marker_category_;
int gpu_trace_level_;
bool gpu_trace_commands_;
bool gpu_debug_commands_;
@@ -2391,8 +2390,6 @@ GLES2DecoderImpl::GLES2DecoderImpl(ContextGroup* group)
TRACE_DISABLED_BY_DEFAULT("cb_command"))),
gpu_decoder_category_(TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(
TRACE_DISABLED_BY_DEFAULT("gpu_decoder"))),
- gpu_group_marker_category_(TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(
- TRACE_DISABLED_BY_DEFAULT("gpu_group_marker"))),
gpu_trace_level_(2),
gpu_trace_commands_(false),
gpu_debug_commands_(false),
@@ -10976,17 +10973,13 @@ void GLES2DecoderImpl::DoPushGroupMarkerEXT(
}
std::string name = length ? std::string(marker, length) : std::string(marker);
debug_marker_manager_.PushGroup(name);
- if (*gpu_group_marker_category_) {
- gpu_tracer_->Begin(TRACE_DISABLED_BY_DEFAULT("gpu_group_marker"), name,
- kTraceGroupMarker);
- }
+ gpu_tracer_->Begin(TRACE_DISABLED_BY_DEFAULT("gpu_group_marker"), name,
+ kTraceGroupMarker);
}
void GLES2DecoderImpl::DoPopGroupMarkerEXT(void) {
debug_marker_manager_.PopGroup();
- if (*gpu_group_marker_category_) {
- gpu_tracer_->End(kTraceGroupMarker);
- }
+ gpu_tracer_->End(kTraceGroupMarker);
}
void GLES2DecoderImpl::DoBindTexImage2DCHROMIUM(
@@ -11106,15 +11099,14 @@ error::Error GLES2DecoderImpl::HandleTraceBeginCHROMIUM(
}
void GLES2DecoderImpl::DoTraceEndCHROMIUM() {
- if (gpu_tracer_->CurrentCategory().empty() ||
- gpu_tracer_->CurrentName().empty()) {
- LOCAL_SET_GL_ERROR(
- GL_INVALID_OPERATION,
- "glTraceEndCHROMIUM", "no trace begin found");
+ const std::string& category = gpu_tracer_->CurrentCategory(kTraceCHROMIUM);
+ const std::string& name = gpu_tracer_->CurrentName(kTraceCHROMIUM);
+ if (category.empty() || name.empty()) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION,
+ "glTraceEndCHROMIUM", "no trace begin found");
return;
}
- TRACE_EVENT_COPY_ASYNC_END0(gpu_tracer_->CurrentCategory().c_str(),
- gpu_tracer_->CurrentName().c_str(), this);
+ TRACE_EVENT_COPY_ASYNC_END0(category.c_str(), name.c_str(), this);
vmiura 2014/12/16 23:40:11 This seems like it might have the same problem, wh
David Yen 2014/12/17 18:29:35 Done.
gpu_tracer_->End(kTraceCHROMIUM);
}
« no previous file with comments | « base/debug/trace_event.h ('k') | gpu/command_buffer/service/gpu_tracer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698