已合并
fix: 移除 memLeakHasData_ 变量修复 native leaks 文件缺失问题 #3483
gan-chuantao创建于 29 天前
fix: 移除 memLeakHasData_ 变量修复 native leaks 文件缺失问题 #3483
已合并
共 2 个文件变更+1-3
| @@ -319,7 +319,6 @@ private: | |||
| 319 | std::string memLeakFileName_; | 319 | std::string memLeakFileName_; |
| 320 | std::string fileCacheDir_ = "/data/log/hiprofiler/"; | 320 | std::string fileCacheDir_ = "/data/log/hiprofiler/"; |
| 321 | std::atomic_bool memLeakDumpDone_ {true}; | 321 | std::atomic_bool memLeakDumpDone_ {true}; |
| 322 | - std::atomic_bool memLeakHasData_ {false}; | ||
| 323 | std::string simplifiedNmd_; | 322 | std::string simplifiedNmd_; |
| 324 | SemaphorePtr nmdSemaphore_{nullptr}; | 323 | SemaphorePtr nmdSemaphore_{nullptr}; |
| 325 | bool shouldSkipGlobalFreed_ = false; | 324 | bool shouldSkipGlobalFreed_ = false; |
| @@ -1457,7 +1457,6 @@ void HookManager::DumpMemLeakInfo() | |||
| 1457 | memLeakDumpDone_ = true; | 1457 | memLeakDumpDone_ = true; |
| 1458 | return; | 1458 | return; |
| 1459 | } | 1459 | } |
| 1460 | - memLeakHasData_ = true; | ||
| 1461 | if (tempMemLeakFd_ < 0) { | 1460 | if (tempMemLeakFd_ < 0) { |
| 1462 | PROFILER_LOG_ERROR(LOG_CORE, "DumpMemLeakInfo tmpMemLeakFd_ err"); | 1461 | PROFILER_LOG_ERROR(LOG_CORE, "DumpMemLeakInfo tmpMemLeakFd_ err"); |
| 1463 | memLeakDumpDone_ = true; | 1462 | memLeakDumpDone_ = true; |
| @@ -1488,7 +1487,7 @@ bool HookManager::HandleMemLeakDone() | |||
| 1488 | 1487 | ||
| 1489 | void HookManager::WaitMemLeakDoneIfNeeded() | 1488 | void HookManager::WaitMemLeakDoneIfNeeded() |
| 1490 | { | 1489 | { |
| 1491 | - if (!hookConfig_.native_orphansnapshots_enable() || memLeakDumpDone_.load() || !memLeakHasData_.load()) { | 1490 | + if (!hookConfig_.native_orphansnapshots_enable() || memLeakDumpDone_.load()) { |
| 1492 | return; | 1491 | return; |
| 1493 | } | 1492 | } |
| 1494 | uint32_t waitedMs = 0; | 1493 | uint32_t waitedMs = 0; |