@@ -3720,6 +3720,7 @@ module VBD = struct
37203720 }
37213721 in
37223722 let dev =
3723+ with_tracing ~task ~name: " VBD_device_add" @@ fun () ->
37233724 Xenops_task. with_subtask task
37243725 (Printf. sprintf " Vbd.add %s" (id_of vbd))
37253726 (fun () ->
@@ -3729,13 +3730,16 @@ module VBD = struct
37293730 )
37303731 in
37313732 (* We store away the disk so we can implement VBD.stat *)
3732- Option. iter
3733- (fun d ->
3734- xs.Xs. write
3735- (vdi_path_of_device ~xs dev)
3736- (d |> rpc_of disk |> Jsonrpc. to_string)
3737- )
3738- vbd.backend ;
3733+ with_tracing ~task ~name: " VBD_xs_write" (fun () ->
3734+ Option. iter
3735+ (fun d ->
3736+ xs.Xs. write
3737+ (vdi_path_of_device ~xs dev)
3738+ (d |> rpc_of disk |> Jsonrpc. to_string)
3739+ )
3740+ vbd.backend
3741+ ) ;
3742+ with_tracing ~task ~name: " VBD_attach_qemu" @@ fun () ->
37393743 (* NB now the frontend position has been resolved *)
37403744 let open Device_common in
37413745 let device_number =
@@ -3851,6 +3855,7 @@ module VBD = struct
38513855 (* this happens on normal shutdown too *)
38523856 (* Case (1): success; Case (2): success; Case (3): an exception is
38533857 thrown *)
3858+ with_tracing ~task ~name: " VBD_device_shutdown" @@ fun () ->
38543859 Xenops_task. with_subtask task
38553860 (Printf. sprintf " Vbd.clean_shutdown %s" (id_of vbd))
38563861 (fun () ->
@@ -3863,14 +3868,17 @@ module VBD = struct
38633868 the DP if the backend is of type VDI *)
38643869 finally
38653870 (fun () ->
3866- Option. iter
3867- (fun dev ->
3868- Xenops_task. with_subtask task
3869- (Printf. sprintf " Vbd.release %s" (id_of vbd))
3870- (fun () -> Device.Vbd. release task ~xc ~xs dev)
3871- )
3872- dev ;
3871+ with_tracing ~task ~name: " VBD_device_release" (fun () ->
3872+ Option. iter
3873+ (fun dev ->
3874+ Xenops_task. with_subtask task
3875+ (Printf. sprintf " Vbd.release %s" (id_of vbd))
3876+ (fun () -> Device.Vbd. release task ~xc ~xs dev)
3877+ )
3878+ dev
3879+ ) ;
38733880 (* If we have a qemu frontend, detach this too. *)
3881+ with_tracing ~task ~name: " VBD_detach_qemu" @@ fun () ->
38743882 let _ =
38753883 DB. update vm
38763884 (Option. map (fun vm_t ->
@@ -3901,6 +3909,7 @@ module VBD = struct
39013909 ()
39023910 )
39033911 (fun () ->
3912+ with_tracing ~task ~name: " VBD_dp_destroy" @@ fun () ->
39043913 match (domid, backend) with
39053914 | Some x , None | Some x , Some (VDI _ ) ->
39063915 Storage. dp_destroy task
0 commit comments