mirror of
https://github.com/openharmony/ark_js_runtime.git
synced 2026-08-26 18:06:39 -04:00
Change the range of dump interface
Signed-off-by: xiongluo <xiongluo@huawei.com>
This commit is contained in:
@@ -54,9 +54,10 @@ void DFXJSNApi::DumpHeapSnapshot(EcmaVM *vm, int dumpFormat, Stream *stream, Pro
|
||||
ecmascript::HeapProfilerInterface::Destroy(vm);
|
||||
}
|
||||
|
||||
#if defined(ENABLE_DUMP_IN_FAULTLOG)
|
||||
void DFXJSNApi::DumpHeapSnapshot(EcmaVM *vm, int dumpFormat, bool isVmMode, bool isPrivate)
|
||||
void DFXJSNApi::DumpHeapSnapshot([[maybe_unused]] EcmaVM *vm, [[maybe_unused]] int dumpFormat,
|
||||
[[maybe_unused]] bool isVmMode, [[maybe_unused]] bool isPrivate)
|
||||
{
|
||||
#if defined(ENABLE_DUMP_IN_FAULTLOG)
|
||||
// Write in faultlog for heap leak.
|
||||
int32_t fd = RequestFileDescriptor(static_cast<int32_t>(FaultLoggerType::JS_HEAP_SNAPSHOT));
|
||||
if (fd < 0) {
|
||||
@@ -66,8 +67,8 @@ void DFXJSNApi::DumpHeapSnapshot(EcmaVM *vm, int dumpFormat, bool isVmMode, bool
|
||||
FileDescriptorStream stream(fd);
|
||||
DumpHeapSnapshot(vm, dumpFormat, &stream, nullptr, isVmMode, isPrivate);
|
||||
close(fd);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool DFXJSNApi::BuildNativeAndJsBackStackTrace(EcmaVM *vm, std::string &stackTraceStr)
|
||||
{
|
||||
|
||||
@@ -44,10 +44,7 @@ public:
|
||||
bool isPrivate = false);
|
||||
static void DumpHeapSnapshot(EcmaVM *vm, int dumpFormat, Stream *stream, Progress *progress = nullptr,
|
||||
bool isVmMode = true, bool isPrivate = false);
|
||||
|
||||
#if defined(ENABLE_DUMP_IN_FAULTLOG)
|
||||
static void DumpHeapSnapshot(EcmaVM *vm, int dumpFormat, bool isVmMode = true, bool isPrivate = false);
|
||||
#endif
|
||||
|
||||
static bool BuildNativeAndJsBackStackTrace(EcmaVM *vm, std::string &stackTraceStr);
|
||||
static bool StartHeapTracking(EcmaVM *vm, double timeInterval, bool isVmMode = true);
|
||||
|
||||
Reference in New Issue
Block a user