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 72064ea331ba1d85ce4d0a848d44c0f6ce4d4b29..337de96ec7e25654ff486b644688f1ed39816e3e 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, 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()) 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 }