File tree Expand file tree Collapse file tree 4 files changed +26
-8
lines changed Expand file tree Collapse file tree 4 files changed +26
-8
lines changed Original file line number Diff line number Diff line change 1+ open Sexplib.Std
2+
3+ type traced_operation = [
4+ | `Set of string * string * [ `Producer | `Consumer | `Suspend | `Suspend_ack ] * [ `Int64 of int64 | `Bool of bool ]
5+ | `Get of string * string * [ `Producer | `Consumer | `Suspend | `Suspend_ack ] * [ `Int64 of int64 | `Bool of bool ]
6+ ] with sexp
7+ type traced_operation_list = traced_operation list with sexp
8+
19let debug fmt = Printf. ksprintf (fun s -> print_endline s) fmt
210let info fmt = Printf. ksprintf (fun s -> print_endline s) fmt
311let error fmt = Printf. ksprintf (fun s -> print_endline s) fmt
12+
13+ let trace ts =
14+ let string_of_key = function
15+ | `Producer -> " producer"
16+ | `Consumer -> " consumer"
17+ | `Suspend -> " suspend"
18+ | `Suspend_ack -> " suspend_ack" in
19+ let string_of_value = function
20+ | `Int64 x -> Int64. to_string x
21+ | `Bool b -> string_of_bool b in
22+ let one = function
23+ | `Set (_ , queue , key , value ) ->
24+ Printf. sprintf " %s.%s := %s" queue (string_of_key key) (string_of_value value)
25+ | `Get (__ , queue , key , value ) ->
26+ Printf. sprintf " %s.%s == %s" queue (string_of_key key) (string_of_value value) in
27+ info " %s" (String. concat " , " (List. map one ts))
Original file line number Diff line number Diff line change @@ -20,12 +20,6 @@ open Lwt
2020(* Mock kernel devices so we can run as a regular user *)
2121let use_mock = ref true
2222
23- module Log = struct
24- let debug fmt = Printf. ksprintf (fun s -> print_endline s) fmt
25- let info fmt = Printf. ksprintf (fun s -> print_endline s) fmt
26- let error fmt = Printf. ksprintf (fun s -> print_endline s) fmt
27- end
28-
2923module Time = struct
3024 type 'a io = 'a Lwt .t
3125 let sleep = Lwt_unix. sleep
Original file line number Diff line number Diff line change @@ -384,7 +384,7 @@ let main use_mock config daemon socket journal fromLVM toLVM =
384384 ) >> = fun device ->
385385
386386 (* We must replay the journal before resynchronising free blocks *)
387- J. start device perform
387+ J. start ~client: " xenvm-local-allocator " ~name: " local allocator journal " device perform
388388 >> |= fun j ->
389389
390390 FreePool. start config vg
Original file line number Diff line number Diff line change @@ -538,7 +538,7 @@ module FreePool = struct
538538 | `Error _ -> fatal_error_t (" open " ^ name)
539539 | `Ok x -> return x )
540540 >> = fun device ->
541- J. start device perform
541+ J. start ~client: " xenvmd " ~name: " allocation journal " device perform
542542 >> |= fun j' ->
543543 journal := Some j';
544544 return ()
You can’t perform that action at this time.
0 commit comments