mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-11-23 18:20:04 +00:00
多实例录制CPU profiler过程中,销毁Woker实例,会导致方舟主线程采样崩溃,进程退出。
issues:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I8ADBJ1 Signed-off-by: rentangyu <rentangyu@huawei.com>
This commit is contained in:
parent
5eb60f158a
commit
7e6d93ce5c
@ -563,4 +563,9 @@ bool CpuProfiler::GetBuildNapiStack()
|
||||
{
|
||||
return isBuildNapiStack_.load();
|
||||
}
|
||||
|
||||
bool CpuProfiler::GetOutToFile()
|
||||
{
|
||||
return outToFile_;
|
||||
}
|
||||
} // namespace panda::ecmascript
|
||||
|
@ -93,6 +93,7 @@ public:
|
||||
void RecordCallNapiInfo(const std::string &methodAddr);
|
||||
void SetBuildNapiStack(bool flag);
|
||||
bool GetBuildNapiStack();
|
||||
bool GetOutToFile();
|
||||
explicit CpuProfiler(const EcmaVM *vm, const int interval = CPUPROFILER_DEFAULT_INTERVAL);
|
||||
virtual ~CpuProfiler();
|
||||
|
||||
|
@ -236,8 +236,11 @@ EcmaVM::~EcmaVM()
|
||||
initialized_ = false;
|
||||
#if defined(ECMASCRIPT_SUPPORT_CPUPROFILER)
|
||||
if (thread_->isProfiling_) {
|
||||
DFXJSNApi::StopCpuProfilerForFile(this);
|
||||
DFXJSNApi::StopCpuProfilerForInfo(this);
|
||||
if (profiler_->GetOutToFile()) {
|
||||
DFXJSNApi::StopCpuProfilerForFile(this);
|
||||
} else {
|
||||
DFXJSNApi::StopCpuProfilerForInfo(this);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if defined(ECMASCRIPT_SUPPORT_HEAPPROFILER)
|
||||
|
Loading…
Reference in New Issue
Block a user