docs: fix debug module documentation discrepancies
- Changed include path in debug.md from Logger.h to Debug.h (umbrella header) - Added XE_ASSERT example in debug.md usage section - Added documentation for Profiler private types (ProfileNode, ProfileSample) - Added documentation for Profiler member variables (m_profileStack, m_samples, m_frameStartTime, m_initialized) - Verified MarkEvent, SetMarker, ExportChromeTracing are correctly marked as stubs
This commit is contained in:
@@ -59,7 +59,7 @@ Debug 模块提供了一套完整的调试工具,包括日志系统和性能
|
||||
## 使用示例
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Debug/Logger.h>
|
||||
#include <XCEngine/Debug/Debug.h>
|
||||
|
||||
// 初始化日志系统
|
||||
Logger::Get().Initialize();
|
||||
@@ -76,6 +76,9 @@ XE_LOG(LogCategory::Rendering, LogLevel::Info, "Render started");
|
||||
if (condition) {
|
||||
XE_LOG(LogCategory::General, LogLevel::Error, "Something went wrong");
|
||||
}
|
||||
|
||||
// 使用断言
|
||||
XE_ASSERT(ptr != nullptr, "Pointer must not be null");
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
@@ -78,6 +78,42 @@
|
||||
|
||||
自动使用当前函数名进行分析。
|
||||
|
||||
## 私有成员
|
||||
|
||||
### ProfileNode
|
||||
|
||||
```cpp
|
||||
struct ProfileNode {
|
||||
const char* name;
|
||||
uint64_t startTime;
|
||||
uint64_t endTime;
|
||||
uint32_t threadId;
|
||||
};
|
||||
```
|
||||
|
||||
内部使用的性能分析节点结构,用于在栈上跟踪嵌套的分析块。
|
||||
|
||||
### ProfileSample
|
||||
|
||||
```cpp
|
||||
struct ProfileSample {
|
||||
const char* name;
|
||||
uint64_t duration;
|
||||
uint32_t threadId;
|
||||
};
|
||||
```
|
||||
|
||||
记录单个性能样本的结构,包含名称、持续时间和线程 ID。
|
||||
|
||||
## 成员变量
|
||||
|
||||
| 成员 | 类型 | 描述 |
|
||||
|------|------|------|
|
||||
| `m_profileStack` | `std::vector<ProfileNode>` | 分析块栈,用于跟踪嵌套调用 |
|
||||
| `m_samples` | `std::vector<ProfileSample>` | 样本列表,记录完成的性能数据 |
|
||||
| `m_frameStartTime` | `uint64_t` | 当前帧开始时间戳(微秒) |
|
||||
| `m_initialized` | `bool` | 初始化标志 |
|
||||
|
||||
## 实现状态
|
||||
|
||||
以下方法目前为存根(stub)实现,尚未完成功能:
|
||||
|
||||
Reference in New Issue
Block a user