Pull Request已成功合入, 合并人@ascend-robot
(感谢 wangzixuan 的贡献)变更摘要
此 PR 在 ExportManager::CheckProfDirsValid() 函数中增加了一条面向用户的错误提示输出。当检测到 profPath_ 路径不包含 "PROF" 子串时,除了原有的 ERROR 日志记录外,新增了 PRINT_ERROR 宏调用,向终端输出更明确的说明信息,提示用户该路径下未找到以 "PROF" 开头的文件名并建议核对文件正确性。
主要改动
- 新增用户可见的错误提示输出:在
analysis/csrc/application/export_manager.cpp的CheckProfDirsValid()中,当路径校验失败时,新增PRINT_ERROR("No file names starting with 'PROF' were found under this path: %. Please verify the file correctness.", profPath_)调用,与已有的ERROR日志互补,使终端用户能直接看到路径不符合要求的说明。


代码审查
经过全面分析,这个变更只是在 CheckProfDirsValid() 中新增了一条 PRINT_ERROR 调用,用于在路径校验失败时向用户输出更友好的错误提示。
审查要点检查结果:
-
逻辑正确性:新增的
PRINT_ERROR调用在return false之前执行,与同文件Init()函数(第125-129行)和CreateOutputPath()函数(第44-45行)中ERROR+PRINT_ERROR成对出现的模式完全一致。不改变控制流,不引入逻辑错误。 -
格式化字符串:项目使用自定义
Format函数(log.h第86-108行),以单个%作为占位符。新增消息中的%.格式与Init()中第125行的%.用法一致,%被替换为profPath_后,.作为普通字符保留输出,格式化行为正确。 -
安全性:无敏感信息泄露、无路径遍历、无注入风险。
-
性能:仅在错误路径上添加一条日志输出,无性能影响。
审查总结
本次变更共审查 1 个文件:
analysis/csrc/application/export_manager.cpp— 无问题
各优先级问题数量:
- P0: 0
- P1: 0
- P2: 0
- P3: 0
整体风险评估:低风险。 变更为在路径校验失败时增加一条用户友好的屏幕输出,遵循已有代码模式,逻辑简单明确,可安全合入。
| 类型 | 数量 |
|---|---|
| 🔴 阻塞 | 0 |
| 🟡 建议 | 1 |
💬 仅评论


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 |
|---|---|---|
| repo-Ascend/msprof | ✅ 潘杨杰, 陈豪 (2/2) | ✅ 潘杨杰 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
Seanesmhxocism, thanks for your pull request. All authors of the commits have signed the CLA. 👍


Pull Request 已合并或已关闭。
If you want to solve this problem, you can click here to do it in the FAQs.


Pull Request 已合并或已关闭。
If you want to solve this problem, you can click here to do it in the FAQs.


PR 合入模板
注:经过自检不涉及的可标注“不涉及”或直接打勾,特殊情况请文字备注。不符合规范的 PR 不允许合入,请(后备)commit 注意。
1. 修改描述
当前数据解析强依赖指定解析的文件命名为PROF,当前仅在log日志中记录相关问题,无法显示提示用户相关依赖
增加对于相关日志的打屏提示
2. 功能验证
3. 分支合并要求
3. 代码检视
要求:
检视意见数:____ 条 (请填写本次检视的意见总数,用于commit合入前审视)
4. 安全自检
Python、C++
C++
5. 变更知会