Skip to content

Commit 2ba18f3

Browse files
committed
DO NOT MERGE - Force self-profiler on for perf run
1 parent f49dea4 commit 2ba18f3

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/librustc/session/config.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1397,7 +1397,7 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
13971397
"don't interleave execution of lints; allows benchmarking individual lints"),
13981398
crate_attr: Vec<String> = (Vec::new(), parse_string_push, [TRACKED],
13991399
"inject the given attribute in the crate"),
1400-
self_profile: bool = (false, parse_bool, [UNTRACKED],
1400+
self_profile: bool = (true, parse_bool, [UNTRACKED],
14011401
"run the self profiler and output the raw event data"),
14021402
emit_stack_sizes: bool = (false, parse_bool, [UNTRACKED],
14031403
"emits a section containing stack size metadata"),

src/librustc/util/profiling.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,12 @@ impl SelfProfiler {
187187
let filename =
188188
format!("{}.profile_events.json", opts.crate_name.clone().unwrap_or_default());
189189

190-
let mut file = BufWriter::new(fs::File::create(filename).unwrap());
190+
let mut file =
191+
if let Ok(file) = fs::File::create(filename) {
192+
BufWriter::new(file)
193+
} else {
194+
return;
195+
};
191196

192197
let threads: Vec<_> =
193198
self.events

0 commit comments

Comments
 (0)