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

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

Issue 1314053002: Have GPUTracer process traces during CommandBuffer Idle time. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months 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 | « gpu/command_buffer/service/gpu_tracer.h ('k') | gpu/command_buffer/service/gpu_tracer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gpu_tracer.cc
diff --git a/gpu/command_buffer/service/gpu_tracer.cc b/gpu/command_buffer/service/gpu_tracer.cc
index bbfcc09c1c24bb2aa61ff76dee3458c537db94b4..3ea2adee14d4f5aad444aedb8894858a71f282db 100644
--- a/gpu/command_buffer/service/gpu_tracer.cc
+++ b/gpu/command_buffer/service/gpu_tracer.cc
@@ -24,7 +24,6 @@
namespace gpu {
namespace gles2 {
-static const unsigned int kProcessInterval = 16;
static const char* kGpuTraceSourceNames[] = {
"TraceCHROMIUM", // kTraceCHROMIUM,
"TraceCmd", // kTraceDecoder,
@@ -251,7 +250,6 @@ bool GPUTracer::EndDecoding() {
}
}
}
- IssueProcessTask();
}
gpu_executing_ = false;
@@ -297,7 +295,6 @@ bool GPUTracer::End(GpuTracerSource source) {
}
finished_traces_.push_back(trace);
- IssueProcessTask();
}
markers_[source].pop_back();
@@ -306,42 +303,8 @@ bool GPUTracer::End(GpuTracerSource source) {
return false;
}
-bool GPUTracer::IsTracing() {
- return (*gpu_trace_srv_category != 0) || (*gpu_trace_dev_category != 0);
-}
-
-const std::string& GPUTracer::CurrentCategory(GpuTracerSource source) const {
- if (source >= 0 &&
- source < NUM_TRACER_SOURCES &&
- !markers_[source].empty()) {
- return markers_[source].back().category_;
- }
- return base::EmptyString();
-}
-
-const std::string& GPUTracer::CurrentName(GpuTracerSource source) const {
- if (source >= 0 &&
- source < NUM_TRACER_SOURCES &&
- !markers_[source].empty()) {
- return markers_[source].back().name_;
- }
- return base::EmptyString();
-}
-
-scoped_refptr<Outputter> GPUTracer::CreateOutputter(const std::string& name) {
- return TraceOutputter::Create(name);
-}
-
-void GPUTracer::PostTask() {
- base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
- FROM_HERE, base::Bind(&GPUTracer::Process, base::AsWeakPtr(this)),
- base::TimeDelta::FromMilliseconds(kProcessInterval));
-}
-
-void GPUTracer::Process() {
- process_posted_ = false;
- ProcessTraces();
- IssueProcessTask();
+bool GPUTracer::HasTracesToProcess() {
+ return !finished_traces_.empty();
}
void GPUTracer::ProcessTraces() {
@@ -386,6 +349,32 @@ void GPUTracer::ProcessTraces() {
DCHECK(GL_NO_ERROR == glGetError());
}
+bool GPUTracer::IsTracing() {
+ return (*gpu_trace_srv_category != 0) || (*gpu_trace_dev_category != 0);
+}
+
+const std::string& GPUTracer::CurrentCategory(GpuTracerSource source) const {
+ if (source >= 0 &&
+ source < NUM_TRACER_SOURCES &&
+ !markers_[source].empty()) {
+ return markers_[source].back().category_;
+ }
+ return base::EmptyString();
+}
+
+const std::string& GPUTracer::CurrentName(GpuTracerSource source) const {
+ if (source >= 0 &&
+ source < NUM_TRACER_SOURCES &&
+ !markers_[source].empty()) {
+ return markers_[source].back().name_;
+ }
+ return base::EmptyString();
+}
+
+scoped_refptr<Outputter> GPUTracer::CreateOutputter(const std::string& name) {
+ return TraceOutputter::Create(name);
+}
+
bool GPUTracer::CheckDisjointStatus() {
const int64 current_time = gpu_timing_client_->GetCurrentCPUTime();
if (*gpu_trace_dev_category == 0)
@@ -423,13 +412,5 @@ void GPUTracer::ClearOngoingTraces(bool have_context) {
}
}
-void GPUTracer::IssueProcessTask() {
- if (finished_traces_.empty() || process_posted_)
- return;
-
- process_posted_ = true;
- PostTask();
-}
-
} // namespace gles2
} // namespace gpu
« no previous file with comments | « gpu/command_buffer/service/gpu_tracer.h ('k') | gpu/command_buffer/service/gpu_tracer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698