Skip to content

Commit

Permalink
Merge pull request #5551 from GabrielBuica/private/dbuica/CP-48195-v2
Browse files Browse the repository at this point in the history
CP-48195: Split `tracing` library to avoid future cyclic dependencies
  • Loading branch information
robhoes committed Apr 22, 2024
2 parents f1903aa + d049d43 commit f208e2f
Show file tree
Hide file tree
Showing 20 changed files with 578 additions and 407 deletions.
1 change: 1 addition & 0 deletions forkexec.opam
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
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
Expand Up @@ -12,6 +12,7 @@
xapi-log
xapi-stdext-pervasives
xapi-stdext-unix
xapi-tracing
)
(preprocess
(pps ppx_deriving_rpc)))
4 changes: 4 additions & 0 deletions ocaml/forkexecd/lib/forkhelpers.ml
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
@@ -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)))

0 comments on commit f208e2f

Please sign in to comment.