Skip to content

Commit 868d29c

Browse files
committed
JT: support passing arguments straight to seafoam
* For example `-- --out graph.svg`.
1 parent 4fc8960 commit 868d29c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tool/jt.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,7 @@ def help
826826
Ruby and cache the result, such as benchmark bench/mri/bm_vm1_not.rb --cache
827827
jt benchmark bench/mri/bm_vm1_not.rb --use-cache
828828
jt profile profiles an application, including the TruffleRuby runtime, and generates a flamegraph
829-
jt graph [ruby options] [--method Object#foo] [--watch] [--no-simplify] file.rb
829+
jt graph [ruby options] [--method Object#foo] [--watch] [--no-simplify] file.rb [-- seafoam options]
830830
render a graph of Object#foo within file.rb
831831
--describe describe the shape of the graph (linear, branches, loops, calls, deopts)
832832
jt igv launches IdealGraphVisualizer
@@ -2045,6 +2045,7 @@ def graph(*args)
20452045
simplify = true
20462046
describe = false
20472047
json = false
2048+
seafoam_args = []
20482049

20492050
vm_args, remaining_args, _parsed_options = ruby_options({}, args)
20502051
args = remaining_args
@@ -2064,7 +2065,8 @@ def graph(*args)
20642065
when '--describe'
20652066
describe = true
20662067
when '--'
2067-
raise
2068+
seafoam_args = args.dup
2069+
args.clear
20682070
when /^-/
20692071
vm_args << arg
20702072
else
@@ -2132,7 +2134,7 @@ def graph(*args)
21322134

21332135
json_args = json ? %w[--json] : []
21342136
action = describe ? 'describe' : 'render'
2135-
run_gem_test_pack_gem_or_install('seafoam', SEAFOAM_VERSION, *json_args, "#{graph}:#{n}", action)
2137+
run_gem_test_pack_gem_or_install('seafoam', SEAFOAM_VERSION, *json_args, "#{graph}:#{n}", action, *seafoam_args)
21362138

21372139
break unless watch
21382140
puts # newline between runs

0 commit comments

Comments
 (0)