File tree 2 files changed +12
-3
lines changed
2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -841,7 +841,7 @@ impl Session {
841
841
842
842
pub fn save_json_results ( & self ) {
843
843
let profiler = self . self_profiling . borrow ( ) ;
844
- profiler. save_results ( ) ;
844
+ profiler. save_results ( & self . opts ) ;
845
845
}
846
846
847
847
pub fn print_perf_stats ( & self ) {
Original file line number Diff line number Diff line change @@ -269,8 +269,17 @@ impl SelfProfiler {
269
269
writeln ! ( lock, "Incremental: {}" , incremental) . unwrap ( ) ;
270
270
}
271
271
272
- pub fn save_results ( & self ) {
273
- fs:: write ( "self_profiler_results.json" , self . data . json ( ) ) . unwrap ( ) ;
272
+ pub fn save_results ( & self , opts : & Options ) {
273
+ let category_data = self . data . json ( ) ;
274
+ let compilation_options = format ! ( "{{ \" optimization_level\" : \" {:?}\" , \" incremental\" : {} }}" ,
275
+ opts. optimize,
276
+ if opts. incremental. is_some( ) { "true" } else { "false" } ) ;
277
+
278
+ let json = format ! ( "{{ \" category_data\" : {}, \" compilation_options\" : {} }}" ,
279
+ category_data,
280
+ compilation_options) ;
281
+
282
+ fs:: write ( "self_profiler_results.json" , json) . unwrap ( ) ;
274
283
}
275
284
276
285
pub fn record_activity < ' a > ( & ' a mut self , category : ProfileCategory ) -> ProfilerActivity < ' a > {
You can’t perform that action at this time.
0 commit comments