Files
XCSDD/docs/api/debug/profiler/exportchrometracing.md
ssdfasd 58a83f445a fix: improve doc link navigation and tree display
- Fix link resolution with proper relative/absolute path handling
- Improve link styling with underline decoration
- Hide leaf nodes from tree, only show directories
- Fix log file path for packaged app
2026-03-19 12:44:08 +08:00

1.1 KiB
Raw Blame History

Profiler::ExportChromeTracing

void ExportChromeTracing(const Containers::String& filePath)

状态: 此方法目前为空实现,暂未功能。

将收集的性能数据导出为 Chrome Tracing JSON 格式。导出的文件可通过 Chrome 浏览器打开(地址栏输入 chrome://tracing 并加载文件)进行可视化分析。

参数:

  • filePath - 输出文件路径

复杂度: O(n)n 为记录的样本数量

示例:

#include <XCEngine/Debug/Profiler.h>

XCEngine::Debug::Profiler::Get().Initialize();

void RenderFrame() {
    XCEngine::Debug::Profiler::Get().BeginFrame();
    XE_PROFILE_FUNCTION();
    
    XE_PROFILE_BEGIN("UpdateScene");
    UpdateScene();
    XE_PROFILE_END();
    
    XE_PROFILE_BEGIN("DrawScene");
    DrawScene();
    XE_PROFILE_END();
    
    XCEngine::Debug::Profiler::Get().EndFrame();
}

// 运行一段时间后导出
XCEngine::Debug::Profiler::Get().ExportChromeTracing("trace.json");
XCEngine::Debug::Profiler::Get().Shutdown();

相关文档