Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from CTF to OCaml 5.1 runtime events #635

Merged
merged 1 commit into from
Oct 26, 2023

Conversation

talex5
Copy link
Collaborator

@talex5 talex5 commented Oct 24, 2023

This is a minimal initial version, which mostly keeps the same set of events as before.

The new eio.runtime_events library defines the events and their types. lib_eio/core/trace.ml now uses this instead of using CTF.

examples/trace/main.ml shows how to subscribe to events.

One slight difference is that current_thread has gone. It is now up to the reader to remember which thread was active. In a few places this meant recording e.g. reading a promise at the point where the fiber is resumed, not when it is enqueued.

Ctx_unix is gone. Eio tracing is now enabled whenever OCaml tracing is.

This is based on @TheLortex's #554 PR, but stripped down to make reviewing easier. The main changes relative to that PR are:

  • eio.runtime_events exposes a typed API for reading events, rather than exposing the types and events directly.
  • There is an example showing how to use the tracing.
  • IDs are now 64-bits.
  • Unused types and functions have been removed.
  • Tracing_common is gone.
  • Eio tracing is now on whenever OCaml tracing is on.

Missing features from that PR can be added in follow-on PRs.

@talex5 talex5 added the enhancement New feature or request label Oct 24, 2023
@talex5 talex5 force-pushed the trace branch 2 times, most recently from e32cbdb to 3cf5d2c Compare October 25, 2023 11:43
This is a minimal initial version, which mostly keeps the same set of
events as before.

The new `eio.runtime_events` library defines the events and their types.
`lib_eio/core/trace.ml` now uses this instead of using CTF.

`examples/trace/main.ml` shows how to subscribe to events.

One slight difference is that `current_thread` has gone. It is now up to
the reader to remember which thread was active. In a few places this
meant recording e.g. reading a promise at the point where the fiber is
resumed, not when it is enqueued.

`Ctx_unix` is gone. Eio tracing is automatically enabled whenever OCaml
tracing is.

Co-authored-by: Thomas Leonard <talex5@gmail.com>
Co-authored-by: Patrick Ferris <patrick@sirref.org>
@talex5 talex5 merged commit 6e6ae31 into ocaml-multicore:main Oct 26, 2023
4 of 5 checks passed
@talex5 talex5 deleted the trace branch October 26, 2023 14:07
@talex5
Copy link
Collaborator Author

talex5 commented Oct 31, 2023

Note: the read-resoved benchmark got slower with this PR (from 10ns to 30ns on the benchmark machine). Probably doesn't really matter, but might be good to expose the ring_is_active C function so we can check for tracing being disabled earlier.

talex5 added a commit to talex5/opam-repository that referenced this pull request Nov 2, 2023
CHANGES:

New features / API changes:

- Add `Flow.read_all` (@SGrondin ocaml-multicore/eio#596, reviewed by @talex5 @rbjorklin).

- Add `Path.stat` (@patricoferris @talex5 @avsm ocaml-multicore/eio#617 ocaml-multicore/eio#618 ocaml-multicore/eio#624 ocaml-multicore/eio#620, reviewed by @SGrondin).

- Add `Path.rmtree` (@talex5 ocaml-multicore/eio#627 ocaml-multicore/eio#628, reviewed by @SGrondin).

- Add `Path.mkdirs` and `Path.split` (@patricoferris @talex5 ocaml-multicore/eio#625).

- Add `Eio.File.{seek,sync,truncate}` (@talex5 ocaml-multicore/eio#626).

- Add `Eio.Path.{kind,is_file,is_directory}` (@patricoferris @talex5 ocaml-multicore/eio#623, reviewed by @avsm).

- Switch from CTF to OCaml 5.1 runtime events (@TheLortex @patricoferris @talex5 ocaml-multicore/eio#634 ocaml-multicore/eio#635, reviewed by @avsm).
  This is a minimal initial version.

Documentation:

- Document `File.Stat` record fields (@avsm @talex5 ocaml-multicore/eio#621).

- Update README section about `env` (@talex5 ocaml-multicore/eio#614, reported by @jonsterling).

Build and test changes:

- Add `File.stat` benchmark (@talex5 ocaml-multicore/eio#616).

- Add `Path.stat` benchmark (@patricoferris @talex5 ocaml-multicore/eio#630).

- eio_linux: mark as only available on Linux (@talex5 ocaml-multicore/eio#629).

- Make MDX tests idempotent (@SGrondin ocaml-multicore/eio#601, reviewed by @talex5).

- Allow trailing whitespace in CHANGES.md (@talex5 ocaml-multicore/eio#632).

- Update minimum OCaml version to 5.1 (@talex5 ocaml-multicore/eio#631).

- Generate prototypes for C stubs from ml files (@talex5 ocaml-multicore/eio#615).

- Don't try to compile uring support on centos 7 (@talex5 ocaml-multicore/eio#638, reported by @zenfey).
talex5 added a commit to talex5/opam-repository that referenced this pull request Nov 2, 2023
CHANGES:

New features / API changes:

- Add `Flow.read_all` (@SGrondin ocaml-multicore/eio#596, reviewed by @talex5 @rbjorklin).

- Add `Path.stat` (@patricoferris @talex5 @avsm ocaml-multicore/eio#617 ocaml-multicore/eio#618 ocaml-multicore/eio#624 ocaml-multicore/eio#620, reviewed by @SGrondin).

- Add `Path.rmtree` (@talex5 ocaml-multicore/eio#627 ocaml-multicore/eio#628, reviewed by @SGrondin).

- Add `Path.mkdirs` and `Path.split` (@patricoferris @talex5 ocaml-multicore/eio#625).

- Add `Eio.File.{seek,sync,truncate}` (@talex5 ocaml-multicore/eio#626).

- Add `Eio.Path.{kind,is_file,is_directory}` (@patricoferris @talex5 ocaml-multicore/eio#623, reviewed by @avsm).

- Switch from CTF to OCaml 5.1 runtime events (@TheLortex @patricoferris @talex5 ocaml-multicore/eio#634 ocaml-multicore/eio#635, reviewed by @avsm).
  This is a minimal initial version.

Documentation:

- Document `File.Stat` record fields (@avsm @talex5 ocaml-multicore/eio#621).

- Update README section about `env` (@talex5 ocaml-multicore/eio#614, reported by @jonsterling).

Build and test changes:

- Add `File.stat` benchmark (@talex5 ocaml-multicore/eio#616).

- Add `Path.stat` benchmark (@patricoferris @talex5 ocaml-multicore/eio#630).

- eio_linux: mark as only available on Linux (@talex5 ocaml-multicore/eio#629).

- Make MDX tests idempotent (@SGrondin ocaml-multicore/eio#601, reviewed by @talex5).

- Allow trailing whitespace in CHANGES.md (@talex5 ocaml-multicore/eio#632).

- Update minimum OCaml version to 5.1 (@talex5 ocaml-multicore/eio#631).

- Generate prototypes for C stubs from ml files (@talex5 ocaml-multicore/eio#615).

- Don't try to compile uring support on centos 7 (@talex5 ocaml-multicore/eio#638, reported by @zenfey).
nberth pushed a commit to nberth/opam-repository that referenced this pull request Jun 18, 2024
CHANGES:

New features / API changes:

- Add `Flow.read_all` (@SGrondin ocaml-multicore/eio#596, reviewed by @talex5 @rbjorklin).

- Add `Path.stat` (@patricoferris @talex5 @avsm ocaml-multicore/eio#617 ocaml-multicore/eio#618 ocaml-multicore/eio#624 ocaml-multicore/eio#620, reviewed by @SGrondin).

- Add `Path.rmtree` (@talex5 ocaml-multicore/eio#627 ocaml-multicore/eio#628, reviewed by @SGrondin).

- Add `Path.mkdirs` and `Path.split` (@patricoferris @talex5 ocaml-multicore/eio#625).

- Add `Eio.File.{seek,sync,truncate}` (@talex5 ocaml-multicore/eio#626).

- Add `Eio.Path.{kind,is_file,is_directory}` (@patricoferris @talex5 ocaml-multicore/eio#623, reviewed by @avsm).

- Switch from CTF to OCaml 5.1 runtime events (@TheLortex @patricoferris @talex5 ocaml-multicore/eio#634 ocaml-multicore/eio#635, reviewed by @avsm).
  This is a minimal initial version.

Documentation:

- Document `File.Stat` record fields (@avsm @talex5 ocaml-multicore/eio#621).

- Update README section about `env` (@talex5 ocaml-multicore/eio#614, reported by @jonsterling).

Build and test changes:

- Add `File.stat` benchmark (@talex5 ocaml-multicore/eio#616).

- Add `Path.stat` benchmark (@patricoferris @talex5 ocaml-multicore/eio#630).

- eio_linux: mark as only available on Linux (@talex5 ocaml-multicore/eio#629).

- Make MDX tests idempotent (@SGrondin ocaml-multicore/eio#601, reviewed by @talex5).

- Allow trailing whitespace in CHANGES.md (@talex5 ocaml-multicore/eio#632).

- Update minimum OCaml version to 5.1 (@talex5 ocaml-multicore/eio#631).

- Generate prototypes for C stubs from ml files (@talex5 ocaml-multicore/eio#615).

- Don't try to compile uring support on centos 7 (@talex5 ocaml-multicore/eio#638, reported by @zenfey).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant