@@ -515,7 +515,8 @@ fn generate_cachegrind_diffs(
515
515
profile_kinds : & [ ProfileKind ] ,
516
516
scenario_kinds : & [ ScenarioKind ] ,
517
517
errors : & mut BenchmarkErrors ,
518
- ) {
518
+ ) -> Vec < PathBuf > {
519
+ let mut annotated_diffs = Vec :: new ( ) ;
519
520
for benchmark in benchmarks {
520
521
for & profile_kind in profile_kinds {
521
522
for & scenario_kind in scenario_kinds {
@@ -559,9 +560,12 @@ fn generate_cachegrind_diffs(
559
560
eprintln ! ( "collector error: {:?}" , e) ;
560
561
continue ;
561
562
}
563
+
564
+ annotated_diffs. push ( cgann) ;
562
565
}
563
566
}
564
567
}
568
+ annotated_diffs
565
569
}
566
570
567
571
/// Demangles symbols in a file using rustfilt and writes result to path.
@@ -1065,7 +1069,7 @@ fn main_result() -> anyhow::Result<i32> {
1065
1069
}
1066
1070
1067
1071
if let Profiler :: Cachegrind = profiler {
1068
- generate_cachegrind_diffs (
1072
+ let diffs = generate_cachegrind_diffs (
1069
1073
id1,
1070
1074
id2,
1071
1075
& out_dir,
@@ -1074,6 +1078,17 @@ fn main_result() -> anyhow::Result<i32> {
1074
1078
& scenario_kinds,
1075
1079
& mut errors,
1076
1080
) ;
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
+ }
1077
1092
}
1078
1093
1079
1094
errors. fail_if_nonzero ( ) ?;
0 commit comments