File tree Expand file tree Collapse file tree
kani-compiler/src/codegen_cprover_gotoc/codegen/cache Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,23 +31,25 @@ macro_rules! implement_cache {
3131
3232 impl Drop for $name {
3333 fn drop( & mut self ) {
34- self . print_stats( ) ;
34+ if std:: env:: var( "CACHE_STATS" ) . is_ok( ) {
35+ self . print_stats( ) ;
36+ }
3537 }
3638 }
3739
3840 impl $name {
3941 fn print_stats( & self ) {
40- tracing :: debug !( "\n ***CACHE STATS***" ) ;
42+ println !( "\n ***CACHE STATS***" ) ;
4143 let mut all_stats = Vec :: new( ) ;
4244 $(
4345 let name = std:: any:: type_name:: <$val>( ) ;
4446 let stats: & impl_stats:: stats:: CacheStats = & self . $field_name. 1 ;
45- tracing :: debug !( "{name}: {:?}" , stats) ;
47+ println !( "{name}: {:?}" , stats) ;
4648 all_stats. push( stats) ;
4749 ) *
4850 let ( hits, total) = impl_stats:: stats:: total_hits_and_queries( all_stats. into_iter( ) ) ;
4951 let hit_rate = hits as f64 / total as f64 * 100_f64 ;
50- tracing :: debug !( "TOTAL: {hits} hits / {total} queries ({hit_rate:.2?}%)\n " ) ;
52+ println !( "TOTAL: {hits} hits / {total} queries ({hit_rate:.2?}%)\n " ) ;
5153 }
5254 }
5355
You can’t perform that action at this time.
0 commit comments