@@ -515,7 +515,8 @@ fn generate_cachegrind_diffs(
515515 profile_kinds : & [ ProfileKind ] ,
516516 scenario_kinds : & [ ScenarioKind ] ,
517517 errors : & mut BenchmarkErrors ,
518- ) {
518+ ) -> Vec < PathBuf > {
519+ let mut annotated_diffs = Vec :: new ( ) ;
519520 for benchmark in benchmarks {
520521 for & profile_kind in profile_kinds {
521522 for & scenario_kind in scenario_kinds {
@@ -559,9 +560,12 @@ fn generate_cachegrind_diffs(
559560 eprintln ! ( "collector error: {:?}" , e) ;
560561 continue ;
561562 }
563+
564+ annotated_diffs. push ( cgann) ;
562565 }
563566 }
564567 }
568+ annotated_diffs
565569}
566570
567571/// Demangles symbols in a file using rustfilt and writes result to path.
@@ -1065,7 +1069,7 @@ fn main_result() -> anyhow::Result<i32> {
10651069 }
10661070
10671071 if let Profiler :: Cachegrind = profiler {
1068- generate_cachegrind_diffs (
1072+ let diffs = generate_cachegrind_diffs (
10691073 id1,
10701074 id2,
10711075 & out_dir,
@@ -1074,6 +1078,17 @@ fn main_result() -> anyhow::Result<i32> {
10741078 & scenario_kinds,
10751079 & mut errors,
10761080 ) ;
1081+ if diffs. len ( ) > 1 {
1082+ eprintln ! ( "Diffs:" ) ;
1083+ for diff in diffs {
1084+ eprintln ! ( "{}" , diff. to_string_lossy( ) ) ;
1085+ }
1086+ } else if diffs. len ( ) == 1 {
1087+ let short = out_dir. join ( "cgdiffann-latest" ) ;
1088+ std:: fs:: copy ( & diffs[ 0 ] , & short) . expect ( "copy to short path" ) ;
1089+ eprintln ! ( "Original diff at: {}" , diffs[ 0 ] . to_string_lossy( ) ) ;
1090+ eprintln ! ( "Short path: {}" , short. to_string_lossy( ) ) ;
1091+ }
10771092 }
10781093
10791094 errors. fail_if_nonzero ( ) ?;
0 commit comments