Change the range of dump interface

Signed-off-by: xiongluo <xiongluo@huawei.com>
This commit is contained in:
xiongluo
2022-05-18 15:21:23 -10:00
parent 5122d18dca
commit 8e463ec9c1
2 changed files with 4 additions and 6 deletions
+4 -3
View File
@@ -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)
{
-3
View File
@@ -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);