Skip to content

Commit

Permalink
Place ring diagnostics into a (string * string) list rather than a bi…
Browse files Browse the repository at this point in the history
…g string

This will allow the diagnostics to fit naturally into a xenstore
directory.
  • Loading branch information
David Scott committed Dec 25, 2012
1 parent 0b9fcc3 commit 56af5c6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/ring.ml
Expand Up @@ -323,7 +323,7 @@ end

module type Bidirectional_byte_stream = sig
val init: Cstruct.t -> unit
val to_debug_string: Cstruct.t -> string
val to_debug_map: Cstruct.t -> (string * string) list

module Front : sig
val unsafe_write: Cstruct.t -> string -> int -> int -> int
Expand Down
2 changes: 1 addition & 1 deletion lib/ring.mli
Expand Up @@ -158,7 +158,7 @@ end

module type Bidirectional_byte_stream = sig
val init: Cstruct.t -> unit
val to_debug_string: Cstruct.t -> string
val to_debug_map: Cstruct.t -> (string * string) list

module Front : sig
val unsafe_write: Cstruct.t -> string -> int -> int -> int
Expand Down
10 changes: 6 additions & 4 deletions xen/console_ring.ml
Expand Up @@ -32,10 +32,12 @@ module Ring = struct
} as little_endian
end
let init = zero
let to_debug_string t =
Printf.sprintf "input_cons = %ld prod = %ld; output cons = %ld prod = %ld"
(Layout.get_ring_input_cons t) (Layout.get_ring_input_prod t)
(Layout.get_ring_output_cons t) (Layout.get_ring_output_prod t)
let to_debug_map t = [
"input-cons", Int32.to_string (Layout.get_ring_input_cons t);
"input-prod", Int32.to_string (Layout.get_ring_input_prod t);
"output-cons", Int32.to_string (Layout.get_ring_output_cons t);
"output-prod", Int32.to_string (Layout.get_ring_output_prod t);
]
module Front = Pipe(Layout)
module Back = Pipe(Reverse(Layout))
end
11 changes: 6 additions & 5 deletions xen/xenstore_ring.ml
Expand Up @@ -32,11 +32,12 @@ module Ring = struct
} as little_endian
end
let init = zero
let to_debug_string t =
Printf.sprintf "input_cons = %ld prod = %ld; output cons = %ld prod = %ld"
(Layout.get_ring_input_cons t) (Layout.get_ring_input_prod t)
(Layout.get_ring_output_cons t) (Layout.get_ring_output_prod t)

let to_debug_map t = [
"input-cons", Int32.to_string (Layout.get_ring_input_cons t);
"input-prod", Int32.to_string (Layout.get_ring_input_prod t);
"output-cons", Int32.to_string (Layout.get_ring_output_cons t);
"output-prod", Int32.to_string (Layout.get_ring_output_prod t);
]
module Front = Pipe(Layout)
module Back = Pipe(Reverse(Layout))
end

0 comments on commit 56af5c6

Please sign in to comment.