文件最后提交记录最后更新时间
doStop sequence mspti functions calls Co-authored-by: Ivan Kniazkov<kniazkov.ivan@huawei.com> # message auto-generated for no-merge-commit merge: !64 merge master into master doStop sequence mspti functions calls Created-by: trinitrovazelin Commit-by: trinitrovazelin;Ivan Kniazkov Merged-by: ascend-robot Description: # PR Merge Template **Note: If a checklist item is not applicable to this change, mark it as "N/A" or provide a brief explanation. PRs that do not meet the required standards must not be merged. Please ensure the final commit(s) comply with the merge requirements.** --- ## 1. Change Description * **Reason for change:** This change adds a minimal unit test to cover the public MSPTI stop sequence corresponding to the Huawei doStop() usage pattern. The purpose is to provide incremental test coverage and demonstrate active progress on the cleanup-path validation issue. * **Description of change:** Added a new unit test file: test/mspti_cpp/ut/callback/callback_manager_test/callback_stop_chain_utest.cpp Updated the corresponding build configuration to include the new test source in the existing callback unit test target. The new test verifies the following public stop sequence: 1. subscribe to MSPTI callback delivery, 2. enable runtime callback domain, 3. enable kernel activity collection, 4. disable kernel activity collection, 5. unsubscribe from callback delivery, 6. verify that callback subscription can be established again after the stop sequence. --- ## 2. Functional Verification * [x] **Function self-test** * [ ] **Screenshot of local self-test cases** * [ ] **Smoke test passed** **Explanation:** This MR only adds a unit test and a related build rule update. Smoke verification is currently not involved in this change. **Self-test result:** The newly added test compiles and executes successfully. **Executed test case:** CallbackStopChainUtest.StopSequenceShouldDisableKernelAndAllowResubscribe **Observed result:** * MSPTI activity registration succeeded * MSPTI subscribe succeeded * Runtime callback domain enable succeeded * Kernel activity enable/disable succeeded * MSPTI unsubscribe succeeded * Re-subscribe after stop-chain cleanup succeeded --- ## 3. Branch Merge Requirements * [ ] **Code merged across required branches** **Explanation:** N/A at the current development stage / to be completed according to the branch merge process before final merge. --- ## 4. Code Review * **Requirements:** * Code changes exceeding 200 lines require a review meeting with at least three reviewers. * Review density must be at least 1 issue per 100 lines. * If the review defect density does not meet the requirement, an explanation must be provided. * In principle, changes exceeding 1000 lines are not allowed to be merged and require special record filing. * [ ] **Code review completed** * [x] **UT test case coverage is provided** A new UT case has been added to cover the MSPTI public stop sequence. The current coverage is intentionally lightweight and focuses on the observable API-level contract. * **Number of review comments: *0*** --- ## 5. Security Self-Check ### Python / C++: * [ ] **If any external interface was added / removed / changed, related materials have been updated accordingly, and input validation follows the external input checklist** **Explanation:** N/A. No external interface was added, removed, or changed. * [ ] **No private file operations are used; secure common-module functions are used instead** **Explanation:** N/A. This change only adds a unit test. * [ ] **Temporary files are deleted after task completion, and failure scenarios are also handled without leaving temporary files behind** **Explanation:** N/A. No temporary files are created. * [ ] **Array out-of-bounds scenarios are checked, and division-by-zero is checked where applicable** **Explanation:** N/A. No new array arithmetic or division logic was introduced. * [ ] **Recursive methods include recursion-depth checks, and regular expressions are checked for ReDoS risks** **Explanation:** N/A. No recursion or regex logic was introduced. * [x] **Abnormal input and return-value scenarios are adequately checked where applicable** The new test verifies expected public API return values across the stop sequence. * [x] **Logs do not contain spelling or grammar issues and do not expose code details or sensitive information** No new logging logic is introduced in this change. ### C++: * [x] **Pointers are checked for null before use where applicable** The test verifies that the subscriber handle is non-null after successful subscription and resets it after unsubscribe. * [ ] **Numeric calculations are checked for overflow and wraparound** **Explanation:** N/A. No numeric calculation logic was introduced. * [x] **No memory leak exists, including exception/failure scenarios** The test performs best-effort cleanup in TearDown(), and dynamically allocated activity buffers are released properly. * [x] **Type conversions do not introduce data truncation** No unsafe narrowing conversion was introduced in this change. * [x] **When copying strings, the destination buffer is at least one byte larger than the source buffer** **Explanation:** N/A. No string copy logic was introduced. * [x] **When copying memory, the destination buffer is not smaller than the source buffer** **Explanation:** N/A. No raw memory copy logic was introduced. * [x] **Pointers are set to nullptr after memory/resource release** The subscriber handle is explicitly reset to nullptr after unsubscribe. --- ## 6. Change Notification * [ ] **Documentation updated** * [ ] **Change notification sent (message notification + email notification)** **Explanation:** N/A for this MR unless specifically required by the project process. See merge request: Ascend/mspti!641 个月前
Add test for group of runtime launch callbacks for common runtime profiling scenario. Co-authored-by: ilya_a<abanin.ilya@huawei.com> # message auto-generated for no-merge-commit merge: !68 merge test_group_of_rt_launch_callbacks into master Add test for group of runtime launch callbacks for common runtime profiling scenario. Created-by: ilya_a Commit-by: ilya_a Merged-by: ascend-robot Description: # PR merging template **Note: If the self-check result indicates that the item is not involved, mark it as "N/A" or directly tick it. In special cases, provide a written explanation. PRs that do not comply with the specifications are not allowed to be merged. Please be aware of this.** ---- ## 1. Change Description - **Reason for change: Add unit test to check most common chain of launch callbacks for time profiling.** - **Change details: Added unit test to callback test suite.** ---- ## 2. Function Verification - [x] **Self-verification** - [x] **Screenshots of local self-verification cases** - [ ] **Smoke test result** (Enter the link to the self-verification report in the group. If the test fails, please provide the reason: __________________. For the function code, please proactively report and add the smoke test.) ---- ## 3. Branch Merging Requirements - [x] **Code merging** (Ensure that the latest code of the master branch is merged into the poc and pre-research branches, and that the code of the poc branch has been correctly merged into the pre-research branch.) ---- ## 4. Code Review - **Requirements:** - If the code to be merged exceeds 200 lines, the code must be reviewed by at least three people. - The code review density must be greater than or equal to 1 review per 100 lines. - If the defect density in the code review does not meet the requirements, an explanation must be provided. - In principle, code with more than 1000 lines is not allowed to be merged. If such code needs to be merged, it must be archived. - [ ] **Whether the code has been reviewed** - [x] **Whether UT cases are maintained** (If the requirement is not met, please provide the reason: __________________.) - **Number of review comments: _____** (Please fill in the total number of comments for this review, which will be used for review before the commit is merged.) ---- ## 5. Security Self-Check ### Python and C++ - [x] **After external APIs are added, deleted, or changed, the corresponding documentation must be added, deleted, or changed accordingly. For details about the verification of input parameters of new APIs, see the external input table.** - [x] **Private file operations are not allowed. Only the security functions of the public module can be used.** - [x] **Temporary files must be deleted after a task is complete. In addition, ensure that no temporary files are left after the task fails.** - [x] **Out-of-bounds access to arrays must be verified. Division by zero must be checked.** - [x] **The recursion depth of recursive methods must be verified. Regular expressions must be checked for ReDoS.** - [x] **The input and return values of APIs must be fully verified.** - [x] **Logs must not contain spelling or syntax errors, and must not expose code details or sensitive information.** ### C++ - [x] **Null pointer check is required before using a pointer.** - [ ] **Numerical calculation** See merge request: Ascend/mspti!681 个月前
doStop sequence mspti functions calls Co-authored-by: Ivan Kniazkov<kniazkov.ivan@huawei.com> # message auto-generated for no-merge-commit merge: !64 merge master into master doStop sequence mspti functions calls Created-by: trinitrovazelin Commit-by: trinitrovazelin;Ivan Kniazkov Merged-by: ascend-robot Description: # PR Merge Template **Note: If a checklist item is not applicable to this change, mark it as "N/A" or provide a brief explanation. PRs that do not meet the required standards must not be merged. Please ensure the final commit(s) comply with the merge requirements.** --- ## 1. Change Description * **Reason for change:** This change adds a minimal unit test to cover the public MSPTI stop sequence corresponding to the Huawei doStop() usage pattern. The purpose is to provide incremental test coverage and demonstrate active progress on the cleanup-path validation issue. * **Description of change:** Added a new unit test file: test/mspti_cpp/ut/callback/callback_manager_test/callback_stop_chain_utest.cpp Updated the corresponding build configuration to include the new test source in the existing callback unit test target. The new test verifies the following public stop sequence: 1. subscribe to MSPTI callback delivery, 2. enable runtime callback domain, 3. enable kernel activity collection, 4. disable kernel activity collection, 5. unsubscribe from callback delivery, 6. verify that callback subscription can be established again after the stop sequence. --- ## 2. Functional Verification * [x] **Function self-test** * [ ] **Screenshot of local self-test cases** * [ ] **Smoke test passed** **Explanation:** This MR only adds a unit test and a related build rule update. Smoke verification is currently not involved in this change. **Self-test result:** The newly added test compiles and executes successfully. **Executed test case:** CallbackStopChainUtest.StopSequenceShouldDisableKernelAndAllowResubscribe **Observed result:** * MSPTI activity registration succeeded * MSPTI subscribe succeeded * Runtime callback domain enable succeeded * Kernel activity enable/disable succeeded * MSPTI unsubscribe succeeded * Re-subscribe after stop-chain cleanup succeeded --- ## 3. Branch Merge Requirements * [ ] **Code merged across required branches** **Explanation:** N/A at the current development stage / to be completed according to the branch merge process before final merge. --- ## 4. Code Review * **Requirements:** * Code changes exceeding 200 lines require a review meeting with at least three reviewers. * Review density must be at least 1 issue per 100 lines. * If the review defect density does not meet the requirement, an explanation must be provided. * In principle, changes exceeding 1000 lines are not allowed to be merged and require special record filing. * [ ] **Code review completed** * [x] **UT test case coverage is provided** A new UT case has been added to cover the MSPTI public stop sequence. The current coverage is intentionally lightweight and focuses on the observable API-level contract. * **Number of review comments: *0*** --- ## 5. Security Self-Check ### Python / C++: * [ ] **If any external interface was added / removed / changed, related materials have been updated accordingly, and input validation follows the external input checklist** **Explanation:** N/A. No external interface was added, removed, or changed. * [ ] **No private file operations are used; secure common-module functions are used instead** **Explanation:** N/A. This change only adds a unit test. * [ ] **Temporary files are deleted after task completion, and failure scenarios are also handled without leaving temporary files behind** **Explanation:** N/A. No temporary files are created. * [ ] **Array out-of-bounds scenarios are checked, and division-by-zero is checked where applicable** **Explanation:** N/A. No new array arithmetic or division logic was introduced. * [ ] **Recursive methods include recursion-depth checks, and regular expressions are checked for ReDoS risks** **Explanation:** N/A. No recursion or regex logic was introduced. * [x] **Abnormal input and return-value scenarios are adequately checked where applicable** The new test verifies expected public API return values across the stop sequence. * [x] **Logs do not contain spelling or grammar issues and do not expose code details or sensitive information** No new logging logic is introduced in this change. ### C++: * [x] **Pointers are checked for null before use where applicable** The test verifies that the subscriber handle is non-null after successful subscription and resets it after unsubscribe. * [ ] **Numeric calculations are checked for overflow and wraparound** **Explanation:** N/A. No numeric calculation logic was introduced. * [x] **No memory leak exists, including exception/failure scenarios** The test performs best-effort cleanup in TearDown(), and dynamically allocated activity buffers are released properly. * [x] **Type conversions do not introduce data truncation** No unsafe narrowing conversion was introduced in this change. * [x] **When copying strings, the destination buffer is at least one byte larger than the source buffer** **Explanation:** N/A. No string copy logic was introduced. * [x] **When copying memory, the destination buffer is not smaller than the source buffer** **Explanation:** N/A. No raw memory copy logic was introduced. * [x] **Pointers are set to nullptr after memory/resource release** The subscriber handle is explicitly reset to nullptr after unsubscribe. --- ## 6. Change Notification * [ ] **Documentation updated** * [ ] **Change notification sent (message notification + email notification)** **Explanation:** N/A for this MR unless specifically required by the project process. See merge request: Ascend/mspti!641 个月前
mspti减少依赖LD_PRELOAD, device源改为直接调用接口注册回调函数 Co-authored-by: HuGallium<hujia23@huawei.com> # message auto-generated for no-merge-commit merge: !25 merge without_ld_preload into master mspti减少依赖LD_PRELOAD, device源改为直接调用接口注册回调函数 Created-by: HuGallium Commit-by: HuGallium Merged-by: ascend-robot Description: # PR 合入模板 **注:经过自检不涉及的可标注“不涉及”或直接打勾,特殊情况请文字备注。不符合规范的 PR 不允许合入,请(后备)commit 注意。** ---- ## 1. 修改描述 - **修改原因:** 本pr为对https://gitcode.com/Ascend/mspti/pull/24回退,重新将对应需求代码加回mspti - **修改内容:** ---- ## 2. 功能验证 - [x] **功能自验** - [x] **本地自验用例截图** - [x] **冒烟是否通过** (填入群链接的自验证报告中,如未通过,请说明原因:____________________ ,功能代码请主动申报添加冒烟) ---- ## 3. 分支合并要求 - [ ] **代码合并**(请确保将 master 分支的最新代码同步合并至 poc 分支及 pre-research 分支,同时保证 poc 分支的代码也已正确合并到 pre-research 分支。) ---- ## 3. 代码检视 - **要求:** - 合入代码超过 200 行,需三人以上会议检视。 - 检视密度≥1个/100行。 - 检视缺陷密度未达要求需提供说明。 - 大于 1000 行代码原则上不允许合入,需进行备案。 - [ ] **是否经过代码检视** - [ ] **是否具备 UT 测试用例看护** (如不符合,请说明原因:____________________) - **检视意见数:____ 条** (请填写本次检视的意见总数,用于commit合入前审视) ---- ## 4. 安全自检 ### Python、C++: - [ ] **对外接口新增/删除/变更后,资料要同步新增/删除/变更,新增接口入参校验参考外部输入表格** - [ ] **不允许私有的文件操作,需要使用公共模块的安全函数** - [ ] **任务结束后需要删除临时文件,同时需要考虑任务失败后,临时文件没有残留** - [ ] **数组访问需要校验越界场景,对除法需要做除零校验** - [ ] **需要对递归方法做递归深度校验,正则表达式必须做 ReDoS 校验** - [ ] **需要充分进行接口输入和返回值异常情况的校验** - [ ] **日志打印不要出现拼写或语法错误,不要暴露代码细节和敏感信息** ### C++: - [ ] **指针使用前需要判空** - [ ] **数值计算校验溢出和反转** - [ ] **不可存在内存泄漏(异常场景需要释放内存)** - [ ] **类型转换不能出现数据截断** - [ ] **拷贝字符串时,目的缓冲区至少比源缓冲区大 1** - [ ] **拷贝内存时,目的缓冲区不小于源缓冲区** - [ ] **内存释放后指针赋值为 nullptr** ---- ## 5. 变更知会 - [ ] **资料修改** - [ ] **变更通知(消息知会 + 邮件知会)** ---- See merge request: Ascend/mspti!253 个月前
msPTI开源 Co-authored-by: z30043230<zhaiyibo@h-partners.com> 5 个月前