tools/oxenstored: Additional debugging commands
PATCH 1/1 tools/oxenstored: Additional debugging commands
From: Edwin Török <[email protected]>
These were added to aid security development, and are useful generally for debugging.
---
CC: Christian Lindig <[email protected]>
CC: Edwin Török <[email protected]>
CC: Rob Hoes <[email protected]>
I found this hiding down the back of the patchqueue.
--- tools/ocaml/xenstored/process.ml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
tools/ocaml/xenstored/process.ml +17 -0
@@ -235,6 +235,23 @@ let do_debug con t _domains cons data = | "watches" :: _ -> let watches = Connections.debug cons in Some (watches ^ "\000") + | "compact" :: _ -> + Gc.compact (); + Some "Compacted" + | "trim" :: _ -> + History.trim (); + Some "trimmed" + | "txn" :: domid :: _ -> + let domid = int_of_string domid in + let con = Connections.find_domain cons domid in + let b = Buffer.create 128 in + let () = con.transactions |> Hashtbl.iter @@ fun id tx -> + Printf.bprintf b "paths: %d, operations: %d, quota_reached: %b\n" + (List.length tx.Transaction.paths) + (List.length tx.Transaction.operations) + tx.Transaction.quota_reached + in + Some (Buffer.contents b) | "xenbus" :: domid :: _ -> let domid = int_of_string domid in let con = Connections.find_domain cons domid in
base-commit: b0cd7499ddd281033548a702c6d61ab13fdd1f67
Signature · 1 line
2.30.2
Quoted 52 lines · Andrew Cooper
From: Edwin Török <[email protected]>
These were added to aid security development, and are useful generally for debugging.
Signed-off-by Edwin Török <[email protected]>Signed-off-by Andrew Cooper <[email protected]>---
CC: Christian Lindig <[email protected]>
CC: Edwin Török <[email protected]>
CC: Rob Hoes <[email protected]>I found this hiding down the back of the patchqueue.
---tools/ocaml/xenstored/process.ml| 17 +++++++++++++++++1 file changed, 17 insertions(+)tools/ocaml/xenstored/process.ml +17
-0@@ -235,6 +235,23 @@ let do_debug con t _domains cons data = | "watches" :: _ -> let watches = Connections.debug cons in Some (watches ^ "\000") + | "compact" :: _ -> + Gc.compact (); + Some "Compacted" + | "trim" :: _ -> + History.trim (); + Some "trimmed" + | "txn" :: domid :: _ -> + let domid = int_of_string domid in + let con = Connections.find_domain cons domid in + let b = Buffer.create 128 in + let () = con.transactions |> Hashtbl.iter @@ fun id tx -> + Printf.bprintf b "paths: %d, operations: %d, quota_reached: %b\n" + (List.length tx.Transaction.paths) + (List.length tx.Transaction.operations) + tx.Transaction.quota_reached + in + Some (Buffer.contents b) | "xenbus" :: domid :: _ -> let domid = int_of_string domid in let con = Connections.find_domain cons domid inbase-commit:
b0cd7499ddd281033548a702c6d61ab13fdd1f67Signature · 1 line
2.30.2