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

Integrate Eio's CTF tracing with OCaml's tracing #138

Closed
talex5 opened this issue Jan 7, 2022 · 5 comments
Closed

Integrate Eio's CTF tracing with OCaml's tracing #138

talex5 opened this issue Jan 7, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@talex5
Copy link
Collaborator

talex5 commented Jan 7, 2022

Eio's Ctf module provides a ring-buffer for storing trace events. Currently, this only works for a single domain. OCaml has its own CTF-based eventlog system (https://ocaml.org/manual/instrumented-runtime.html) and we should probably just use that somehow. It might not currently support user-defined events. There's also a proposal to replace it with eventring (ocaml-multicore/ocaml-multicore#793), which says:

This implementation is designed to be open for extension to user tracing events in the future, as well as integration with statmemprof (e.g continuous allocation profiling).

/cc @sadiqj

@talex5 talex5 added the enhancement New feature or request label Jan 7, 2022
@talex5
Copy link
Collaborator Author

talex5 commented Jan 7, 2022

@sadiqj and I discussed a couple of ways of doing this today:

  • eio could watch eventring to get GC events and then copy them to its own ring, or
  • eventring could allow users to add custom events and we store everything there.

The second option seems better, because:

  • Having a single ring means events get recorded in the right order.
  • It saves us a lot of code managing CTF buffers.
  • It allows other tools to add extra events of their own.

The default eventring size is quite small (64KB) but is configurable. Eio uses 1MB by default.

@TheLortex
Copy link
Contributor

Custom event rings PR: ocaml/ocaml#11474
We should make sure that it fits Eio's requirements.

@patricoferris
Copy link
Collaborator

Had a quick go at using custom runtime events: patricoferris@671a5b4#diff-b48e492abda9e349dd9f1df758814b45a11c5a63fcd89d65d09dc0bb7194125b -- looks good @TheLortex, but I didn't test it fully.

(note: I had to do some questionable changes to your OCaml PR to get it running on macOS)

@talex5
Copy link
Collaborator Author

talex5 commented Jun 20, 2023

PR: #554

@talex5
Copy link
Collaborator Author

talex5 commented Nov 20, 2023

This was done in #635.

@talex5 talex5 closed this as completed Nov 20, 2023
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

No branches or pull requests

3 participants