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

Unified Diff: gpu/command_buffer/client/gles2_implementation.cc

Issue 776603003: Changed the GPU Tracer so the category names can be customized. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Service side GPU trace not turned on when device is turned on 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
Index: gpu/command_buffer/client/gles2_implementation.cc
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index 4c148e9081cd22c2079fbd19c1e6198b16f5739c..69d6e25c47910ec5a8141d432d73138609d95bac 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -3477,32 +3477,38 @@ void GLES2Implementation::PopGroupMarkerEXT() {
debug_marker_manager_.PopGroup();
}
-void GLES2Implementation::TraceBeginCHROMIUM(const char* name) {
+void GLES2Implementation::TraceBeginCHROMIUM(
+ const char* category_name, const char* trace_name) {
GPU_CLIENT_SINGLE_THREAD_CHECK();
GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glTraceBeginCHROMIUM("
- << name << ")");
- if (current_trace_name_.get()) {
+ << category_name << ", " << trace_name << ")");
+ if (current_trace_category_.get() || current_trace_name_.get()) {
SetGLError(GL_INVALID_OPERATION, "glTraceBeginCHROMIUM",
"trace already running");
return;
}
- TRACE_EVENT_COPY_ASYNC_BEGIN0("gpu", name, this);
- SetBucketAsCString(kResultBucketId, name);
- helper_->TraceBeginCHROMIUM(kResultBucketId);
+ TRACE_EVENT_COPY_ASYNC_BEGIN0(category_name, trace_name, this);
+ SetBucketAsCString(kResultBucketId, category_name);
+ SetBucketAsCString(kResultBucketId + 1, category_name);
+ helper_->TraceBeginCHROMIUM(kResultBucketId, kResultBucketId + 1);
helper_->SetBucketSize(kResultBucketId, 0);
- current_trace_name_.reset(new std::string(name));
+ helper_->SetBucketSize(kResultBucketId + 1, 0);
+ current_trace_category_.reset(new std::string(category_name));
+ current_trace_name_.reset(new std::string(trace_name));
}
void GLES2Implementation::TraceEndCHROMIUM() {
GPU_CLIENT_SINGLE_THREAD_CHECK();
GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glTraceEndCHROMIUM(" << ")");
- if (!current_trace_name_.get()) {
+ if (!current_trace_category_.get() || !current_trace_name_.get()) {
SetGLError(GL_INVALID_OPERATION, "glTraceEndCHROMIUM",
"missing begin trace");
return;
}
helper_->TraceEndCHROMIUM();
- TRACE_EVENT_COPY_ASYNC_END0("gpu", current_trace_name_->c_str(), this);
+ TRACE_EVENT_COPY_ASYNC_END0(current_trace_category_->c_str(),
+ current_trace_name_->c_str(), this);
+ current_trace_category_.reset();
current_trace_name_.reset();
}
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation.h ('k') | gpu/command_buffer/client/gles2_implementation_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698