已合并
【PR】: add error manager C callback wrappers #858
KenChow创建于 3月13日
【PR】: add error manager C callback wrappers #858
已合并
KenChow创建于 3月13日
KenChow
3月13日

Pull Request

描述

  • 在 error_manager.h 中新增 3 个纯 C ABI 的 ForC 接口声明,供驱动按回调函数指针注册使用
  • 在 error_manager.cc 中实现对现有 C++ 错误上报接口的二次封装,完成 C 形参与 std::vector/va_list 的桥接
  • 为新增 C 接口补充 UT,覆盖注册、预定义错误上报、内部错误上报及空指针失败场景

变更类型

请选择本次引入的变更类型:

关联的Issue

  • N/A

如何测试

描述测试此变更的步骤和前提条件:

  1. 构建 ut_error_manager
  2. 执行新增 *ForC* 相关 UT,验证符号导出和行为路径
  3. 回归现有 error_manager UT

核对清单

其他信息

后续需要补充Error Manager初始化时调驱动的注册接口,将错误码注册和上报接口的句柄注册给驱动使用,驱动接口为:

int32_t __attribute__((weak)) drv_log_report_err_msg_handle_register(struct err_msg_report_handle *handle, size_t input_size);
int32_t __attribute__((weak)) drv_log_report_err_msg_handle_unregister(void);
typedef int32_t (*register_format_err_msg_func)(const char *error_msg, unsigned long error_msg_len);
typedef int32_t (*report_predefined_err_msg_func)(const char *error_code, const char **key, const char **value,
                                                  unsigned long arg_num);
typedef int32_t (*report_inner_err_msg_func)(const char *file_name, const char *func, uint32_t line,
                                             const char *error_code, const char *format, ...);
struct err_msg_report_handle {
    register_format_err_msg_func register_format_func;
    report_predefined_err_msg_func predefined_report_func;
    report_inner_err_msg_func inner_report_func;
};
likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 KenChow 的贡献)
KKenChow
3月13日 创建了 pull request,commit b425da59
CANN-robot
CANN-robot成员
3月13日 评论:

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
src/dfx ✅ zhuliangying, yanmingxiang (2/2) ✅ zhuliangying (1/1)
tests/ut/error_manager ✅ zhuliangying, yanmingxiang (2/2) ✅ zhuliangying (1/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

KenChow, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
CANN-robotCANN-robot成员
3月13日 将newstarzj,chenhao_1209,zhuliangying,wangtao43,zhangpengpeng8,yanmingxiang,Reyn52166,derekxu,tingwood设为评审人
CANN-robotCANN-robot成员
3月13日 将newstarzj,chenhao_1209,zhuliangying设为审查人
CANN-robotCANN-robot成员
3月13日 添加了label:cann-cla/yes
此处折叠了53条消息 查看更多
CANN-robot
CANN-robot成员
3月19日 评论:

The following users do not have permission to comment /lgtm or /approve on any module in this PR:
fu-jun2, zhanj

likedislike
CANN-robotCANN-robot成员
3月19日 添加了label:lgtmapproved
CANN-robot
CANN-robot成员
3月19日 评论:

Review Guide

This pull-request passes review.
Committers who wrote a comment of /approve are: zhuliangying.
Reviewers who wrote a comment of /lgtm are: yanmingxiang, zhuliangying.

likedislike
CANN-robotCANN-robot成员
3月19日 合入了pull request
KKenChow
4月9日 修改了pull request 的描述