Changeset 205275 in webkit


Ignore:
Timestamp:
Aug 31, 2016 6:33:40 PM (8 years ago)
Author:
Keith Rollin
Message:

WebKit should set a subsystem for os_log so it's easier to filter for WebKit log messages
https://bugs.webkit.org/show_bug.cgi?id=160969
<rdar://problem/26068734>

Reviewed by Simon Fraser.

Source/WebCore:

  • Specify a channel when using RELEASE_LOG macros
  • Add a new channel so that we have something to pass to the RELEASE_LOG macros (Layers).
  • Enable subsystem- and channel-related data and functions when using RELEASE_LOG macros.
  • Use the DECLARE_LOG_CHANNEL, DEFINE_LOG_CHANNEL, and LOG_CHANNEL_ADDRESS macros that are now defined in WTF.

No new tests. There are no tests for logging.

  • loader/FrameLoader.cpp:
  • platform/LogInitialization.h:
  • platform/LogMacros.h:
  • platform/Logging.cpp:
  • platform/Logging.h:
  • platform/MemoryPressureHandler.cpp:

(WebCore::MemoryPressureHandler::ReliefLogger::logMemoryUsageChange):

  • platform/graphics/cg/GraphicsContextCG.cpp:

(WebCore::GraphicsContext::drawNativeImage):

  • platform/graphics/cocoa/IOSurface.mm:

(WebCore::IOSurface::IOSurface):

  • platform/mac/LoggingMac.mm:
  • platform/unix/LoggingUnix.cpp:
  • platform/win/LoggingWin.cpp:
  • testing/js/WebCoreTestSupport.cpp:

(WebCoreTestSupport::initializeLogChannelsIfNecessary):

Source/WebKit/mac:

Enable subsystem- and channel-related data and functions when using
RELEASE_LOG macros. Use the DECLARE_LOG_CHANNEL, DEFINE_LOG_CHANNEL,
and LOG_CHANNEL_ADDRESS macros that are now defined in WTF.

  • Misc/WebKitLogging.h:
  • Misc/WebKitLogging.m:
  • WebView/WebView.mm:

(-[WebView _commonInitializationWithFrameName:groupName:]):

Source/WebKit/win:

Enable subsystem- and channel-related data and functions when using
RELEASE_LOG macros. Use the DECLARE_LOG_CHANNEL, DEFINE_LOG_CHANNEL,
and LOG_CHANNEL_ADDRESS macros that are now defined in WTF.

  • WebKitLogging.cpp:
  • WebKitLogging.h:
  • WebView.cpp:

(WebView::initWithFrame):

Source/WebKit2:

  • Specify a channel when using RELEASE_LOG macros.
  • Add some new channels so that we have something to pass to the RELEASE_LOG macros (ProcessSuspension, IPC, Layers).
  • Enable subsystem- and channel-related data and functions when using RELEASE_LOG macros.
  • Use the DECLARE_LOG_CHANNEL, DEFINE_LOG_CHANNEL, and LOG_CHANNEL_ADDRESS macros that are now defined in WTF.
  • NetworkProcess/Downloads/Download.cpp:
  • NetworkProcess/NetworkProcess.cpp:

(WebKit::NetworkProcess::prepareToSuspend):
(WebKit::NetworkProcess::cancelPrepareToSuspend):
(WebKit::NetworkProcess::processDidResume):

  • NetworkProcess/NetworkResourceLoader.cpp:
  • Platform/IPC/Connection.cpp:

(IPC::Connection::waitForSyncReply):

  • Platform/LogInitialization.h:
  • Platform/Logging.cpp:

(WebKit::initializeLogChannelsIfNecessary):

  • Platform/Logging.h:
  • Platform/foundation/LoggingFoundation.mm:
  • Platform/unix/LoggingUnix.cpp:
  • Shared/ChildProcess.cpp:

(WebKit::didCloseOnConnectionWorkQueue):

  • Shared/WebKit2Initialize.cpp:

(WebKit::InitializeWebKit2):

  • UIProcess/Cocoa/NavigationState.mm:

(WebKit::NavigationState::releaseNetworkActivityToken):
(WebKit::NavigationState::didChangeIsLoading):

  • UIProcess/Network/NetworkProcessProxy.cpp:

(WebKit::NetworkProcessProxy::fetchWebsiteData):
(WebKit::NetworkProcessProxy::deleteWebsiteData):
(WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
(WebKit::NetworkProcessProxy::setIsHoldingLockedFiles):

  • UIProcess/ProcessThrottler.cpp:

(WebKit::ProcessThrottler::updateAssertionNow):
(WebKit::ProcessThrottler::updateAssertion):

  • UIProcess/WebPageProxy.cpp:
  • UIProcess/WebProcessPool.cpp:

(WebKit::m_hiddenPageThrottlingTimer):

  • UIProcess/WebProcessProxy.cpp:

(WebKit::WebProcessProxy::fetchWebsiteData):
(WebKit::WebProcessProxy::deleteWebsiteData):
(WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
(WebKit::WebProcessProxy::didSetAssertionState):
(WebKit::WebProcessProxy::setIsHoldingLockedFiles):

  • UIProcess/ios/ProcessAssertionIOS.mm:

(-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
(WebKit::ProcessAssertion::ProcessAssertion):

  • WebProcess/Network/WebLoaderStrategy.cpp:
  • WebProcess/Network/WebResourceLoader.cpp:
  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::layerVolatilityTimerFired):

  • WebProcess/WebProcess.cpp:

(WebKit::WebProcess::actualPrepareToSuspend):
(WebKit::WebProcess::processWillSuspendImminently):
(WebKit::WebProcess::prepareToSuspend):
(WebKit::WebProcess::cancelPrepareToSuspend):
(WebKit::WebProcess::markAllLayersVolatile):
(WebKit::WebProcess::processDidResume):

Source/WTF:

Add support for attaching a subsystem and category when logging via
the RELEASE_LOG macros. This support is provided by adding subsystem
and category information to WTFLogChannel. An os_log_t object is then
created to enacpsulate that information. When using RELEASE_LOG to log
through that channel, the associated log object is used when calling
os_log.

To help support the inclusion of the subsystem and category
information in WTFLogChannel, the DECLARE_LOG_CHANNEL,
DEFINE_LOG_CHANNEL, and LOG_CHANNEL_ADDRESS macros that were defined
in various modules are consolidated and moved to Assertions.h.
DEFINE_LOG_CHANNEL is now defined to initialize the subsystem and
category.

  • wtf/Assertions.cpp:
  • wtf/Assertions.h:
  • wtf/RefCountedLeakCounter.cpp:
Location:
trunk/Source
Files:
48 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r205273 r205275  
     12016-08-31  Keith Rollin  <krollin@apple.com>
     2
     3        WebKit should set a subsystem for os_log so it's easier to filter for WebKit log messages
     4        https://bugs.webkit.org/show_bug.cgi?id=160969
     5        <rdar://problem/26068734>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Add support for attaching a subsystem and category when logging via
     10        the RELEASE_LOG macros. This support is provided by adding subsystem
     11        and category information to WTFLogChannel. An os_log_t object is then
     12        created to enacpsulate that information. When using RELEASE_LOG to log
     13        through that channel, the associated log object is used when calling
     14        os_log.
     15
     16        To help support the inclusion of the subsystem and category
     17        information in WTFLogChannel, the DECLARE_LOG_CHANNEL,
     18        DEFINE_LOG_CHANNEL, and LOG_CHANNEL_ADDRESS macros that were defined
     19        in various modules are consolidated and moved to Assertions.h.
     20        DEFINE_LOG_CHANNEL is now defined to initialize the subsystem and
     21        category.
     22
     23        * wtf/Assertions.cpp:
     24        * wtf/Assertions.h:
     25        * wtf/RefCountedLeakCounter.cpp:
     26
    1272016-08-31  Alex Christensen  <achristensen@webkit.org>
    228
  • trunk/Source/WTF/wtf/Assertions.cpp

    r202782 r205275  
    556556void WTFInitializeLogChannelStatesFromString(WTFLogChannel* channels[], size_t count, const char* logLevel)
    557557{
     558#if !RELEASE_LOG_DISABLED
     559    for (size_t i = 0; i < count; ++i) {
     560        WTFLogChannel* channel = channels[i];
     561        channel->osLogChannel = os_log_create(channel->subsystem, channel->name);
     562    }
     563#endif
     564
    558565    String logLevelString = logLevel;
    559566    Vector<String> components;
  • trunk/Source/WTF/wtf/Assertions.h

    r204472 r205275  
    136136    WTFLogChannelState state;
    137137    const char* name;
     138#if !RELEASE_LOG_DISABLED
     139    const char* subsystem;
     140    __unsafe_unretained os_log_t osLogChannel;
     141#endif
    138142} WTFLogChannel;
     143
     144#define LOG_CHANNEL(name) JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, name)
     145#define LOG_CHANNEL_ADDRESS(name) &LOG_CHANNEL(name),
     146#define JOIN_LOG_CHANNEL_WITH_PREFIX(prefix, channel) JOIN_LOG_CHANNEL_WITH_PREFIX_LEVEL_2(prefix, channel)
     147#define JOIN_LOG_CHANNEL_WITH_PREFIX_LEVEL_2(prefix, channel) prefix ## channel
     148
     149#define LOG_CHANNEL_WEBKIT_SUBSYSTEM "com.apple.WebKit"
     150
     151#define DECLARE_LOG_CHANNEL(name) \
     152    extern WTFLogChannel LOG_CHANNEL(name);
     153
     154#if !defined(DEFINE_LOG_CHANNEL)
     155#if RELEASE_LOG_DISABLED
     156#define DEFINE_LOG_CHANNEL(name, subsystem) \
     157    WTFLogChannel LOG_CHANNEL(name) = { WTFLogChannelOff, #name };
     158#else
     159#define DEFINE_LOG_CHANNEL(name, subsystem) \
     160    WTFLogChannel LOG_CHANNEL(name) = { WTFLogChannelOff, #name, subsystem, OS_LOG_DEFAULT };
     161#endif
     162#endif
    139163
    140164WTF_EXPORT_PRIVATE void WTFReportAssertionFailure(const char* file, int line, const char* function, const char* assertion);
     
    368392#define LOG(channel, ...) ((void)0)
    369393#else
    370 #define LOG(channel, ...) WTFLog(&JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, channel), __VA_ARGS__)
    371 #define JOIN_LOG_CHANNEL_WITH_PREFIX(prefix, channel) JOIN_LOG_CHANNEL_WITH_PREFIX_LEVEL_2(prefix, channel)
    372 #define JOIN_LOG_CHANNEL_WITH_PREFIX_LEVEL_2(prefix, channel) prefix ## channel
     394#define LOG(channel, ...) WTFLog(&LOG_CHANNEL(channel), __VA_ARGS__)
    373395#endif
    374396
     
    378400#define LOG_VERBOSE(channel, ...) ((void)0)
    379401#else
    380 #define LOG_VERBOSE(channel, ...) WTFLogVerbose(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, &JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, channel), __VA_ARGS__)
     402#define LOG_VERBOSE(channel, ...) WTFLogVerbose(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, &LOG_CHANNEL(channel), __VA_ARGS__)
    381403#endif
    382404
    383405/* RELEASE_LOG */
    384406
    385 #define WTF_LOGGING_PREFIX "#WK: "
    386407#if RELEASE_LOG_DISABLED
    387 #define RELEASE_LOG(format, ...)       ((void)0)
    388 #define RELEASE_LOG_ERROR(format, ...) WTFReportError(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, format, ##__VA_ARGS__)
    389 #else
    390 #define WTF_LOG_DEFAULT OS_LOG_DEFAULT
    391 #define RELEASE_LOG(format, ...)       os_log(WTF_LOG_DEFAULT, WTF_LOGGING_PREFIX format, ##__VA_ARGS__)
    392 #define RELEASE_LOG_ERROR(format, ...) os_log_error(WTF_LOG_DEFAULT, WTF_LOGGING_PREFIX format, ##__VA_ARGS__)
    393 #endif
    394 #define RELEASE_LOG_IF(isAllowed, format, ...)       do { if (isAllowed) RELEASE_LOG(format, ##__VA_ARGS__); } while (0)
    395 #define RELEASE_LOG_ERROR_IF(isAllowed, format, ...) do { if (isAllowed) RELEASE_LOG_ERROR(format, ##__VA_ARGS__); } while (0)
     408#define RELEASE_LOG(      channel, format, ...) ((void)0)
     409#define RELEASE_LOG_ERROR(channel, format, ...) LOG_ERROR(format, ##__VA_ARGS__)
     410
     411#define RELEASE_LOG_IF(      isAllowed, channel, format, ...) ((void)0)
     412#define RELEASE_LOG_ERROR_IF(isAllowed, channel, format, ...) do { if (isAllowed) RELEASE_LOG_ERROR(channel, format, ##__VA_ARGS__); } while (0)
     413#else
     414#define RELEASE_LOG(      channel, format, ...) os_log(      LOG_CHANNEL(channel).osLogChannel, format, ##__VA_ARGS__)
     415#define RELEASE_LOG_ERROR(channel, format, ...) os_log_error(LOG_CHANNEL(channel).osLogChannel, format, ##__VA_ARGS__)
     416
     417#define RELEASE_LOG_IF(      isAllowed, channel, format, ...) do { if (isAllowed) RELEASE_LOG(      channel, format, ##__VA_ARGS__); } while (0)
     418#define RELEASE_LOG_ERROR_IF(isAllowed, channel, format, ...) do { if (isAllowed) RELEASE_LOG_ERROR(channel, format, ##__VA_ARGS__); } while (0)
     419#endif
     420
    396421
    397422/* RELEASE_ASSERT */
  • trunk/Source/WTF/wtf/RefCountedLeakCounter.cpp

    r162777 r205275  
    4040
    4141#define LOG_CHANNEL_PREFIX Log
     42#if RELEASE_LOG_DISABLED
    4243static WTFLogChannel LogRefCountedLeaks = { WTFLogChannelOn, "RefCountedLeaks" };
     44#else
     45static WTFLogChannel LogRefCountedLeaks = { WTFLogChannelOn, "RefCountedLeaks", LOG_CHANNEL_WEBKIT_SUBSYSTEM, OS_LOG_DEFAULT };
     46#endif
    4347
    4448typedef HashCountedSet<const char*, PtrHash<const char*>> ReasonSet;
  • trunk/Source/WebCore/ChangeLog

    r205274 r205275  
     12016-08-31  Keith Rollin  <krollin@apple.com>
     2
     3        WebKit should set a subsystem for os_log so it's easier to filter for WebKit log messages
     4        https://bugs.webkit.org/show_bug.cgi?id=160969
     5        <rdar://problem/26068734>
     6
     7        Reviewed by Simon Fraser.
     8
     9        - Specify a channel when using RELEASE_LOG macros
     10        - Add a new channel so that we have something to pass to the
     11          RELEASE_LOG macros (Layers).
     12        - Enable subsystem- and channel-related data and functions when using
     13          RELEASE_LOG macros.
     14        - Use the DECLARE_LOG_CHANNEL, DEFINE_LOG_CHANNEL, and
     15          LOG_CHANNEL_ADDRESS macros that are now defined in WTF.
     16
     17        No new tests. There are no tests for logging.
     18
     19        * loader/FrameLoader.cpp:
     20        * platform/LogInitialization.h:
     21        * platform/LogMacros.h:
     22        * platform/Logging.cpp:
     23        * platform/Logging.h:
     24        * platform/MemoryPressureHandler.cpp:
     25        (WebCore::MemoryPressureHandler::ReliefLogger::logMemoryUsageChange):
     26        * platform/graphics/cg/GraphicsContextCG.cpp:
     27        (WebCore::GraphicsContext::drawNativeImage):
     28        * platform/graphics/cocoa/IOSurface.mm:
     29        (WebCore::IOSurface::IOSurface):
     30        * platform/mac/LoggingMac.mm:
     31        * platform/unix/LoggingUnix.cpp:
     32        * platform/win/LoggingWin.cpp:
     33        * testing/js/WebCoreTestSupport.cpp:
     34        (WebCoreTestSupport::initializeLogChannelsIfNecessary):
     35
    1362016-08-31  Ricky Mondello  <rmondello@apple.com>
    237
  • trunk/Source/WebCore/loader/FrameLoader.cpp

    r205249 r205275  
    143143#endif
    144144
    145 #define RELEASE_LOG_IF_ALLOWED(...) RELEASE_LOG_IF(isAlwaysOnLoggingAllowed(), __VA_ARGS__)
     145#define RELEASE_LOG_IF_ALLOWED(...) RELEASE_LOG_IF(isAlwaysOnLoggingAllowed(), Network, __VA_ARGS__)
    146146
    147147namespace WebCore {
  • trunk/Source/WebCore/platform/LogInitialization.h

    r203749 r205275  
    3131namespace WebCore {
    3232
    33 #if !LOG_DISABLED
     33#if !LOG_DISABLED || !RELEASE_LOG_DISABLED
    3434
    3535String logLevelString();
     
    3838WEBCORE_EXPORT void initializeLogChannelsIfNecessary();
    3939
    40 #endif // !LOG_DISABLED
     40#endif // !LOG_DISABLED || !RELEASE_LOG_DISABLED
    4141
    4242} // namespace WebCore
  • trunk/Source/WebCore/platform/LogMacros.h

    r203749 r205275  
    2828#include <functional>
    2929
    30 #if LOG_DISABLED
     30#if LOG_DISABLED && RELEASE_LOG_DISABLED
    3131
    3232#define LOG_RESULT(channel, function) ((void)0)
     
    4848    });
    4949
    50 #endif // !LOG_DISABLED
     50#endif // !LOG_DISABLED || !RELEASE_LOG_DISABLED
  • trunk/Source/WebCore/platform/Logging.cpp

    r203749 r205275  
    3636#endif
    3737
    38 #if !LOG_DISABLED
     38#if !LOG_DISABLED || !RELEASE_LOG_DISABLED
    3939
    4040namespace WebCore {
    4141
    42 #define DEFINE_LOG_CHANNEL(name) \
    43     WTFLogChannel JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, name) = { WTFLogChannelOff, #name };
    44 WEBCORE_LOG_CHANNELS(DEFINE_LOG_CHANNEL)
     42#define DEFINE_WEBCORE_LOG_CHANNEL(name) DEFINE_LOG_CHANNEL(name, LOG_CHANNEL_WEBKIT_SUBSYSTEM)
     43WEBCORE_LOG_CHANNELS(DEFINE_WEBCORE_LOG_CHANNEL)
    4544
    46 #define LOG_CHANNEL_ADDRESS(name)  &JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, name),
    47 WTFLogChannel* logChannels[] = {
     45static WTFLogChannel* logChannels[] = {
    4846    WEBCORE_LOG_CHANNELS(LOG_CHANNEL_ADDRESS)
    4947};
    5048
    51 size_t logChannelCount = WTF_ARRAY_LENGTH(logChannels);
     49static const size_t logChannelCount = WTF_ARRAY_LENGTH(logChannels);
    5250
    5351bool isLogChannelEnabled(const String& name)
     
    103101} // namespace WebCore
    104102
    105 #endif // !LOG_DISABLED
     103#endif // !LOG_DISABLED || !RELEASE_LOG_DISABLED
  • trunk/Source/WebCore/platform/Logging.h

    r204544 r205275  
    3232namespace WebCore {
    3333
    34 #if !LOG_DISABLED
     34#if !LOG_DISABLED || !RELEASE_LOG_DISABLED
    3535
    3636#ifndef LOG_CHANNEL_PREFIX
     
    4747    M(Editing) \
    4848    M(Events) \
    49     M(FTP) \
    5049    M(FileAPI) \
    5150    M(Frames) \
     51    M(FTP) \
    5252    M(Fullscreen) \
    5353    M(Gamepad) \
     
    5656    M(Images) \
    5757    M(IndexedDB) \
     58    M(Layers) \
    5859    M(Layout) \
    5960    M(Loading) \
     
    7172    M(RemoteInspector) \
    7273    M(ResourceLoading) \
     74    M(ResourceLoadObserver) \
     75    M(Scrolling) \
     76    M(Services) \
     77    M(SpellingAndGrammar) \
    7378    M(SQLDatabase) \
     79    M(StorageAPI) \
    7480    M(SVG) \
    75     M(Services) \
    76     M(Scrolling) \
    77     M(SpellingAndGrammar) \
    78     M(StorageAPI) \
    7981    M(TextAutosizing) \
    8082    M(Threading) \
     
    8486    M(WebReplay) \
    8587    M(WheelEventTestTriggers) \
    86     M(ResourceLoadObserver) \
    8788
     89#undef DECLARE_LOG_CHANNEL
    8890#define DECLARE_LOG_CHANNEL(name) \
    8991    WEBCORE_EXPORT extern WTFLogChannel JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, name);
     
    98100#endif
    99101
    100 #endif // !LOG_DISABLED
     102#endif // !LOG_DISABLED || !RELEASE_LOG_DISABLED
    101103
    102104} // namespace WebCore
  • trunk/Source/WebCore/platform/MemoryPressureHandler.cpp

    r204472 r205275  
    3535#include "HTMLMediaElement.h"
    3636#include "InspectorInstrumentation.h"
     37#include "Logging.h"
    3738#include "MemoryCache.h"
    3839#include "Page.h"
     
    221222#if !RELEASE_LOG_DISABLED
    222223#define STRING_SPECIFICATION "%{public}s"
    223 #define MEMORYPRESSURE_LOG(...) RELEASE_LOG(__VA_ARGS__)
     224#define MEMORYPRESSURE_LOG(...) RELEASE_LOG(MemoryPressure, __VA_ARGS__)
    224225#else
    225226#define STRING_SPECIFICATION "%s"
  • trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp

    r201777 r205275  
    176176    }
    177177
    178 #if !LOG_DISABLED
     178#if !LOG_DISABLED || !RELEASE_LOG_DISABLED
    179179    double startTime = currentTime();
    180180#endif
  • trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm

    r204472 r205275  
    3535#import "ImageBuffer.h"
    3636#import "ImageBufferDataCG.h"
     37#import "Logging.h"
    3738#import "MachSendRight.h"
    3839#import <wtf/Assertions.h>
     
    212213        m_totalBytes = IOSurfaceGetAllocSize(m_surface.get());
    213214    else
    214         RELEASE_LOG_ERROR("Surface creation failed for size: (%d %d) and format: (%d)", size.width(), size.height(), format);
     215        RELEASE_LOG_ERROR(Layers, "Surface creation failed for size: (%d %d) and format: (%d)", size.width(), size.height(), format);
    215216}
    216217
  • trunk/Source/WebCore/platform/mac/LoggingMac.mm

    r165676 r205275  
    2929#include <wtf/text/WTFString.h>
    3030
    31 #if !LOG_DISABLED
     31#if !LOG_DISABLED || !RELEASE_LOG_DISABLED
    3232
    3333namespace WebCore {
     
    4242}
    4343
    44 #endif // !LOG_DISABLED
     44#endif // !LOG_DISABLED || !RELEASE_LOG_DISABLED
  • trunk/Source/WebCore/platform/unix/LoggingUnix.cpp

    r199815 r205275  
    2323#include "Logging.h"
    2424
    25 #if !LOG_DISABLED
     25#if !LOG_DISABLED || !RELEASE_LOG_DISABLED
    2626
    2727#include <string.h>
     
    4747} // namespace WebCore
    4848
    49 #endif // !LOG_DISABLED
     49#endif // !LOG_DISABLED || !RELEASE_LOG_DISABLED
  • trunk/Source/WebCore/platform/win/LoggingWin.cpp

    r173949 r205275  
    2727#include "Logging.h"
    2828
    29 #if !LOG_DISABLED
     29#if !LOG_DISABLED || !RELEASE_LOG_DISABLED
    3030
    3131#include <windows.h>
     
    5353} // namespace WebCore
    5454
    55 #endif // !LOG_DISABLED
     55#endif // !LOG_DISABLED || !RELEASE_LOG_DISABLED
  • trunk/Source/WebCore/testing/js/WebCoreTestSupport.cpp

    r204853 r205275  
    111111void initializeLogChannelsIfNecessary()
    112112{
    113 #if !LOG_DISABLED
     113#if !LOG_DISABLED || !RELEASE_LOG_DISABLED
    114114    WebCore::initializeLogChannelsIfNecessary();
    115115#endif
  • trunk/Source/WebKit/mac/ChangeLog

    r205247 r205275  
     12016-08-31  Keith Rollin  <krollin@apple.com>
     2
     3        WebKit should set a subsystem for os_log so it's easier to filter for WebKit log messages
     4        https://bugs.webkit.org/show_bug.cgi?id=160969
     5        <rdar://problem/26068734>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Enable subsystem- and channel-related data and functions when using
     10        RELEASE_LOG macros. Use the DECLARE_LOG_CHANNEL, DEFINE_LOG_CHANNEL,
     11        and LOG_CHANNEL_ADDRESS macros that are now defined in WTF.
     12
     13        * Misc/WebKitLogging.h:
     14        * Misc/WebKitLogging.m:
     15        * WebView/WebView.mm:
     16        (-[WebView _commonInitializationWithFrameName:groupName:]):
     17
    1182016-08-31  Brady Eidson  <beidson@apple.com>
    219
  • trunk/Source/WebKit/mac/Misc/WebKitLogging.h

    r203756 r205275  
    3737#endif
    3838
    39 #if !LOG_DISABLED
     39#if !LOG_DISABLED || !RELEASE_LOG_DISABLED
    4040
    4141#define WEBKIT_LOG_CHANNELS(M) \
     
    6565    M(View) \
    6666
    67 #define DECLARE_LOG_CHANNEL(name) \
    68 extern WTFLogChannel JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, name);
    69 
    7067WEBKIT_LOG_CHANNELS(DECLARE_LOG_CHANNEL)
    7168
     
    7370
    7471void WebKitInitializeLogChannelsIfNecessary(void);
    75 #endif // !LOG_DISABLED
     72#endif // !LOG_DISABLED || !RELEASE_LOG_DISABLED
    7673
    7774void ReportDiscardedDelegateException(SEL delegateSelector, id exception);
  • trunk/Source/WebKit/mac/Misc/WebKitLogging.m

    r203749 r205275  
    2929#import "WebKitLogging.h"
    3030
    31 #if !LOG_DISABLED
     31#if !LOG_DISABLED || !RELEASE_LOG_DISABLED
    3232
    33 #define DEFINE_LOG_CHANNEL(name) \
    34     WTFLogChannel JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, name) = { WTFLogChannelOff, #name };
    35 WEBKIT_LOG_CHANNELS(DEFINE_LOG_CHANNEL)
     33#define DEFINE_WEBKIT_LOG_CHANNEL(name) DEFINE_LOG_CHANNEL(name, LOG_CHANNEL_WEBKIT_SUBSYSTEM)
     34WEBKIT_LOG_CHANNELS(DEFINE_WEBKIT_LOG_CHANNEL)
    3635
    37 #define LOG_CHANNEL_ADDRESS(name)  &JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, name),
    3836static WTFLogChannel* logChannels[] = {
    3937    WEBKIT_LOG_CHANNELS(LOG_CHANNEL_ADDRESS)
     
    5957}
    6058
    61 #endif // !LOG_DISABLED
     59#endif // !LOG_DISABLED || !RELEASE_LOG_DISABLED
    6260
    6361void ReportDiscardedDelegateException(SEL delegateSelector, id exception)
  • trunk/Source/WebKit/mac/WebView/WebView.mm

    r205247 r205275  
    968968#endif
    969969    if (!didOneTimeInitialization) {
    970 #if !LOG_DISABLED
     970#if !LOG_DISABLED || !RELEASE_LOG_DISABLED
    971971        WebKitInitializeLogChannelsIfNecessary();
    972972        WebCore::initializeLogChannelsIfNecessary();
  • trunk/Source/WebKit/win/ChangeLog

    r205116 r205275  
     12016-08-31  Keith Rollin  <krollin@apple.com>
     2
     3        WebKit should set a subsystem for os_log so it's easier to filter for WebKit log messages
     4        https://bugs.webkit.org/show_bug.cgi?id=160969
     5        <rdar://problem/26068734>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Enable subsystem- and channel-related data and functions when using
     10        RELEASE_LOG macros. Use the DECLARE_LOG_CHANNEL, DEFINE_LOG_CHANNEL,
     11        and LOG_CHANNEL_ADDRESS macros that are now defined in WTF.
     12
     13        * WebKitLogging.cpp:
     14        * WebKitLogging.h:
     15        * WebView.cpp:
     16        (WebView::initWithFrame):
     17
    1182016-08-16  Carlos Garcia Campos  <cgarcia@igalia.com>
    219
  • trunk/Source/WebKit/win/WebKitLogging.cpp

    r203749 r205275  
    2828#include "WebKitLogging.h"
    2929
    30 #if !LOG_DISABLED
     30#if !LOG_DISABLED || !RELEASE_LOG_DISABLED
    3131
    32 #define DEFINE_LOG_CHANNEL(name) \
    33     WTFLogChannel JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, name) = { WTFLogChannelOff, #name };
    34 WEBKIT_LOG_CHANNELS(DEFINE_LOG_CHANNEL)
     32#define DEFINE_WEBKIT_LOG_CHANNEL(name) DEFINE_LOG_CHANNEL(name, LOG_CHANNEL_WEBKIT_SUBSYSTEM)
     33WEBKIT_LOG_CHANNELS(DEFINE_WEBKIT_LOG_CHANNEL)
    3534
    36 #define LOG_CHANNEL_ADDRESS(name)  &JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, name),
    3735static WTFLogChannel* logChannels[] = {
    3836    WEBKIT_LOG_CHANNELS(LOG_CHANNEL_ADDRESS)
     
    5250}
    5351
    54 #endif // !LOG_DISABLED
     52#endif // !LOG_DISABLED || !RELEASE_LOG_DISABLED
  • trunk/Source/WebKit/win/WebKitLogging.h

    r203749 r205275  
    3131#include <wtf/Assertions.h>
    3232
    33 #if !LOG_DISABLED
     33#if !LOG_DISABLED || !RELEASE_LOG_DISABLED
    3434
    3535#ifndef LOG_CHANNEL_PREFIX
     
    6363    M(View) \
    6464
    65 #define DECLARE_LOG_CHANNEL(name) \
    66 extern WTFLogChannel JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, name);
    67 
    6865WEBKIT_LOG_CHANNELS(DECLARE_LOG_CHANNEL)
    6966
     
    7269void WebKitInitializeLogChannelsIfNecessary(void);
    7370
    74 #endif // !LOG_DISABLED
     71#endif // !LOG_DISABLED || !RELEASE_LOG_DISABLED
    7572
    7673#endif
  • trunk/Source/WebKit/win/WebView.cpp

    r204293 r205275  
    29072907    static bool didOneTimeInitialization;
    29082908    if (!didOneTimeInitialization) {
    2909 #if !LOG_DISABLED
     2909#if !LOG_DISABLED || !RELEASE_LOG_DISABLED
    29102910        initializeLogChannelsIfNecessary();
    2911 #endif // !LOG_DISABLED
     2911#endif // !LOG_DISABLED || !RELEASE_LOG_DISABLED
    29122912
    29132913        // Initialize our platform strategies first before invoking the rest
  • trunk/Source/WebKit2/ChangeLog

    r205269 r205275  
     12016-08-31  Keith Rollin  <krollin@apple.com>
     2
     3        WebKit should set a subsystem for os_log so it's easier to filter for WebKit log messages
     4        https://bugs.webkit.org/show_bug.cgi?id=160969
     5        <rdar://problem/26068734>
     6
     7        Reviewed by Simon Fraser.
     8
     9        - Specify a channel when using RELEASE_LOG macros.
     10        - Add some new channels so that we have something to pass to the
     11          RELEASE_LOG macros (ProcessSuspension, IPC, Layers).
     12        - Enable subsystem- and channel-related data and functions when using
     13          RELEASE_LOG macros.
     14        - Use the DECLARE_LOG_CHANNEL, DEFINE_LOG_CHANNEL, and
     15          LOG_CHANNEL_ADDRESS macros that are now defined in WTF.
     16
     17        * NetworkProcess/Downloads/Download.cpp:
     18        * NetworkProcess/NetworkProcess.cpp:
     19        (WebKit::NetworkProcess::prepareToSuspend):
     20        (WebKit::NetworkProcess::cancelPrepareToSuspend):
     21        (WebKit::NetworkProcess::processDidResume):
     22        * NetworkProcess/NetworkResourceLoader.cpp:
     23        * Platform/IPC/Connection.cpp:
     24        (IPC::Connection::waitForSyncReply):
     25        * Platform/LogInitialization.h:
     26        * Platform/Logging.cpp:
     27        (WebKit::initializeLogChannelsIfNecessary):
     28        * Platform/Logging.h:
     29        * Platform/foundation/LoggingFoundation.mm:
     30        * Platform/unix/LoggingUnix.cpp:
     31        * Shared/ChildProcess.cpp:
     32        (WebKit::didCloseOnConnectionWorkQueue):
     33        * Shared/WebKit2Initialize.cpp:
     34        (WebKit::InitializeWebKit2):
     35        * UIProcess/Cocoa/NavigationState.mm:
     36        (WebKit::NavigationState::releaseNetworkActivityToken):
     37        (WebKit::NavigationState::didChangeIsLoading):
     38        * UIProcess/Network/NetworkProcessProxy.cpp:
     39        (WebKit::NetworkProcessProxy::fetchWebsiteData):
     40        (WebKit::NetworkProcessProxy::deleteWebsiteData):
     41        (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
     42        (WebKit::NetworkProcessProxy::setIsHoldingLockedFiles):
     43        * UIProcess/ProcessThrottler.cpp:
     44        (WebKit::ProcessThrottler::updateAssertionNow):
     45        (WebKit::ProcessThrottler::updateAssertion):
     46        * UIProcess/WebPageProxy.cpp:
     47        * UIProcess/WebProcessPool.cpp:
     48        (WebKit::m_hiddenPageThrottlingTimer):
     49        * UIProcess/WebProcessProxy.cpp:
     50        (WebKit::WebProcessProxy::fetchWebsiteData):
     51        (WebKit::WebProcessProxy::deleteWebsiteData):
     52        (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
     53        (WebKit::WebProcessProxy::didSetAssertionState):
     54        (WebKit::WebProcessProxy::setIsHoldingLockedFiles):
     55        * UIProcess/ios/ProcessAssertionIOS.mm:
     56        (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
     57        (WebKit::ProcessAssertion::ProcessAssertion):
     58        * WebProcess/Network/WebLoaderStrategy.cpp:
     59        * WebProcess/Network/WebResourceLoader.cpp:
     60        * WebProcess/WebPage/WebPage.cpp:
     61        (WebKit::WebPage::layerVolatilityTimerFired):
     62        * WebProcess/WebProcess.cpp:
     63        (WebKit::WebProcess::actualPrepareToSuspend):
     64        (WebKit::WebProcess::processWillSuspendImminently):
     65        (WebKit::WebProcess::prepareToSuspend):
     66        (WebKit::WebProcess::cancelPrepareToSuspend):
     67        (WebKit::WebProcess::markAllLayersVolatile):
     68        (WebKit::WebProcess::processDidResume):
     69
    1702016-08-31  Yoav Weiss  <yoav@yoav.ws>
    271
  • trunk/Source/WebKit2/NetworkProcess/Downloads/Download.cpp

    r204472 r205275  
    3232#include "DownloadManager.h"
    3333#include "DownloadProxyMessages.h"
     34#include "Logging.h"
    3435#include "SandboxExtension.h"
    3536#include "WebCoreArgumentCoders.h"
     
    3839using namespace WebCore;
    3940
    40 #define RELEASE_LOG_IF_ALLOWED(...) RELEASE_LOG_IF(isAlwaysOnLoggingAllowed(), __VA_ARGS__)
    41 #define RELEASE_LOG_ERROR_IF_ALLOWED(...) RELEASE_LOG_ERROR_IF(isAlwaysOnLoggingAllowed(), __VA_ARGS__)
     41#define RELEASE_LOG_IF_ALLOWED(...) RELEASE_LOG_IF(isAlwaysOnLoggingAllowed(), Network, __VA_ARGS__)
     42#define RELEASE_LOG_ERROR_IF_ALLOWED(...) RELEASE_LOG_ERROR_IF(isAlwaysOnLoggingAllowed(), Network, __VA_ARGS__)
    4243
    4344namespace WebKit {
  • trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp

    r205266 r205275  
    624624void NetworkProcess::prepareToSuspend()
    625625{
    626     RELEASE_LOG("%p - NetworkProcess::prepareToSuspend()", this);
     626    RELEASE_LOG(ProcessSuspension, "%p - NetworkProcess::prepareToSuspend()", this);
    627627    lowMemoryHandler(Critical::Yes);
    628628
    629     RELEASE_LOG("%p - NetworkProcess::prepareToSuspend() Sending ProcessReadyToSuspend IPC message", this);
     629    RELEASE_LOG(ProcessSuspension, "%p - NetworkProcess::prepareToSuspend() Sending ProcessReadyToSuspend IPC message", this);
    630630    parentProcessConnection()->send(Messages::NetworkProcessProxy::ProcessReadyToSuspend(), 0);
    631631}
     
    637637    // message. And NetworkProcessProxy expects to receive either a NetworkProcessProxy::ProcessReadyToSuspend-
    638638    // or NetworkProcessProxy::DidCancelProcessSuspension- message, but not both.
    639     RELEASE_LOG("%p - NetworkProcess::cancelPrepareToSuspend()", this);
     639    RELEASE_LOG(ProcessSuspension, "%p - NetworkProcess::cancelPrepareToSuspend()", this);
    640640}
    641641
    642642void NetworkProcess::processDidResume()
    643643{
    644     RELEASE_LOG("%p - NetworkProcess::processDidResume()", this);
     644    RELEASE_LOG(ProcessSuspension, "%p - NetworkProcess::processDidResume()", this);
    645645}
    646646
  • trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp

    r205052 r205275  
    5050using namespace WebCore;
    5151
    52 #define RELEASE_LOG_IF_ALLOWED(...) RELEASE_LOG_IF(isAlwaysOnLoggingAllowed(), __VA_ARGS__)
    53 #define RELEASE_LOG_ERROR_IF_ALLOWED(...) RELEASE_LOG_ERROR_IF(isAlwaysOnLoggingAllowed(), __VA_ARGS__)
     52#define RELEASE_LOG_IF_ALLOWED(...) RELEASE_LOG_IF(isAlwaysOnLoggingAllowed(), Network, __VA_ARGS__)
     53#define RELEASE_LOG_ERROR_IF_ALLOWED(...) RELEASE_LOG_ERROR_IF(isAlwaysOnLoggingAllowed(), Network, __VA_ARGS__)
    5454
    5555namespace WebKit {
  • trunk/Source/WebKit2/Platform/IPC/Connection.cpp

    r205207 r205275  
    2727#include "Connection.h"
    2828
     29#include "Logging.h"
    2930#include <memory>
    3031#include <wtf/CurrentTime.h>
     
    574575        // any more incoming messages.
    575576        if (!isValid()) {
    576             RELEASE_LOG_ERROR("Connection::waitForSyncReply: Connection no longer valid, id = %" PRIu64, syncRequestID);
     577            RELEASE_LOG_ERROR(IPC, "Connection::waitForSyncReply: Connection no longer valid, id = %" PRIu64, syncRequestID);
    577578            didReceiveSyncReply(sendSyncOptions);
    578579            return nullptr;
     
    585586    }
    586587
    587     RELEASE_LOG_ERROR("Connection::waitForSyncReply: Timed-out while waiting for reply, id = %" PRIu64, syncRequestID);
     588    RELEASE_LOG_ERROR(IPC, "Connection::waitForSyncReply: Timed-out while waiting for reply, id = %" PRIu64, syncRequestID);
    588589    didReceiveSyncReply(sendSyncOptions);
    589590
  • trunk/Source/WebKit2/Platform/LogInitialization.h

    r203749 r205275  
    2828#include <wtf/text/WTFString.h>
    2929
    30 #if !LOG_DISABLED
     30#if !LOG_DISABLED || !RELEASE_LOG_DISABLED
    3131
    3232namespace WebKit {
     
    3737} // namespace WebKit
    3838
    39 #endif // !LOG_DISABLED
     39#endif // !LOG_DISABLED || !RELEASE_LOG_DISABLED
  • trunk/Source/WebKit2/Platform/Logging.cpp

    r203749 r205275  
    3131#include <wtf/text/CString.h>
    3232
    33 #if !LOG_DISABLED
     33#if !LOG_DISABLED || !RELEASE_LOG_DISABLED
    3434
    35 #define DEFINE_LOG_CHANNEL(name) \
    36     WTFLogChannel JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, name) = { WTFLogChannelOff, #name };
    37 WEBKIT2_LOG_CHANNELS(DEFINE_LOG_CHANNEL)
     35#define DEFINE_WEBKIT2_LOG_CHANNEL(name) DEFINE_LOG_CHANNEL(name, LOG_CHANNEL_WEBKIT_SUBSYSTEM)
     36WEBKIT2_LOG_CHANNELS(DEFINE_WEBKIT2_LOG_CHANNEL)
    3837
    39 #define LOG_CHANNEL_ADDRESS(name)  &JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, name),
    4038static WTFLogChannel* logChannels[] = {
    4139    WEBKIT2_LOG_CHANNELS(LOG_CHANNEL_ADDRESS)
     
    4442namespace WebKit {
    4543
    46 const size_t logChannelCount = WTF_ARRAY_LENGTH(logChannels);
     44static const size_t logChannelCount = WTF_ARRAY_LENGTH(logChannels);
    4745
    4846void initializeLogChannelsIfNecessary()
     
    6361} // namespace WebKit
    6462
    65 #endif // !LOG_DISABLED
     63#endif // !LOG_DISABLED || !RELEASE_LOG_DISABLED
  • trunk/Source/WebKit2/Platform/Logging.h

    r204886 r205275  
    3232#include <wtf/text/WTFString.h>
    3333
    34 #if !LOG_DISABLED
     34#if !LOG_DISABLED || !RELEASE_LOG_DISABLED
    3535
    3636#ifndef LOG_CHANNEL_PREFIX
     
    4545    M(ContextMenu) \
    4646    M(Gamepad) \
     47    M(IconDatabase) \
    4748    M(IDB) \
    48     M(IconDatabase) \
    4949    M(IndexedDB) \
    5050    M(InspectorServer) \
     51    M(IPC) \
    5152    M(KeyHandling) \
     53    M(Layers) \
    5254    M(Network) \
    5355    M(NetworkCache) \
     56    M(NetworkCacheSpeculativePreloading) \
    5457    M(NetworkCacheStorage) \
    55     M(NetworkCacheSpeculativePreloading) \
     58    M(NetworkScheduling) \
    5659    M(NetworkSession) \
    57     M(NetworkScheduling) \
    5860    M(Plugins) \
    5961    M(Printing) \
     62    M(ProcessSuspension) \
    6063    M(RemoteLayerTree) \
    6164    M(Resize) \
     
    6770    M(VisibleRects) \
    6871
    69 #define DECLARE_LOG_CHANNEL(name) \
    70     extern WTFLogChannel JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, name);
    71 
    7272WEBKIT2_LOG_CHANNELS(DECLARE_LOG_CHANNEL)
    7373
     
    7878#endif
    7979
    80 #endif // !LOG_DISABLED
     80#endif // !LOG_DISABLED || !RELEASE_LOG_DISABLED
    8181
    8282#endif // Logging_h
  • trunk/Source/WebKit2/Platform/foundation/LoggingFoundation.mm

    r203749 r205275  
    3030namespace WebKit {
    3131
    32 #if !LOG_DISABLED
     32#if !LOG_DISABLED || !RELEASE_LOG_DISABLED
    3333
    3434static NSString * const defaultsDomain = @"WebKit2Logging";
  • trunk/Source/WebKit2/Platform/unix/LoggingUnix.cpp

    r200143 r205275  
    3030namespace WebKit {
    3131
    32 #if !LOG_DISABLED
     32#if !LOG_DISABLED || !RELEASE_LOG_DISABLED
    3333
    3434String logLevelString()
     
    3737}
    3838
    39 #endif // !LOG_DISABLED
     39#endif // !LOG_DISABLED || !RELEASE_LOG_DISABLED
    4040
    4141}
  • trunk/Source/WebKit2/Shared/ChildProcess.cpp

    r204472 r205275  
    2727#include "ChildProcess.h"
    2828
     29#include "Logging.h"
    2930#include "SandboxInitializationParameters.h"
    3031#include <unistd.h>
     
    5455        // global destructors or atexit handlers to be called from this thread while the main thread is busy
    5556        // doing its thing.
    56         RELEASE_LOG_ERROR("Exiting process early due to unacknowledged closed-connection");
     57        RELEASE_LOG_ERROR(IPC, "Exiting process early due to unacknowledged closed-connection");
    5758        _exit(EXIT_FAILURE);
    5859    });
  • trunk/Source/WebKit2/Shared/WebKit2Initialize.cpp

    r205266 r205275  
    5757    RunLoop::initializeMainRunLoop();
    5858
    59 #if !LOG_DISABLED
     59#if !LOG_DISABLED || !RELEASE_LOG_DISABLED
    6060    WebCore::initializeLogChannelsIfNecessary();
    6161    WebKit::initializeLogChannelsIfNecessary();
    62 #endif // !LOG_DISABLED
     62#endif // !LOG_DISABLED || !RELEASE_LOG_DISABLED
    6363}
    6464
  • trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm

    r204716 r205275  
    3636#import "AuthenticationDecisionListener.h"
    3737#import "CompletionHandlerCallChecker.h"
     38#import "Logging.h"
    3839#import "NavigationActionData.h"
    3940#import "PageLoadState.h"
     
    826827void NavigationState::releaseNetworkActivityToken()
    827828{
    828     RELEASE_LOG_IF(m_webView->_page->isAlwaysOnLoggingAllowed(), "%p UIProcess is releasing a background assertion because a page load completed", this);
     829    RELEASE_LOG_IF(m_webView->_page->isAlwaysOnLoggingAllowed(), ProcessSuspension, "%p UIProcess is releasing a background assertion because a page load completed", this);
    829830    ASSERT(m_activityToken);
    830831    m_activityToken = nullptr;
     
    839840            m_releaseActivityTimer.stop();
    840841        else {
    841             RELEASE_LOG_IF(m_webView->_page->isAlwaysOnLoggingAllowed(), "%p - UIProcess is taking a background assertion because a page load started", this);
     842            RELEASE_LOG_IF(m_webView->_page->isAlwaysOnLoggingAllowed(), ProcessSuspension, "%p - UIProcess is taking a background assertion because a page load started", this);
    842843            ASSERT(!m_activityToken);
    843844            m_activityToken = m_webView->_page->process().throttler().backgroundActivityToken();
  • trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp

    r204996 r205275  
    3131#include "DatabaseProcessMessages.h"
    3232#include "DownloadProxyMessages.h"
     33#include "Logging.h"
    3334#include "NetworkProcessCreationParameters.h"
    3435#include "NetworkProcessMessages.h"
     
    126127    uint64_t callbackID = generateCallbackID();
    127128    auto token = throttler().backgroundActivityToken();
    128     RELEASE_LOG_IF(sessionID.isAlwaysOnLoggingAllowed(), "%p - NetworkProcessProxy is taking a background assertion because the Network process is fetching Website data", this);
     129    RELEASE_LOG_IF(sessionID.isAlwaysOnLoggingAllowed(), ProcessSuspension, "%p - NetworkProcessProxy is taking a background assertion because the Network process is fetching Website data", this);
    129130
    130131    m_pendingFetchWebsiteDataCallbacks.add(callbackID, [this, token, completionHandler, sessionID](WebsiteData websiteData) {
    131132        completionHandler(WTFMove(websiteData));
    132         RELEASE_LOG_IF(sessionID.isAlwaysOnLoggingAllowed(), "%p - NetworkProcessProxy is releasing a background assertion because the Network process is done fetching Website data", this);
     133        RELEASE_LOG_IF(sessionID.isAlwaysOnLoggingAllowed(), ProcessSuspension, "%p - NetworkProcessProxy is releasing a background assertion because the Network process is done fetching Website data", this);
    133134    });
    134135
     
    140141    auto callbackID = generateCallbackID();
    141142    auto token = throttler().backgroundActivityToken();
    142     RELEASE_LOG_IF(sessionID.isAlwaysOnLoggingAllowed(), "%p - NetworkProcessProxy is taking a background assertion because the Network process is deleting Website data", this);
     143    RELEASE_LOG_IF(sessionID.isAlwaysOnLoggingAllowed(), ProcessSuspension, "%p - NetworkProcessProxy is taking a background assertion because the Network process is deleting Website data", this);
    143144
    144145    m_pendingDeleteWebsiteDataCallbacks.add(callbackID, [this, token, completionHandler, sessionID] {
    145146        completionHandler();
    146         RELEASE_LOG_IF(sessionID.isAlwaysOnLoggingAllowed(), "%p - NetworkProcessProxy is releasing a background assertion because the Network process is done deleting Website data", this);
     147        RELEASE_LOG_IF(sessionID.isAlwaysOnLoggingAllowed(), ProcessSuspension, "%p - NetworkProcessProxy is releasing a background assertion because the Network process is done deleting Website data", this);
    147148    });
    148149    send(Messages::NetworkProcess::DeleteWebsiteData(sessionID, dataTypes, modifiedSince, callbackID), 0);
     
    155156    uint64_t callbackID = generateCallbackID();
    156157    auto token = throttler().backgroundActivityToken();
    157     RELEASE_LOG_IF(sessionID.isAlwaysOnLoggingAllowed(), "%p - NetworkProcessProxy is taking a background assertion because the Network process is deleting Website data for several origins", this);
     158    RELEASE_LOG_IF(sessionID.isAlwaysOnLoggingAllowed(), ProcessSuspension, "%p - NetworkProcessProxy is taking a background assertion because the Network process is deleting Website data for several origins", this);
    158159
    159160    m_pendingDeleteWebsiteDataForOriginsCallbacks.add(callbackID, [this, token, completionHandler, sessionID] {
    160161        completionHandler();
    161         RELEASE_LOG_IF(sessionID.isAlwaysOnLoggingAllowed(), "%p - NetworkProcessProxy is releasing a background assertion because the Network process is done deleting Website data for several origins", this);
     162        RELEASE_LOG_IF(sessionID.isAlwaysOnLoggingAllowed(), ProcessSuspension, "%p - NetworkProcessProxy is releasing a background assertion because the Network process is done deleting Website data for several origins", this);
    162163    });
    163164
     
    402403{
    403404    if (!isHoldingLockedFiles) {
    404         RELEASE_LOG("UIProcess is releasing a background assertion because the Network process is no longer holding locked files");
     405        RELEASE_LOG(ProcessSuspension, "UIProcess is releasing a background assertion because the Network process is no longer holding locked files");
    405406        m_tokenForHoldingLockedFiles = nullptr;
    406407        return;
    407408    }
    408409    if (!m_tokenForHoldingLockedFiles) {
    409         RELEASE_LOG("UIProcess is taking a background assertion because the Network process is holding locked files");
     410        RELEASE_LOG(ProcessSuspension, "UIProcess is taking a background assertion because the Network process is holding locked files");
    410411        m_tokenForHoldingLockedFiles = m_throttler.backgroundActivityToken();
    411412    }
  • trunk/Source/WebKit2/UIProcess/ProcessThrottler.cpp

    r204472 r205275  
    2727#include "ProcessThrottler.h"
    2828
     29#include "Logging.h"
    2930#include "ProcessThrottlerClient.h"
    3031
     
    5859    if (m_assertion) {
    5960        if (m_assertion->state() != assertionState())
    60             RELEASE_LOG("%p - ProcessThrottler::updateAssertionNow() updating process assertion state to %u (foregroundActivities: %lu, backgroundActivities: %lu)", this, assertionState(), m_foregroundCounter.value(), m_backgroundCounter.value());
     61            RELEASE_LOG(ProcessSuspension, "%p - ProcessThrottler::updateAssertionNow() updating process assertion state to %u (foregroundActivities: %lu, backgroundActivities: %lu)", this, assertionState(), m_foregroundCounter.value(), m_backgroundCounter.value());
    6162        m_assertion->setState(assertionState());
    6263        m_process.didSetAssertionState(assertionState());
     
    7172    if (m_assertion && m_assertion->state() != AssertionState::Suspended && !m_foregroundCounter.value() && !m_backgroundCounter.value()) {
    7273        ++m_suspendMessageCount;
    73         RELEASE_LOG("%p - ProcessThrottler::updateAssertion() sending PrepareToSuspend IPC", this);
     74        RELEASE_LOG(ProcessSuspension, "%p - ProcessThrottler::updateAssertion() sending PrepareToSuspend IPC", this);
    7475        m_process.sendPrepareToSuspend();
    7576        m_suspendTimer.startOneShot(processSuspensionTimeout);
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp

    r205137 r205275  
    180180#define MESSAGE_CHECK_URL(url) MESSAGE_CHECK_BASE(m_process->checkURLReceivedFromWebProcess(url), m_process->connection())
    181181
    182 #define RELEASE_LOG_IF_ALLOWED(...) RELEASE_LOG_IF(isAlwaysOnLoggingAllowed(), __VA_ARGS__)
     182#define RELEASE_LOG_IF_ALLOWED(...) RELEASE_LOG_IF(isAlwaysOnLoggingAllowed(), ProcessSuspension, __VA_ARGS__)
    183183
    184184using namespace WebCore;
  • trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp

    r205266 r205275  
    214214    addLanguageChangeObserver(this, languageChanged);
    215215
    216 #if !LOG_DISABLED
     216#if !LOG_DISABLED || !RELEASE_LOG_DISABLED
    217217    WebCore::initializeLogChannelsIfNecessary();
    218218    WebKit::initializeLogChannelsIfNecessary();
    219 #endif // !LOG_DISABLED
     219#endif // !LOG_DISABLED || !RELEASE_LOG_DISABLED
    220220
    221221#ifndef NDEBUG
  • trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp

    r205213 r205275  
    3333#include "DataReference.h"
    3434#include "DownloadProxyMap.h"
     35#include "Logging.h"
    3536#include "PluginInfoStore.h"
    3637#include "PluginProcessManager.h"
     
    710711
    711712    auto token = throttler().backgroundActivityToken();
    712     RELEASE_LOG_IF(sessionID.isAlwaysOnLoggingAllowed(), "%p - WebProcessProxy is taking a background assertion because the Web process is fetching Website data", this);
     713    RELEASE_LOG_IF(sessionID.isAlwaysOnLoggingAllowed(), ProcessSuspension, "%p - WebProcessProxy is taking a background assertion because the Web process is fetching Website data", this);
    713714
    714715    connection()->sendWithReply(Messages::WebProcess::FetchWebsiteData(sessionID, dataTypes), 0, RunLoop::main(), [this, token, completionHandler = WTFMove(completionHandler), sessionID](auto reply) {
     
    719720
    720721        completionHandler(WTFMove(std::get<0>(*reply)));
    721         RELEASE_LOG_IF(sessionID.isAlwaysOnLoggingAllowed(), "%p - WebProcessProxy is releasing a background assertion because the Web process is done fetching Website data", this);
     722        RELEASE_LOG_IF(sessionID.isAlwaysOnLoggingAllowed(), ProcessSuspension, "%p - WebProcessProxy is releasing a background assertion because the Web process is done fetching Website data", this);
    722723    });
    723724}
     
    728729
    729730    auto token = throttler().backgroundActivityToken();
    730     RELEASE_LOG_IF(sessionID.isAlwaysOnLoggingAllowed(), "%p - WebProcessProxy is taking a background assertion because the Web process is deleting Website data", this);
     731    RELEASE_LOG_IF(sessionID.isAlwaysOnLoggingAllowed(), ProcessSuspension, "%p - WebProcessProxy is taking a background assertion because the Web process is deleting Website data", this);
    731732
    732733    connection()->sendWithReply(Messages::WebProcess::DeleteWebsiteData(sessionID, dataTypes, modifiedSince), 0, RunLoop::main(), [this, token, completionHandler = WTFMove(completionHandler), sessionID](auto reply) {
    733734        completionHandler();
    734         RELEASE_LOG_IF(sessionID.isAlwaysOnLoggingAllowed(), "%p - WebProcessProxy is releasing a background assertion because the Web process is done deleting Website data", this);
     735        RELEASE_LOG_IF(sessionID.isAlwaysOnLoggingAllowed(), ProcessSuspension, "%p - WebProcessProxy is releasing a background assertion because the Web process is done deleting Website data", this);
    735736    });
    736737}
     
    741742
    742743    auto token = throttler().backgroundActivityToken();
    743     RELEASE_LOG_IF(sessionID.isAlwaysOnLoggingAllowed(), "%p - WebProcessProxy is taking a background assertion because the Web process is deleting Website data for several origins", this);
     744    RELEASE_LOG_IF(sessionID.isAlwaysOnLoggingAllowed(), ProcessSuspension, "%p - WebProcessProxy is taking a background assertion because the Web process is deleting Website data for several origins", this);
    744745
    745746    Vector<SecurityOriginData> originData;
     
    749750    connection()->sendWithReply(Messages::WebProcess::DeleteWebsiteDataForOrigins(sessionID, dataTypes, originData), 0, RunLoop::main(), [this, token, completionHandler = WTFMove(completionHandler), sessionID](auto reply) {
    750751        completionHandler();
    751         RELEASE_LOG_IF(sessionID.isAlwaysOnLoggingAllowed(), "%p - WebProcessProxy is releasing a background assertion because the Web process is done deleting Website data for several origins", this);
     752        RELEASE_LOG_IF(sessionID.isAlwaysOnLoggingAllowed(), ProcessSuspension, "%p - WebProcessProxy is releasing a background assertion because the Web process is done deleting Website data for several origins", this);
    752753    });
    753754}
     
    946947    switch (state) {
    947948    case AssertionState::Suspended:
    948         RELEASE_LOG("%p - WebProcessProxy::didSetAssertionState(Suspended) release all assertions for network process", this);
     949        RELEASE_LOG(ProcessSuspension, "%p - WebProcessProxy::didSetAssertionState(Suspended) release all assertions for network process", this);
    949950        m_foregroundTokenForNetworkProcess = nullptr;
    950951        m_backgroundTokenForNetworkProcess = nullptr;
     
    954955
    955956    case AssertionState::Background:
    956         RELEASE_LOG("%p - WebProcessProxy::didSetAssertionState(Background) taking background assertion for network process", this);
     957        RELEASE_LOG(ProcessSuspension, "%p - WebProcessProxy::didSetAssertionState(Background) taking background assertion for network process", this);
    957958        m_backgroundTokenForNetworkProcess = processPool().ensureNetworkProcess().throttler().backgroundActivityToken();
    958959        m_foregroundTokenForNetworkProcess = nullptr;
     
    960961   
    961962    case AssertionState::Foreground:
    962         RELEASE_LOG("%p - WebProcessProxy::didSetAssertionState(Foreground) taking foreground assertion for network process", this);
     963        RELEASE_LOG(ProcessSuspension, "%p - WebProcessProxy::didSetAssertionState(Foreground) taking foreground assertion for network process", this);
    963964        m_foregroundTokenForNetworkProcess = processPool().ensureNetworkProcess().throttler().foregroundActivityToken();
    964965        m_backgroundTokenForNetworkProcess = nullptr;
     
    977978{
    978979    if (!isHoldingLockedFiles) {
    979         RELEASE_LOG("UIProcess is releasing a background assertion because the WebContent process is no longer holding locked files");
     980        RELEASE_LOG(ProcessSuspension, "UIProcess is releasing a background assertion because the WebContent process is no longer holding locked files");
    980981        m_tokenForHoldingLockedFiles = nullptr;
    981982        return;
    982983    }
    983984    if (!m_tokenForHoldingLockedFiles) {
    984         RELEASE_LOG("UIProcess is taking a background assertion because the WebContent process is holding locked files");
     985        RELEASE_LOG(ProcessSuspension, "UIProcess is taking a background assertion because the WebContent process is holding locked files");
    985986        m_tokenForHoldingLockedFiles = m_throttler.backgroundActivityToken();
    986987    }
  • trunk/Source/WebKit2/UIProcess/ios/ProcessAssertionIOS.mm

    r204472 r205275  
    3030
    3131#import "AssertionServicesSPI.h"
     32#import "Logging.h"
    3233#import <UIKit/UIApplication.h>
    3334#import <wtf/HashSet.h>
     
    106107    if (_needsToRunInBackgroundCount && _backgroundTask == UIBackgroundTaskInvalid) {
    107108        _backgroundTask = [[UIApplication sharedApplication] beginBackgroundTaskWithName:@"com.apple.WebKit.ProcessAssertion" expirationHandler:^{
    108             RELEASE_LOG_ERROR("Background task expired while holding WebKit ProcessAssertion (isMainThread? %d).", RunLoop::isMain());
     109            RELEASE_LOG_ERROR(ProcessSuspension, "Background task expired while holding WebKit ProcessAssertion (isMainThread? %d).", RunLoop::isMain());
    109110            // The expiration handler gets called on a non-main thread when the underlying assertion could not be taken (rdar://problem/27278419).
    110111            if (RunLoop::isMain())
     
    166167    BKSProcessAssertionAcquisitionHandler handler = ^(BOOL acquired) {
    167168        if (!acquired) {
    168             RELEASE_LOG_ERROR("Unable to acquire assertion for process %d", pid);
     169            RELEASE_LOG_ERROR(ProcessSuspension, "Unable to acquire assertion for process %d", pid);
    169170            ASSERT_NOT_REACHED();
    170171            dispatch_async(dispatch_get_main_queue(), ^{
  • trunk/Source/WebKit2/WebProcess/Network/WebLoaderStrategy.cpp

    r205269 r205275  
    5858using namespace WebCore;
    5959
    60 #define RELEASE_LOG_IF_ALLOWED(...) RELEASE_LOG_IF(loadParameters.sessionID.isAlwaysOnLoggingAllowed(), __VA_ARGS__)
    61 #define RELEASE_LOG_ERROR_IF_ALLOWED(...) RELEASE_LOG_ERROR_IF(loadParameters.sessionID.isAlwaysOnLoggingAllowed(), __VA_ARGS__)
     60#define RELEASE_LOG_IF_ALLOWED(...) RELEASE_LOG_IF(loadParameters.sessionID.isAlwaysOnLoggingAllowed(), Network, __VA_ARGS__)
     61#define RELEASE_LOG_ERROR_IF_ALLOWED(...) RELEASE_LOG_ERROR_IF(loadParameters.sessionID.isAlwaysOnLoggingAllowed(), Network, __VA_ARGS__)
    6262
    6363namespace WebKit {
  • trunk/Source/WebKit2/WebProcess/Network/WebResourceLoader.cpp

    r204472 r205275  
    4343using namespace WebCore;
    4444
    45 #define RELEASE_LOG_IF_ALLOWED(...) RELEASE_LOG_IF(isAlwaysOnLoggingAllowed(), __VA_ARGS__)
     45#define RELEASE_LOG_IF_ALLOWED(...) RELEASE_LOG_IF(isAlwaysOnLoggingAllowed(), Network, __VA_ARGS__)
    4646
    4747namespace WebKit {
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r204996 r205275  
    256256static const std::chrono::seconds maximumLayerVolatilityTimerInterval { 2 };
    257257
    258 #define RELEASE_LOG_IF_ALLOWED(...) RELEASE_LOG_IF(isAlwaysOnLoggingAllowed(), __VA_ARGS__)
    259 #define RELEASE_LOG_ERROR_IF_ALLOWED(...) RELEASE_LOG_ERROR_IF(isAlwaysOnLoggingAllowed(), __VA_ARGS__)
     258#define RELEASE_LOG_IF_ALLOWED(...) RELEASE_LOG_IF(isAlwaysOnLoggingAllowed(), Layers, __VA_ARGS__)
     259#define RELEASE_LOG_ERROR_IF_ALLOWED(...) RELEASE_LOG_ERROR_IF(isAlwaysOnLoggingAllowed(), Layers, __VA_ARGS__)
    260260
    261261class SendStopResponsivenessTimer {
     
    20652065    if (didSucceed || newInterval > maximumLayerVolatilityTimerInterval) {
    20662066        m_layerVolatilityTimer.stop();
    2067         RELEASE_LOG_IF_ALLOWED("%p - WebPage - Attempted to mark surfaces as volatile, success? %d", this, didSucceed);
     2067        RELEASE_LOG_IF_ALLOWED("%p - WebPage - Attempted to mark layers as volatile, success? %d", this, didSucceed);
    20682068        callVolatilityCompletionHandlers();
    20692069        return;
  • trunk/Source/WebKit2/WebProcess/WebProcess.cpp

    r205266 r205275  
    12731273
    12741274    markAllLayersVolatile([this, shouldAcknowledgeWhenReadyToSuspend] {
    1275         RELEASE_LOG("%p - WebProcess::markAllLayersVolatile() Successfuly marked all layers as volatile", this);
     1275        RELEASE_LOG(ProcessSuspension, "%p - WebProcess::markAllLayersVolatile() Successfuly marked all layers as volatile", this);
    12761276
    12771277        if (shouldAcknowledgeWhenReadyToSuspend == ShouldAcknowledgeWhenReadyToSuspend::Yes) {
    1278             RELEASE_LOG("%p - WebProcess::actualPrepareToSuspend() Sending ProcessReadyToSuspend IPC message", this);
     1278            RELEASE_LOG(ProcessSuspension, "%p - WebProcess::actualPrepareToSuspend() Sending ProcessReadyToSuspend IPC message", this);
    12791279            parentProcessConnection()->send(Messages::WebProcessProxy::ProcessReadyToSuspend(), 0);
    12801280        }
     
    12921292    }
    12931293
    1294     RELEASE_LOG("%p - WebProcess::processWillSuspendImminently()", this);
     1294    RELEASE_LOG(ProcessSuspension, "%p - WebProcess::processWillSuspendImminently()", this);
    12951295    DatabaseTracker::tracker().closeAllDatabases(CurrentQueryBehavior::Interrupt);
    12961296    actualPrepareToSuspend(ShouldAcknowledgeWhenReadyToSuspend::No);
     
    13001300void WebProcess::prepareToSuspend()
    13011301{
    1302     RELEASE_LOG("%p - WebProcess::prepareToSuspend()", this);
     1302    RELEASE_LOG(ProcessSuspension, "%p - WebProcess::prepareToSuspend()", this);
    13031303    actualPrepareToSuspend(ShouldAcknowledgeWhenReadyToSuspend::Yes);
    13041304}
     
    13061306void WebProcess::cancelPrepareToSuspend()
    13071307{
    1308     RELEASE_LOG("%p - WebProcess::cancelPrepareToSuspend()", this);
     1308    RELEASE_LOG(ProcessSuspension, "%p - WebProcess::cancelPrepareToSuspend()", this);
    13091309    setAllLayerTreeStatesFrozen(false);
    13101310
     
    13161316    cancelMarkAllLayersVolatile();
    13171317
    1318     RELEASE_LOG("%p - WebProcess::cancelPrepareToSuspend() Sending DidCancelProcessSuspension IPC message", this);
     1318    RELEASE_LOG(ProcessSuspension, "%p - WebProcess::cancelPrepareToSuspend() Sending DidCancelProcessSuspension IPC message", this);
    13191319    parentProcessConnection()->send(Messages::WebProcessProxy::DidCancelProcessSuspension(), 0);
    13201320}
     
    13221322void WebProcess::markAllLayersVolatile(std::function<void()> completionHandler)
    13231323{
    1324     RELEASE_LOG("%p - WebProcess::markAllLayersVolatile()", this);
     1324    RELEASE_LOG(ProcessSuspension, "%p - WebProcess::markAllLayersVolatile()", this);
    13251325    m_pagesMarkingLayersAsVolatile = m_pageMap.size();
    13261326    if (!m_pagesMarkingLayersAsVolatile) {
     
    13551355void WebProcess::processDidResume()
    13561356{
    1357     RELEASE_LOG("%p - WebProcess::processDidResume()", this);
     1357    RELEASE_LOG(ProcessSuspension, "%p - WebProcess::processDidResume()", this);
    13581358
    13591359    cancelMarkAllLayersVolatile();
Note: See TracChangeset for help on using the changeset viewer.