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:
32
test-tools/aot-analyzer/include/aot_file.h
Normal file
32
test-tools/aot-analyzer/include/aot_file.h
Normal file
@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright (C) 2024 Xiaomi Corporation. All rights reserved.
|
||||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
*/
|
||||
|
||||
#ifndef AOT_FILE_H_
|
||||
#define AOT_FILE_H_
|
||||
|
||||
#include "binary_file.h"
|
||||
|
||||
namespace analyzer {
|
||||
|
||||
class AoTFile : public BinaryFile
|
||||
{
|
||||
public:
|
||||
AoTFile(const char *file_name);
|
||||
|
||||
Result Scan();
|
||||
|
||||
Result ParseTargetInfo();
|
||||
AOTTargetInfo GetTargetInfo();
|
||||
|
||||
std::string GetBinTypeName(uint16_t bin_type);
|
||||
std::string GetExectuionTypeName(uint16_t e_type);
|
||||
std::string GetExectuionMachineName(uint16_t e_machine);
|
||||
|
||||
private:
|
||||
AOTTargetInfo target_info_;
|
||||
};
|
||||
|
||||
} // namespace analyzer
|
||||
#endif
|
||||
Reference in New Issue
Block a user