Enable AOT linux perf support (#2930)

And refactor the original perf support
- use WAMR_BUILD_LINUX_PERF as the cmake compilation control
- use WASM_ENABLE_LINUX_PERF as the compiler macro
- use `wamrc --enable-linux-perf` to generate aot file which contains fp operations
- use `iwasm --enable-linux-perf` to create perf map for `perf record`
This commit is contained in:
liang.he
2024-01-02 15:58:17 +08:00
committed by GitHub
parent 38019f273a
commit 5c3ad0279a
17 changed files with 208 additions and 36 deletions

View File

@ -65,7 +65,6 @@ typedef struct AOTCompOption {
uint32_t bounds_checks;
uint32_t stack_bounds_checks;
uint32_t segue_flags;
bool linux_perf_support;
char **custom_sections;
uint32_t custom_sections_count;
const char *stack_usage_file;

View File

@ -181,7 +181,7 @@ typedef union MemAllocOption {
struct wasm_config_t {
mem_alloc_type_t mem_alloc_type;
MemAllocOption mem_alloc_option;
bool linux_perf_support;
bool enable_linux_perf;
/*TODO: wasi args*/
};
@ -189,7 +189,7 @@ struct wasm_config_t {
* by default:
* - mem_alloc_type is Alloc_With_System_Allocator
* - mem_alloc_option is all 0
* - linux_perf_support is false
* - enable_linux_perf is false
*/
WASM_API_EXTERN own wasm_config_t* wasm_config_new(void);

View File

@ -172,12 +172,12 @@ typedef struct RuntimeInitArgs {
/**
* If enabled
* - llvm-jit will output a jitdump file for `perf inject`
* - aot. TBD
* - aot will output a perf-${pid}.map for `perf record`
* - fast-jit. TBD
* - multi-tier-jit. TBD
* - interpreter. TBD
*/
bool linux_perf_support;
bool enable_linux_perf;
} RuntimeInitArgs;
#ifndef WASM_VALKIND_T_DEFINED
@ -243,8 +243,8 @@ WASM_RUNTIME_API_EXTERN bool
wasm_runtime_full_init(RuntimeInitArgs *init_args);
/**
* Set the log level. To be called after the runtime is initialized.
*
* Set the log level. To be called after the runtime is initialized.
*
* @param level the log level to set
*/
WASM_RUNTIME_API_EXTERN void