Changeset 276682 in webkit
- Timestamp:
- Apr 27, 2021, 5:18:19 PM (5 years ago)
- Location:
- trunk/Source/WTF
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
wtf/MemoryPressureHandler.cpp (modified) (2 diffs)
-
wtf/cocoa/MemoryPressureHandlerCocoa.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r276652 r276682 1 2021-04-27 Ben Nham <nham@apple.com> 2 3 Memory pressure events should be logged to com.apple.WebKit subsystem 4 https://bugs.webkit.org/show_bug.cgi?id=225112 5 6 Reviewed by Chris Dumez. 7 8 Currently memory pressure events are logged to the default os_log subsystem instead of the 9 com.apple.WebKit subsystem. This makes it hard to capture such events using common logging 10 prefs (e.g. a pref that persists all logs from the WebKit subsystem). 11 12 To fix this, call WTFInitializeLogChannelStatesFromString at init time. This associates the 13 WTFLogChannel with an os_log object that sends the messages to the WebKit subsystem. 14 15 * wtf/MemoryPressureHandler.cpp: 16 (WTF::MemoryPressureHandler::singleton): 17 * wtf/cocoa/MemoryPressureHandlerCocoa.mm: 18 (WTF::MemoryPressureHandler::install): 19 1 20 2021-04-27 Alex Christensen <achristensen@webkit.org> 2 21 -
trunk/Source/WTF/wtf/MemoryPressureHandler.cpp
r274594 r276682 35 35 namespace WTF { 36 36 37 #if RELEASE_LOG_DISABLED 38 WTFLogChannel LogMemoryPressure = { WTFLogChannelState::On, "MemoryPressure", WTFLogLevel::Error }; 39 #endif 40 #if USE(OS_LOG) && !RELEASE_LOG_DISABLED 41 WTFLogChannel LogMemoryPressure = { WTFLogChannelState::On, "MemoryPressure", WTFLogLevel::Error, LOG_CHANNEL_WEBKIT_SUBSYSTEM, OS_LOG_DEFAULT }; 42 #endif 43 #if USE(JOURNALD) && !RELEASE_LOG_DISABLED 44 WTFLogChannel LogMemoryPressure = { WTFLogChannelState::On, "MemoryPressure", WTFLogLevel::Error, LOG_CHANNEL_WEBKIT_SUBSYSTEM }; 45 #endif 37 DEFINE_LOG_CHANNEL(MemoryPressure, LOG_CHANNEL_WEBKIT_SUBSYSTEM); 46 38 47 39 WTF_EXPORT_PRIVATE bool MemoryPressureHandler::ReliefLogger::s_loggingEnabled = false; … … 52 44 static std::once_flag onceKey; 53 45 std::call_once(onceKey, [&] { 46 WTFLogChannel* channels[] = { &LogMemoryPressure }; 47 WTFInitializeLogChannelStatesFromString(channels, 1, ""); 48 54 49 memoryPressureHandler.construct(); 55 50 }); -
trunk/Source/WTF/wtf/cocoa/MemoryPressureHandlerCocoa.mm
r275909 r276682 42 42 namespace WTF { 43 43 44 #if RELEASE_LOG_DISABLED45 WTFLogChannel LogPerformanceLogging = { WTFLogChannelState::On, "PerformanceLogging", WTFLogLevel::Error };46 #else47 WTFLogChannel LogPerformanceLogging = { WTFLogChannelState::On, "PerformanceLogging", WTFLogLevel::Error, LOG_CHANNEL_WEBKIT_SUBSYSTEM, OS_LOG_DEFAULT };48 #endif49 50 44 void MemoryPressureHandler::platformReleaseMemory(Critical critical) 51 45 { … … 105 99 } 106 100 if (m_shouldLogMemoryMemoryPressureEvents) 107 RELEASE_LOG( PerformanceLogging, "Received memory pressure event %lu vm pressure %d", status, isUnderMemoryPressure());101 RELEASE_LOG(MemoryPressure, "Received memory pressure event %lu vm pressure %d", status, isUnderMemoryPressure()); 108 102 }); 109 103 dispatch_resume(memoryPressureEventSource);
Note:
See TracChangeset
for help on using the changeset viewer.