Skip to content

Commit

Permalink
Merge pull request ocaml-multicore#749 from talex5/trace-spawn
Browse files Browse the repository at this point in the history
Record trace event when spawning processes
  • Loading branch information
talex5 authored Aug 23, 2024
2 parents 33d4e01 + c2d314b commit d47b5e2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib_eio_linux/low_level.ml
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,10 @@ module Process = struct
let exit_status, set_exit_status = Promise.create () in
let t =
Fd.use_exn "errors-w" errors_w @@ fun errors_w ->
let pid, pid_fd = eio_spawn errors_w c_actions in
let pid, pid_fd =
Eio.Private.Trace.with_span "spawn" @@ fun () ->
eio_spawn errors_w c_actions
in
let pid_fd = Fd.of_unix ~sw ~seekable:false ~close_unix:true pid_fd in
{ pid; pid_fd; exit_status }
in
Expand Down
1 change: 1 addition & 0 deletions lib_eio_posix/low_level.ml
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@ module Process = struct
let t =
let pid =
Fd.use_exn "errors-w" errors_w @@ fun errors_w ->
Eio.Private.Trace.with_span "spawn" @@ fun () ->
eio_spawn errors_w c_actions
in
Fd.close errors_w;
Expand Down

0 comments on commit d47b5e2

Please sign in to comment.