[chromium] Use new-style tracing macros with explicit category
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Aug 2012 02:29:39 +0000 (02:29 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Aug 2012 02:29:39 +0000 (02:29 +0000)
https://bugs.webkit.org/show_bug.cgi?id=92928

Patch by James Robinson <jamesr@chromium.org> on 2012-08-01
Reviewed by Adam Barth.

Source/WebCore:

The chromium tracing system supports using a string identifier for trace categories that can be used to filter
events. This switches over to setting an explicit category for all traces and removes the old-style
TRACE_EVENT() macro.

* bindings/v8/ScheduledAction.cpp:
(WebCore::ScheduledAction::execute):
* platform/ScrollAnimatorNone.cpp:
(WebCore::ScrollAnimatorNone::scroll):
(WebCore::ScrollAnimatorNone::animationTimerFired):
* platform/chromium/TraceEvent.h:
* platform/graphics/chromium/ProgramBinding.cpp:
(WebCore::ProgramBindingBase::init):
* platform/graphics/skia/ImageSkia.cpp:
(WebCore::drawResampledBitmap):
(WebCore::paintSkBitmap):
(WebCore::Image::drawPattern):
* platform/graphics/skia/NativeImageSkia.cpp:
(WebCore::NativeImageSkia::resizedBitmap):
* platform/graphics/skia/PlatformContextSkia.cpp:
(WebCore::PlatformContextSkia::bitmap):
* platform/image-decoders/bmp/BMPImageDecoder.cpp:
(WebCore::BMPImageDecoder::decode):
* platform/image-decoders/gif/GIFImageDecoder.cpp:
(WebCore::GIFImageDecoder::decode):
* platform/image-decoders/ico/ICOImageDecoder.cpp:
(WebCore::ICOImageDecoder::decode):
* platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
(WebCore::JPEGImageDecoder::decode):
* platform/image-decoders/png/PNGImageDecoder.cpp:
(WebCore::PNGImageDecoder::decode):
* platform/image-decoders/webp/WEBPImageDecoder.cpp:
(WebCore::WEBPImageDecoder::decode):

Source/WebKit/chromium:

Set the category explicitly in traces.

* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::updateAnimations):
(WebKit::WebViewImpl::layout):
(WebKit::WebViewImpl::setIsAcceleratedCompositingActive):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@124400 268f45cc-cd09-0410-ab3c-d52691b4dbfc

16 files changed:
Source/WebCore/ChangeLog
Source/WebCore/bindings/v8/ScheduledAction.cpp
Source/WebCore/platform/ScrollAnimatorNone.cpp
Source/WebCore/platform/chromium/TraceEvent.h
Source/WebCore/platform/graphics/chromium/ProgramBinding.cpp
Source/WebCore/platform/graphics/skia/ImageSkia.cpp
Source/WebCore/platform/graphics/skia/NativeImageSkia.cpp
Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
Source/WebCore/platform/image-decoders/bmp/BMPImageDecoder.cpp
Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp
Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp
Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp
Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/WebViewImpl.cpp

index 64e6a52..ba0f883 100644 (file)
@@ -1,3 +1,43 @@
+2012-08-01  James Robinson  <jamesr@chromium.org>
+
+        [chromium] Use new-style tracing macros with explicit category
+        https://bugs.webkit.org/show_bug.cgi?id=92928
+
+        Reviewed by Adam Barth.
+
+        The chromium tracing system supports using a string identifier for trace categories that can be used to filter
+        events. This switches over to setting an explicit category for all traces and removes the old-style
+        TRACE_EVENT() macro.
+
+        * bindings/v8/ScheduledAction.cpp:
+        (WebCore::ScheduledAction::execute):
+        * platform/ScrollAnimatorNone.cpp:
+        (WebCore::ScrollAnimatorNone::scroll):
+        (WebCore::ScrollAnimatorNone::animationTimerFired):
+        * platform/chromium/TraceEvent.h:
+        * platform/graphics/chromium/ProgramBinding.cpp:
+        (WebCore::ProgramBindingBase::init):
+        * platform/graphics/skia/ImageSkia.cpp:
+        (WebCore::drawResampledBitmap):
+        (WebCore::paintSkBitmap):
+        (WebCore::Image::drawPattern):
+        * platform/graphics/skia/NativeImageSkia.cpp:
+        (WebCore::NativeImageSkia::resizedBitmap):
+        * platform/graphics/skia/PlatformContextSkia.cpp:
+        (WebCore::PlatformContextSkia::bitmap):
+        * platform/image-decoders/bmp/BMPImageDecoder.cpp:
+        (WebCore::BMPImageDecoder::decode):
+        * platform/image-decoders/gif/GIFImageDecoder.cpp:
+        (WebCore::GIFImageDecoder::decode):
+        * platform/image-decoders/ico/ICOImageDecoder.cpp:
+        (WebCore::ICOImageDecoder::decode):
+        * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
+        (WebCore::JPEGImageDecoder::decode):
+        * platform/image-decoders/png/PNGImageDecoder.cpp:
+        (WebCore::PNGImageDecoder::decode):
+        * platform/image-decoders/webp/WEBPImageDecoder.cpp:
+        (WebCore::WEBPImageDecoder::decode):
+
 2012-08-01  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
 
         [EFL] Crash at WebCore::toRenderSlider
index c406047..f564576 100644 (file)
@@ -123,7 +123,7 @@ void ScheduledAction::execute(V8Proxy* proxy)
         return; // JS may not be enabled.
 
 #if PLATFORM(CHROMIUM)
-    TRACE_EVENT("ScheduledAction::execute", this, 0);
+    TRACE_EVENT0("v8", "ScheduledAction::execute");
 #endif
 
     v8::Context::Scope scope(v8Context);
index b804a92..45cc1e5 100644 (file)
@@ -417,7 +417,7 @@ bool ScrollAnimatorNone::scroll(ScrollbarOrientation orientation, ScrollGranular
         return ScrollAnimator::scroll(orientation, granularity, step, multiplier);
 
 #if PLATFORM(CHROMIUM)
-    TRACE_EVENT("ScrollAnimatorNone::scroll", this, 0);
+    TRACE_EVENT0("webkit", "ScrollAnimatorNone::scroll");
 #endif
 
     // FIXME: get the type passed in. MouseWheel could also be by line, but should still have different
@@ -532,7 +532,7 @@ void ScrollAnimatorNone::animationTimerFired(Timer<ScrollAnimatorNone>* timer)
 void ScrollAnimatorNone::animationTimerFired()
 {
 #if PLATFORM(CHROMIUM)
-    TRACE_EVENT("ScrollAnimatorNone::animationTimerFired", this, 0);
+    TRACE_EVENT0("webkit", "ScrollAnimatorNone::animationTimerFired");
 #endif
 
     double currentTime = WTF::monotonicallyIncreasingTime();
@@ -562,7 +562,7 @@ void ScrollAnimatorNone::animationTimerFired()
 #endif
 
 #if PLATFORM(CHROMIUM)
-    TRACE_EVENT("ScrollAnimatorNone::notifyPositionChanged", this, 0);
+    TRACE_EVENT0("webkit", "ScrollAnimatorNone::notifyPositionChanged");
 #endif
     notifyPositionChanged();
 
index f784a59..89ef85e 100644 (file)
 #include <wtf/DynamicAnnotations.h>
 #include <wtf/text/CString.h>
 
-// Issues begin trace event here and end trace event when the current scope ends.
-#define TRACE_EVENT(name, id, extra) TRACE_EVENT2("webkit", name, "id", id, "extra", extra)
-
 // By default, const char* argument values are assumed to have long-lived scope
 // and will not be copied. Use this macro to force a const char* to be copied.
 #define TRACE_STR_COPY(str) \
index 1abc218..2f6ca22 100644 (file)
@@ -65,7 +65,7 @@ static bool contextLost(WebGraphicsContext3D* context)
 
 void ProgramBindingBase::init(WebGraphicsContext3D* context, const String& vertexShader, const String& fragmentShader)
 {
-    TRACE_EVENT("ProgramBindingBase::init", this, 0);
+    TRACE_EVENT0("cc", "ProgramBindingBase::init");
     m_vertexShaderId = loadShader(context, GraphicsContext3D::VERTEX_SHADER, vertexShader);
     if (!m_vertexShaderId) {
         if (!contextLost(context))
index 461434a..a0af3d6 100644 (file)
@@ -178,7 +178,7 @@ static ResamplingMode limitResamplingMode(PlatformContextSkia* platformContext,
 static void drawResampledBitmap(SkCanvas& canvas, SkPaint& paint, const NativeImageSkia& bitmap, const SkIRect& srcIRect, const SkRect& destRect)
 {
 #if PLATFORM(CHROMIUM)
-    TRACE_EVENT("drawResampledBitmap", &canvas, 0);
+    TRACE_EVENT0("skia", "drawResampledBitmap");
 #endif
     // Apply forward transform to destRect to estimate required size of
     // re-sampled bitmap, and use only in calls required to resize, or that
@@ -227,7 +227,7 @@ static bool hasNon90rotation(PlatformContextSkia* context)
 static void paintSkBitmap(PlatformContextSkia* platformContext, const NativeImageSkia& bitmap, const SkIRect& srcRect, const SkRect& destRect, const SkXfermode::Mode& compOp)
 {
 #if PLATFORM(CHROMIUM)
-    TRACE_EVENT("paintSkBitmap", platformContext, 0);
+    TRACE_EVENT0("skia", "paintSkBitmap");
 #endif
     SkPaint paint;
     paint.setXfermodeMode(compOp);
@@ -313,7 +313,7 @@ void Image::drawPattern(GraphicsContext* context,
                         const FloatRect& destRect)
 {
 #if PLATFORM(CHROMIUM)
-    TRACE_EVENT("Image::drawPattern", this, 0);
+    TRACE_EVENT0("skia", "Image::drawPattern");
 #endif
     FloatRect normSrcRect = normalizeRect(floatSrcRect);
     if (destRect.isEmpty() || normSrcRect.isEmpty())
index 7cc23c4..7e34c07 100644 (file)
@@ -75,7 +75,7 @@ SkBitmap NativeImageSkia::resizedBitmap(const SkIRect& srcSubset,
                                         const SkIRect& destVisibleSubset) const
 {
 #if PLATFORM(CHROMIUM)
-    TRACE_EVENT("NativeImageSkia::resizedBitmap", const_cast<NativeImageSkia*>(this), 0);
+    TRACE_EVENT0("skia", "NativeImageSkia::resizedBitmap");
 #endif
     if (!hasResizedBitmap(srcSubset, destWidth, destHeight)) {
         bool shouldCache = isDataComplete()
@@ -85,7 +85,7 @@ SkBitmap NativeImageSkia::resizedBitmap(const SkIRect& srcSubset,
         m_image.extractSubset(&subset, srcSubset);
         if (!shouldCache) {
 #if PLATFORM(CHROMIUM)
-            TRACE_EVENT("nonCachedResize", const_cast<NativeImageSkia*>(this), 0);
+            TRACE_EVENT0("skia", "nonCachedResize");
 #endif
             // Just resize the visible subset and return it.
             SkBitmap resizedImage = skia::ImageOperations::Resize(subset, skia::ImageOperations::RESIZE_LANCZOS3, destWidth, destHeight, destVisibleSubset);
@@ -93,7 +93,7 @@ SkBitmap NativeImageSkia::resizedBitmap(const SkIRect& srcSubset,
             return resizedImage;
         } else {
 #if PLATFORM(CHROMIUM)
-            TRACE_EVENT("cachedResize", const_cast<NativeImageSkia*>(this), 0);
+            TRACE_EVENT0("skia", "cachedResize");
 #endif
             m_resizedImage = skia::ImageOperations::Resize(subset, skia::ImageOperations::RESIZE_LANCZOS3, destWidth, destHeight);
         }
index 50df711..394688f 100644 (file)
@@ -583,7 +583,7 @@ void PlatformContextSkia::paintSkPaint(const SkRect& rect,
 const SkBitmap* PlatformContextSkia::bitmap() const
 {
 #if PLATFORM(CHROMIUM)
-    TRACE_EVENT("PlatformContextSkia::bitmap", this, 0);
+    TRACE_EVENT0("skia", "PlatformContextSkia::bitmap");
 #endif
     return &m_canvas->getDevice()->accessBitmap(false);
 }
index 20a248c..43ef518 100644 (file)
@@ -95,7 +95,7 @@ bool BMPImageDecoder::setFailed()
 void BMPImageDecoder::decode(bool onlySize)
 {
 #if PLATFORM(CHROMIUM)
-    TRACE_EVENT("BMPImageDecoder::decode", this, 0);
+    TRACE_EVENT0("webkit", "BMPImageDecoder::decode");
 #endif
     if (failed())
         return;
index 5f6193b..724ea0d 100644 (file)
@@ -315,7 +315,7 @@ void GIFImageDecoder::gifComplete()
 void GIFImageDecoder::decode(unsigned haltAtFrame, GIFQuery query)
 {
 #if PLATFORM(CHROMIUM)
-    TRACE_EVENT("GIFImageDecoder::decode", this, 0);
+    TRACE_EVENT0("webkit", "GIFImageDecoder::decode");
 #endif
     if (failed())
         return;
index 3a03e54..36dde1c 100644 (file)
@@ -158,7 +158,7 @@ void ICOImageDecoder::setDataForPNGDecoderAtIndex(size_t index)
 void ICOImageDecoder::decode(size_t index, bool onlySize)
 {
 #if PLATFORM(CHROMIUM)
-    TRACE_EVENT("ICOImageDecoder::decode", this, 0);
+    TRACE_EVENT0("webkit", "ICOImageDecoder::decode");
 #endif
     if (failed())
         return;
index 91f1236..bef4203 100644 (file)
@@ -648,7 +648,7 @@ void JPEGImageDecoder::jpegComplete()
 void JPEGImageDecoder::decode(bool onlySize)
 {
 #if PLATFORM(CHROMIUM)
-    TRACE_EVENT("JPEGImageDecoder::decode", this, 0);
+    TRACE_EVENT0("webkit", "JPEGImageDecoder::decode");
 #endif
     if (failed())
         return;
index 138d5c5..158debb 100644 (file)
@@ -531,7 +531,7 @@ void PNGImageDecoder::pngComplete()
 void PNGImageDecoder::decode(bool onlySize)
 {
 #if PLATFORM(CHROMIUM)
-    TRACE_EVENT("PNGImageDecoder::decode", this, 0);
+    TRACE_EVENT0("webkit", "PNGImageDecoder::decode");
 #endif
     if (failed())
         return;
index 082e33d..612890f 100644 (file)
@@ -88,7 +88,7 @@ ImageFrame* WEBPImageDecoder::frameBufferAtIndex(size_t index)
 bool WEBPImageDecoder::decode(bool onlySize)
 {
 #if PLATFORM(CHROMIUM)
-    TRACE_EVENT("WEBPImageDecoder::decode", this, 0);
+    TRACE_EVENT0("webkit", "WEBPImageDecoder::decode");
 #endif
     if (failed())
         return false;
index 684306c..4d5e1df 100644 (file)
@@ -1,5 +1,19 @@
 2012-08-01  James Robinson  <jamesr@chromium.org>
 
+        [chromium] Use new-style tracing macros with explicit category
+        https://bugs.webkit.org/show_bug.cgi?id=92928
+
+        Reviewed by Adam Barth.
+
+        Set the category explicitly in traces.
+
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::updateAnimations):
+        (WebKit::WebViewImpl::layout):
+        (WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
+
+2012-08-01  James Robinson  <jamesr@chromium.org>
+
         [chromium] Move compositor HUD font atlas initialization code out of compositor core
         https://bugs.webkit.org/show_bug.cgi?id=92924
 
index 2fa8dd2..5343200 100644 (file)
@@ -1633,7 +1633,7 @@ void WebViewImpl::didBeginFrame()
 void WebViewImpl::updateAnimations(double monotonicFrameBeginTime)
 {
 #if ENABLE(REQUEST_ANIMATION_FRAME)
-    TRACE_EVENT("WebViewImpl::updateAnimations", this, 0);
+    TRACE_EVENT0("webkit", "WebViewImpl::updateAnimations");
 
     WebFrameImpl* webframe = mainFrameImpl();
     if (!webframe)
@@ -1656,7 +1656,7 @@ void WebViewImpl::updateAnimations(double monotonicFrameBeginTime)
 
 void WebViewImpl::layout()
 {
-    TRACE_EVENT("WebViewImpl::layout", this, 0);
+    TRACE_EVENT0("webkit", "WebViewImpl::layout");
     PageWidgetDelegate::layout(m_page.get());
 }
 
@@ -3631,7 +3631,7 @@ void WebViewImpl::setIsAcceleratedCompositingActive(bool active)
 
         m_client->didActivateCompositor(m_layerTreeView.compositorIdentifier());
     } else {
-        TRACE_EVENT("WebViewImpl::setIsAcceleratedCompositingActive(true)", this, 0);
+        TRACE_EVENT0("webkit", "WebViewImpl::setIsAcceleratedCompositingActive(true)");
 
         WebLayerTreeView::Settings layerTreeViewSettings;
         layerTreeViewSettings.acceleratePainting = page()->settings()->acceleratedDrawingEnabled();