RESOLVED FIXED 97641
Web Inspector: compare objects counted by the memory instrumentation with those allocated in the heap
https://bugs.webkit.org/show_bug.cgi?id=97641
Summary Web Inspector: compare objects counted by the memory instrumentation with tho...
Yury Semikhatsky
Reported 2012-09-26 00:40:06 PDT
We need to be sure that the memory instrumentation only counts size of objects allocated in the heap. To test that we could request a set of all allocated objects from the memory allocator and check if the counted objects set is a subset of the set of all heap allocated objects.
Attachments
Possible implementation draft (15.93 KB, patch)
2012-09-26 00:41 PDT, Yury Semikhatsky
no flags
Patch (21.56 KB, patch)
2012-09-26 02:04 PDT, Yury Semikhatsky
no flags
Patch (20.77 KB, patch)
2012-09-26 03:04 PDT, Yury Semikhatsky
no flags
Patch (21.20 KB, patch)
2012-09-26 03:37 PDT, Yury Semikhatsky
pfeldman: review+
peter+ews: commit-queue-
Yury Semikhatsky
Comment 1 2012-09-26 00:41:32 PDT
Created attachment 165743 [details] Possible implementation draft
WebKit Review Bot
Comment 2 2012-09-26 00:43:41 PDT
Please wait for approval from abarth@webkit.org, dglazkov@chromium.org, fishd@chromium.org, jamesr@chromium.org or tkent@chromium.org before submitting, as this patch contains changes to the Chromium public API. See also https://trac.webkit.org/wiki/ChromiumWebKitAPI.
WebKit Review Bot
Comment 3 2012-09-26 00:44:00 PDT
Attachment 165743 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WTF/wtf/MemoryInstrumentation.h', u..." exit_code: 1 Source/WebCore/inspector/MemoryInstrumentationImpl.cpp:80: Should have a space between // and comment [whitespace/comments] [4] Source/WebCore/inspector/InspectorMemoryAgent.cpp:43: Alphabetical sorting problem. [build/include_order] [4] Source/WebKit/chromium/src/WebDevToolsAgentImpl.h:109: The parameter name "set" adds no information, so it should be removed. [readability/parameter_name] [5] Source/WebKit/chromium/src/InspectorClientImpl.h:81: The parameter name "set" adds no information, so it should be removed. [readability/parameter_name] [5] Total errors found: 4 in 12 files If any of these errors are false positives, please file a bug against check-webkit-style.
Build Bot
Comment 4 2012-09-26 01:11:03 PDT
Comment on attachment 165743 [details] Possible implementation draft Attachment 165743 [details] did not pass win-ews (win): Output: http://queues.webkit.org/results/14027415
Build Bot
Comment 5 2012-09-26 01:12:42 PDT
Comment on attachment 165743 [details] Possible implementation draft Attachment 165743 [details] did not pass mac-ews (mac): Output: http://queues.webkit.org/results/14021406
WebKit Review Bot
Comment 6 2012-09-26 01:18:39 PDT
Comment on attachment 165743 [details] Possible implementation draft Attachment 165743 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/14018429
Peter Beverloo (cr-android ews)
Comment 7 2012-09-26 01:34:09 PDT
Comment on attachment 165743 [details] Possible implementation draft Attachment 165743 [details] did not pass cr-android-ews (chromium-android): Output: http://queues.webkit.org/results/14004033
Yury Semikhatsky
Comment 8 2012-09-26 02:04:56 PDT
Pavel Feldman
Comment 9 2012-09-26 02:31:16 PDT
Comment on attachment 165753 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=165753&action=review > Source/WTF/wtf/MemoryInstrumentation.h:110 > +#if ENABLE(DEBUG_MEMORY_INSTRUMENTATION) I would only guard the backing implementation for better readability. > Source/WebCore/inspector/InspectorClient.h:75 > +#if ENABLE(DEBUG_MEMORY_INSTRUMENTATION) I would even remove this guard. > Source/WebCore/inspector/MemoryInstrumentationImpl.cpp:86 > + if (!m_allocatedObjects.contains(object)) { You could only consider non-empty arrays valid.
Yury Semikhatsky
Comment 10 2012-09-26 03:04:49 PDT
Yury Semikhatsky
Comment 11 2012-09-26 03:05:14 PDT
(In reply to comment #9) > (From update of attachment 165753 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=165753&action=review > > > Source/WTF/wtf/MemoryInstrumentation.h:110 > > +#if ENABLE(DEBUG_MEMORY_INSTRUMENTATION) > > I would only guard the backing implementation for better readability. > Done. > > Source/WebCore/inspector/InspectorClient.h:75 > > +#if ENABLE(DEBUG_MEMORY_INSTRUMENTATION) > > I would even remove this guard. > Done. > > Source/WebCore/inspector/MemoryInstrumentationImpl.cpp:86 > > + if (!m_allocatedObjects.contains(object)) { > > You could only consider non-empty arrays valid. Done.
Pavel Feldman
Comment 12 2012-09-26 03:13:44 PDT
Comment on attachment 165763 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=165763&action=review > Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp:492 > + : m_totalObjectsCount(totalObjectsCount + 1) I would multiply it by 2 and add a comment that the first pass was only estimating the number of objects for this allocation. If the *2 size is not enough, you could double it again and re-run as a fall back.
Yury Semikhatsky
Comment 13 2012-09-26 03:31:05 PDT
(In reply to comment #12) > (From update of attachment 165763 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=165763&action=review > > > Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp:492 > > + : m_totalObjectsCount(totalObjectsCount + 1) > > I would multiply it by 2 and add a comment that the first pass was only estimating the number of objects for this allocation. If the *2 size is not enough, you could double it again and re-run as a fall back. Done.
Yury Semikhatsky
Comment 14 2012-09-26 03:37:07 PDT
Peter Beverloo (cr-android ews)
Comment 15 2012-09-26 04:29:07 PDT
Comment on attachment 165765 [details] Patch Attachment 165765 [details] did not pass cr-android-ews (chromium-android): Output: http://queues.webkit.org/results/14035385
Pavel Feldman
Comment 16 2012-09-26 04:44:18 PDT
Comment on attachment 165765 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=165765&action=review > Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp:506 > + printf("Adding more than %lu pointers.", m_maxObjectsCount); Please remove this.
Yury Semikhatsky
Comment 17 2012-09-26 05:09:24 PDT
Note You need to log in before you can comment on or make changes to this bug.