Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CP-48195: Split tracing library to avoid future cyclic dependencies #5551

Merged
merged 3 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions forkexec.opam
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ depends: [
"xapi-log"
"xapi-stdext-pervasives"
"xapi-stdext-unix"
"xapi-tracing"
]
synopsis: "Sub-process control service for xapi"
description:
Expand Down
1 change: 1 addition & 0 deletions forkexec.opam.template
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ depends: [
"xapi-log"
"xapi-stdext-pervasives"
"xapi-stdext-unix"
"xapi-tracing"
]
synopsis: "Sub-process control service for xapi"
description:
Expand Down
1 change: 1 addition & 0 deletions ocaml/forkexecd/lib/dune
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
xapi-log
xapi-stdext-pervasives
xapi-stdext-unix
xapi-tracing
psafont marked this conversation as resolved.
Show resolved Hide resolved
)
(preprocess
(pps ppx_deriving_rpc)))
4 changes: 4 additions & 0 deletions ocaml/forkexecd/lib/forkhelpers.ml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ let test_path =

let runtime_path = Option.value ~default:"/var" test_path

let _with_tracing ?tracing ~name f =
let name = Printf.sprintf "forkhelpers.%s" name in
Tracing.with_tracing ?parent:tracing ~name f

let finally = Xapi_stdext_pervasives.Pervasiveext.finally

type pidty = Unix.file_descr * int
Expand Down
42 changes: 25 additions & 17 deletions ocaml/libs/tracing/dune
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
(library
(name tracing)
(public_name xapi-tracing)
(libraries
cohttp
cohttp-posix
ptime
ptime.clock.os
rpclib.core
rpclib.json
xapi-log
xapi-open-uri
xapi-stdext-threads
xapi-stdext-unix
zstd
)
(preprocess (pps ppx_deriving_rpc))
)
(name tracing)
(modules tracing)
(libraries re uri xapi-log xapi-stdext-threads)
(public_name xapi-tracing))

(library
(name tracing_export)
(modules tracing_export)
(public_name xapi-tracing.export)
(libraries
cohttp
cohttp-posix
ptime
ptime.clock.os
rpclib.core
rpclib.json
tracing
uri
xapi-log
xapi-open-uri
xapi-stdext-threads
xapi-stdext-unix
zstd)
(preprocess
(pps ppx_deriving_rpc)))
Loading
Loading