let string_of_message string_of_gdesc string_of_tdesc msg = match msg with
| Created (pid,mc_addr,_,tdesc) ->
Printf.sprintf "Created (%s, %s, %s)"
(Proc_info.to_string pid) (Proc_info.to_string mc_addr)
(string_of_tdesc tdesc)
| Destroyed tdesc ->
Printf.sprintf "Destroyed (%s)" (string_of_tdesc tdesc)
| Valid (tdesc,valid) ->
Printf.sprintf "Valid (%s, %b)" (string_of_tdesc tdesc) valid
| Set_timer _ ->
Printf.sprintf "Set_timer"
| Cancel_timer tid ->
Printf.sprintf "Cancel_timer (%s)" (Timer.to_string tid)
| Message (tdesc,pid,iovec) ->
Printf.sprintf "Message (%s, from=%s IOVEC[%d])" (string_of_tdesc tdesc)
(Proc_info.to_string pid) (Iovec.length iovec)
| Send_success (tdesc,iovec) ->
Printf.sprintf "Success: Message (%s, IOVEC[%d])" (string_of_tdesc tdesc)
(Iovec.length iovec)
| Send_failure (tdesc,view,iovec) ->
Printf.sprintf "Failure: Message (%s, %s, IOVEC[%d])" (string_of_tdesc tdesc)
(View.to_string view)
(Iovec.length iovec)
| Select (tdesc,read,write) ->
Printf.sprintf "Select (%s,read=%b,write=%b)"
(string_of_tdesc tdesc) read write