From fedcd3792b656feeddaa50b53949a267611f591c Mon Sep 17 00:00:00 2001 From: Bill Thiede Date: Sat, 22 Sep 2018 12:06:08 -0700 Subject: [PATCH] Missed part of commit 78da1c644141e87bb47ae907ef9d80fb926c1965 --- rtiow/src/bin/tracer.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/rtiow/src/bin/tracer.rs b/rtiow/src/bin/tracer.rs index c96adae..b745dcf 100644 --- a/rtiow/src/bin/tracer.rs +++ b/rtiow/src/bin/tracer.rs @@ -25,13 +25,16 @@ fn main() -> Result<(), std::io::Error> { let opt = Opt::from_args(); let scene = opt.model.scene(&opt); fs::create_dir_all(&opt.output)?; - let pprof_path = "pprof.profile"; - if opt.pprof { - PROFILER.lock().unwrap().start(pprof_path).unwrap(); + if let Some(ref pprof_path) = opt.pprof { + PROFILER + .lock() + .unwrap() + .start(pprof_path.to_str().unwrap().as_bytes()) + .unwrap(); } let res = render(scene, &opt.output); - if opt.pprof { - info!("Saving pprof to {}", pprof_path); + if let Some(pprof_path) = opt.pprof { + info!("Saving pprof to {}", pprof_path.to_string_lossy()); PROFILER.lock().unwrap().stop().unwrap(); } let runtime = start.elapsed();