perf profiling: Adjust the calculation of execution time (#3089)
This commit is contained in:
@ -3455,14 +3455,13 @@ llvm_jit_free_frame(WASMExecEnv *exec_env)
|
||||
|
||||
#if WASM_ENABLE_PERF_PROFILING != 0
|
||||
if (frame->function) {
|
||||
frame->function->total_exec_time +=
|
||||
os_time_thread_cputime_us() - frame->time_started;
|
||||
uint64 elapsed = os_time_thread_cputime_us() - frame->time_started;
|
||||
frame->function->total_exec_time += elapsed;
|
||||
frame->function->total_exec_cnt++;
|
||||
|
||||
/* parent function */
|
||||
if (prev_frame)
|
||||
prev_frame->function->children_exec_time =
|
||||
frame->function->total_exec_time;
|
||||
prev_frame->function->children_exec_time += elapsed;
|
||||
}
|
||||
#endif
|
||||
wasm_exec_env_free_wasm_frame(exec_env, frame);
|
||||
|
||||
Reference in New Issue
Block a user