Auto dump mem/perf profiling in execute_main/execute_func (#1157)

Automatically dump memory/performance profiling data in
wasm_application_execute_main and wasm_application_execute_func when
the related feature is enabled.

And remove unused aot_compile_wasm_file func declaration in aot_compiler.h.
This commit is contained in:
Wenyong Huang
2022-05-09 15:19:55 +08:00
committed by GitHub
parent 474f081f56
commit ca4b60b335
2 changed files with 26 additions and 5 deletions

View File

@ -212,6 +212,8 @@ wasm_application_execute_main(WASMModuleInstanceCommon *module_inst, int32 argc,
bool ret;
#if WASM_ENABLE_THREAD_MGR != 0
WASMCluster *cluster;
#endif
#if WASM_ENABLE_THREAD_MGR != 0 || WASM_ENABLE_MEMORY_PROFILING != 0
WASMExecEnv *exec_env;
#endif
@ -224,6 +226,17 @@ wasm_application_execute_main(WASMModuleInstanceCommon *module_inst, int32 argc,
}
#endif
#if WASM_ENABLE_MEMORY_PROFILING != 0
exec_env = wasm_runtime_get_exec_env_singleton(module_inst);
if (exec_env) {
wasm_runtime_dump_mem_consumption(exec_env);
}
#endif
#if WASM_ENABLE_PERF_PROFILING != 0
wasm_runtime_dump_perf_profiling(module_inst);
#endif
return (ret && !wasm_runtime_get_exception(module_inst)) ? true : false;
}
@ -721,6 +734,8 @@ wasm_application_execute_func(WASMModuleInstanceCommon *module_inst,
bool ret;
#if WASM_ENABLE_THREAD_MGR != 0
WASMCluster *cluster;
#endif
#if WASM_ENABLE_THREAD_MGR != 0 || WASM_ENABLE_MEMORY_PROFILING != 0
WASMExecEnv *exec_env;
#endif
@ -733,5 +748,16 @@ wasm_application_execute_func(WASMModuleInstanceCommon *module_inst,
}
#endif
#if WASM_ENABLE_MEMORY_PROFILING != 0
exec_env = wasm_runtime_get_exec_env_singleton(module_inst);
if (exec_env) {
wasm_runtime_dump_mem_consumption(exec_env);
}
#endif
#if WAMR_ENABLE_PERF_PROFILING != 0
wasm_runtime_dump_perf_profiling(module_inst);
#endif
return (ret && !wasm_runtime_get_exception(module_inst)) ? true : false;
}