Skip to content

Commit

Permalink
Pass --serve-files to rr replay with remote traces. (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt authored Aug 3, 2022
1 parent d460fe2 commit 1af7ed8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name = "BugReporting"
uuid = "bcf9a6e7-4020-453c-b88e-690564246bb8"
authors = ["Keno Fischer <[email protected]>",
"Tim Besard <[email protected]>"]
version = "0.2.4"
version = "0.2.5"

[deps]
AWS = "fbe9abb3-538b-5e4e-ba9e-bc94f4f92ebc"
Expand Down
12 changes: 10 additions & 2 deletions src/BugReporting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

2 comments on commit 1af7ed8

@maleadt
Copy link
Member Author

@maleadt maleadt commented on 1af7ed8 Aug 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/65541

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.5 -m "<description of version>" 1af7ed8d50148d77d44c6f1d762791c98eb819a3
git push origin v0.2.5

Please sign in to comment.