Add perfetto tracing to host renderer

... to aid debugging.

Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
This commit is contained in:
Jason Macnak
2024-08-28 19:20:05 +00:00
committed by Marge Bot
parent 8e02355e55
commit ea2035e898
3 changed files with 3 additions and 5 deletions

View File

@@ -932,14 +932,13 @@ size_t VkDecoder::Impl::decode(void* buf, size_t len, IOStream* ioStream,
cgen.line("case OP_%s:" % name)
cgen.beginBlock()
cgen.stmt("android::base::beginTrace(\"%s decode\")" % name)
cgen.stmt("GFXSTREAM_TRACE_EVENT(GFXSTREAM_TRACE_DECODER_CATEGORY, \"VkDecoder %s\")" % name)
if api.name in custom_decodes.keys():
custom_decodes[api.name](typeInfo, api, cgen)
else:
emit_default_decoding(typeInfo, api, cgen)
cgen.stmt("android::base::endTrace()")
cgen.stmt("break")
cgen.endBlock()
self.module.appendImpl(self.cgen.swapCode())

View File

@@ -378,14 +378,13 @@ class VulkanSubDecoder(VulkanWrapperGenerator):
cgen.line("case OP_%s:" % name)
cgen.beginBlock()
cgen.stmt("android::base::beginTrace(\"%s subdecode\")" % name)
cgen.stmt("GFXSTREAM_TRACE_EVENT(GFXSTREAM_TRACE_DECODER_CATEGORY, \"VkSubDecoder %s\")" % name)
if api.name in custom_decodes.keys():
custom_decodes[api.name](typeInfo, api, cgen)
else:
emit_default_decoding(typeInfo, api, cgen)
cgen.stmt("android::base::endTrace()")
cgen.stmt("break")
cgen.endBlock()
self.module.appendImpl(self.cgen.swapCode())

View File

@@ -530,10 +530,10 @@ class BumpPool;
#include "{self.baseLibDirPrefix}/BumpPool.h"
#include "{self.baseLibDirPrefix}/system/System.h"
#include "{self.baseLibDirPrefix}/Tracing.h"
#include "{self.baseLibDirPrefix}/Metrics.h"
#include "render-utils/IOStream.h"
#include "FrameBuffer.h"
#include "gfxstream/host/Tracing.h"
#include "host-common/feature_control.h"
#include "host-common/GfxstreamFatalError.h"
#include "host-common/logging.h"