Support building executables against OCaml 4.11's instrumented runtime
Nobody has claimed this yet.
- Dominant language
- OCaml
- Stars
- 1.9k
- Forks
- 500
- Avg merge
- 15h 21m
- Merged PRs (30d)
- 277
Description
Hello,
Desired Behavior
OCaml 4.11.0 will ship with a new version of the instrumented runtime.
This allows users to generates tracefiles containing information about the execution of the runtime, mainly GC activity for now.
Building an executable against the instrumented runtime works as follow:
ocamlopt -runtime-variant=i -o program.exe program.ml
It also does work for the bytecode compiler. (and the runtime is also available as ocamlruni.)
Once built, a program has to be started with the OCAML_EVENTLOG_ENABLED=1 environment variable as well to enabled tracing.
I open this feature request. after discussing with @avsm and @kayceesrk about the potential inclusion of a simplified flow for building instrumented targets in dune.
For now, using the flags stanza in dunefiles is enough, but maybe an user could request a target to be built against the instrumented runtime via a shorthand of some sort.
(maybe by allowing building a target.exe.inst/target.bc.inst target? I do not know which approach would be the most desirable.)
Thank you very much in advance for your time, and sorry if I missed providing more information about the expected flow.
I can provide more information on the instrumented runtime if need be, feel free to ask if you have any question.
Engil.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing how Dune's flags stanza invokes ocamlopt and the bytecode compiler, then compare that flow with OCaml 4.11's -runtime-variant=i option and the ocamlruni runtime. The issue is complete when Dune has a decided, documented way to request instrumented native and bytecode targets and those targets can be built and run with OCAML_EVENTLOG_ENABLED=1.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ocaml
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100