File tree Expand file tree Collapse file tree 4 files changed +9
-1
lines changed Expand file tree Collapse file tree 4 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -999,6 +999,7 @@ rb_iseq_translate_threaded_code(rb_iseq_t *iseq)
999
999
1000
1000
#if USE_YJIT
1001
1001
rb_yjit_live_iseq_count ++ ;
1002
+ rb_yjit_iseq_alloc_count ++ ;
1002
1003
#endif
1003
1004
1004
1005
return COMPILE_OK ;
Original file line number Diff line number Diff line change 28
28
extern uint64_t rb_yjit_call_threshold ;
29
29
extern uint64_t rb_yjit_cold_threshold ;
30
30
extern uint64_t rb_yjit_live_iseq_count ;
31
+ extern uint64_t rb_yjit_iseq_alloc_count ;
31
32
extern bool rb_yjit_enabled_p ;
32
33
void rb_yjit_incr_counter (const char * counter_name );
33
34
void rb_yjit_invalidate_all_method_lookup_assumptions (void );
Original file line number Diff line number Diff line change @@ -346,6 +346,7 @@ def _print_stats(out: $stderr) # :nodoc:
346
346
out . puts "bindings_set: " + format_number ( 13 , stats [ :binding_set ] )
347
347
out . puts "compilation_failure: " + format_number ( 13 , compilation_failure ) if compilation_failure != 0
348
348
out . puts "live_iseq_count: " + format_number ( 13 , stats [ :live_iseq_count ] )
349
+ out . puts "iseq_alloc_count: " + format_number ( 13 , stats [ :iseq_alloc_count ] )
349
350
out . puts "compiled_iseq_entry: " + format_number ( 13 , stats [ :compiled_iseq_entry ] )
350
351
out . puts "cold_iseq_entry: " + format_number_pct ( 13 , stats [ :cold_iseq_entry ] , stats [ :compiled_iseq_entry ] + stats [ :cold_iseq_entry ] )
351
352
out . puts "compiled_iseq_count: " + format_number ( 13 , stats [ :compiled_iseq_count ] )
Original file line number Diff line number Diff line change @@ -15,10 +15,14 @@ use crate::cruby::*;
15
15
use crate :: options:: * ;
16
16
use crate :: yjit:: yjit_enabled_p;
17
17
18
- /// A running total of how many ISeqs are in the system.
18
+ /// Running total of how many ISeqs are in the system.
19
19
#[ no_mangle]
20
20
pub static mut rb_yjit_live_iseq_count: u64 = 0 ;
21
21
22
+ /// Monotonically increasing total of how many ISEQs were allocated
23
+ #[ no_mangle]
24
+ pub static mut rb_yjit_iseq_alloc_count: u64 = 0 ;
25
+
22
26
/// A middleware to count Rust-allocated bytes as yjit_alloc_size.
23
27
#[ global_allocator]
24
28
static GLOBAL_ALLOCATOR : StatsAlloc = StatsAlloc { alloc_size : AtomicUsize :: new ( 0 ) } ;
@@ -748,6 +752,7 @@ fn rb_yjit_gen_stats_dict(context: bool) -> VALUE {
748
752
hash_aset_usize ! ( hash, "vm_insns_count" , rb_vm_insns_count as usize ) ;
749
753
750
754
hash_aset_usize ! ( hash, "live_iseq_count" , rb_yjit_live_iseq_count as usize ) ;
755
+ hash_aset_usize ! ( hash, "iseq_alloc_count" , rb_yjit_iseq_alloc_count as usize ) ;
751
756
}
752
757
753
758
// If we're not generating stats, put only default counters
You can’t perform that action at this time.
0 commit comments