wasm-micro-runtime/test-tools/aot-analyzer
Benbuck Nason 8239dd4aa7
Add wasm_export.h APIs to expose memory type (#3496)
Support to get `wasm_memory_type_t memory_type` from API
`wasm_runtime_get_import_type` and `wasm_runtime_get_export_type`,
and then get shared flag, initial page cout, maximum page count
from the memory_type:
```C
bool
wasm_memory_type_get_shared(const wasm_memory_type_t memory_type);
uint32_t
wasm_memory_type_get_init_page_count(const wasm_memory_type_t memory_type);
uint32_t
wasm_memory_type_get_max_page_count(const wasm_memory_type_t memory_type);
```
2024-06-06 09:20:24 +08:00
..
include Add aot binary analysis tool aot-analyzer (#3379) 2024-05-08 16:31:39 +08:00
src Add wasm_export.h APIs to expose memory type (#3496) 2024-06-06 09:20:24 +08:00
CMakeLists.txt Add aot binary analysis tool aot-analyzer (#3379) 2024-05-08 16:31:39 +08:00
README.md Add aot binary analysis tool aot-analyzer (#3379) 2024-05-08 16:31:39 +08:00

AoT-Analyzer: The AoT Binary analysis tool

Cloning

Clone as normal:

$ git clone 
$ cd aot-analyzer

Building using CMake directly

You'll need CMake. You can then run CMake, the normal way:

$ mkdir build
$ cd build
$ cmake ..
$ cmake --build .

To analyze AoT files with GC feature enabled, you need to enable GC feature when compiling this tool:

$ mkdir build
$ cd build
$ cmake -DWAMR_BUILD_GC=1 ..
$ cmake --build .

Running aot-analyzer

Some examples:

# 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

NOTE: Using -c for file comparison, must ensure that the AoT file is generated based on this Wasm file.

You can use --help to get additional help:

$ ./aot-analyzer --help