New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 669116 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Dec 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Bug



Sign in to add a comment

Tracing doesn't capture tasks that stem from processing NSEvents [rather than Chrome tasks].

Project Member Reported by erikc...@chromium.org, Nov 28 2016

Issue description

This can contain a non-trivial amount of work/blockage, especially if it involves a nested CFRunLoop, or a lot of drawing. This can also trigger a lot of Chrome logic [from redraws].
 
Cc: charliea@chromium.org fmea...@chromium.org

Comment 2 by ajha@chromium.org, Nov 30 2016

Components: Internals>Tracing
Labels: M-57
Labelling with canary milestone.
Is this Chrome code that's being executed, or just code that Chrome is causing to be executed? If it's Chrome code, it seems like we could just instrument this with a toplevel trace span, right?
Both. What is a toplevel trace span?
I think this might be as simple as adding a trace event to -[NSApp sendEvent:] or some such.
From a tracing perspective, a toplevel trace span is just a trace event with the "toplevel" category, like this one (https://cs.chromium.org/chromium/src/ipc/ipc_channel_mojo.cc?q=trace.*toplevel&sq=package:chromium&l=385&dr=C).

From a conceptual standpoint, a toplevel span should be active any time that a Chrome process is active, and needs to wrap any entry points where Chrome code can start running, like this one. This ensures that metrics like the CPU time metric are accurate.

The classic "toplevel" event is MessageLoop::RunTask (https://cs.chromium.org/chromium/src/base/message_loop/message_loop.cc?q=messageloop::runtask&sq=package:chromium&l=409&dr=C), but it looks like that uses  a special trace macro just for it in order to make sure we know where it got called from. I think for our purposes, just using a regular old trace event like the first one I linked to.
Status: Available (was: Untriaged)
Owner: erikc...@chromium.org
Status: Assigned (was: Available)
Project Member

Comment 9 by bugdroid1@chromium.org, Dec 8 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ad0b46843bbcca3ef126402974d9ceaaf136bef5

commit ad0b46843bbcca3ef126402974d9ceaaf136bef5
Author: erikchen <erikchen@chromium.org>
Date: Thu Dec 08 20:58:04 2016

mac: Add tracing for -[BrowserCrApplication sendEvent:].

This captures work triggered from NSEvents for tracing.

BUG= 669116 

Review-Url: https://codereview.chromium.org/2566443002
Cr-Commit-Position: refs/heads/master@{#437334}

[modify] https://crrev.com/ad0b46843bbcca3ef126402974d9ceaaf136bef5/chrome/browser/chrome_browser_application_mac.mm

Status: Fixed (was: Assigned)

Sign in to add a comment