RESOLVED FIXED 89584
Web Inspector: Forward message loop instrumentation data to frontend.
https://bugs.webkit.org/show_bug.cgi?id=89584
Summary Web Inspector: Forward message loop instrumentation data to frontend.
eustas.bug
Reported 2012-06-20 11:26:35 PDT
Transmit collected message loop tasks to inspector frontend. Now "Program" should be a top-level event where appropriate. Frontend was changed so that user will not see any changes.
Attachments
Patch (15.80 KB, patch)
2012-06-20 12:06 PDT, eustas.bug
no flags
Patch (15.55 KB, patch)
2012-06-20 18:41 PDT, eustas.bug
no flags
Patch (18.64 KB, patch)
2012-06-21 11:03 PDT, eustas.bug
no flags
Patch (21.15 KB, patch)
2012-06-21 15:20 PDT, eustas.bug
no flags
Patch (21.14 KB, patch)
2012-06-21 18:30 PDT, eustas.bug
no flags
Patch (20.58 KB, patch)
2012-06-22 09:29 PDT, eustas.bug
no flags
Patch (18.94 KB, patch)
2012-06-29 03:33 PDT, eustas.bug
no flags
Patch (21.04 KB, patch)
2012-06-29 09:57 PDT, eustas.bug
yurys: review+
Patch (21.22 KB, patch)
2012-07-03 07:21 PDT, eustas.bug
no flags
Patch (22.22 KB, patch)
2012-07-03 08:12 PDT, eustas.bug
no flags
eustas.bug
Comment 1 2012-06-20 12:06:22 PDT
Andrey Kosyakov
Comment 2 2012-06-20 16:59:41 PDT
Comment on attachment 148623 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=148623&action=review > Source/WebCore/inspector/InspectorTimelineAgent.cpp:99 > +static const char Program[] = "Program"; We do seem to order these semantically, so I'd make Program the top one. > Source/WebCore/inspector/InspectorTimelineAgent.cpp:457 > + if (record->getString("type", &type)) { > + if (type == program) if (record->getString("type", &type) && type == program) return; > Source/WebCore/inspector/front-end/TimelinePresentationModel.js:54 > + program: new WebInspector.TimelineCategory("program", WebInspector.UIString("Program"), -1, "transparent", "transparent", "transparent") This is not supposed to ever be painted, so passing concrete values for colors seems strange. Can we just omit them? The category may also be named "Hidden", I think. > Source/WebCore/inspector/front-end/TimelinePresentationModel.js:214 > + var records = [record]; > + if (record.type === recordTypes.Program) > + records = record.children; var records = record.type === recordTypes.Program ? record.children : [record]; or if (...) records = ... else records = ...; > Source/WebCore/inspector/front-end/TimelinePresentationModel.js:223 > + _addRecord: function(record, parentRecord) innerAddRecord?
eustas.bug
Comment 3 2012-06-20 17:51:16 PDT
Comment on attachment 148623 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=148623&action=review >> Source/WebCore/inspector/InspectorTimelineAgent.cpp:99 >> +static const char Program[] = "Program"; > > We do seem to order these semantically, so I'd make Program the top one. Done >> Source/WebCore/inspector/InspectorTimelineAgent.cpp:457 >> + if (type == program) > > if (record->getString("type", &type) && type == program) > return; Done >> Source/WebCore/inspector/front-end/TimelinePresentationModel.js:54 >> + program: new WebInspector.TimelineCategory("program", WebInspector.UIString("Program"), -1, "transparent", "transparent", "transparent") > > This is not supposed to ever be painted, so passing concrete values for colors seems strange. Can we just omit them? > The category may also be named "Hidden", I think. Done. I think "hidden" is not very good, because it doesn't reflect the nature of activity. >> Source/WebCore/inspector/front-end/TimelinePresentationModel.js:214 >> + records = record.children; > > var records = record.type === recordTypes.Program ? record.children : [record]; > or if (...) records = ... else records = ...; Done >> Source/WebCore/inspector/front-end/TimelinePresentationModel.js:223 >> + _addRecord: function(record, parentRecord) > > innerAddRecord? Done
eustas.bug
Comment 4 2012-06-20 18:41:18 PDT
Pavel Feldman
Comment 5 2012-06-20 19:14:02 PDT
Comment on attachment 148703 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=148703&action=review > Source/WebCore/inspector/InspectorTimelineAgent.cpp:451 > void InspectorTimelineAgent::setHeapSizeStatistic(InspectorObject* record) setHeapSizeStatistics > Source/WebCore/inspector/InspectorTimelineAgent.cpp:456 > + if (record->getString("type", &type) && type == program) I'd rather not call setHeapSizeStatistics for Program type. > Source/WebCore/inspector/front-end/MemoryStatistics.js:260 > + var record = event.data; We should not expect counters in the second-level records only. When we fix the GC to be synchronous, the counters should only stay in Parse, Script and GC records (maybe the whitelist is longer). > Source/WebCore/inspector/front-end/TimelineFrameController.js:69 > + records.forEach(this._innerAddRecord, this); DFS?
Yury Semikhatsky
Comment 6 2012-06-21 01:16:02 PDT
Comment on attachment 148703 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=148703&action=review >> Source/WebCore/inspector/front-end/MemoryStatistics.js:260 >> + var record = event.data; > > We should not expect counters in the second-level records only. When we fix the GC to be synchronous, the counters should only stay in Parse, Script and GC records (maybe the whitelist is longer). What do you mean by "When we fix the GC to be synchronous" ?
eustas.bug
Comment 7 2012-06-21 11:01:23 PDT
Comment on attachment 148703 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=148703&action=review >> Source/WebCore/inspector/InspectorTimelineAgent.cpp:451 >> void InspectorTimelineAgent::setHeapSizeStatistic(InspectorObject* record) > > setHeapSizeStatistics Done >> Source/WebCore/inspector/InspectorTimelineAgent.cpp:456 >> + if (record->getString("type", &type) && type == program) > > I'd rather not call setHeapSizeStatistics for Program type. Done >>> Source/WebCore/inspector/front-end/MemoryStatistics.js:260 >>> + var record = event.data; >> >> We should not expect counters in the second-level records only. When we fix the GC to be synchronous, the counters should only stay in Parse, Script and GC records (maybe the whitelist is longer). > > What do you mean by "When we fix the GC to be synchronous" ? Done >> Source/WebCore/inspector/front-end/TimelineFrameController.js:69 >> + records.forEach(this._innerAddRecord, this); > > DFS? Unfortunately, no. This would require severe changes to time aggregation methods.
eustas.bug
Comment 8 2012-06-21 11:03:13 PDT
Andrey Kosyakov
Comment 9 2012-06-21 13:44:56 PDT
Comment on attachment 148842 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=148842&action=review > Source/WebCore/inspector/front-end/TimelinePanel.js:492 > + this._scheduleRefresh(false); indent > Source/WebCore/inspector/front-end/TimelinePanel.js:509 > + function isAttachedRecord(record) { isAdoptedRecord()? style: { => next line > Source/WebCore/inspector/front-end/TimelinePresentationModel.js:50 > + no need for extra ws here > Source/WebCore/inspector/front-end/TimelinePresentationModel.js:121 > +WebInspector.TimelinePresentationModel.forAllRecords = function(recordsArray, preOrderCallback, postOrderCallback) Can we have a test for this? > Source/WebCore/inspector/front-end/TimelinePresentationModel.js:228 > + _innerAddRecord: function(record, parentRecord) so how about a recursive call this used to have?
eustas.bug
Comment 10 2012-06-21 14:40:17 PDT
Comment on attachment 148842 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=148842&action=review >> Source/WebCore/inspector/front-end/TimelinePanel.js:492 >> + this._scheduleRefresh(false); > > indent fixed >> Source/WebCore/inspector/front-end/TimelinePanel.js:509 >> + function isAttachedRecord(record) { > > isAdoptedRecord()? > style: { => next line Done >> Source/WebCore/inspector/front-end/TimelinePresentationModel.js:50 >> + > > no need for extra ws here fixed >> Source/WebCore/inspector/front-end/TimelinePresentationModel.js:121 >> +WebInspector.TimelinePresentationModel.forAllRecords = function(recordsArray, preOrderCallback, postOrderCallback) > > Can we have a test for this? Of sure. >> Source/WebCore/inspector/front-end/TimelinePresentationModel.js:228 >> + _innerAddRecord: function(record, parentRecord) > > so how about a recursive call this used to have? Fixed.
eustas.bug
Comment 11 2012-06-21 15:20:41 PDT
Andrey Kosyakov
Comment 12 2012-06-21 15:26:15 PDT
Comment on attachment 148899 [details] Patch LGTM
Pavel Feldman
Comment 13 2012-06-21 18:07:34 PDT
Comment on attachment 148899 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=148899&action=review > Source/WebCore/inspector/front-end/TimelinePresentationModel.js:133 > + stack.push({array: [], index: 0, record: record}); record: record should move into the same entry below.
eustas.bug
Comment 14 2012-06-21 18:30:50 PDT
eustas.bug
Comment 15 2012-06-21 18:31:50 PDT
Comment on attachment 148899 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=148899&action=review >> Source/WebCore/inspector/front-end/TimelinePresentationModel.js:133 >> + stack.push({array: [], index: 0, record: record}); > > record: record should move into the same entry below. Done
Pavel Feldman
Comment 16 2012-06-21 20:19:24 PDT
Comment on attachment 148936 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=148936&action=review > Source/WebCore/inspector/front-end/TimelinePresentationModel.js:132 > + if (record.children) { nit: no need for { }
eustas.bug
Comment 17 2012-06-22 09:29:15 PDT
Created attachment 149039 [details] Patch Rebased
eustas.bug
Comment 18 2012-06-29 03:33:05 PDT
Created attachment 150128 [details] Patch Hide-program-category-checkbox
eustas.bug
Comment 19 2012-06-29 09:57:01 PDT
Andrey Kosyakov
Comment 20 2012-07-03 05:23:01 PDT
Comment on attachment 150201 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=150201&action=review LGTM > Source/WebCore/inspector/front-end/TimelinePresentationModel.js:227 > + var formattedRecords = []; > + var recordsCount = records.length; > + for (var i = 0; i < recordsCount; ++i) > + formattedRecords.push(this._innerAddRecord(records[i], parentRecord)); > + return formattedRecords; nit: swap arguments to innerAddRecord, return records.map(this._innerAddRecord.bind(this, parentRecord));
Yury Semikhatsky
Comment 21 2012-07-03 05:56:37 PDT
Comment on attachment 150201 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=150201&action=review > Source/WebCore/ChangeLog:9 > + Now "Program" should be a top-level event where appropriate. Could you please elaborate on what "appropriate" means. > Source/WebCore/inspector/front-end/TimelinePresentationModel.js:212 > var recordTypes = WebInspector.TimelineModel.RecordType; There is only one usage, inline this?
eustas.bug
Comment 22 2012-07-03 07:15:36 PDT
Comment on attachment 150201 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=150201&action=review >> Source/WebCore/ChangeLog:9 >> + Now "Program" should be a top-level event where appropriate. > > Could you please elaborate on what "appropriate" means. Done >> Source/WebCore/inspector/front-end/TimelinePresentationModel.js:212 >> var recordTypes = WebInspector.TimelineModel.RecordType; > > There is only one usage, inline this? Done
eustas.bug
Comment 23 2012-07-03 07:21:06 PDT
Created attachment 150604 [details] Patch Rebased-and-fixed-nits
eustas.bug
Comment 24 2012-07-03 08:12:28 PDT
Created attachment 150611 [details] Patch Rebased-and-fixed-js-compilation-warnings
Andrey Kosyakov
Comment 25 2012-07-03 08:27:31 PDT
Andrey Kosyakov
Comment 26 2012-07-04 10:40:03 PDT
Reverted r121767 for reason: Crashes inspected page while recording timeline due to conflict with BeginFrame in record stack Committed r121865: <http://trac.webkit.org/changeset/121865>
Andrey Kosyakov
Comment 27 2012-07-11 01:57:37 PDT
Note You need to log in before you can comment on or make changes to this bug.