perf profiling: Adjust the calculation of execution time (#3089)

This commit is contained in:
liang.he
2024-01-26 18:06:21 +08:00
committed by GitHub
parent 9fb5fcc709
commit 99bbad8cdb
4 changed files with 12 additions and 17 deletions

View File

@ -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);