Enhancements on wasm function execution time statistic (#2985)
Enhance the statistic of wasm function execution time, or the performance profiling feature: - Add os_time_thread_cputime_us() to get the cputime of a thread, and use it to calculate the execution time of a wasm function - Support the statistic of the children execution time of a function, and dump it in wasm_runtime_dump_perf_profiling - Expose two APIs: wasm_runtime_sum_wasm_exec_time wasm_runtime_get_wasm_func_exec_time And rename os_time_get_boot_microsecond to os_time_get_boot_us.
This commit is contained in:
@ -396,9 +396,8 @@ handle_func_return(JitCompContext *cc, JitBlock *block)
|
||||
#endif
|
||||
|
||||
#if WASM_ENABLE_PERF_PROFILING != 0
|
||||
/* time_end = os_time_get_boot_microsecond() */
|
||||
if (!jit_emit_callnative(cc, os_time_get_boot_microsecond, time_end, NULL,
|
||||
0)) {
|
||||
/* time_end = os_time_get_boot_us() */
|
||||
if (!jit_emit_callnative(cc, os_time_get_boot_us, time_end, NULL, 0)) {
|
||||
return false;
|
||||
}
|
||||
/* time_start = cur_frame->time_started */
|
||||
|
||||
Reference in New Issue
Block a user