Bug 208975 - Add a very verbose logging mode for incremental PDF loading
Summary: Add a very verbose logging mode for incremental PDF loading
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brady Eidson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-03-11 22:07 PDT by Brady Eidson
Modified: 2020-03-13 09:58 PDT (History)
4 users (show)

See Also:


Attachments
Patch v1 (11.59 KB, patch)
2020-03-11 22:13 PDT, Brady Eidson
simon.fraser: review+
Details | Formatted Diff | Diff
PFL (11.95 KB, patch)
2020-03-11 22:56 PDT, Brady Eidson
no flags Details | Formatted Diff | Diff
PFL (13.15 KB, patch)
2020-03-12 09:39 PDT, Brady Eidson
no flags Details | Formatted Diff | Diff
PFL (13.47 KB, patch)
2020-03-12 20:56 PDT, Brady Eidson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brady Eidson 2020-03-11 22:07:10 PDT
Add a very verbose logging mode for incremental PDF loading

Helps to diagnose specific types of behavior we see from the data provider callbacks
Comment 1 Brady Eidson 2020-03-11 22:13:14 PDT
Created attachment 393340 [details]
Patch v1
Comment 2 Simon Fraser (smfr) 2020-03-11 22:21:05 PDT
Comment on attachment 393340 [details]
Patch v1

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

> Source/WebKit/Platform/Logging.h:60
> +    M(IncrementalPDFVerbose) \

Just call it IncrementalPDF?

> Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h:133
> +#ifndef NDEBUG

#if !LOG_DISABLED

> Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h:135
> +    size_t addDataCallbackThread() { return ++m_dataCallbackThreadCount; }

Is this adding a thread? Or just increasing the callback count? Should it be incrementPendingCallbackCount or something?

> Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h:385
> +#ifndef NDEBUG

#if !LOG_DISABLED

> Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm:636
> +#ifndef NDEBUG

#if !LOG_DISABLED

> Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm:646
> +    LOG(PDF, "%s", message.utf8().data());

LOG_WITH_STREAM(PDF, stream << message);

> Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm:648
> +    LOG(IncrementalPDFVerbose, "%s", message.utf8().data());

LOG_WITH_STREAM(IncrementalPDF, stream << message);

> Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm:690
> +    LOG(IncrementalPDFVerbose, "%s", stream.release().utf8().data());

LOG_WITH_STREAM all the pieces at once?

> Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm:698
> +#ifndef NDEBUG

#if !LOG_DISABLED

> Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm:699
> +    Ref<PDFPlugin> debugPluginRef = *((PDFPlugin*)info);

It's a bit nasty of logging changes behavior, like changing object lifetimes.

> Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm:719
> +#ifndef NDEBUG

#if !LOG_DISABLED everywhere.

> Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm:742
> +    debugPluginRef->pdfLog(stream.release());

LOG_WITH_STREAM directly?
Comment 3 Brady Eidson 2020-03-11 22:44:33 PDT
Making most of these changes.

Unfortunately with LOG_WITH_STREAM, you (I think?) have to use the TextStream that the macro creates for you, so complicated streams I build up beforehand are a nonstarter.
Comment 4 Brady Eidson 2020-03-11 22:48:30 PDT
(In reply to Brady Eidson from comment #3)
> Making most of these changes.
> 
> Unfortunately with LOG_WITH_STREAM, you (I think?) have to use the
> TextStream that the macro creates for you, so complicated streams I build up
> beforehand are a nonstarter.

(Note, the reason ::logPDF exists is to log the message to (2) different logging channels, so if somebody builds up a text stream to call into it, LOG_WITH_STREAM  won't work and stream.release() is necessary)
Comment 5 Brady Eidson 2020-03-11 22:56:36 PDT
Created attachment 393342 [details]
PFL
Comment 6 Brady Eidson 2020-03-12 09:39:36 PDT
Created attachment 393385 [details]
PFL
Comment 7 Brady Eidson 2020-03-12 20:56:02 PDT
Created attachment 393450 [details]
PFL
Comment 8 WebKit Commit Bot 2020-03-12 22:56:04 PDT
Comment on attachment 393450 [details]
PFL

Clearing flags on attachment: 393450

Committed r258384: <https://trac.webkit.org/changeset/258384>
Comment 9 WebKit Commit Bot 2020-03-12 22:56:05 PDT
All reviewed patches have been landed.  Closing bug.
Comment 10 Radar WebKit Bug Importer 2020-03-12 22:57:14 PDT
<rdar://problem/60405343>
Comment 11 Ryosuke Niwa 2020-03-13 02:48:02 PDT
Release build fixed in https://trac.webkit.org/changeset/258389.
Comment 12 Brady Eidson 2020-03-13 09:58:13 PDT
(In reply to Ryosuke Niwa from comment #11)
> Release build fixed in https://trac.webkit.org/changeset/258389.

Wonder why the EWS release builders didn't hit that
Comment 13 Brady Eidson 2020-03-13 09:58:38 PDT
(In reply to Brady Eidson from comment #12)
> (In reply to Ryosuke Niwa from comment #11)
> > Release build fixed in https://trac.webkit.org/changeset/258389.
> 
> Wonder why the EWS release builders didn't hit that

(And thanks for the fix!)