RESOLVED FIXED167285
Add memory footprint reporting using diagnostic logging
https://bugs.webkit.org/show_bug.cgi?id=167285
Summary Add memory footprint reporting using diagnostic logging
Andreas Kling
Reported 2017-01-21 14:50:14 PST
We should have memory usage logging alongside the CPU usage logging for telemetry.
Attachments
Patch for EWS (32.45 KB, patch)
2017-01-21 14:51 PST, Andreas Kling
no flags
Patch for EWS (32.46 KB, patch)
2017-01-21 15:17 PST, Andreas Kling
no flags
Patch for EWS II (39.68 KB, patch)
2017-01-22 21:51 PST, Andreas Kling
no flags
Patch for EWS 4 (39.70 KB, patch)
2017-01-22 22:21 PST, Andreas Kling
no flags
Patch (44.43 KB, patch)
2017-01-23 14:39 PST, Andreas Kling
no flags
Patch (43.92 KB, patch)
2017-01-23 15:14 PST, Andreas Kling
no flags
Patch (46.20 KB, patch)
2017-01-23 19:36 PST, Andreas Kling
no flags
Patch (45.49 KB, patch)
2017-01-23 20:13 PST, Andreas Kling
buildbot: commit-queue-
Archive of layout-test-results from ews116 for mac-elcapitan (1.62 MB, application/zip)
2017-01-23 21:18 PST, Build Bot
no flags
Patch (12.49 KB, patch)
2017-01-23 21:24 PST, Andreas Kling
cdumez: review+
Andreas Kling
Comment 1 2017-01-21 14:51:31 PST
Created attachment 299446 [details] Patch for EWS
Andreas Kling
Comment 2 2017-01-21 15:17:52 PST
Created attachment 299449 [details] Patch for EWS
Andreas Kling
Comment 3 2017-01-22 21:51:55 PST
Created attachment 299498 [details] Patch for EWS II
Andreas Kling
Comment 4 2017-01-22 22:21:19 PST
Created attachment 299501 [details] Patch for EWS 4
Andreas Kling
Comment 5 2017-01-23 14:39:59 PST
Chris Dumez
Comment 6 2017-01-23 14:55:19 PST
Does not build in Debug.
Andreas Kling
Comment 7 2017-01-23 15:14:35 PST
Chris Dumez
Comment 8 2017-01-23 15:40:09 PST
Comment on attachment 299545 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=299545&action=review > Source/WebCore/page/PerformanceMonitor.cpp:177 > + m_postBackgroundingCPUTime = std::nullopt; muhahaha, you're resetting my CPU variables in your memory code. > Source/WebCore/page/PerformanceMonitor.cpp:273 > +#if !RELEASE_LOG_DISABLED This does not look needed? > Source/WebCore/page/cocoa/PerformanceLoggingCocoa.mm:39 > + if (err != KERN_SUCCESS) err != success look weird. How about we call it result? > Source/WebKit2/UIProcess/PerActivityStateMemoryUsageSampler.h:37 > +class PerActivityStateMemoryUsageSampler { I would have merged this class with mine. PerActivityStatePerformanceSampler? Why didn't you do it?
Chris Dumez
Comment 9 2017-01-23 15:44:08 PST
Comment on attachment 299545 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=299545&action=review > Source/WebKit2/UIProcess/PerActivityStateMemoryUsageSampler.cpp:58 > +static inline String loggingKeyForActivityState(ActivityStateForPerformanceMonitoring state) This is duplicated from my code. > Source/WebKit2/UIProcess/PerActivityStateMemoryUsageSampler.cpp:88 > +WebPageProxy* PerActivityStateMemoryUsageSampler::pageForLogging() const This is duplicated from my code. > Source/WebKit2/UIProcess/WebPageProxy.cpp:5185 > + fprintf(stderr, "DLog: %s ~ %s ~ %s\n", message.ascii().data(), description.ascii().data(), value.ascii().data()); I guess you did not mean to leave this in? :)
Chris Dumez
Comment 10 2017-01-23 15:45:57 PST
Comment on attachment 299545 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=299545&action=review >> Source/WebKit2/UIProcess/PerActivityStateMemoryUsageSampler.h:37 >> +class PerActivityStateMemoryUsageSampler { > > I would have merged this class with mine. PerActivityStatePerformanceSampler? Why didn't you do it? Or maybe WebPeformanceMetricsSampler
Andreas Kling
Comment 11 2017-01-23 15:46:07 PST
(In reply to comment #8) > Comment on attachment 299545 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=299545&action=review > > > Source/WebCore/page/PerformanceMonitor.cpp:177 > > + m_postBackgroundingCPUTime = std::nullopt; > > muhahaha, you're resetting my CPU variables in your memory code. > > > Source/WebCore/page/PerformanceMonitor.cpp:273 > > +#if !RELEASE_LOG_DISABLED > > This does not look needed? Ugh, copy/pasting code gone too far. :| > > Source/WebCore/page/cocoa/PerformanceLoggingCocoa.mm:39 > > + if (err != KERN_SUCCESS) > > err != success look weird. How about we call it result? Sure! That would read nicer. > > Source/WebKit2/UIProcess/PerActivityStateMemoryUsageSampler.h:37 > > +class PerActivityStateMemoryUsageSampler { > > I would have merged this class with mine. > PerActivityStatePerformanceSampler? Why didn't you do it? I'll merge them. And take out that printf :)
Andreas Kling
Comment 12 2017-01-23 19:36:54 PST
Andreas Kling
Comment 13 2017-01-23 20:13:46 PST
Build Bot
Comment 14 2017-01-23 21:18:01 PST
Comment on attachment 299569 [details] Patch Attachment 299569 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/2938633 New failing tests: media/modern-media-controls/tracks-support/tracks-support-show-panel-fullscreen.html
Build Bot
Comment 15 2017-01-23 21:18:04 PST
Created attachment 299571 [details] Archive of layout-test-results from ews116 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews116 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Andreas Kling
Comment 16 2017-01-23 21:19:08 PST
Okay now that I've had some sleep & coffee let me actually fix up this patch properly :|
Andreas Kling
Comment 17 2017-01-23 21:24:27 PST
Created attachment 299572 [details] Patch Okay, now without the WK2 part since that logging didn't even make sense (combined footprints looked goofy and what am I gonna do with them anyway) Also without the enum renames and stuff.
Chris Dumez
Comment 18 2017-01-24 10:14:47 PST
Comment on attachment 299572 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=299572&action=review r=me with comment > Source/WebCore/page/PerformanceMonitor.cpp:90 > + m_postPageLoadMemoryUsageTimer.startOneShot(memoryUsageMeasurementDelay); You should probably stop this timer if a new Page load starts.
Andreas Kling
Comment 19 2017-01-24 16:16:24 PST
Note You need to log in before you can comment on or make changes to this bug.