Skip to content

Commit b0ca708

Browse files
authored
flambda-backend: Install runtime events for runtime5 (#2106)
1 parent d35d125 commit b0ca708

23 files changed

+122
-46
lines changed

Makefile.common-jst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ dune_config_targets = \
115115

116116
$(ocamldir)/otherlibs/dune:
117117
if [ "$(RUNTIME_DIR)" = "runtime4" ]; then \
118-
echo "(dirs (:standard \ systhreads))" > $@; \
118+
echo "(dirs (:standard \ systhreads runtime_events))" > $@; \
119119
else \
120120
echo "(dirs (:standard \ systhreads4))" > $@; \
121121
fi
@@ -249,11 +249,14 @@ install_for_test: _install
249249
done; \
250250
ln -s . lex; ln -s . yacc; \
251251
ln -s _install/lib/ocaml/compiler-libs compilerlibs; \
252-
mkdir -p otherlibs/{unix,dynlink/native,str,bigarray}; \
252+
mkdir -p otherlibs/{unix,dynlink/native,str,bigarray,runtime_events}; \
253253
ln -s ../stdlib/threads otherlibs/systhreads$(RUNTIME_SUFFIX); \
254254
$(cpl) stdlib/unix/{lib,}unix* otherlibs/unix; \
255255
$(cpl) stdlib/dynlink/dynlink* otherlibs/dynlink; \
256256
$(cpl) stdlib/str/{lib,}str* otherlibs/str; \
257+
if [[ x"$(RUNTIME_DIR)" = x"runtime" ]]; then \
258+
$(cpl) stdlib/runtime_events/{lib,}runtime_events* otherlibs/runtime_events; \
259+
fi; \
257260
ln -s ../_build/main/$(ocamldir)/toplevel/byte/.ocamltoplevel.objs/byte toplevel; \
258261
)
259262

configure

Lines changed: 10 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -667,12 +667,15 @@ AS_CASE([$host],
667667
[exeext=".exe"],
668668
[exeext=''])
669669

670-
dnl CR ocaml 5 runtime:
671-
dnl otherlibraries="dynlink runtime_events"
672670
otherlibraries="dynlink"
673671
lib_dynlink=true
674-
dnl CR ocaml 5 runtime:
675-
dnl lib_runtime_events = true
672+
673+
AS_IF(
674+
[test x"$enable_runtime5" = x"yes"],
675+
[otherlibraries="$otherlibraries runtime_events"
676+
lib_runtime_events=true],
677+
[])
678+
676679
AS_IF([test x"$enable_unix_lib" != "xno"],
677680
[enable_unix_lib=yes
678681
AC_CONFIG_FILES([otherlibs/unix/META])
@@ -2118,11 +2121,10 @@ AS_CASE([$host],
21182121

21192122
## Activate the systhread library
21202123

2121-
if [[ x"$enable_runtime5" = x"yes" ]]; then
2122-
runtime_suffix=
2123-
else
2124-
runtime_suffix=4
2125-
fi
2124+
AS_IF(
2125+
[test x"$enable_runtime5" = x"yes"],
2126+
[runtime_suffix=],
2127+
[runtime_suffix=4])
21262128

21272129
AS_CASE([$enable_systhreads,$enable_unix_lib],
21282130
[yes,no],

otherlibs/runtime_events/dune

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
;**************************************************************************
2+
;* *
3+
;* OCaml *
4+
;* *
5+
;* Zesen Qian, Jane Street Europe *
6+
;* *
7+
;* Copyright 2023 Jane Street Group LLC *
8+
;* *
9+
;* All rights reserved. This file is distributed under the terms of *
10+
;* the GNU Lesser General Public License version 2.1, with the *
11+
;* special exception on linking described in the file LICENSE. *
12+
;* *
13+
;**************************************************************************
14+
15+
(library
16+
(name runtime_events)
17+
(wrapped false)
18+
(modes byte native)
19+
(flags (
20+
-strict-sequence -principal -absname -w +a-4-9-40-41-42-44-45-48-66
21+
-warn-error A -bin-annot -safe-string -strict-formats
22+
))
23+
(ocamlopt_flags (:include %{project_root}/ocamlopt_flags.sexp))
24+
(library_flags (:standard -linkall))
25+
(foreign_stubs (language c) (names runtime_events_consumer)
26+
(flags ((:include %{project_root}/oc_cflags.sexp)
27+
(:include %{project_root}/sharedlib_cflags.sexp)
28+
(:include %{project_root}/oc_cppflags.sexp)))))
29+
30+
(install
31+
(files
32+
(.runtime_events.objs/native/runtime_events.cmx as runtime_events/runtime_events.cmx)
33+
(libruntime_events_stubs.a as runtime_events/libruntime_events_stubs.a)
34+
(libruntime_events_stubs.a as libruntime_events_stubs_native.a) ; for special_dune compat
35+
(dllruntime_events_stubs.so as stublibs/dllruntime_events_stubs.so)
36+
(runtime_events.cmxa as runtime_events/runtime_events.cmxa)
37+
(runtime_events.a as runtime_events/runtime_events.a)
38+
(runtime_events.cmxs as runtime_events/runtime_events.cmxs)
39+
(runtime_events.cma as runtime_events/runtime_events.cma)
40+
(runtime_events.mli as runtime_events/runtime_events.mli)
41+
(.runtime_events.objs/byte/runtime_events.cmi as runtime_events/runtime_events.cmi)
42+
(.runtime_events.objs/byte/runtime_events.cmt as runtime_events/runtime_events.cmt)
43+
(.runtime_events.objs/byte/runtime_events.cmti as runtime_events/runtime_events.cmti)
44+
(runtime_events_consumer.h as runtime_events_consumer.h)
45+
)
46+
(section lib)
47+
(package ocaml))

testsuite/tests/lib-runtime-events/test.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
(* TEST
2+
* runtime4
3+
** skip
4+
* runtime5
25
modules = "stubs.c"
36
include runtime_events
4-
* skip
5-
reason = "OCaml 5 only"
67
*)
78

89
external start_runtime_events : unit -> unit = "start_runtime_events"

testsuite/tests/lib-runtime-events/test_caml.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
(* TEST
2+
* runtime4
3+
** skip
4+
* runtime5
25
include runtime_events
3-
* skip
4-
reason = "OCaml 5 only"
56
*)
67
open Runtime_events
78

testsuite/tests/lib-runtime-events/test_caml_counters.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
(* TEST
2+
* runtime4
3+
** skip
4+
* runtime5
25
include runtime_events
3-
* skip
4-
reason = "OCaml 5 only"
56
*)
67
open Runtime_events
78

testsuite/tests/lib-runtime-events/test_caml_exception.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
(* TEST
2+
* runtime5
23
include runtime_events
3-
* skip
4-
reason = "OCaml 5 only"
4+
* runtime4
5+
** skip
56
*)
67
open Runtime_events
78

testsuite/tests/lib-runtime-events/test_caml_parallel.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
(* TEST
22
include runtime_events
33
* skip
4-
reason = "OCaml 5 only"
4+
reason = "CR OCaml 5 domains"
55
*)
66
open Runtime_events
77

testsuite/tests/lib-runtime-events/test_caml_reentry.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
(* TEST
2+
* runtime5
23
include runtime_events
3-
* skip
4-
reason = "OCaml 5 only"
4+
* runtime4
5+
** skip
56
*)
67
open Runtime_events
78

testsuite/tests/lib-runtime-events/test_caml_runparams.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
(* TEST
2+
* runtime4
3+
** skip
4+
* runtime5
25
include runtime_events
36
ocamlrunparam += ",e=4"
4-
* skip
5-
reason = "OCaml 5 only"
67
*)
78

89
(* We set the ring buffer size smaller and witness that we do indeed

testsuite/tests/lib-runtime-events/test_caml_slot_reuse.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
(* TEST
22
include runtime_events
33
* skip
4-
reason = "OCaml 5 only"
4+
reason = "CR OCaml 5 domains"
55
*)
66
open Runtime_events
77

testsuite/tests/lib-runtime-events/test_caml_stubs_gc.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
(* TEST
2+
* runtime4
3+
** skip
4+
* runtime5
25
include runtime_events
3-
* skip
4-
reason = "OCaml 5 only"
56
*)
67
open Runtime_events
78

testsuite/tests/lib-runtime-events/test_compact.ml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
(* TEST
2+
* runtime4
3+
** skip
4+
* runtime5
25
include runtime_events;
36
*)
47
open Runtime_events

testsuite/tests/lib-runtime-events/test_dropped_events.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
include unix
44
set OCAMLRUNPARAM = "e=6"
55
* skip
6-
reason = "OCaml 5 only"
6+
reason = "CR OCaml 5 domains"
77
** libunix
88
*** native
99
*** bytecode

testsuite/tests/lib-runtime-events/test_env_start.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
(* TEST
2+
* runtime4
3+
** skip
4+
* runtime5
25
include runtime_events
36
set OCAML_RUNTIME_EVENTS_START = "1"
4-
* skip
5-
reason = "OCaml 5 only"
67
*)
78

89
(* In this test the runtime_events should already be started by the environment

testsuite/tests/lib-runtime-events/test_external.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
(* TEST
2-
reason = "OCaml 5 only"
2+
* runtime4
3+
** skip
4+
* runtime5
35
include runtime_events
46
include unix
5-
* skip
67
** libunix
78
*** bytecode
89
*** native *)

testsuite/tests/lib-runtime-events/test_external_preserve.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
(* TEST
2+
* runtime4
3+
** skip
4+
* runtime5
25
include runtime_events
36
include unix
47
set OCAML_RUNTIME_EVENTS_PRESERVE = "1"
5-
* skip
6-
reason = "OCaml 5 only"
78
** libunix
89
*** bytecode
910
*** native *)

testsuite/tests/lib-runtime-events/test_fork.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
(* TEST
2+
* runtime4
3+
** skip
4+
* runtime5
25
include runtime_events
36
include unix
4-
* skip
5-
reason = "OCaml 5 only"
67
** libunix
78
*** bytecode
89
*** native *)

testsuite/tests/lib-runtime-events/test_instrumented.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
(* TEST
2+
* runtime4
3+
** skip
4+
* runtime5
25
include runtime_events
36
flags = "-runtime-variant=i"
4-
5-
* skip
6-
reason = "OCaml 5 only"
77
** instrumented-runtime
88
*** native
99
*)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
lost_event_words: 0, total_sizes: 2000004, total_minors: 31
1+
lost_event_words: 0, total_sizes: 2000004, total_minors: 15

testsuite/tests/lib-runtime-events/test_user_event.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
(* TEST
2+
* runtime4
3+
** skip
4+
* runtime5
25
include runtime_events
3-
* skip
4-
reason = "OCaml 5 only"
56
*)
67
open Runtime_events
78

testsuite/tests/lib-runtime-events/test_user_event_unknown.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
(* TEST
2+
* runtime4
3+
** skip
4+
* runtime5
25
include runtime_events
36
include unix
47
set OCAML_RUNTIME_EVENTS_PRESERVE = "1"
5-
* skip
6-
reason = "OCaml 5 only"
78
** libunix
89
*** bytecode
910
*** native

0 commit comments

Comments
 (0)