RESOLVED WONTFIX24253
Add functions to ChromiumBridge for profiler API control
https://bugs.webkit.org/show_bug.cgi?id=24253
Summary Add functions to ChromiumBridge for profiler API control
Antony Sargent
Reported 2009-02-27 15:58:35 PST
patch forthcoming
Attachments
Patch (1.23 KB, patch)
2009-02-27 16:03 PST, Antony Sargent
fishd: review-
Patch v2 (1.31 KB, patch)
2009-02-27 17:52 PST, Antony Sargent
fishd: review-
Patch v3 (1.31 KB, patch)
2009-03-02 09:24 PST, Antony Sargent
fishd: review-
Antony Sargent
Comment 1 2009-02-27 16:03:26 PST
Darin Fisher (:fishd, Google)
Comment 2 2009-02-27 16:08:28 PST
Comment on attachment 28105 [details] Patch >Index: ChangeLog >+2009-02-27 Antony Sargent <asargent@chromium.org> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add functions to ChromiumBridge for profiler API control (eg Quantify) >+ >+ * platform/chromium/ChromiumBridge.h: nit: please include a bug link in the ChangeLog. >Index: platform/chromium/ChromiumBridge.h >+ // PerformanceProfiler ------------------------------------------------ >+ static void performanceProfilerStart(); nit: wouldn't it be sufficient to just use the prefix "profiler"? usually a profiler has to do with performance. >+ static void performanceProfilerSetThreadName(char *name); nit: that should be (const char* name)
Sam Weinig
Comment 3 2009-02-27 16:19:09 PST
What kind of profiler is this being used for? Where will this be called in WebCore?
Antony Sargent
Comment 4 2009-02-27 17:46:57 PST
(In reply to comment #3) > What kind of profiler is this being used for? Where will this be called in > WebCore? > It's to expose control of Quantify (a companion tool to Purify, if you aren't familiar with it) to javascript functions in developer builds. For instance, imagine you have a layout test and want to profile some pieces of running javascript but ignore others; you can then write something like: var profiler = new window.chromium.Profiler(); profiler.stop(); profiler.clear(); profiler.setThreadName("my test thread"); doSetupThatShouldntBeProfiled(); profiler.start(); doTest(); profiler.stop(); This is something that would only be exposed in developer builds compiled with Purify; not in regular builds. It's going in the Chromium bridge so that our javascript extension code can call through to the chrome code that links against the purify API. See these files for our abstraction of the Purify memory debugging API: http://src.chromium.org/viewvc/chrome/trunk/src/base/memory_debug.h http://src.chromium.org/viewvc/chrome/trunk/src/base/memory_debug.cc (I'll be adding a similar class for the quantify performance profiler.)
Antony Sargent
Comment 5 2009-02-27 17:52:37 PST
Created attachment 28110 [details] Patch v2
Darin Fisher (:fishd, Google)
Comment 6 2009-02-28 10:55:34 PST
Comment on attachment 28110 [details] Patch v2 >Index: platform/chromium/ChromiumBridge.h ... > // Widget ------------------------------------------------------------- > static void widgetSetCursor(Widget*, const Cursor&); > static void widgetSetFocus(Widget*); >+ >+ // Profiler ----------------------------------------------------------- >+ static void profilerStart(); >+ static void profilerStop(); >+ static void profilerClearData(); >+ static void profilerSetThreadName(const char *name); one more stylistic problem that i forgot to mention... the groups in ChromiumBridge are intentionally alphabetized, but this breaks that. please sort them :) also, please note that webkit style says to write |const char* name| instead of |const char *name|. sorry for not making that more clear in my previous review. otherwise, this change LG. but please upload a clean patch. thanks!
Antony Sargent
Comment 7 2009-03-02 09:24:28 PST
Created attachment 28179 [details] Patch v3
Darin Fisher (:fishd, Google)
Comment 8 2009-03-05 21:23:23 PST
Antony, this bug can be closed now given your recent Chromium work, right?
Antony Sargent
Comment 9 2009-03-05 22:22:20 PST
Yes. (For the record and/or in case anyone else is interested, we found a better way to expose JS extensions in Chromium code that won't involve having to go through the ChromiumBridge. Those changes are at http://codereview.chromium.org/40132 )
Note You need to log in before you can comment on or make changes to this bug.