Bug 205691 - Reformat WebProcess logging
Summary: Reformat WebProcess logging
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Keith Rollin
Keywords: InRadar
Depends on:
Reported: 2020-01-02 13:54 PST by Keith Rollin
Modified: 2020-01-02 19:52 PST (History)
4 users (show)

See Also:

Patch (18.53 KB, patch)
2020-01-02 13:57 PST, Keith Rollin
no flags Details | Formatted Diff | Diff
Patch (19.57 KB, patch)
2020-01-02 15:22 PST, Keith Rollin
no flags Details | Formatted Diff | Diff
Patch (19.62 KB, patch)
2020-01-02 15:43 PST, Keith Rollin
no flags Details | Formatted Diff | Diff
Patch (14.73 KB, patch)
2020-01-02 16:52 PST, Keith Rollin
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Keith Rollin 2020-01-02 13:54:14 PST
Update the format used by WebProcess in its RELEASE_LOG logging. Use the format used by WebPageProxy and NetworkResourceLoader, which is generally of the form:

    <object-address> - [<values that help thread together operations>] <class>::<method>: <message and other useful values>

So, for example:

    0x6f1df7000 - WebProcess::destroyRenderingResources() took 0.02ms


    0x6f1df7000 - WebProcess::destroyRenderingResources: took 0.02ms

So there's not actually much difference in that example line. That's because the only "values that help thread together operations" is the WebProcess PID, which is automatically logged by the os_log system. But other logging lines show more significant changes. For example, there are some logging lines that didn't used to log the method name.
Comment 1 Radar WebKit Bug Importer 2020-01-02 13:54:27 PST
Comment 2 Keith Rollin 2020-01-02 13:57:35 PST
Created attachment 386627 [details]
Comment 3 Keith Rollin 2020-01-02 15:10:57 PST
Based on comments from Chris, I'm incorporating the following changes:

* Rather than having a separate macro for each channel to which we're logging, have a single macro that takes a channel as a parameter.

* Log the sessionID as part of the "values that help thread together operations".

* Hide the logging in private sessions.
Comment 4 Keith Rollin 2020-01-02 15:22:44 PST
Created attachment 386637 [details]
Comment 5 Chris Dumez 2020-01-02 15:28:27 PST
Comment on attachment 386637 [details]

View in context: https://bugs.webkit.org/attachment.cgi?id=386637&action=review

> Source/WebKit/WebProcess/WebProcess.cpp:171
> +#define RELEASE_LOG_SESSION_ID (m_sessionID.hasValue() ? m_sessionID->toUInt64() : 0)


> Source/WebKit/WebProcess/WebProcess.h:489
> +    bool isAlwaysOnLoggingAllowed() { return m_sessionID.hasValue() ? m_sessionID->isAlwaysOnLoggingAllowed() : true; }

m_sessionID ? m_sessionID->isAlwaysOnLoggingAllowed() : true;

> Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:129
> +#define RELEASE_LOG_SESSION_ID (m_sessionID.hasValue() ? m_sessionID->toUInt64() : 0)

Comment 6 Keith Rollin 2020-01-02 15:41:55 PST
I chatted with Chris, and we realized that the ValueOr approach wouldn't work (since we need to also call toUInt64(), and we can't apply that to "0"). So we'll change those lines, but only to remove ".hasValue()".
Comment 7 Keith Rollin 2020-01-02 15:43:11 PST
Created attachment 386638 [details]
Comment 8 Keith Rollin 2020-01-02 15:44:31 PST
Looks like I need to rebase.
Comment 9 Keith Rollin 2020-01-02 16:52:13 PST
Created attachment 386648 [details]
Comment 10 WebKit Commit Bot 2020-01-02 19:52:21 PST
Comment on attachment 386648 [details]

Clearing flags on attachment: 386648

Committed r253990: <https://trac.webkit.org/changeset/253990>
Comment 11 WebKit Commit Bot 2020-01-02 19:52:23 PST
All reviewed patches have been landed.  Closing bug.