Pull Request已成功合入, 合并人@CANN-robot
(感谢 komorebi 的贡献)变更摘要
本次 PR 属于 Profiling 模块错误信息易用性整改的第五阶段,主要围绕三个方面:修复 error_code.json 中的拼写错误;调整 EK0201 错误消息格式,将内存大小参数前置以提升可读性;以及修正 prof_ge_core.cpp 和 msprofiler_acl_api.cpp 中错误上报接口的调用方式,统一使用 MSPROF_INPUT_ERROR 并补充更完整的错误参数信息。
主要改动
-
error_code.json拼写修正: 将"Do not enable two or more profile data colection modes."中的colection修正为collection,并将"Stop unnecessary theads..."中的theads修正为threads。 -
EK0201错误消息格式调整: 将"Failed to allocate host memory for Profiling: %s."改为"Failed to allocate %s host memory for Profiling.",使内存大小(buf_size)参数前置,格式更符合统一的错误消息规范。 -
prof_ge_core.cpp中aclgrphProfDestroyConfig错误上报规范化: 将MSPROF_INPUT_ERROR的调用参数从简单的{"config"}/{"profilerConfig"}扩展为三字段结构{"value", "config", "reason"}/{"nullptr", "profilerConfig", "profilerConfig cannot be nullptr"},补充了实际值、参数名和原因说明。 -
msprofiler_acl_api.cpp中ProfGetModelId错误上报方式修正: 将原来使用内部错误码EK9999的MSPROF_INNER_ERROR调用改为使用EK0001的MSPROF_INPUT_ERROR,并按照三字段结构传入index值、参数名"index"和失败原因"failed to get model id",使错误分类更准确。


代码审查
审查总结
对全部 3 个变更文件逐一审查完毕:
src/dfx/error_manager/error_code.json— 3 处修正(2 处拼写修正 + 1 处 EK0201 消息模板格式调整),均为正确修改,未发现问题。src/dfx/msprof/collector/dvvp/msprofiler/prof_ge_core.cpp— 修复 EK0003 调用参数数量从 1 个补齐到 3 个,与模板占位符匹配,且 key 名与 JSON Arglist 一致,通过 key-based 查找机制正确替换。未发现功能性问题。src/dfx/msprof/collector/dvvp/profimpl/adapter/src/msprofiler_acl_api.cpp— 修复 EK9999(内部码)误用为 EK0001(外部 Invalid_Argument 码),参数数量与模板匹配正确。发现 1 个轻微问题:新旧消息相比丢失了订阅类型 (type) 诊断信息。
按严重度统计:
- P0: 0
- P1: 0
- P2: 0
- P3: 1(诊断信息丢失,可选改进)
整体风险评估:低风险。 所有变更均正确完成了其目标——修复 error_code.json 拼写、补齐 EK0003 参数、将 EK9999 替换为正确的 EK0001。唯一的 P3 项是面向用户错误消息中丢失了 type 上下文,不影响功能正确性,属于可选优化。
⚠️ 已识别出整体风险,但无法提取行内评论,请参考整体评估。


Thanks for your pull-request.
The full list of commands accepted by me can be found at here。
You can get sig-info at here
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| ** | ✅ 侯延保, gcw_kUomxQ2l (2/2) | ✅ gcw_kUomxQ2l (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
chenminghao11, thanks for your pull request. All authors of the commits have signed the CLA. 👍


流水线任务触发成功
任务链接 [6717bfab89e042799f1e57c6ba585fd6][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| Compile_Ascend_X86 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM | ✅ SUCCESS | >>>>> | >>>>> |
| pre_comment | ✅ SUCCESS | >>>>> | |
| UT_Test_acl | ✅ SUCCESS | >>>>> | |
| UT_Test_rts_v201 | ✅ SUCCESS | >>>>> | |
| UT_Test_rts_c | ✅ SUCCESS | >>>>> | |
| UT_Test_rts_david | ✅ SUCCESS | >>>>> | |
| UT_Test_rts_910b | ✅ SUCCESS | >>>>> | |
| UT_Test_rts_common | ✅ SUCCESS | >>>>> | |
| UT_Test_platform | ✅ SUCCESS | >>>>> | |
| UT_Test_qs | ✅ SUCCESS | >>>>> | |
| UT_Test_aicpusd | ✅ SUCCESS | >>>>> | |
| UT_Test_tsd | ✅ SUCCESS | >>>>> | |
| UT_Test_error_manager | ✅ SUCCESS | >>>>> | |
| UT_Test_slog | ✅ SUCCESS | >>>>> | |
| UT_Test_atrace | ✅ SUCCESS | >>>>> | |
| UT_Test_adump | ✅ SUCCESS | >>>>> | |
| UT_Test_mmpa | ✅ SUCCESS | >>>>> | |
| PreSmoke_A900_npupool | ✅ SUCCESS | >>>>> | |
| UT_Test_msprof | ✅ SUCCESS | >>>>> | |
| UT_Test_rts_report | ✅ SUCCESS | >>>>> | |
| UT_Test_msprof_report | ✅ SUCCESS |
[2026-07-24 15:18:55] CI执行结束


流水线任务触发成功
任务链接 [625aa51a2cf24ce89783533fa9bc3f6c][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| codecheck | ✅ SUCCESS | >>>>> | |
| SCA | ✅ SUCCESS | >>>>> | |
| antipoison | ✅ SUCCESS | >>>>> | |
| codecheck_Check_Pr | ✅ SUCCESS | ||
| codecheck_style | ✅ SUCCESS | >>>>> | |
| codecheck_precommit | ⚠️ WARNING | >>>>> | >>>>> |
| StaticCheck_codespell_check | ✅ SUCCESS | ||
| StaticCheck_link_validity_check | ✅ SUCCESS | ||
| StaticCheck_resource_existence_check | ✅ SUCCESS | ||
| StaticCheck_tag_closed_check | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS |
[2026-07-24 15:14:37] CI执行结束


/approve


/lgtm


The following users do not have permission to comment /lgtm or /approve on any module in this PR:
newstarzj


The following users do not have permission to comment /lgtm or /approve on any module in this PR:
newstarzj


Pull Request
描述
请清晰准确地描述本次 Pull Request 的意图和变更内容。
Err Msg易用性整改phase5
1:修复error_code.json拼写问题
2:统一error_code EK0201的描述,将内存和单位前置。
3:修复https://gitcode.com/cann/runtime/issues/705
变更类型
请选择本次引入的变更类型:
关联的Issue
https://gitcode.com/cann/runtime/issues/705
如何测试
描述测试此变更的步骤和前提条件:
1.本地测试
核对清单
其他信息
在此添加任何其他关于本次 PR 的说明。