From 1af7ed8d50148d77d44c6f1d762791c98eb819a3 Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Wed, 3 Aug 2022 12:46:37 +0200 Subject: [PATCH] Pass --serve-files to rr replay with remote traces. (#83) --- Project.toml | 2 +- src/BugReporting.jl | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Project.toml b/Project.toml index 352dd9a..407bde5 100644 --- a/Project.toml +++ b/Project.toml @@ -2,7 +2,7 @@ name = "BugReporting" uuid = "bcf9a6e7-4020-453c-b88e-690564246bb8" authors = ["Keno Fischer ", "Tim Besard "] -version = "0.2.4" +version = "0.2.5" [deps] AWS = "fbe9abb3-538b-5e4e-ba9e-bc94f4f92ebc" diff --git a/src/BugReporting.jl b/src/BugReporting.jl index 95e1c78..392d35b 100644 --- a/src/BugReporting.jl +++ b/src/BugReporting.jl @@ -284,12 +284,17 @@ function get_sourcecode(commit) return dir end -function replay(trace_url=default_rr_trace_dir(); gdb_commands=[], gdb_flags=``) +function replay(trace_url=default_rr_trace_dir(); gdb_commands=[], gdb_flags=``, + rr_replay_flags=``) + # download remote traces if startswith(trace_url, "s3://") trace_url = string("https://s3.amazonaws.com/julialang-dumps/", trace_url[6:end]) end if startswith(trace_url, "http://") || startswith(trace_url, "https://") trace_url = download_rr_trace(trace_url) + rr_replay_flags = `$rr_replay_flags --serve-files` + # for remote traces, we assume it originated on a different system, so we need to + # tell rr to serve files as it's unlikely they will be available locally. end # If it's a file, try to decompress it @@ -316,6 +321,7 @@ function replay(trace_url=default_rr_trace_dir(); gdb_commands=[], gdb_flags=``) metadata = nothing end + # determine GDB arguments gdb_args = `$gdb_flags` if metadata !== nothing # standard library sources are part of the trace @@ -349,12 +355,14 @@ function replay(trace_url=default_rr_trace_dir(); gdb_commands=[], gdb_flags=``) gdb_args = `$gdb_args -ex "$gdb_command"` end + # replay with rr proc = rr() do rr_path gdb() do gdb_path - run(`$(rr_path) replay -d $(gdb_path) $trace_dir -- $gdb_args`) + run(`$rr_path replay $rr_replay_flags -d $gdb_path $trace_dir -- $gdb_args`) end end + # clean-up if @isdefined(source_code) && source_code !== nothing rm(source_code; recursive=true) end