Modified: trunk/Source/WTF/wtf/SystemTracing.h (286564 => 286565)
--- trunk/Source/WTF/wtf/SystemTracing.h 2021-12-06 21:06:11 UTC (rev 286564)
+++ trunk/Source/WTF/wtf/SystemTracing.h 2021-12-06 21:15:39 UTC (rev 286565)
@@ -196,6 +196,7 @@
WTF_EXPORT_PRIVATE os_log_t WTFSignpostLogHandle();
WTF_EXTERN_C_END
+// These macros only emit signposts on internal builds when WEBKIT_SIGNPOSTS_ENABLED is set.
#define WTFEmitSignpost(pointer, name, ...) \
WTFEmitSignpostWithFunction(os_signpost_event_emit, (pointer), name, ##__VA_ARGS__)
@@ -214,6 +215,21 @@
} \
} while (0)
+// These macros emit signposts on all builds.
+#define WTFEmitSignpostAlways(name, format, ...) \
+ do { os_signpost_event_emit(WTFSignpostLogHandle(), OS_SIGNPOST_ID_EXCLUSIVE, name, format, ##__VA_ARGS__); } } while (0)
+
+#define WTFBeginSignpostIntervalAlways(name, format, ...) \
+ do { os_signpost_interval_begin(WTFSignpostLogHandle(), OS_SIGNPOST_ID_EXCLUSIVE, name, format, ##__VA_ARGS__); } while (0)
+
+#define WTF_OS_SIGNPOST_ANIMATION_INTERVAL_TAG "isAnimation=YES"
+
+#define WTFBeginAnimationSignpostIntervalAlways(name, format, ...) \
+ do { os_signpost_interval_begin(WTFSignpostLogHandle(), OS_SIGNPOST_ID_EXCLUSIVE, name, format " " WTF_OS_SIGNPOST_ANIMATION_INTERVAL_TAG, ##__VA_ARGS__); } while (0)
+
+#define WTFEndSignpostIntervalAlways(name, format, ...) \
+ do { os_signpost_interval_end(WTFSignpostLogHandle(), OS_SIGNPOST_ID_EXCLUSIVE, name, format, ##__VA_ARGS__); } while (0)
+
#else
#define WTFEmitSignpost(pointer, name, ...) do { } while (0)
@@ -220,4 +236,9 @@
#define WTFBeginSignpost(pointer, name, ...) do { } while (0)
#define WTFEndSignpost(pointer, name, ...) do { } while (0)
+#define WTFEmitSignpostAlways(name, format, ...) do { } while (0)
+#define WTFBeginSignpostIntervalAlways(name, format, ...) do { } while (0)
+#define WTFBeginAnimationSignpostIntervalAlways(name, format, ...) do { } while (0)
+#define WTFEndSignpostIntervalAlways(name, format, ...) do { } while (0)
+
#endif
Modified: trunk/Source/WebCore/platform/mac/ScrollingEffectsController.mm (286564 => 286565)
--- trunk/Source/WebCore/platform/mac/ScrollingEffectsController.mm 2021-12-06 21:06:11 UTC (rev 286564)
+++ trunk/Source/WebCore/platform/mac/ScrollingEffectsController.mm 2021-12-06 21:15:39 UTC (rev 286565)
@@ -34,6 +34,7 @@
#import <pal/spi/mac/NSScrollViewSPI.h>
#import <sys/sysctl.h>
#import <sys/time.h>
+#import <wtf/SystemTracing.h>
#import <wtf/text/TextStream.h>
#if PLATFORM(MAC)
@@ -177,6 +178,10 @@
delta = deltaAlignedToDominantAxis(delta);
auto momentumPhase = wheelEvent.momentumPhase();
+
+ if (momentumPhase == PlatformWheelEventPhase::Began)
+ WTFBeginAnimationSignpostIntervalAlways("Momentum scroll", "");
+
if (!m_momentumScrollInProgress && (momentumPhase == PlatformWheelEventPhase::Began || momentumPhase == PlatformWheelEventPhase::Changed))
m_momentumScrollInProgress = true;
@@ -219,6 +224,7 @@
}
if (m_momentumScrollInProgress && momentumPhase == PlatformWheelEventPhase::Ended) {
+ WTFEndSignpostIntervalAlways("Momentum scroll", "");
m_momentumScrollInProgress = false;
m_ignoreMomentumScrolls = false;
m_lastMomentumScrollTimestamp = { };