File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 1+ Update the README usage section to mention --format option for the native recorder (json or binary) and use of -- to separate tracer options from program arguments, showing example invocations with these options
Original file line number Diff line number Diff line change @@ -36,19 +36,28 @@ recorder.flush_trace(Dir.pwd)
3636you can currently use it directly with
3737
3838``` bash
39- ruby gems/codetracer-pure-ruby-recorder/bin/codetracer-pure-ruby-recorder [--out-dir DIR] < path to ruby file>
39+ ruby gems/codetracer-pure-ruby-recorder/bin/codetracer-pure-ruby-recorder [--out-dir DIR] < path to ruby file> [-- < program args > ]
4040# produces several trace json files in DIR,
4141# or in `$CODETRACER_RUBY_RECORDER_OUT_DIR` if DIR is not provided.
4242# Defaults to the current directory.
43+ # Use `--` to stop option parsing and pass arguments to the program.
4344# Pass --help to list all options.
4445```
4546
4647You can also invoke a lightweight CLI that loads the native tracer extension
4748directly:
4849
4950``` bash
50- ruby gems/codetracer-ruby-recorder/bin/codetracer-ruby-recorder [--out-dir DIR] < path to ruby file>
51+ ruby gems/codetracer-ruby-recorder/bin/codetracer-ruby-recorder [--out-dir DIR] [--format json | binary] < path to ruby file> [-- < program args > ]
5152# Uses DIR or `$CODETRACER_RUBY_RECORDER_OUT_DIR` to choose where traces are saved.
53+ # `--format` selects the trace format (`json` or `binary`).
54+ # Use `--` to pass arguments to the traced program.
55+ ```
56+
57+ Example recording a binary trace while passing arguments to the program:
58+
59+ ``` bash
60+ ruby gems/codetracer-ruby-recorder/bin/codetracer-ruby-recorder --format=binary --out-dir traces examples/runtime_code_execution.rb -- 2
5261```
5362
5463however you probably want to use it in combination with CodeTracer, which would be released soon.
You can’t perform that action at this time.
0 commit comments