Skip to content

CP-50836: Add VM_migrate_downtime and request_shutdown spans to help visualise potential optimisations #6379

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

Merged
merged 2 commits into from
Apr 8, 2025
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
5 changes: 1 addition & 4 deletions ocaml/libs/tracing/tracing.ml
Original file line number Diff line number Diff line change
Expand Up @@ -437,10 +437,7 @@ module Span = struct

let to_propagation_context span =
let traceparent = span |> get_context |> SpanContext.to_traceparent in
span
|> get_context
|> SpanContext.context_of_span_context
|> TraceContext.with_traceparent (Some traceparent)
span |> get_trace_context |> TraceContext.with_traceparent (Some traceparent)

let with_trace_context span trace_context =
let span_context =
Expand Down
5 changes: 1 addition & 4 deletions ocaml/libs/tracing/tracing_export.ml
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,7 @@ module Content = struct
)
in
let tags =
let span_context = Span.get_context s in
let trace_context =
SpanContext.context_of_span_context span_context
in
let trace_context = Span.get_trace_context s in
let baggage =
TraceContext.baggage_of trace_context |> Option.value ~default:[]
in
Expand Down
1 change: 1 addition & 0 deletions ocaml/xenopsd/lib/xenops_server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2988,6 +2988,7 @@ and perform_exn ?result (op : operation) (t : Xenops_task.task_handle) : unit =
]
)
t ;
with_tracing ~task:t ~name:"VM_migrate_downtime_end" Fun.id ;
Handshake.send s Handshake.Success ;
debug "VM.receive_memory: Synchronisation point 4"
with e ->
Expand Down
8 changes: 8 additions & 0 deletions ocaml/xenopsd/xc/xenops_server_xen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2515,6 +2515,7 @@ module VM = struct
@@ fun () -> pre_suspend_callback task
) ;

with_tracing ~task ~name:"VM_save_request_shutdown" @@ fun () ->
if
not
( with_tracing ~task
Expand All @@ -2523,6 +2524,13 @@ module VM = struct
)
then
raise (Xenopsd_error Failed_to_acknowledge_suspend_request) ;
(* If this is for a migration, record the begin time *)
( match data with
| FD _ ->
with_tracing ~task ~name:"VM_migrate_downtime_begin" Fun.id
| _ ->
()
) ;
if
not
( with_tracing ~task
Expand Down
Loading