Hi all,
I’m trying to write a small toy ocaml program to be profiled with spacetime, but can’t manage to produce the expected spacetime-<mypid>
file.
Here’s what I do:
-
opam switch 4.05.0+spacetime
eval $(opam config env)
- in a file
main.ml
:
type myrec = { s: string; x: int }
let () =
(* let's allocate memory *)
let x = { s = "hi"; x = 1 } in
(* let's do useless computation so as not to die immediately. *)
for i = 0 to 100000000 do
(if i = 99 then Printf.printf "%d" i;)
done;
Printf.printf "%d" x.x;
()
- compile with
ocamlfind ocamlc -o main main.ml -verbose
- run with
OCAML_SPACETIME_INTERVAL=1 ./main
Expected: a spacetime-xxxx
file is created in the working directory.
Real: no file is created.
What am I doing wrong?