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

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

Issue 2904743002: cc: Add UMA for tracking decode duration for out of raster decodes. (Closed)
Patch Set: move 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 | « cc/base/devtools_instrumentation.h ('k') | cc/tiles/gpu_image_decode_cache.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "cc/base/devtools_instrumentation.h" 5 #include "cc/base/devtools_instrumentation.h"
6 6
7 namespace cc { 7 namespace cc {
8 namespace devtools_instrumentation { 8 namespace devtools_instrumentation {
9 9
10 namespace internal { 10 namespace internal {
(...skipping 12 matching lines...) Expand all
23 extern const char kActivateLayerTree[] = "ActivateLayerTree"; 23 extern const char kActivateLayerTree[] = "ActivateLayerTree";
24 extern const char kRequestMainThreadFrame[] = "RequestMainThreadFrame"; 24 extern const char kRequestMainThreadFrame[] = "RequestMainThreadFrame";
25 extern const char kBeginMainThreadFrame[] = "BeginMainThreadFrame"; 25 extern const char kBeginMainThreadFrame[] = "BeginMainThreadFrame";
26 extern const char kDrawFrame[] = "DrawFrame"; 26 extern const char kDrawFrame[] = "DrawFrame";
27 extern const char kCompositeLayers[] = "CompositeLayers"; 27 extern const char kCompositeLayers[] = "CompositeLayers";
28 } // namespace internal 28 } // namespace internal
29 29
30 extern const char kPaintSetup[] = "PaintSetup"; 30 extern const char kPaintSetup[] = "PaintSetup";
31 extern const char kUpdateLayer[] = "UpdateLayer"; 31 extern const char kUpdateLayer[] = "UpdateLayer";
32 32
33 ScopedImageDecodeTask::ScopedImageDecodeTask(const void* image_ptr,
34 DecodeType decode_type,
35 TaskType task_type)
36 : decode_type_(decode_type),
37 task_type_(task_type),
38 start_time_(base::TimeTicks::Now()) {
39 TRACE_EVENT_BEGIN1(internal::kCategory, internal::kImageDecodeTask,
40 internal::kPixelRefId,
41 reinterpret_cast<uint64_t>(image_ptr));
42 }
43
44 ScopedImageDecodeTask::~ScopedImageDecodeTask() {
45 TRACE_EVENT_END0(internal::kCategory, internal::kImageDecodeTask);
46 base::TimeDelta duration = base::TimeTicks::Now() - start_time_;
47 switch (task_type_) {
48 case kInRaster:
49 switch (decode_type_) {
50 case kSoftware:
51 UMA_HISTOGRAM_COUNTS_1M(
52 "Renderer4.ImageDecodeTaskDurationUs.Software",
53 duration.InMicroseconds());
54 break;
55 case kGpu:
56 UMA_HISTOGRAM_COUNTS_1M("Renderer4.ImageDecodeTaskDurationUs.Gpu",
57 duration.InMicroseconds());
58 break;
59 }
60 break;
61 case kOutOfRaster:
62 switch (decode_type_) {
63 case kSoftware:
64 UMA_HISTOGRAM_COUNTS_1M(
65 "Renderer4.ImageDecodeTaskDurationUs.OutOfRaster.Software",
66 duration.InMicroseconds());
67 break;
68 case kGpu:
69 UMA_HISTOGRAM_COUNTS_1M(
70 "Renderer4.ImageDecodeTaskDurationUs.OutOfRaster.Gpu",
71 duration.InMicroseconds());
72 break;
73 }
74 break;
75 }
76 }
77
33 } // namespace devtools_instrumentation 78 } // namespace devtools_instrumentation
34 } // namespace cc 79 } // namespace cc
OLDNEW
« no previous file with comments | « cc/base/devtools_instrumentation.h ('k') | cc/tiles/gpu_image_decode_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698