Skip to content

Commit

Permalink
add host_call stat
Browse files Browse the repository at this point in the history
  • Loading branch information
yamt committed Jan 18, 2023
1 parent 071e8ed commit 0413e39
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions lib/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 0413e39

Please sign in to comment.