Add aot binary analysis tool aot-analyzer (#3379)
Add aot binary analysis tool aot-analyzer, samples: ```bash # parse example.aot, and print basic information about AoT file $ ./aot-analyzer -i example.aot # parse example.aot, and print the size of text section of the AoT file $ ./aot-analyzer -t example.aot # compare these two files, and show the difference in function size between them $ ./aot-analyzer -c example.aot example.wasm ``` Signed-off-by: ganjing <ganjing@xiaomi.com>
This commit is contained in:
27
test-tools/aot-analyzer/src/wasm_file.cc
Normal file
27
test-tools/aot-analyzer/src/wasm_file.cc
Normal file
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright (C) 2024 Xiaomi Corporation. All rights reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
*/
|
||||
|
||||
#include "wasm_file.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
#include "analyzer_error.h"
|
||||
#include "common.h"
|
||||
|
||||
namespace analyzer {
|
||||
|
||||
WasmFile::WasmFile(const char *file_name)
|
||||
: BinaryFile(file_name)
|
||||
{}
|
||||
|
||||
Result
|
||||
WasmFile::Scan()
|
||||
{
|
||||
WASMModuleMemConsumption mem_conspn = GetMemConsumption();
|
||||
wasm_get_module_mem_consumption((WASMModule *)GetModule(), &mem_conspn);
|
||||
return Result::Ok;
|
||||
}
|
||||
|
||||
} // namespace analyzer
|
||||
Reference in New Issue
Block a user