venus: fix tracing init to include instance creation
authorYiwei Zhang <zzyiwei@chromium.org>
Sun, 5 Feb 2023 03:36:53 +0000 (19:36 -0800)
committerMarge Bot <emma+marge@anholt.net>
Wed, 8 Feb 2023 05:34:13 +0000 (05:34 +0000)
The issue was hidden so far because:
- wsi_device_init does the perfetto tracing init
- Android atrace does lazy tracing init

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21153>

src/virtio/vulkan/vn_common.c
src/virtio/vulkan/vn_instance.c

index bcc0d8e..74ce9dc 100644 (file)
@@ -87,6 +87,8 @@ vn_trace_init(void)
 {
 #ifdef ANDROID
    atrace_init();
+#else
+   util_perfetto_init();
 #endif
 }
 
index ea8715c..90ea399 100644 (file)
@@ -701,14 +701,15 @@ vn_CreateInstance(const VkInstanceCreateInfo *pCreateInfo,
                   const VkAllocationCallbacks *pAllocator,
                   VkInstance *pInstance)
 {
+   vn_trace_init();
    VN_TRACE_FUNC();
+
    const VkAllocationCallbacks *alloc =
       pAllocator ? pAllocator : vk_default_allocator();
    struct vn_instance *instance;
    VkResult result;
 
    vn_env_init();
-   vn_trace_init();
 
    instance = vk_zalloc(alloc, sizeof(*instance), VN_DEFAULT_ALIGN,
                         VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);