Debug: Add Systrace Markers
Update ScopedPerfEventHelper class to add systrace markers by default.
This change unifies ANGLE EVENT* macro system so that at the base level
in LoggingAnnotator class, systrace markers will be added by default.
Modify the base DebugLogger to use char* by default and move any
conversions to wchar_t to the Windows specializations where wchar is
used. This limits type conversions to only where they're needed.
This change also includes some new TRACE_EVENT() calls in the VK
backend which will result in systrace markers for those calls on the
Android platform.
The new build flag "angle_enable_trace" is added to enable the tracing
calls.
Bug: angleproject:2528
Change-Id: Icefc197d4407e1cd31338710e37865abae6a0b15
Reviewed-on: https://chromium-review.googlesource.com/c/1042785
Commit-Queue: Tobin Ehlis <tobine@google.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
diff --git a/src/libANGLE/renderer/vulkan/ContextVk.cpp b/src/libANGLE/renderer/vulkan/ContextVk.cpp
index da3496b..c08a251 100644
--- a/src/libANGLE/renderer/vulkan/ContextVk.cpp
+++ b/src/libANGLE/renderer/vulkan/ContextVk.cpp
@@ -32,6 +32,8 @@
#include "libANGLE/renderer/vulkan/TransformFeedbackVk.h"
#include "libANGLE/renderer/vulkan/VertexArrayVk.h"
+#include "third_party/trace_event/trace_event.h"
+
namespace rx
{
@@ -122,6 +124,7 @@
mViewport{},
mScissor{}
{
+ TRACE_EVENT0("gpu.angle", "ContextVk::ContextVk");
memset(&mClearColorValue, 0, sizeof(mClearColorValue));
memset(&mClearDepthStencilValue, 0, sizeof(mClearDepthStencilValue));
@@ -189,6 +192,7 @@
angle::Result ContextVk::initialize()
{
+ TRACE_EVENT0("gpu.angle", "ContextVk::initialize");
// Note that this may reserve more sets than strictly necessary for a particular layout.
ANGLE_TRY(mDynamicDescriptorPools[kUniformsDescriptorSetIndex].init(
this, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, GetUniformBufferDescriptorCount()));
diff --git a/src/libANGLE/renderer/vulkan/RendererVk.cpp b/src/libANGLE/renderer/vulkan/RendererVk.cpp
index 6d85f90..f148613 100644
--- a/src/libANGLE/renderer/vulkan/RendererVk.cpp
+++ b/src/libANGLE/renderer/vulkan/RendererVk.cpp
@@ -1020,6 +1020,7 @@
const VkSubmitInfo &submitInfo,
vk::CommandBuffer &&commandBuffer)
{
+ TRACE_EVENT0("gpu.angle", "RendererVk::submitFrame");
VkFenceCreateInfo fenceInfo = {};
fenceInfo.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO;
fenceInfo.flags = 0;