| "netrx" -> NetRX | "nettx" -> NetTX
| "blockrdrq" -> BlockRdRq | "blockwrrq" -> BlockWrRq
| str ->
- failwith
- (sprintf (f_ "%s: sort order should be: %s")
- str "cpu|mem|time|id|name|netrx|nettx|blockrdrq|blockwrrq")
+ failwithf (f_ "%s: sort order should be: %s")
+ str "cpu|mem|time|id|name|netrx|nettx|blockrdrq|blockwrrq"
let cli_of_sort_order = function
| Processor -> "cpu"
| Memory -> "mem"
| "block" -> BlockDisplay
| "net" -> NetDisplay
| str ->
- failwith
- (sprintf (f_ "%s: display should be %s")
- str "task|pcpu|block|net")
+ failwithf (f_ "%s: display should be %s") str "task|pcpu|block|net"
let cli_of_display = function
| TaskDisplay -> "task"
| PCPUDisplay -> "pcpu"
let ( *^ ) = Int64.mul
let (/^) = Int64.div
+(* failwithf is a printf-like version of failwith. *)
+let failwithf fs = ksprintf failwith fs
+
(* Input a whole file as a list of lines. *)
let input_all_lines chan =
let lines = ref [] in
(* Filename concatenation. *)
val (//) : string -> string -> string
+(* failwithf is a printf-like version of failwith. *)
+val failwithf : ('a, unit, string, 'b) format4 -> 'a
+
(* Read a configuration file as a list of (lineno, key, value) pairs.
* If the config file is missing this returns an empty list.
*)