Bug 187881 - Add alternative bmalloc Scavenger logging that is machine-readable
Summary: Add alternative bmalloc Scavenger logging that is machine-readable
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-21 11:23 PDT by Simon Fraser (smfr)
Modified: 2018-07-23 11:18 PDT (History)
4 users (show)

See Also:


Attachments
Patch (6.85 KB, patch)
2018-07-21 11:25 PDT, Simon Fraser (smfr)
saam: review+
ews-watchlist: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews106 for mac-sierra-wk2 (3.09 MB, application/zip)
2018-07-21 12:37 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews205 for win-future (12.91 MB, application/zip)
2018-07-21 16:44 PDT, EWS Watchlist
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2018-07-21 11:23:39 PDT
Add alternative bmalloc Scavenger logging that is machine-readable
Comment 1 Simon Fraser (smfr) 2018-07-21 11:25:13 PDT
Created attachment 345515 [details]
Patch
Comment 2 Simon Fraser (smfr) 2018-07-21 11:33:57 PDT
My std::chrono fu is too weak to figure out how to print current time at a resolution finer than seconds.
Comment 3 Simon Fraser (smfr) 2018-07-21 12:25:31 PDT
This is also useful for dumping the GC heap size:

diff --git a/Source/WebCore/page/cocoa/MemoryReleaseCocoa.mm b/Source/WebCore/page/cocoa/MemoryReleaseCocoa.mm
index 7d170433bfc8577c5d28dc513f1458f3f1af5cd8..ede9bd65936e85817b5383a6b9f6f3253c9bbff5 100644
--- a/Source/WebCore/page/cocoa/MemoryReleaseCocoa.mm
+++ b/Source/WebCore/page/cocoa/MemoryReleaseCocoa.mm
@@ -29,6 +29,7 @@
 #import "GCController.h"
 #import "IOSurfacePool.h"
 #import "LayerPool.h"
+#import "PerformanceLogging.h"
 #import <notify.h>
 #import <pal/spi/ios/GraphicsServicesSPI.h>
 
@@ -93,6 +94,10 @@ void registerMemoryReleaseNotifyCallbacks()
             GCController::singleton().deleteAllCode(JSC::PreventCollectionAndDeleteAllCode);
             GCController::singleton().garbageCollectNow();
         });
+        notify_register_dispatch("com.apple.WebKit.dumpGCStats", &dummy, dispatch_get_main_queue(), ^(int) {
+            for (auto& it : PerformanceLogging::memoryUsageStatistics(ShouldIncludeExpensiveComputations::Yes))
+                WTFLogAlways("%s %lu", it.key, it.value);
+        });
     });
 }
Comment 4 EWS Watchlist 2018-07-21 12:37:56 PDT
Comment on attachment 345515 [details]
Patch

Attachment 345515 [details] did not pass mac-wk2-ews (mac-wk2):
Output: https://webkit-queues.webkit.org/results/8610483

New failing tests:
accessibility/smart-invert-reference.html
Comment 5 EWS Watchlist 2018-07-21 12:37:58 PDT
Created attachment 345516 [details]
Archive of layout-test-results from ews106 for mac-sierra-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews106  Port: mac-sierra-wk2  Platform: Mac OS X 10.12.6
Comment 6 EWS Watchlist 2018-07-21 16:44:17 PDT
Comment on attachment 345515 [details]
Patch

Attachment 345515 [details] did not pass win-ews (win):
Output: https://webkit-queues.webkit.org/results/8611728

New failing tests:
http/tests/security/canvas-remote-read-remote-video-localhost.html
http/tests/security/video-poster-cross-origin-crash2.html
Comment 7 EWS Watchlist 2018-07-21 16:44:30 PDT
Created attachment 345520 [details]
Archive of layout-test-results from ews205 for win-future

The attached test failures were seen while running run-webkit-tests on the win-ews.
Bot: ews205  Port: win-future  Platform: CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit
Comment 8 Saam Barati 2018-07-23 11:18:44 PDT
Comment on attachment 345515 [details]
Patch

r=me