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

Side by Side Diff: cc/base/devtools_instrumentation.h

Issue 2904743002: cc: Add UMA for tracking decode duration for out of raster decodes. (Closed)
Patch Set: addressed comments Created 3 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | cc/tiles/gpu_image_decode_cache.cc » ('j') | cc/tiles/image_decode_cache.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef CC_BASE_DEVTOOLS_INSTRUMENTATION_H_ 5 #ifndef CC_BASE_DEVTOOLS_INSTRUMENTATION_H_
6 #define CC_BASE_DEVTOOLS_INSTRUMENTATION_H_ 6 #define CC_BASE_DEVTOOLS_INSTRUMENTATION_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 ~ScopedLayerTask() { TRACE_EVENT_END0(internal::kCategory, event_name_); } 50 ~ScopedLayerTask() { TRACE_EVENT_END0(internal::kCategory, event_name_); }
51 51
52 private: 52 private:
53 const char* event_name_; 53 const char* event_name_;
54 54
55 DISALLOW_COPY_AND_ASSIGN(ScopedLayerTask); 55 DISALLOW_COPY_AND_ASSIGN(ScopedLayerTask);
56 }; 56 };
57 57
58 class CC_BASE_EXPORT ScopedImageDecodeTask { 58 class CC_BASE_EXPORT ScopedImageDecodeTask {
59 public: 59 public:
60 enum Type { SOFTWARE, GPU }; 60 enum DecodeType { kSoftware, kGpu };
61 enum TaskType { kInRaster, kOutOfRaster };
61 62
62 ScopedImageDecodeTask(const void* imagePtr, Type type) 63 ScopedImageDecodeTask(const void* image_ptr,
63 : type_(type), start_time_(base::TimeTicks::Now()) { 64 DecodeType type,
65 TaskType task_type)
66 : type_(type),
vmpstr 2017/06/01 21:40:56 nit: decode_type_(decode_type)
Khushal 2017/06/01 23:45:09 Done.
67 task_type_(task_type),
68 start_time_(base::TimeTicks::Now()) {
64 TRACE_EVENT_BEGIN1(internal::kCategory, internal::kImageDecodeTask, 69 TRACE_EVENT_BEGIN1(internal::kCategory, internal::kImageDecodeTask,
65 internal::kPixelRefId, 70 internal::kPixelRefId,
66 reinterpret_cast<uint64_t>(imagePtr)); 71 reinterpret_cast<uint64_t>(image_ptr));
67 } 72 }
68 ~ScopedImageDecodeTask() { 73 ~ScopedImageDecodeTask() {
69 TRACE_EVENT_END0(internal::kCategory, internal::kImageDecodeTask); 74 TRACE_EVENT_END0(internal::kCategory, internal::kImageDecodeTask);
70 base::TimeDelta duration = base::TimeTicks::Now() - start_time_; 75 base::TimeDelta duration = base::TimeTicks::Now() - start_time_;
71 switch (type_) { 76 switch (task_type_) {
72 case SOFTWARE: 77 case kInRaster:
73 UMA_HISTOGRAM_COUNTS_1M("Renderer4.ImageDecodeTaskDurationUs.Software", 78 switch (type_) {
74 duration.InMicroseconds()); 79 case kSoftware:
80 UMA_HISTOGRAM_COUNTS_1M(
81 "Renderer4.ImageDecodeTaskDurationUs.Software",
82 duration.InMicroseconds());
83 break;
84 case kGpu:
85 UMA_HISTOGRAM_COUNTS_1M("Renderer4.ImageDecodeTaskDurationUs.Gpu",
86 duration.InMicroseconds());
87 break;
88 }
75 break; 89 break;
76 case GPU: 90 case kOutOfRaster:
77 UMA_HISTOGRAM_COUNTS_1M("Renderer4.ImageDecodeTaskDurationUs.Gpu", 91 switch (type_) {
78 duration.InMicroseconds()); 92 case kSoftware:
93 UMA_HISTOGRAM_COUNTS_1M(
94 "Renderer4.ImageDecodeTaskDurationUs.OutOfRaster.Software",
95 duration.InMicroseconds());
96 break;
97 case kGpu:
98 UMA_HISTOGRAM_COUNTS_1M(
99 "Renderer4.ImageDecodeTaskDurationUs.OutOfRaster.Gpu",
100 duration.InMicroseconds());
101 break;
102 }
79 break; 103 break;
80 } 104 }
81 } 105 }
82 106
83 private: 107 private:
84 const Type type_; 108 const DecodeType type_;
109 const TaskType task_type_;
85 const base::TimeTicks start_time_; 110 const base::TimeTicks start_time_;
86 DISALLOW_COPY_AND_ASSIGN(ScopedImageDecodeTask); 111 DISALLOW_COPY_AND_ASSIGN(ScopedImageDecodeTask);
87 }; 112 };
88 113
89 class CC_BASE_EXPORT ScopedLayerTreeTask { 114 class CC_BASE_EXPORT ScopedLayerTreeTask {
90 public: 115 public:
91 ScopedLayerTreeTask(const char* event_name, 116 ScopedLayerTreeTask(const char* event_name,
92 int layer_id, 117 int layer_id,
93 int layer_tree_host_id) 118 int layer_tree_host_id)
94 : event_name_(event_name) { 119 : event_name_(event_name) {
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 TRACE_EVENT_INSTANT2( 207 TRACE_EVENT_INSTANT2(
183 internal::kCategoryFrame, internal::kNeedsBeginFrameChanged, 208 internal::kCategoryFrame, internal::kNeedsBeginFrameChanged,
184 TRACE_EVENT_SCOPE_THREAD, internal::kLayerTreeId, layer_tree_host_id, 209 TRACE_EVENT_SCOPE_THREAD, internal::kLayerTreeId, layer_tree_host_id,
185 internal::kData, NeedsBeginFrameData(new_value)); 210 internal::kData, NeedsBeginFrameData(new_value));
186 } 211 }
187 212
188 } // namespace devtools_instrumentation 213 } // namespace devtools_instrumentation
189 } // namespace cc 214 } // namespace cc
190 215
191 #endif // CC_BASE_DEVTOOLS_INSTRUMENTATION_H_ 216 #endif // CC_BASE_DEVTOOLS_INSTRUMENTATION_H_
OLDNEW
« no previous file with comments | « no previous file | cc/tiles/gpu_image_decode_cache.cc » ('j') | cc/tiles/image_decode_cache.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698