Skip to content

Commit 8985a41

Browse files
runtime-events as optional dep (to be compatible with 4.14)
1 parent 30e4f4d commit 8985a41

File tree

18 files changed

+110
-34
lines changed

18 files changed

+110
-34
lines changed

dune-project

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,15 @@
6262
base-unix
6363
(lwt (>= 6))))
6464

65+
(package
66+
(name lwt_runtime_events)
67+
(version 6.0.0~beta00)
68+
(synopsis "Emit runtime events to trace the execution of Lwt programs")
69+
(authors "Raphaël Proust")
70+
(depends
71+
(ocaml (>= 5.1))
72+
))
73+
6574
(package
6675
(name lwt)
6776
(version 6.0.0~beta00)
@@ -76,10 +85,10 @@ a single thread by default. This reduces the need for locks or other
7685
synchronization primitives. Code can be run in parallel on an opt-in basis.
7786
")
7887
(depends
79-
(ocaml (>= 5.1))
88+
(ocaml (>= 4.14))
8089
(cppo (and :build (>= 1.1)))
8190
(ocamlfind (and :dev (>= 1.7.3-1)))
8291
(odoc (and :with-doc (>= 2.3)))
8392
dune-configurator
8493
ocplib-endian)
85-
(depopts base-threads base-unix conf-libev))
94+
(depopts base-threads base-unix conf-libev lwt_runtime_events))

lwt.opam

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ doc: "https://ocsigen.org/lwt"
2222
bug-reports: "https://github.com/ocsigen/lwt/issues"
2323
depends: [
2424
"dune" {>= "3.15"}
25-
"ocaml" {>= "5.1"}
25+
"ocaml" {>= "4.14"}
2626
"cppo" {build & >= "1.1"}
2727
"ocamlfind" {dev & >= "1.7.3-1"}
2828
"odoc" {with-doc & >= "2.3"}
2929
"dune-configurator"
3030
"ocplib-endian"
3131
]
32-
depopts: ["base-threads" "base-unix" "conf-libev"]
32+
depopts: ["base-threads" "base-unix" "conf-libev" "lwt_runtime_events"]
3333
dev-repo: "git+https://github.com/ocsigen/lwt.git"
3434
build: [
3535
["dune" "subst"] {dev}

lwt_runtime_events.opam

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# This file is generated by dune, edit dune-project instead
2+
opam-version: "2.0"
3+
version: "6.0.0~beta00"
4+
synopsis: "Emit runtime events to trace the execution of Lwt programs"
5+
maintainer: [
6+
"Raphaël Proust <code@bnwr.net>" "Anton Bachin <antonbachin@yahoo.com>"
7+
]
8+
authors: ["Raphaël Proust"]
9+
license: "MIT"
10+
homepage: "https://github.com/ocsigen/lwt"
11+
doc: "https://ocsigen.org/lwt"
12+
bug-reports: "https://github.com/ocsigen/lwt/issues"
13+
depends: [
14+
"dune" {>= "3.15"}
15+
"ocaml" {>= "5.1"}
16+
"odoc" {with-doc}
17+
]
18+
build: [
19+
["dune" "subst"] {dev}
20+
[
21+
"dune"
22+
"build"
23+
"-p"
24+
name
25+
"-j"
26+
jobs
27+
"@install"
28+
"@runtest" {with-test}
29+
"@doc" {with-doc}
30+
]
31+
]
32+
dev-repo: "git+https://github.com/ocsigen/lwt.git"

src/core/dune

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
(public_name lwt)
33
(synopsis "Monadic promises and concurrent I/O")
44
(wrapped false)
5-
(libraries runtime_events))
5+
(libraries
6+
(select lwt_rte.ml from
7+
(lwt_runtime_events -> lwt_rte.with.ml)
8+
(-> lwt_rte.without.ml))))
69

710
(documentation
811
(package lwt))

src/core/lwt.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3240,6 +3240,4 @@ end
32403240
module Private = struct
32413241
type nonrec storage = storage
32423242
module Sequence_associated_storage = Sequence_associated_storage
3243-
type Runtime_events.User.tag += Paused_count
3244-
let paused_count = Runtime_events.User.register "lwt-paused-count" Paused_count Runtime_events.Type.int
32453243
end

src/core/lwt.mli

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2071,6 +2071,4 @@ module Private : sig
20712071
val empty_storage : storage
20722072
val current_storage : storage ref
20732073
end
2074-
2075-
val paused_count : int Runtime_events.User.t
20762074
end [@@alert trespassing "for internal use only, keep away"]

src/core/lwt_rte.mli

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
val emit_paused_count : int -> unit
2+
val emit_sch_call_begin : unit -> unit
3+
val emit_sch_call_end : unit -> unit
4+
val emit_sch_lap : unit -> unit
5+
val emit_job_count : int -> unit

src/core/lwt_rte.with.ml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
let emit_paused_count v = Lwt_runtime_events.emit_paused_count v
2+
let emit_sch_call_begin () = Lwt_runtime_events.emit_sch_call_begin ()
3+
let emit_sch_call_end () = Lwt_runtime_events.emit_sch_call_end ()
4+
let emit_sch_lap v = Lwt_runtime_events.emit_sch_lap v
5+
let emit_job_count v = Lwt_runtime_events.emit_job_count v

src/core/lwt_rte.without.ml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
let emit_paused_count _v = ()
2+
let emit_sch_call_begin () = ()
3+
let emit_sch_call_end () = ()
4+
let emit_sch_lap _v = ()
5+
let emit_job_count _v = ()

src/runtime_events/dune

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
(library
2+
(public_name lwt_runtime_events)
3+
(synopsis "Emit runtime events to trace the execution of Lwt programs")
4+
(wrapped false)
5+
(libraries runtime_events))

0 commit comments

Comments
 (0)