From fbc03019c8134846805c1b09035e71f2c9e5a96e Mon Sep 17 00:00:00 2001 From: tiankaijin Date: Fri, 8 Aug 2025 11:19:43 +0800 Subject: [PATCH 1/2] fix --- .../worker/monitor/profiling/file_manager.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/component/taskd/taskd/go/framework_backend/worker/monitor/profiling/file_manager.go b/component/taskd/taskd/go/framework_backend/worker/monitor/profiling/file_manager.go index 72064ea33..4052cb649 100644 --- a/component/taskd/taskd/go/framework_backend/worker/monitor/profiling/file_manager.go +++ b/component/taskd/taskd/go/framework_backend/worker/monitor/profiling/file_manager.go @@ -49,7 +49,7 @@ func SetDiskUsageUpperLimitMB(upperLimitInMB int) { // SaveProfilingDataIntoFile save current profiling data to file func SaveProfilingDataIntoFile(rank int) error { if len(ProfileRecordsMark) == 0 && len(ProfileRecordsApi) == 0 && len(ProfileRecordsKernel) == 0 { - hwlog.RunLog.Debug("Profiling Records is all empty, will do nothing") + hwlog.RunLog.Info("Profiling Records is all empty, will do nothing") return nil } savePath, err := getCurrentSavePath(rank) @@ -57,24 +57,25 @@ func SaveProfilingDataIntoFile(rank int) error { hwlog.RunLog.Errorf("failed to get profiling saving path, err: %s", err.Error()) return err } + hwlog.RunLog.Infof("profdata save path: %v", savePath) newestFileName, err := getNewestFileName(savePath) if err != nil { hwlog.RunLog.Errorf("failed to get newest file to write profiling data,err: %s", err.Error()) return fmt.Errorf("failed to get newest file to write profiling data,err: %s", err.Error()) } fileName := path.Join(savePath, newestFileName) - hwlog.RunLog.Debugf("rank:%v,the save fileName is %s", GlobalRankId, fileName) + hwlog.RunLog.Infof("rank:%v,the save fileName is %s", GlobalRankId, fileName) file, err := os.OpenFile(fileName, os.O_WRONLY|os.O_APPEND|os.O_CREATE, constant.ProfilingFileMode) if err != nil { hwlog.RunLog.Errorf("failed to open save file, err:%s", err) return err } defer file.Close() - hwlog.RunLog.Debugf("rank:%v,start to write profiling data", GlobalRankId) + hwlog.RunLog.Infof("rank:%v,start to write profiling data", GlobalRankId) if err = saveProfileFile(file); err != nil { return err } - hwlog.RunLog.Debugf("finished write profiling file for rank:%d", rank) + hwlog.RunLog.Infof("finished write profiling file for rank:%d", rank) return nil } @@ -125,14 +126,14 @@ func isFileOver10MB(filePath string) (bool, error) { func saveProfileFile(file *os.File) error { // marshal all profilingRecords to json - hwlog.RunLog.Debugf("rank:%v,will stat to save file", GlobalRankId) recordsBytes := writeToBytes() + hwlog.RunLog.Infof("rank:%v,will start to save file, bytesLength=%v", GlobalRankId, recordsBytes) hwlog.RunLog.Debugf("rank:%v, finished to unmarsh marker to string at:%v", GlobalRankId, time.Now()) if err := writeLongStringToFileWithBuffer(file, recordsBytes); err != nil { hwlog.RunLog.Errorf("Error writing to file: %s", err.Error()) return err } - hwlog.RunLog.Debugf("Data successfully written to %s, will try to rename file to indicate wrote", file.Name()) + hwlog.RunLog.Infof("Data successfully written to %s, will try to rename file to indicate wrote", file.Name()) return nil } -- Gitee From 5e404c8f949b033d9c3c22a71ebf44c59cb00956 Mon Sep 17 00:00:00 2001 From: tiankaijin Date: Fri, 8 Aug 2025 11:20:46 +0800 Subject: [PATCH 2/2] fix --- .../framework_backend/worker/monitor/profiling/file_manager.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/component/taskd/taskd/go/framework_backend/worker/monitor/profiling/file_manager.go b/component/taskd/taskd/go/framework_backend/worker/monitor/profiling/file_manager.go index 4052cb649..337de96ec 100644 --- a/component/taskd/taskd/go/framework_backend/worker/monitor/profiling/file_manager.go +++ b/component/taskd/taskd/go/framework_backend/worker/monitor/profiling/file_manager.go @@ -127,7 +127,7 @@ func isFileOver10MB(filePath string) (bool, error) { func saveProfileFile(file *os.File) error { // marshal all profilingRecords to json recordsBytes := writeToBytes() - hwlog.RunLog.Infof("rank:%v,will start to save file, bytesLength=%v", GlobalRankId, recordsBytes) + hwlog.RunLog.Infof("rank:%v,will start to save file, bytesLength=%v", GlobalRankId, len(recordsBytes)) hwlog.RunLog.Debugf("rank:%v, finished to unmarsh marker to string at:%v", GlobalRankId, time.Now()) if err := writeLongStringToFileWithBuffer(file, recordsBytes); err != nil { hwlog.RunLog.Errorf("Error writing to file: %s", err.Error()) -- Gitee