| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "gpu/command_buffer/service/gpu_tracer.h" | 5 #include "gpu/command_buffer/service/gpu_tracer.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <deque> | 10 #include <deque> |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 const std::string& category, | 67 const std::string& category, |
| 68 const std::string& name, | 68 const std::string& name, |
| 69 int64_t start_time, | 69 int64_t start_time, |
| 70 int64_t end_time) { | 70 int64_t end_time) { |
| 71 DCHECK(source >= 0 && source < NUM_TRACER_SOURCES); | 71 DCHECK(source >= 0 && source < NUM_TRACER_SOURCES); |
| 72 TRACE_EVENT_COPY_BEGIN_WITH_ID_TID_AND_TIMESTAMP2( | 72 TRACE_EVENT_COPY_BEGIN_WITH_ID_TID_AND_TIMESTAMP2( |
| 73 TRACE_DISABLED_BY_DEFAULT("gpu.device"), | 73 TRACE_DISABLED_BY_DEFAULT("gpu.device"), |
| 74 name.c_str(), | 74 name.c_str(), |
| 75 local_trace_device_id_, | 75 local_trace_device_id_, |
| 76 named_thread_.GetThreadId(), | 76 named_thread_.GetThreadId(), |
| 77 start_time, | 77 base::TimeTicks::FromInternalValue(start_time), |
| 78 "gl_category", | 78 "gl_category", |
| 79 category.c_str(), | 79 category.c_str(), |
| 80 "channel", | 80 "channel", |
| 81 kGpuTraceSourceNames[source]); | 81 kGpuTraceSourceNames[source]); |
| 82 | 82 |
| 83 // Time stamps are inclusive, since the traces are durations we subtract | 83 // Time stamps are inclusive, since the traces are durations we subtract |
| 84 // 1 microsecond from the end time to make the trace markers show up cleaner. | 84 // 1 microsecond from the end time to make the trace markers show up cleaner. |
| 85 TRACE_EVENT_COPY_END_WITH_ID_TID_AND_TIMESTAMP2( | 85 TRACE_EVENT_COPY_END_WITH_ID_TID_AND_TIMESTAMP2( |
| 86 TRACE_DISABLED_BY_DEFAULT("gpu.device"), | 86 TRACE_DISABLED_BY_DEFAULT("gpu.device"), |
| 87 name.c_str(), | 87 name.c_str(), |
| 88 local_trace_device_id_, | 88 local_trace_device_id_, |
| 89 named_thread_.GetThreadId(), | 89 named_thread_.GetThreadId(), |
| 90 end_time - 1, | 90 base::TimeTicks::FromInternalValue(end_time - 1), |
| 91 "gl_category", | 91 "gl_category", |
| 92 category.c_str(), | 92 category.c_str(), |
| 93 "channel", | 93 "channel", |
| 94 kGpuTraceSourceNames[source]); | 94 kGpuTraceSourceNames[source]); |
| 95 ++local_trace_device_id_; | 95 ++local_trace_device_id_; |
| 96 } | 96 } |
| 97 | 97 |
| 98 void TraceOutputter::TraceServiceBegin(GpuTracerSource source, | 98 void TraceOutputter::TraceServiceBegin(GpuTracerSource source, |
| 99 const std::string& category, | 99 const std::string& category, |
| 100 const std::string& name) { | 100 const std::string& name) { |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 } | 416 } |
| 417 | 417 |
| 418 while (!finished_traces_.empty()) { | 418 while (!finished_traces_.empty()) { |
| 419 finished_traces_.front()->Destroy(have_context); | 419 finished_traces_.front()->Destroy(have_context); |
| 420 finished_traces_.pop_front(); | 420 finished_traces_.pop_front(); |
| 421 } | 421 } |
| 422 } | 422 } |
| 423 | 423 |
| 424 } // namespace gles2 | 424 } // namespace gles2 |
| 425 } // namespace gpu | 425 } // namespace gpu |
| OLD | NEW |