Bug 70620 - [chromium] Route Console::time and Console::timeEnd to trace_event
Summary: [chromium] Route Console::time and Console::timeEnd to trace_event
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nat Duca
URL:
Keywords:
Depends on: 70618
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-21 10:48 PDT by Nat Duca
Modified: 2011-10-25 02:53 PDT (History)
5 users (show)

See Also:


Attachments
Patch (1.89 KB, patch)
2011-10-21 10:49 PDT, Nat Duca
no flags Details | Formatted Diff | Diff
Patch (1.88 KB, patch)
2011-10-24 15:12 PDT, Nat Duca
no flags Details | Formatted Diff | Diff
Should build (1.87 KB, patch)
2011-10-24 15:49 PDT, Nat Duca
pfeldman: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nat Duca 2011-10-21 10:48:09 PDT
[chromium] Route Console::time and Console::timeEnd to trace_event
Comment 1 Nat Duca 2011-10-21 10:49:07 PDT
Created attachment 111986 [details]
Patch
Comment 2 Nat Duca 2011-10-21 10:49:56 PDT
James -- do I need other reviewers?
Comment 3 WebKit Review Bot 2011-10-21 10:52:23 PDT
Comment on attachment 111986 [details]
Patch

Attachment 111986 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/10179962
Comment 4 James Robinson 2011-10-21 12:19:43 PDT
Pavel or Yury should take a look.  Could you explain how the tracing works (or point them at the relevant docs), Nat?
Comment 5 Pavel Feldman 2011-10-21 12:51:50 PDT
Comment on attachment 111986 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=111986&action=review

What is the story behind the change? We tend to do it the other way (push information into the Web Inspector front-end through the WebCore). r- for not compiling in any case.

> Source/WebCore/page/Console.cpp:311
> +#if PLATFORM(CHROMIUM)

I really don't like these. But I don't see a better way of handling it here.

> Source/WebCore/page/Console.cpp:312
> +    if (PlatformSupport::isTraceEventEnabledForCategory("webcore.console"))

I don't see this method on ToT. See compile failures on ews.
Comment 6 Nat Duca 2011-10-21 12:58:00 PDT
Yeah, I agree with the #ifs. If I find time, I'd like to get some platform abstraction of tracing concept landed. In the near term, would this be OK? Its okay if no, but it does help us chase interactions between JS and chrome innards.

The isTraceEventEnabled is b70618, marked as a dep on this bug. That needs some tweaks to land too. :)
Comment 7 Nat Duca 2011-10-21 13:31:55 PDT
(In reply to comment #5)
> What is the story behind the change? We tend to do it the other way (push information into the Web Inspector front-end through the WebCore). r- for not compiling in any case.

Oh, sorry I missed this comment!

This isn't intended for use by web developers. I don't think web devlopers reading about:tracing to understand performance is the *right* thing for our platform.

trace_event ties to chrome's about:tracing, which is an implementer-facing  tool. For example, us folks working on GPU acceleration now ask developers to submit about:trace dumps with their graphics-related bug reports. Whereas inspector information is tailored for human consumption, the about:trace contains extremely detailed implementation level information about what Chrome was doing to lead to bad perf. This has been really useful for us in speeding chrome perf up and we're constantly adding instrumentation to shipping Chrome builds to make these types of perf dumps more informative.

One problem we have with these traces is that we'll see some heavy MessageLoop task in Chrome [e.g. some sync message call] but not have a clue what the JS part of the app was trying to do. Was it their renderer code? Or was it some other piece of third_party advertising code the page just happens to be using?

This patch allows us or our customers to sprinkle time/timeEnd calls throughout JS. The dumps they send us will help us see the relationship between "their code" and our code.

The reason I hooked console.time and timeEnd rather than adding a platform-specific or test-specific macro is because our traces often come from people outside running Canary. Were this to require a custom build of Chrome, it'd limit the utility of the hooking.

Hope that makes sense? I'm totally fine if you think this is a bad thing to land... it was a simple change, so I figured I'd try. :)
Comment 8 Pavel Feldman 2011-10-24 12:14:15 PDT
> Hope that makes sense? I'm totally fine if you think this is a bad thing to land... it was a simple change, so I figured I'd try. :)

I think it is Ok to land it as is once you get the API it uses in place. In return, it would be great if you could experiment with the data and push developer-centric scenarios back into the inspector. I am sure there is enough we could expose to the end-user without frightening him.
Comment 9 Nat Duca 2011-10-24 12:31:10 PDT
(In reply to comment #8)
> In return, it would be great if you could experiment with the data and push developer-centric scenarios back into the inspector. I am sure there is enough we could expose to the end-user without frightening him.

Definitely! That's why I was poking you the other day about how to an experimental rendering tab for inspector. Its not clear to me what we should tell the end-dev yet, but we definitely need to make something human-consumable available. :)
Comment 10 Nat Duca 2011-10-24 15:12:35 PDT
Created attachment 112259 [details]
Patch
Comment 11 WebKit Review Bot 2011-10-24 15:21:04 PDT
Comment on attachment 112259 [details]
Patch

Attachment 112259 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/10200988
Comment 12 Nat Duca 2011-10-24 15:49:12 PDT
Created attachment 112266 [details]
Should build
Comment 13 Nat Duca 2011-10-25 01:45:59 PDT
Ok, it builds. Pavel, can you do the final review?
Comment 14 Nat Duca 2011-10-25 02:53:43 PDT
Committed r98331: <http://trac.webkit.org/changeset/98331>