Implement performance profiler and call stack dump, and update toolchain document (#501)

And remove redundant FAST_INTERP macros in wasm_interp_fast.c, and fix wamrc --help wrong line order issue.

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
This commit is contained in:
Wenyong Huang
2021-01-17 23:23:10 -06:00
committed by GitHub
parent 794028a968
commit 240ca2ed46
26 changed files with 752 additions and 109 deletions

View File

@ -281,8 +281,13 @@ typedef struct AOTModuleInstance {
uint32 llvm_stack;
uint32 default_wasm_stack_size;
uint32 __padding;
/* function performance profiling info list */
AOTPointer func_perf_profilings;
/* reserved */
uint32 reserved[11];
uint32 reserved[8];
union {
uint64 _make_it_8_byte_aligned_;
@ -311,6 +316,24 @@ typedef struct AOTTargetInfo {
char arch[16];
} AOTTargetInfo;
typedef struct AOTFuncPerfProfInfo
{
/* total execution time */
uint64 total_exec_time;
/* total execution count */
uint32 total_exec_cnt;
} AOTFuncPerfProfInfo;
/* AOT auxiliary call stack */
typedef struct AOTFrame {
struct AOTFrame *prev_frame;
uint32 func_index;
#if WASM_ENABLE_PERF_PROFILING != 0
uint64 time_started;
AOTFuncPerfProfInfo *func_perf_prof_info;
#endif
} AOTFrame;
/**
* Load a AOT module from aot file buffer
* @param buf the byte buffer which contains the AOT file data
@ -568,6 +591,18 @@ void
aot_get_module_inst_mem_consumption(const AOTModuleInstance *module_inst,
WASMModuleInstMemConsumption *mem_conspn);
bool
aot_alloc_frame(WASMExecEnv *exec_env, uint32 func_index);
void
aot_free_frame(WASMExecEnv *exec_env);
void
aot_dump_call_stack(WASMExecEnv *exec_env);
void
aot_dump_perf_profiling(const AOTModuleInstance *module_inst);
#ifdef __cplusplus
} /* end of extern "C" */
#endif