open Landmark
let loop = register "loop"
let sleep = register "sleep"
let main = register "main"
let zzz () =
enter sleep;
Unix.sleep 1;
exit sleep
let () =
begin
start_profiling ();
enter main;
enter loop;
for _ = 1 to 9 do
zzz ()
done;
exit loop;
zzz ();
exit main;
end
Unfortunately when I run dune build from the project's root directory the generated program (main.exe) returns the following output:
Warning: landmark failure when closing 'load(bin/main)' (bin/main.ml:1), expecting 'ROOT' (src/landmark.ml).
Call graph './main.exe':
------------------------
Note: Nodes accounting for less than 1.00% of their parent have been ignored.
Aggregated table:
----------------
Name; Filename; Calls; Time; Allocated bytes
ROOT; src/landmark.ml; 0; 69.01K; 59888
Fatal error: exception Landmark.LandmarkFailure("unable to recover from landmark failure when closing 'load(bin/main)' (bin/main.ml:1), expecting 'ROOT' (src/landmark.ml).")
Having said that, building the same program with ocamlfind ocamlc -o prog -package landmarks -package unix -linkpkg main.ml results with perfectly fine working program that produces the following output:
Call graph './prog':
--------------------
[ 22.61G cycles in 1 calls ] - 100.00% : main
[ 20.35G cycles in 1 calls ] | - 90.00% : loop
[ 20.35G cycles in 9 calls ] | | - 100.00% : [1;31msleep[0m
[ 2.26G cycles in 1 calls ] | - 10.00% : [0;31msleep[0m
Note: Nodes accounting for less than 1.00% of their parent have been ignored.
Aggregated table:
----------------
Name; Filename; Calls; Time; Allocated bytes
ROOT; src/landmark.ml; 0; 22.61G; 113304
main; unknown; 1; 22.61G; 7456
sleep; unknown; 10; 22.61G; 2720
loop; unknown; 1; 20.35G; 5472
I tried to build the following example:
With a dune file like:
Unfortunately when I run
dune build
from the project's root directory the generated program (main.exe) returns the following output:Having said that, building the same program with
ocamlfind ocamlc -o prog -package landmarks -package unix -linkpkg main.ml
results with perfectly fine working program that produces the following output: