From b9e46de8a69aac61b56f615e4c2896487d2bd590 Mon Sep 17 00:00:00 2001 From: huangtianzhi Date: Thu, 14 Nov 2024 01:14:04 +0800 Subject: [PATCH] Add dump raw heap to binary file Issue: #IB414A Signed-off-by: huangtianzhi --- build/core/gn/BUILD.gn | 3 +++ tooling/agent/heapprofiler_impl.h | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/build/core/gn/BUILD.gn b/build/core/gn/BUILD.gn index 2dc69e0..2d42a12 100644 --- a/build/core/gn/BUILD.gn +++ b/build/core/gn/BUILD.gn @@ -42,7 +42,10 @@ group("unittest_packages") { group("ets_runtime") { deps = [ + "$js_root:js_type_metadata", "$js_root:libark_jsruntime", + "$js_root/ecmascript/dfx/hprof:ark_js_heap_snapshot_tool", + "$js_root/ecmascript/dfx/hprof/rawheap_translate:rawheap_translator", "$js_root/ecmascript/js_vm:ark_js_vm", "$js_root/ecmascript/quick_fix:quick_fix", ] diff --git a/tooling/agent/heapprofiler_impl.h b/tooling/agent/heapprofiler_impl.h index d031475..60bdb9f 100644 --- a/tooling/agent/heapprofiler_impl.h +++ b/tooling/agent/heapprofiler_impl.h @@ -143,6 +143,10 @@ private: frontend_->AddHeapSnapshotChunk(data, size); return true; } + bool WriteBinBlock(char *data, int32_t size) override + { + return WriteChunk(data, size); + } bool Good() override { return frontend_ != nullptr;