@@ -1700,24 +1700,25 @@ You have to build a stage1 compiler for `{}` first, and then use it to build a s
1700
1700
#[ cfg( feature = "build-metrics" ) ]
1701
1701
self . metrics . enter_step ( & step, self ) ;
1702
1702
1703
+ if self . config . print_step_timings && !self . config . dry_run ( ) {
1704
+ println ! ( "[TIMING:start] {}" , pretty_print_step( & step) ) ;
1705
+ }
1706
+
1703
1707
let ( out, dur) = {
1704
1708
let start = Instant :: now ( ) ;
1705
1709
let zero = Duration :: new ( 0 , 0 ) ;
1706
1710
let parent = self . time_spent_on_dependencies . replace ( zero) ;
1711
+
1707
1712
let out = step. clone ( ) . run ( self ) ;
1708
1713
let dur = start. elapsed ( ) ;
1709
1714
let deps = self . time_spent_on_dependencies . replace ( parent + dur) ;
1710
1715
( out, dur. saturating_sub ( deps) )
1711
1716
} ;
1712
1717
1713
1718
if self . config . print_step_timings && !self . config . dry_run ( ) {
1714
- let step_string = format ! ( "{step:?}" ) ;
1715
- let brace_index = step_string. find ( '{' ) . unwrap_or ( 0 ) ;
1716
- let type_string = type_name :: < S > ( ) ;
1717
1719
println ! (
1718
- "[TIMING] {} {} -- {}.{:03}" ,
1719
- & type_string. strip_prefix( "bootstrap::" ) . unwrap_or( type_string) ,
1720
- & step_string[ brace_index..] ,
1720
+ "[TIMING:end] {} -- {}.{:03}" ,
1721
+ pretty_print_step( & step) ,
1721
1722
dur. as_secs( ) ,
1722
1723
dur. subsec_millis( )
1723
1724
) ;
@@ -1804,6 +1805,17 @@ You have to build a stage1 compiler for `{}` first, and then use it to build a s
1804
1805
}
1805
1806
}
1806
1807
1808
+ fn pretty_print_step < S : Step > ( step : & S ) -> String {
1809
+ let step_dbg_repr = format ! ( "{step:?}" ) ;
1810
+ let brace_index = step_dbg_repr. find ( '{' ) . unwrap_or ( 0 ) ;
1811
+
1812
+ // Normalize step type path to only keep the module and the type name
1813
+ let path = type_name :: < S > ( ) . rsplit ( "::" ) . take ( 2 ) . collect :: < Vec < _ > > ( ) ;
1814
+ let type_string = path. into_iter ( ) . rev ( ) . collect :: < Vec < _ > > ( ) . join ( "::" ) ;
1815
+
1816
+ format ! ( "{type_string} {}" , & step_dbg_repr[ brace_index..] )
1817
+ }
1818
+
1807
1819
impl < ' a > AsRef < ExecutionContext > for Builder < ' a > {
1808
1820
fn as_ref ( & self ) -> & ExecutionContext {
1809
1821
self . exec_ctx ( )
0 commit comments