(* create some number of snaps at random intervals *) let kebab (pid:int64) (cnt:int) = let sctl = Sctl.create_local () in let (prog,ctx) = Sctl.attach sctl pid in for i = 1 to cnt do Sctl.cont prog; Unix.sleep 2; ignore(Sctl.stop prog); let ctx' = Sctl.snap prog in Printf.printf "new snapshot: %Lx\n" ctx'.Sctl.id; flush stdout done; Sctl.cont prog; Sctl.detach prog; Sctl.close sctl ;; if (Array.length Sys.argv) <> 3 then Printf.printf "usage: kebab \n" else kebab (Int64.of_string Sys.argv.(1)) (int_of_string Sys.argv.(2))