RESOLVED FIXED 74547
[Chromium] Add trace events for decoding and drawing images.
https://bugs.webkit.org/show_bug.cgi?id=74547
Summary [Chromium] Add trace events for decoding and drawing images.
Daniel Sievers
Reported 2011-12-14 15:17:12 PST
[Chromium] Add trace events for decoding and drawing images.
Attachments
Patch (9.74 KB, patch)
2011-12-14 15:24 PST, Daniel Sievers
no flags
Patch (9.97 KB, patch)
2011-12-15 11:47 PST, Daniel Sievers
no flags
Patch (10.36 KB, patch)
2011-12-15 14:17 PST, Daniel Sievers
no flags
Patch (10.65 KB, patch)
2011-12-15 17:20 PST, Daniel Sievers
no flags
Daniel Sievers
Comment 1 2011-12-14 15:24:14 PST
Nat Duca
Comment 2 2011-12-14 15:44:14 PST
Comment on attachment 119308 [details] Patch Neato.
John Bates
Comment 3 2011-12-14 18:04:30 PST
Comment on attachment 119308 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=119308&action=review > Source/WebCore/platform/graphics/skia/NativeImageSkia.cpp:81 > + TRACE_EVENT("NativeImageSkia::resizedBitmap", const_cast<NativeImageSkia*>(this), "noncached"); May want to avoid using the extra string parameter -- it causes a strdup even when tracing is disabled. Hmm or you could remove the strdup from TraceEvent.h and always pass 0 to traceEventEnd. Isn't that redundant info anyway?
Nat Duca
Comment 4 2011-12-15 09:50:10 PST
(In reply to comment #3) > May want to avoid using the extra string parameter -- it causes a strdup even when tracing is disabled. Oh good god, how the @%&()* did that get in there? Daniel, while you're in this code, can you please make the strdup in TraceEvent.h conditional on PlatformSupport::isTraceEventEnabled, at least?
Daniel Sievers
Comment 5 2011-12-15 11:47:48 PST
Daniel Sievers
Comment 6 2011-12-15 11:49:28 PST
https://bugs.webkit.org/show_bug.cgi?id=74637 for strdup(). I realized it might add value to have different trace events for the three paths we can hit in resizedBitmap(). That way you can simply select a region and see how often we hit the cache and such.
John Bates
Comment 7 2011-12-15 13:11:07 PST
Comment on attachment 119476 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=119476&action=review > Source/WebCore/platform/graphics/skia/NativeImageSkia.cpp:86 > + TRACE_EVENT("NativeImageSkia::resizedBitmap_cachedResize", const_cast<NativeImageSkia*>(this), 0); Better to use {} around this macro -- if I get around to improving it, this code would break. > Source/WebCore/platform/graphics/skia/NativeImageSkia.cpp:90 > + TRACE_EVENT("NativeImageSkia::resizedBitmap_cacheHit", const_cast<NativeImageSkia*>(this), 0); Same here
Nat Duca
Comment 8 2011-12-15 13:12:52 PST
(In reply to comment #7) > (From update of attachment 119476 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=119476&action=review > > > Source/WebCore/platform/graphics/skia/NativeImageSkia.cpp:86 > > + TRACE_EVENT("NativeImageSkia::resizedBitmap_cachedResize", const_cast<NativeImageSkia*>(this), 0); > > Better to use {} around this macro -- if I get around to improving it, this code would break. Woah, no! That's terrible! That'd break the timing measurement its' trying to do?
John Bates
Comment 9 2011-12-15 13:31:03 PST
Comment on attachment 119476 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=119476&action=review >>> Source/WebCore/platform/graphics/skia/NativeImageSkia.cpp:86 >>> + TRACE_EVENT("NativeImageSkia::resizedBitmap_cachedResize", const_cast<NativeImageSkia*>(this), 0); >> >> Better to use {} around this macro -- if I get around to improving it, this code would break. > > Woah, no! That's terrible! That'd break the timing measurement its' trying to do? (discussed offline -- it was a misunderstanding) You may want to change this back to your old impl with the string arg now that you're fixing the strdup. Otherwise these trace events don't catch this whole scope (if that matters).
Daniel Sievers
Comment 10 2011-12-15 14:17:03 PST
Daniel Sievers
Comment 11 2011-12-15 14:19:04 PST
I think I'd like to keep the separate trace events, just because it's cool to be able to drag a rectangle in the trace viewer and see the occurrence count for both (cached, noncached) separately. How about this new variant? > > You may want to change this back to your old impl with the string arg now that you're fixing the strdup. Otherwise these trace events don't catch this whole scope (if that matters).
John Bates
Comment 12 2011-12-15 14:34:33 PST
Comment on attachment 119502 [details] Patch lgtm
James Robinson
Comment 13 2011-12-15 16:46:14 PST
Comment on attachment 119502 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=119502&action=review > Source/WebCore/platform/graphics/skia/ImageSkia.cpp:49 > +#include "TraceEvent.h" skia does not necessarily imply chromium, so you need the same #if PLATFORM() guards here as elsewhere. sorry i didn't catch this the first time
Daniel Sievers
Comment 14 2011-12-15 17:20:50 PST
James Robinson
Comment 15 2011-12-15 23:28:47 PST
Comment on attachment 119528 [details] Patch Awesome.
WebKit Review Bot
Comment 16 2011-12-16 00:35:22 PST
Comment on attachment 119528 [details] Patch Clearing flags on attachment: 119528 Committed r103041: <http://trac.webkit.org/changeset/103041>
WebKit Review Bot
Comment 17 2011-12-16 00:35:28 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.