From 0413e39c8c3bfc455a8099f708bd4a08ec53f556 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 18 Jan 2023 21:30:02 +0900 Subject: [PATCH] add host_call stat --- lib/context.h | 1 + lib/exec.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/lib/context.h b/lib/context.h index a260c18a..8144567f 100644 --- a/lib/context.h +++ b/lib/context.h @@ -132,6 +132,7 @@ enum exec_event { struct exec_stat { uint64_t call; + uint64_t host_call; uint64_t branch; uint64_t branch_goto_else; uint64_t jump_cache_hit; diff --git a/lib/exec.c b/lib/exec.c index 7562219e..b3d191b3 100644 --- a/lib/exec.c +++ b/lib/exec.c @@ -498,6 +498,7 @@ do_call(struct exec_context *ctx, const struct funcinst *finst) { STAT_INC(ctx->stats.call); if (finst->is_host) { + STAT_INC(ctx->stats.host_call); return do_host_call(ctx, finst); } else { return do_wasm_call(ctx, finst); @@ -1079,6 +1080,7 @@ exec_context_print_stats(struct exec_context *ctx) VEC_PRINT_USAGE("frames", &ctx->frames); STAT_PRINT(call); + STAT_PRINT(host_call); STAT_PRINT(branch); STAT_PRINT(branch_goto_else); STAT_PRINT(jump_cache2_hit);