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

Issue 2973543002: Record task durations on Renderer Main & Compositor threads.

Created:
3 years, 5 months ago by tdresser
Modified:
3 years, 4 months ago
Reviewers:
Sami, altimin, tdresser1
CC:
chromium-reviews, danakj+watch_chromium.org, asvitkine+watch_chromium.org, vmpstr+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Record task durations on Renderer Main & Compositor threads. This change piggybacks on the chrome://profiler machinery. Normally, this machinery is only enabled on some platforms. This patch forces us to measure durations of tasks on the renderer main and compositor threads. This may negatively impact Android performance, but based on previous experimentation of this sort, I strongly expect we won't see any regressions here. BUG=736449

Patch Set 1 #

Patch Set 2 : Cleanup #

Patch Set 3 : Fix layering issues. #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+102 lines, -6 lines) Patch
M base/debug/task_annotator.cc View 1 2 2 chunks +25 lines, -0 lines 4 comments Download
M base/debug/task_annotator_unittest.cc View 2 chunks +23 lines, -0 lines 0 comments Download
M base/tracked_objects.h View 1 2 3 chunks +12 lines, -0 lines 1 comment Download
M base/tracked_objects.cc View 1 2 5 chunks +22 lines, -5 lines 0 comments Download
M base/tracking_info.cc View 1 chunk +0 lines, -1 line 0 comments Download
M content/renderer/renderer_main.cc View 1 2 2 chunks +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/scheduler/DEPS View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/scheduler/child/webthread_base.cc View 1 2 2 chunks +2 lines, -0 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 2 chunks +15 lines, -0 lines 0 comments Download

Messages

Total messages: 15 (6 generated)
tdresser1
+altimin, can you see if this seems sane to you? I'm a bit worried about ...
3 years, 5 months ago (2017-07-06 20:36:15 UTC) #6
altimin
On 2017/07/06 20:36:15, tdresser1 wrote: > +altimin, can you see if this seems sane to ...
3 years, 5 months ago (2017-07-07 14:36:33 UTC) #7
tdresser1
Yeah, that's a good point. Any thoughts on where this should live / how it ...
3 years, 5 months ago (2017-07-07 15:02:46 UTC) #9
altimin
On 2017/07/07 15:02:46, tdresser1 wrote: > Yeah, that's a good point. > > Any thoughts ...
3 years, 5 months ago (2017-07-07 16:53:37 UTC) #10
tdresser
How's this?
3 years, 4 months ago (2017-07-26 18:14:28 UTC) #11
Sami
https://codereview.chromium.org/2973543002/diff/40001/base/debug/task_annotator.cc File base/debug/task_annotator.cc (right): https://codereview.chromium.org/2973543002/diff/40001/base/debug/task_annotator.cc#newcode26 base/debug/task_annotator.cc:26: if (!thread_data->task_length_recording_enabled_for_uma()) Can we swap this before the previous ...
3 years, 4 months ago (2017-07-26 20:36:38 UTC) #12
tdresser
https://codereview.chromium.org/2973543002/diff/40001/base/debug/task_annotator.cc File base/debug/task_annotator.cc (right): https://codereview.chromium.org/2973543002/diff/40001/base/debug/task_annotator.cc#newcode29 base/debug/task_annotator.cc:29: // TODO - this is slow. On 2017/07/26 20:36:38, ...
3 years, 4 months ago (2017-07-27 19:18:06 UTC) #13
Sami
https://codereview.chromium.org/2973543002/diff/40001/base/debug/task_annotator.cc File base/debug/task_annotator.cc (right): https://codereview.chromium.org/2973543002/diff/40001/base/debug/task_annotator.cc#newcode29 base/debug/task_annotator.cc:29: // TODO - this is slow. On 2017/07/27 19:18:05, ...
3 years, 4 months ago (2017-08-04 15:46:33 UTC) #14
tdresser
3 years, 4 months ago (2017-08-04 15:56:57 UTC) #15
On 2017/08/04 15:46:33, Sami wrote:
>
https://codereview.chromium.org/2973543002/diff/40001/base/debug/task_annotat...
> File base/debug/task_annotator.cc (right):
> 
>
https://codereview.chromium.org/2973543002/diff/40001/base/debug/task_annotat...
> base/debug/task_annotator.cc:29: // TODO - this is slow.
> On 2017/07/27 19:18:05, tdresser wrote:
> > On 2017/07/26 20:36:38, Sami wrote:
> > > TODO(tdresser)
> > > 
> > > In any case we probably can't land this as is given Bruce's recent
findings
> > > about debug string prints during video playback.
> > 
> > Oops, yeah, I meant to call this out as something I was wondering about.
> > 
> > I can imagine a solution in which we use some kind of integer thread type
> > identifier, and a STATIC_HISTOGRAM_POINTER_GROUP, which would make this much
> > faster, but most approaches to this would result in some awkward layering
> > violations.
> > 
> > We could have the "max thread id" get passed to the task annotator at some
> > point, have a big enum listing possible thread types, and use those here
> instead
> > of string manipulation. 
> > 
> > We'd then need to populate a vector where the index indicates the histogram
> > name, and use a STATIC_HISTOGRAM_POINTER_GROUP.
> > 
> > Pretty messy, but could work.
> > 
> > Thoughts?
> 
> Yeah, this is pretty tough from a layering perspective. A parallel case that
> comes to mind is the tracing thread sorting index:
> 
>
https://cs.chromium.org/chromium/src/base/trace_event/trace_log.h?l=320&gs=cp...
> 
> Maybe we could merge and generalize that with InitializeThreadContext()? We'd
> still need to have a registry of ids somewhere for that to work however.
> 
> Alternatively we could compute a small hash of the thread name (possibly at
> compile time) and use that as the id (and DCHECK that none of the names
> collide).

Interesting thought.

For STATIC_HISTOGRAM_POINTER_GROUP, we'd still need to know the number of unique
thread names. We could pass that in though.

I'll take a stab at something along these lines when I get the chance.

Powered by Google App Engine
This is Rietveld 408576698