Open
日志修改 #1
liu-luAdd on  12 hours ago
liu-lu
liu-luCollaborators
12 hours ago Create

规则 仓库 分支 文件 行号 代码 问题原因 修复建议
缺少度量单位 runtime master src/aicpu_sched/aicpu_schedule/core/aicpusd_resource_manager.cpp 69 aicpusd_err("Failed to alloc mbuf, size[%lu], ret[%d].", allocSize, drvRet); mbuf 分配大小 size[%lu] 未标注度量单位(字节/KB),无法判断内存量级,易在排障时产生误解 改为 "Failed to alloc mbuf, size[%lu]B, ret[%d]." 或按实际单位标注(如 KB)
ERROR关键定位信息缺失 runtime master src/aicpu_sched/aicpu_schedule/core/aicpusd_so_manager.cpp 96 aicpusd_err("HiMpiSysSetDeviceId fail"); ERROR 日志 "HiMpiSysSetDeviceId fail" 未输出返回值 ret,调用结果为 int32_t 且在判断条件中可获取,缺少错误码会影响根因定位 改为 aicpusd_err("HiMpiSysSetDeviceId failed, ret=%d", ret); 输出返回值
ERROR关键定位信息缺失 runtime master src/aicpu_sched/aicpu_schedule/core/aicpusd_threads_process.cpp 122 aicpusd_err("Memory svm device failed."); ERROR 日志 "Memory svm device failed." 未输出返回值 ret,ret 在同一判断语句中可获取且随后被返回,缺少错误码不利于定位 MemorySvmDevice 失败原因 改为 aicpusd_err("Memory svm device failed, ret=%d.", ret); 输出返回值
ERROR关键定位信息缺失 runtime master src/aicpu_sched/aicpu_schedule/core/aicpusd_threads_process.cpp 143 aicpusd_err("Register aicpu nonblock task and async event manager task failed."); ERROR 日志 "Register aicpu nonblock task and async event manager task failed." 未输出返回值 ret,ret 在同一判断语句中可获取且随后被返回,缺少错误码 改为 aicpusd_err("Register aicpu nonblock task and async event manager task failed, ret=%d.", ret); 输出返回值
ERROR关键定位信息缺失 runtime master src/aicpu_sched/aicpu_schedule/core/aicpusd_threads_process.cpp 272 aicpusd_err("Init task monitor context failed"); ERROR 日志 "Init task monitor context failed" 未输出 aicpu::InitTaskMonitorContext 的错误码,判断条件中已获取该返回值但未记录,缺少错误码不利于定位 先保存 InitTaskMonitorContext 的返回值并输出,如 aicpusd_err("Init task monitor context failed, ret=%d", ret);
循环体内打印高频日志 runtime master src/aicpu_sched/aicpu_schedule/core/dfx/aicpusd_cust_dump_process.cpp 108 aicpusd_info("prepare bind threadId=%lu to cpuId=%u", threadId, static_cast<uint32_t>(cpuId)); 该 INFO 日志位于 for (const auto cpuId : ccpuIds) 正常循环体内,每次迭代都会输出一条 'prepare bind threadId=... to cpuId=...',属于正常流程的循环内 INFO 打印,CPU 数量多时会产生高频冗余日志。 将日志移出循环,在循环前一次性输出待绑定的 cpuId 列表,或将循环内逐条日志降为 DEBUG 级别。
失败日志缺少错误描述 runtime master src/aicpu_sched/aicpu_schedule/core/dfx/aicpusd_cust_dump_process.cpp 274 aicpusd_err("len[%u], headLen[%u].", len, headLen); 该 ERROR 日志处于参数校验失败并返回 AICPU_SCHEDULE_ERROR_PARAMETER_NOT_VALID 的异常路径,但文案仅有 'len[%u], headLen[%u].',没有任何失败对象、动作或错误说明,读者无法判断是空指针还是长度越界(实际包含 msg/rsp 空指针与 len<headLen 两类失败)。 补充错误描述,例如:"Check msg failed: msg or rsp is null, or len[%u] is less than headLen[%u].",区分空指针与长度不足两种情况。
日志格式化参数不匹配 runtime master src/aicpu_sched/aicpu_schedule/core/dfx/aicpusd_cust_dump_process.cpp 312 " aicpusd_info(
""event id[%u], headLen[%u], msg len[%u] udfInfo len[%u]"", drvEventInfo.comm.subevent_id, headLen,
static_cast<size_t>(drvEventInfo.priv.msg_len), sizeof(AICPUDumpUdfInfo));" 格式串 'msg len[%u] udfInfo len[%u]' 对应的实参为 static_cast<size_t>(drvEventInfo.priv.msg_len) 和 sizeof(AICPUDumpUdfInfo),均为 size_t(64位平台为8字节),却使用 %u(4字节)格式符,会导致读取位宽不匹配,可能输出截断值或未定义行为,应使用 %zu。 将 'msg len[%u]' 和 'udfInfo len[%u]' 的格式符改为 %zu,与 size_t 实参类型匹配。
日志格式化参数不匹配 runtime master src/aicpu_sched/aicpu_schedule/core/dfx/aicpusd_cust_dump_process.cpp 316 " aicpusd_err(
""The len[%u] is not correct[%u + %u]."", drvEventInfo.priv.msg_len, sizeof(AICPUDumpUdfInfo), headLen);" 格式串 'The len[%u] is not correct[%u + %u].' 的第二个实参 sizeof(AICPUDumpUdfInfo) 为 size_t 类型(64位平台8字节),却使用 %u(4字节)格式符,类型不匹配可能导致输出值截断或未定义行为,应使用 %zu。 将 sizeof 对应的格式符改为 %zu,即 'The len[%u] is not correct[%zu + %u].'
缺少度量单位 runtime master src/aicpu_sched/aicpu_schedule/core/dfx/aicpusd_cust_dump_process.cpp 338 " aicpusd_info(
""udf data dump begin dumpInfo[%p], length[%llu], info->udfInfo[%llu], udfPid[%d]"", dumpInfo, length,
info->udfInfo, udfPid);" INFO 日志中输出转储数据长度 length[%llu],属于数据量度量信息,但未标注度量单位(字节),读者无法确定该值是字节数还是元素个数,可能造成量级误解。 在日志中为长度值补充单位,例如改为 "length[%llu]B" 或 "length[%llu] bytes"。
日志格式化参数不匹配 runtime master src/aicpu_sched/aicpu_schedule/core/dfx/aicpusd_cust_dump_process.cpp 355 " aicpusd_info(
""udf data dump finish dumpInfo[%p], length[%lld], udfPid[%d], deviceId[%u]"", dumpInfo, length, udfPid,
deviceId);" 同一函数中 length 声明为 uint64_t(见本函数起始处 uint64_t length = info->length;),此处却使用 %lld(有符号 long long)打印,符号不匹配,属于未定义行为,可能造成输出值异常。 将格式符改为 %llu 与 uint64_t 类型匹配(同函数 begin 日志已使用 %llu),保持一致。
缺少度量单位 runtime master src/aicpu_sched/aicpu_schedule/core/dfx/aicpusd_cust_dump_process.cpp 355 " aicpusd_info(
""udf data dump finish dumpInfo[%p], length[%lld], udfPid[%d], deviceId[%u]"", dumpInfo, length, udfPid,
deviceId);" INFO 日志中输出转储数据长度 length[%lld],属于数据量度量信息,但未标注度量单位(字节),无法确定是字节数还是其他度量,可能造成量级误解。 在日志中为长度值补充单位,例如改为 "length[%lld]B" 或 "length[%lld] bytes"。
失败日志缺少错误描述 runtime master src/aicpu_sched/aicpu_schedule/core/dfx/dump_task.cpp 250 " aicpusd_err(
""inputFromContextSize[%u], baseDumpData_.input_size[%u]"", inputFromContextSize, baseDumpData_.input_size());" ERROR 日志仅输出两个变量数值 inputFromContextSize 与 baseDumpData_.input_size,未说明发生了何种错误(输入数量校验不一致/不匹配),也没有失败动作或原因描述,读日志时无法判断该条 ERROR 的含义 补充错误说明,例如:Input size mismatch, inputFromContextSize[%u], expected baseDumpData_.input_size[%u],说明是输入数量校验失败
缺少度量单位 runtime master src/aicpu_sched/aicpu_schedule/core/dfx/dump_task.cpp 264 aicpusd_info("size[%llu]", size); size[%llu] 为数据量/内存度量值(字节),未标识度量单位,无法确认是字节数还是元素个数,可能造成量级误解 改为 size[%llu] bytes 等带单位的写法
失败日志缺少错误描述 runtime master src/aicpu_sched/aicpu_schedule/core/dfx/dump_task.cpp 269 " aicpusd_err(
""outputFromContextSize[%u], baseDumpData_.output_size[%u]"", outputFromContextSize,
baseDumpData_.output_size());" ERROR 日志仅输出 outputFromContextSize 与 baseDumpData_.output_size 两个数值,未说明发生了输出数量不一致的校验失败,缺少错误描述与失败动作 补充错误说明,例如:Output size mismatch, outputFromContextSize[%u], expected baseDumpData_.output_size[%u]
缺少度量单位 runtime master src/aicpu_sched/aicpu_schedule/core/dfx/dump_task.cpp 284 aicpusd_info("size[%llu]", size); size[%llu] 为数据量度量值(字节),未标识度量单位,无法确认量纲 改为 size[%llu] bytes 等带单位的写法
缺少度量单位 runtime master src/aicpu_sched/aicpu_schedule/core/dfx/dump_task.cpp 286 " aicpusd_info(
""PreProcessFFTSPLUSInputAndOutput inputTotalSize[%llu], outputTotalSize[%llu]"", inputTotalSize_,
outputTotalSize_);" inputTotalSize[%llu]、outputTotalSize[%llu] 为累计数据量(字节),未标识度量单位,无法判断量级 补充单位,如 inputTotalSize[%llu] bytes, outputTotalSize[%llu] bytes
缺少度量单位 runtime master src/aicpu_sched/aicpu_schedule/core/dfx/dump_task.cpp 394 aicpusd_info("op name[%s], input[%d], size[%llu]", opName_.c_str(), i, len); size[%llu] 为输入数据大小(字节),未标识度量单位 补充单位,如 size[%llu] bytes
缺少度量单位 runtime master src/aicpu_sched/aicpu_schedule/core/dfx/dump_task.cpp 405 " aicpusd_info(
""op name[%s], begin to copy data from HBM to DDR for input[%d],""
"" srcSize[%llu], innerOffset[%llu], offset[%llu], dstSize[%llu], dst value[%lx], src value[%lx]"",
opName_.c_str(), i, actSize, innerOffset, offset_, emptyBufferSize, buff_.get() + offset_, srcAddr);" srcSize、innerOffset、offset、dstSize 均为字节度量值,未标识度量单位,无法确认量纲 各数值后补充 bytes 单位,如 srcSize[%llu] bytes
缺少度量单位 runtime master src/aicpu_sched/aicpu_schedule/core/dfx/dump_task.cpp 416 " aicpusd_info(
""op name[%s], end of copy data from HBM to DDR for input[%d], size[%llu]"", opName_.c_str(), i, actSize);" size[%llu] 为本次拷贝数据量(字节),未标识度量单位 补充单位,如 size[%llu] bytes
缺少度量单位 runtime master src/aicpu_sched/aicpu_schedule/core/dfx/dump_task.cpp 473 aicpusd_info("op name[%s], output[%d] size[%llu].", opName_.c_str(), i, len); size[%llu] 为输出数据大小(字节),未标识度量单位 补充单位,如 size[%llu] bytes
缺少度量单位 runtime master src/aicpu_sched/aicpu_schedule/core/dfx/dump_task.cpp 483 " aicpusd_info(
""op name[%s], begin to copy data from HBM to DDR for output[%d],""
"" srcSize[%llu], innerOffset[%llu], offset[%llu], dstSize[%llu]"",
opName_.c_str(), i, actSize, innerOffset, offset_, emptyBufferSize);" srcSize、innerOffset、offset、dstSize 均为字节度量值,未标识度量单位 各数值后补充 bytes 单位
缺少度量单位 runtime master src/aicpu_sched/aicpu_schedule/core/dfx/dump_task.cpp 496 " aicpusd_info(
""op name[%s], end of copy data from HBM to DDR for output[%d],""
"" srcSize[%llu], dstSize[%llu]"",
opName_.c_str(), i, actSize, emptyBufferSize);" srcSize[%llu]、dstSize[%llu] 为拷贝数据量(字节),未标识度量单位 补充单位,如 srcSize[%llu] bytes, dstSize[%llu] bytes
缺少度量单位 runtime master src/aicpu_sched/aicpu_schedule/core/dfx/dump_task.cpp 540 " aicpusd_info(
""op name[%s], begin to copy data from HBM to DDR for op buffer[%d],""
"" srcSize[%llu], dstSize[%llu]"",
opName_.c_str(), i, actSize, emptyBufferSize);" srcSize[%llu]、dstSize[%llu] 为拷贝数据量(字节),未标识度量单位 补充单位,如 srcSize[%llu] bytes, dstSize[%llu] bytes
缺少度量单位 runtime master src/aicpu_sched/aicpu_schedule/core/dfx/dump_task.cpp 551 " aicpusd_info(
""op name[%s], end of copy data from HBM to DDR for op buffer[%d],""
"" srcSize[%llu], dstSize[%llu]"",
opName_.c_str(), i, actSize, emptyBufferSize);" srcSize[%llu]、dstSize[%llu] 为拷贝数据量(字节),未标识度量单位 补充单位,如 srcSize[%llu] bytes, dstSize[%llu] bytes
缺少度量单位 runtime master src/aicpu_sched/aicpu_schedule/core/dfx/dump_task.cpp 593 " aicpusd_info(
""op name[%s], begin to copy data from HBM to DDR for spaceIndex[%d],""
"" srcSize[%llu], innerOffset[%llu], offset[%llu], dstSize[%llu]"",
opName_.c_str(), i, actSize, innerOffset, offset_, emptyWorkspaceSize);" srcSize、innerOffset、offset、dstSize 均为字节度量值,未标识度量单位 各数值后补充 bytes 单位
循环体内打印高频日志 runtime master src/aicpu_sched/aicpu_schedule/core/dfx/dump_task.cpp 1440 " aicpusd_info(
""Dump op info for kfc op: opWorkspaceAddr[%lu] size[%lu]."", dumpInfo->workspace[i].data_addr,
dumpInfo->workspace[i].size);" 该 aicpusd_info(宏链最终为 dlog_info,INFO 级)位于 for 循环体内,按 workspace 数量逐次迭代输出,属于正常循环体内的 INFO 打印,迭代次数多时会产生高频日志。 将循环内的 INFO 日志降为 DEBUG 级,或在循环外合并为一条汇总日志(如输出 workspace 总数),避免逐次迭代打印。
循环体内打印高频日志 runtime master src/aicpu_sched/aicpu_schedule/core/dfx/dump_task.cpp 1454 " aicpusd_info(
""Dump input info for kfc op: index[%d], data_type[%d], format[%d], address[%ld], size[%ld], shape[%s], ""
""origin_shape[%s]"",
dumpInfo->inputDumpInfo[i].index, dumpInfo->inputDumpInfo[i].data_type, dumpInfo->inputDumpInfo[i].format,
dumpInfo->inputDumpInfo[i].address, dumpInfo->inputDumpInfo[i].size,
ShapeDebugString(dumpInfo->inputDumpInfo[i].shape).c_str(),
ShapeDebugString(dumpInfo->inputDumpInfo[i].origin_shape).c_str());" 该 aicpusd_info(宏链最终为 dlog_info,INFO 级)位于遍历输入的 for 循环体内,逐 tensor 输出 dump 信息,属于正常循环体内的 INFO 打印,输入数量大时会形成高频日志。 将逐条输入 dump 信息降为 DEBUG 级,或在循环外汇总输出输入数量等关键信息,异常情况单独打印。
循环体内打印高频日志 runtime master src/aicpu_sched/aicpu_schedule/core/dfx/dump_task.cpp 1472 " aicpusd_info(
""Dump output info for kfc op: index[%d], data_type[%d], format[%d], address[%ld], size[%ld], shape[%s], ""
""origin_shape[%s]."",
dumpInfo->outputDumpInfo[i].index, dumpInfo->outputDumpInfo[i].data_type,
dumpInfo->outputDumpInfo[i].format, dumpInfo->outputDumpInfo[i].address, dumpInfo->outputDumpInfo[i].size,
ShapeDebugString(dumpInfo->outputDumpInfo[i].shape).c_str(),
ShapeDebugString(dumpInfo->outputDumpInfo[i].origin_shape).c_str());" 该 aicpusd_info(宏链最终为 dlog_info,INFO 级)位于遍历输出的 for 循环体内,逐 tensor 输出 dump 信息,属于正常循环体内的 INFO 打印,输出数量大时会形成高频日志。 将逐条输出 dump 信息降为 DEBUG 级,或在循环外汇总输出,避免循环内逐次打印 INFO。
语法错误 runtime master src/aicpu_sched/aicpu_schedule/core/dfx/dump_task.cpp 1190 aicpusd_info("Kfc dump API[%s] not get.", kfcDumpKernelName); 文案 "Kfc dump API[%s] not get." 中谓语动词形式错误,缺少助动词或被动结构,"not get" 不是合法的英文谓语形式,应使用 not found / failed to get 等表达。 改为 "Kfc dump API[%s] not found." 或 "Failed to get Kfc dump API[%s]."
语法错误 runtime master src/aicpu_sched/aicpu_schedule/core/dfx/dump_task.cpp 1193 aicpusd_info("Kfc dump API[%s] has get, no need get again.", kfcDumpKernelName); 文案 "Kfc dump API[%s] has get, no need get again." 存在两处动词形式错误:"has get" 应为被动/完成结构(has been obtained 等);"no need get again" 缺少不定式标记 to。 改为 "Kfc dump API[%s] has been obtained, no need to get again."
语法错误 runtime master src/aicpu_sched/aicpu_schedule/core/dfx/dump_task.cpp 1208 aicpusd_info("Not find kfc statistical dump api [%s] from kfc op.", KFC_DUMP_KERNEL_NAME.c_str()); 文案 "Not find kfc statistical dump api [%s] from kfc op." 中 "Not find" 动词形式错误,缺少助动词(did not find)或应使用过去分词 not found。 改为 "Failed to find kfc statistical dump api [%s] from kfc op." 或 "Kfc statistical dump api [%s] not found in kfc op."
语法错误 runtime master src/aicpu_sched/aicpu_schedule/core/dfx/dump_task.cpp 1219 aicpusd_err("Not get kfc statistical dump api [%s].", KFC_DUMP_KERNEL_NAME.c_str()); 文案 "Not get kfc statistical dump api [%s]." 中 "Not get" 动词形式错误,缺少助动词(did not get / could not get)或应使用过去分词 not obtained/not found。 改为 "Failed to get kfc statistical dump api [%s]." 或 "Kfc statistical dump api [%s] not found."
配置错误信息不完整 runtime master src/aicpu_sched/aicpu_schedule/core/dfx/dump_task_manager.cpp 98 aicpusd_err("Step error[%s].", dumpStepStr.c_str()); GetDumpStepFromString 解析失败判定 dump step 配置非法,日志仅输出错误值 Step error[%s],未给出合法的 step 取值或期望格式,用户无法据此自行修正配置。 补充合法的 dump step 取值范围或期望格式,例如:Invalid dump step[%s], expect one of [step1, step2, ...].
循环体内打印高频日志 runtime master src/aicpu_sched/aicpu_schedule/core/dfx/dump_task_manager.cpp 109 aicpusd_info("Get load dump data from proto task id[%u], stream id[%u]", task.task_id(), task.stream_id()); 该 aicpusd_info(宏链最终为 dlog_info,INFO 级)位于 for (int32_t i = 0; i < opMappingInfo.task_size(); ++i) 的正常循环体内,逐 task 打印,任务数量大时形成高频 INFO 日志。 将循环内的逐 task INFO 日志降为 DEBUG 级,或在循环外汇总打印 task 总数,异常 task 单独以 WARNING/ERROR 输出。
循环体内打印高频日志 runtime master src/aicpu_sched/aicpu_schedule/core/dfx/dump_task_manager.cpp 134 aicpusd_memory_log("MallocMemory, func=new, size=%zu, purpose=data dumper", sizeof(OpDumpTask)); aicpusd_memory_log 宏链最终为 dlog_info(INFO 级),且该调用位于 task 遍历循环体内(与 R39 同层缩进),每次迭代都会输出内存分配 INFO 日志,构成循环内高频打印。 将循环内的内存分配日志降为 DEBUG 级,或移出循环进行汇总统计后一次性输出。
缺少度量单位 runtime master src/aicpu_sched/aicpu_schedule/core/dfx/dump_task_manager.cpp 167 aicpusd_memory_log("MallocMemory, func=new, size=%zu, purpose=data dumper", sizeof(OpDumpTask)); INFO 日志输出内存分配大小 size=%zu(sizeof(OpDumpTask)),是内存度量值但未标注单位(字节),阅读者无法确认量级,影响排查与统计。 将文案改为 "MallocMemory, func=new, size=%zu Bytes, purpose=data dumper",明确单位为字节。
缺少度量单位 runtime master src/aicpu_sched/aicpu_schedule/core/dfx/dump_task_manager.cpp 465 aicpusd_memory_log("MallocMemory, func=new, size=%zu, purpose=data dumper", sizeof(OpDumpTask)); INFO 日志输出内存分配大小 size=%zu(sizeof(OpDumpTask)),是内存度量值但未标注单位(字节),阅读者无法确认量级。 将文案改为 "MallocMemory, func=new, size=%zu Bytes, purpose=data dumper",明确单位为字节。
缺少度量单位 runtime master src/aicpu_sched/aicpu_schedule/core/dfx/dump_task_manager.cpp 598 aicpusd_memory_log("MallocMemory, func=new, size=%zu, purpose=data dumper.", sizeof(OpDumpTask)); INFO 日志输出内存分配大小 size=%zu(sizeof(OpDumpTask)),是内存度量值但未标注单位(字节),阅读者无法确认量级。 将文案改为 "MallocMemory, func=new, size=%zu Bytes, purpose=data dumper.",明确单位为字节。
配置错误信息不完整 runtime master src/aicpu_sched/aicpu_schedule/core/dfx/dump_task_manager.cpp 736 aicpusd_err("invalid step[%s], please check.", step.c_str()); step 配置非法时报错只输出了错误配置值 invalid step[%s],未给出期望值或合法取值范围(如合法格式 0|5-10 及取值上限),用户无法据此修正配置 补充期望值或合法范围,例如:invalid step[%s], expected format like "0|5-10" with value in [0, uint64 max], please check.
配置错误信息不完整 runtime master src/aicpu_sched/aicpu_schedule/core/dfx/dump_task_manager.cpp 759 aicpusd_err("invalid step[%s], please check.", step.c_str()); step 解析失败的 catch 分支只输出错误配置值 invalid step[%s],未说明合法的 step 格式或取值范围,配置错误信息不成对 补充期望值或合法范围,例如:invalid step[%s], expected format like "0|5-10" with value in [0, uint64 max], please check.
语法错误 runtime master src/aicpu_sched/aicpu_schedule/core/dfx/dump_task_manager.cpp 517 " aicpusd_err(
""The open device interface return failed, device id is %u, stream id is %u, op type is %u."", deviceId,
streamId, opType);" ERROR 文案 "The open device interface return failed" 中谓语动词形式错误:主语 interface 为第三人称单数且描述已发生的失败,动词 return 应为 returned/returns,对比同文件 R44 使用 "interface returned" 可确认此处为动词形式错误。 改为 "The open device interface returned failed" 或更规范的 "Failed to open device, device id is %u, stream id is %u, op type is %u."
语法错误 runtime master src/aicpu_sched/aicpu_schedule/core/dfx/dump_task_manager.cpp 745 aicpusd_info("Step need to dump[%s].", str.c_str()); 文案 "Step need to dump[%s]." 存在主谓不一致:单数主语 Step 搭配动词原形 need,且语义上应为被动(步骤需要被 dump) 改为 "The step to dump is [%s]." 或 "Step needs to be dumped: [%s]."
ERROR关键定位信息缺失 runtime master src/aicpu_sched/aicpu_schedule/core/hwts_kernel/hwts_kernel_cust_so.cpp 284 aicpusd_err("Get current aicpu ctx failed."); ERROR 日志仅写 Get current aicpu ctx failed.,上下文中 aicpu::GetAicpuRunMode 返回的 status 错误码未输出,无法确定具体失败原因,不利于定位。 补充返回码,例如:aicpusd_err("Get current aicpu ctx failed, status=%d.", status);
ERROR关键定位信息缺失 runtime master src/aicpu_sched/aicpu_schedule/core/hwts_kernel/hwts_kernel_cust_so.cpp 296 aicpusd_err("Get aicpu group, start up and add group to cust aicpu failed."); ERROR 日志仅写 Get aicpu group, start up and add group to cust aicpu failed.,该操作包含获取 group、启动进程、添加 group 多个子步骤,但 StartCustProcess 的返回值 startRet 未输出,无法确定哪一步失败及失败原因。 补充返回码,例如:aicpusd_err("Get aicpu group, start up and add group to cust aicpu failed, ret=%d.", startRet);
ERROR关键定位信息缺失 runtime master src/aicpu_sched/aicpu_schedule/core/hwts_kernel/hwts_kernel_cust_so.cpp 315 aicpusd_err("Get current aicpu ctx failed."); ERROR 日志仅写 Get current aicpu ctx failed.,上下文中 aicpu::GetAicpuRunMode 返回的 status 错误码未输出,无法确定具体失败原因。 补充返回码,例如:aicpusd_err("Get current aicpu ctx failed, status=%d.", status);
ERROR关键定位信息缺失 runtime master src/aicpu_sched/aicpu_schedule/core/hwts_kernel/hwts_kernel_cust_so.cpp 322 aicpusd_err("Get aicpu group, start up and add group to cust aicpu failed."); ERROR 日志仅写 Get aicpu group, start up and add group to cust aicpu failed.,StartCustProcess 的返回值 ret 未输出,无法确定失败的具体子步骤与原因。 补充返回码,例如:aicpusd_err("Get aicpu group, start up and add group to cust aicpu failed, ret=%d.", ret);
语法错误 runtime master src/aicpu_sched/aicpu_schedule/core/hwts_kernel/hwts_kernel_cust_so.cpp 109 aicpusd_info("Create or find custom pid by CreateOrFindCustPid, load so event will be send to tsd."); 文案 "load so event will be send to tsd" 中被动语态动词形式错误,be 动词后应接过去分词 sent 而非 send 改为 "... load so event will be sent to tsd."
缺少度量单位 runtime master src/aicpu_sched/aicpu_schedule/core/hwts_kernel/hwts_kernel_soma.cpp 37 " aicpusd_info(
""SOMA: malloc deviceId=%u,mempoolId=%llx,va=%llx,size=%llu,memAsyncSubCMD=%u."", Mng->deviceId,
Mng->mempoolId, Mng->va, Mng->size, Mng->memAsyncSubCMD);" INFO 日志输出内存分配的 size=%llu,该值为内存大小度量信息但未标注单位(字节/KB 等),阅读者无法确定量级,易造成对内存规模的误解。 为 size 增加度量单位,例如 "size=%llu bytes",或统一格式为 size=%lluB。
越限错误信息不完整 runtime master src/aicpu_sched/aicpu_schedule/core/hwts_kernel/hwts_kernel_soma.cpp 50 aicpusd_err("Ts Kernel SomaMemMng OpType [%d] is invalid.", static_cast<int32_t>(op)); 日志输出 OpType [%d] is invalid,仅给出当前非法的 OpType 值,未给出合法的 OpType 取值范围或合法枚举说明,无法据此定位合法取值。 补充合法 OpType 取值范围,例如:aicpusd_err("Ts Kernel SomaMemMng OpType [%d] is invalid, valid range is [0-%d].", static_cast<int32_t>(op), OP_TYPE_MAX); 或列出合法枚举值。
语法错误 runtime master src/aicpu_sched/aicpu_schedule/core/operator_kernel/control_flow/operator_kernel_active_entry_stream.cpp 42 aicpusd_info("Begin to active modelId[%u] streamId[%u].", taskContext.modelId, streamId); 文案 "Begin to active modelId[%u] streamId[%u]." 中 to 后接动词应为 activate,active 是形容词,动词形式错误。 改为 "Begin to activate modelId[%u] streamId[%u]."
语法错误 runtime master src/aicpu_sched/aicpu_schedule/core/operator_kernel/control_flow/operator_kernel_active_entry_stream.cpp 95 " aicpusd_info(
""Begin to active drv ts stream, tsId[%u], tsStreamId[%u], modelId[%u], streamId[%u], pid[%u],""
""devId[%u]."",
tsId, streamId, taskContext.modelId, taskContext.streamId, pid, deviceId);" 1) "Begin to active drv ts stream" 中 to 后应为动词 activate,active 词形错误;2) 相邻字符串字面量拼接后生成 "pid[%u],devId[%u]",逗号后缺少空格。 改为 "Begin to activate drv ts stream, ..., pid[%u], " "devId[%u].",在拼接处补空格。
语法错误 runtime master src/aicpu_sched/aicpu_schedule/core/operator_kernel/control_flow/operator_kernel_active_model.cpp 35 aicpusd_info("Begin to active modelId[%u].", *modelIdPtr); 文案 "Begin to active modelId[%u]." 中 to 后接动词应为 activate,active 是形容词,动词形式错误。 改为 "Begin to activate modelId[%u]."
越限错误信息不完整 runtime master src/aicpu_sched/aicpu_schedule/core/operator_kernel/control_flow/operator_kernel_lock_table.cpp 61 aicpusd_err("Invalid lockType[%d].", lockType); 日志输出 Invalid lockType[%d].,仅给出当前非法值,未给出 lockType 的合法取值(上下文可见合法值为 0 和 1),定位者无法得知正确范围。 补充合法取值范围,例如:aicpusd_err("Invalid lockType[%d], valid values are 0(RdLock) or 1(WrLock).", lockType);
日志格式化参数不匹配 runtime master src/aicpu_sched/aicpu_schedule/core/operator_kernel/control_flow/operator_kernel_stream_repeat.cpp 44 aicpusd_err("Model stream repeat failed, model execute failed. modelId=%d.", taskContext.modelId); 格式串使用 modelId=%d,但实参 taskContext.modelId 在同文件其他日志(如 R1、R24 的 modelId[%u])中均为 uint32_t 类型并以 %u 打印,说明该字段为无符号 32 位整数,%d 与无符号参数类型不匹配,属格式化类型不一致,当 modelId 高位置位时输出会为负数、误导排障。 将格式占位符改为 %u:"Model stream repeat failed, model execute failed. modelId=%u.",与 taskContext.modelId 的 uint32_t 类型保持一致。
越限错误信息不完整 runtime master src/aicpu_sched/aicpu_schedule/core/operator_kernel/dequeue/operator_kernel_dequeue_base.cpp 207 aicpusd_err("Mbuf head is error headSize[%u]", headSize); ERROR 日志 "Mbuf head is error headSize[%u]" 表达了 headSize 小于 sizeof(MbufHeadMsg) 的越限场景,只输出了当前 headSize 值,未给出合法取值范围(应不小于 sizeof(MbufHeadMsg)),无法据此判断正确边界。 补充合法范围,例如:aicpusd_err("Mbuf head size[%u] is invalid, should not be less than sizeof(MbufHeadMsg)=%zu.", headSize, sizeof(MbufHeadMsg));
越限错误信息不完整 runtime master src/aicpu_sched/aicpu_schedule/core/operator_kernel/dequeue/operator_kernel_gather_dequeue.cpp 38 aicpusd_err("inputNums or queueIdsAddr or mbufAddrsAddr is invalid"); ERROR 日志 "inputNums or queueIdsAddr or mbufAddrsAddr is invalid" 对应 inputNums==0 或两个地址为 0 的越限检查,既未输出当前实际值(哪个字段为 0、值为多少),也未给出期望值(非 0),无法定位具体是哪个参数非法。 分别输出非法字段的当前值和期望条件,例如:aicpusd_err("Invalid GatherDequeParam: inputNums=%u, queueIdsAddr=%llu, mbufAddrsAddr=%llu, all should be non-zero.", ...);
循环体内打印高频日志 runtime master src/aicpu_sched/aicpu_schedule/core/operator_kernel/dequeue/operator_kernel_gather_dequeue.cpp 62 " aicpusd_info(
""Batch queue is not gathered, modelId[%u], streamId[%u], taskId[%u]."", taskContext.modelId,
taskContext.streamId, kernelTaskInfo.taskID);" 该 INFO 日志位于 while (!DequeAndCheckIfReady(...)) 循环体内,每次迭代未收集完成都会输出同一文案 "Batch queue is not gathered...";当 WaitEvent 未触发等待(needWait 为 false)时循环会立即重试,形成高频重复 INFO 打印。 将循环内的状态日志降为 DEBUG 或限频输出(如每 N 次迭代打印一次),仅在最终失败或退出循环处输出 INFO/ERROR。
循环体内打印高频日志 runtime master src/aicpu_sched/aicpu_schedule/core/operator_kernel/dequeue/operator_kernel_gather_dequeue.cpp 113 aicpusd_info("free the [%zu]th mbuf", i); INFO 日志 "free the [%zu]th mbuf" 位于遍历各输入 mbuf 的正常循环体内,每次迭代输出一条,属于正常流程中的逐迭代高频 INFO 打印。 删除循环内逐条 INFO,改为循环结束后输出一条汇总日志(如释放的 mbuf 总数),或降为 DEBUG 级别。
循环体内打印高频日志 runtime master src/aicpu_sched/aicpu_schedule/core/operator_kernel/dequeue/operator_kernel_gather_dequeue.cpp 126 aicpusd_info("stub mbuf for the [%zu]th input", i); INFO 日志 "stub mbuf for the [%zu]th input" 位于遍历各输入的正常循环体内,每次迭代输出一条,属于逐迭代高频 INFO 打印。 改为循环结束后输出汇总日志,或将该条降为 DEBUG 级别,避免每次迭代打印 INFO。
ERROR关键定位信息缺失 runtime master src/aicpu_sched/aicpu_schedule/core/operator_kernel/dequeue/operator_kernel_gather_dequeue.cpp 145 aicpusd_err("null head"); ERROR 日志仅输出 "null head",缺少失败所在对象上下文(如 modelId、对应的 mbuf 或队列信息)、关键参数和错误码,出现问题时无法定位是哪个模型的哪个流程出现 null head。 补充关键定位信息,例如:aicpusd_err("Failed to get mbuf head, head is null, modelId=%u.", modelId);
循环体内打印高频日志 runtime master src/aicpu_sched/aicpu_schedule/core/operator_kernel/dequeue/operator_kernel_gather_dequeue.cpp 194 aicpusd_info("start [%llu]th dequeue queue[%zu]", loopCnt, queueIndex); INFO 日志 "start [%llu]th dequeue queue[%zu]" 位于逐队列出队的正常循环体内,每次迭代输出一条,属于逐迭代高频 INFO 打印。 删除循环内逐条 INFO 或降为 DEBUG;若需保留进度信息,可在循环外输出队列总数及最终结果。

likedislike