!1081 修复hiebpf trace文件解析失败

Merge pull request !1081 from 卢韬/master
This commit is contained in:
openharmony_ci 2023-08-24 06:26:43 +00:00 committed by Gitee
commit 95a9e6b742
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -299,7 +299,7 @@ int BPFEventReceiver::EncodeFSTraceEvent(
item->type_ = static_cast<uint16_t>(cmplt_event->start_event.type);
CHECK_TRUE(strncpy_s(item->typeName_, MAX_TYPE_NAME_LEN,
gFSTraceTypeTable[item->type_].c_str(),
gFSTraceTypeTable[item->type_].size() == EOK),
gFSTraceTypeTable[item->type_].size()) == EOK,
-1, "failed to copy fstrace type name");
CHECK_TRUE(ConvertFSTraceArgsToArray(item->args_, &cmplt_event->start_event) == 0, -1,
"failed to convert fstrace event args");
@ -326,7 +326,7 @@ int BPFEventReceiver::EncodePFTraceEvent(
item->pid_ = cmplt_event->tgid;
item->tid_ = cmplt_event->pid;
CHECK_TRUE(strncpy_s(item->tracerName_, MAX_TRACER_NAME_LEN,
gTracerTable[PFTRACE].c_str(), gTracerTable[PFTRACE].size() == EOK),
gTracerTable[PFTRACE].c_str(), gTracerTable[PFTRACE].size()) == EOK,
-1, "failed to copy pftrace tracer name");
item->stime_ = cmplt_event->start_event.stime;
item->ctime_ = cmplt_event->ctime;