From d26d3575cab676ade7d0257138a044e22b373e68 Mon Sep 17 00:00:00 2001 From: Maxime Chevalier-Boisvert Date: Tue, 4 Apr 2023 16:41:52 -0400 Subject: YJIT: add stats for ratio of versions per block (#7653) --- yjit/src/core.rs | 5 +++++ yjit/src/stats.rs | 1 + 2 files changed, 6 insertions(+) (limited to 'yjit/src') diff --git a/yjit/src/core.rs b/yjit/src/core.rs index 05e9f85b18..98b9e792c8 100644 --- a/yjit/src/core.rs +++ b/yjit/src/core.rs @@ -1416,6 +1416,11 @@ unsafe fn add_block_version(blockref: BlockRef, cb: &CodeBlock) { let version_list = get_or_create_version_list(block.get_blockid()); + // If this the first block being compiled with this block id + if version_list.len() == 0 { + incr_counter!(compiled_blockid_count); + } + version_list.push(blockref); version_list.shrink_to_fit(); diff --git a/yjit/src/stats.rs b/yjit/src/stats.rs index 6ca19c93f3..0e832dbe71 100644 --- a/yjit/src/stats.rs +++ b/yjit/src/stats.rs @@ -316,6 +316,7 @@ make_counters! { vm_insns_count, compiled_iseq_count, + compiled_blockid_count, compiled_block_count, compiled_branch_count, compilation_failure, -- cgit v1.2.1