X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;ds=sidebyside;f=ps%2Fvirt_ps.ml;h=ccdd972b7c751c013a7ee1a04c9b0958e52a1b6e;hb=82201a5312c3582daeb7215efd731f7e784d9edf;hp=065b4c36ec59a69e5bdba1709a9999cf85ce433e;hpb=97131d94f5513b732f8f8d310984e71d8201cadf;p=virt-mem.git diff --git a/ps/virt_ps.ml b/ps/virt_ps.ml index 065b4c3..ccdd972 100644 --- a/ps/virt_ps.ml +++ b/ps/virt_ps.ml @@ -21,13 +21,32 @@ open Printf open Virt_mem_gettext.Gettext open Virt_mem_utils -open Virt_mem_mmap +open Virt_mem_types -let run debug images = () +(* +open Kernel_task_struct + +let run debug { domname = domname; mem = mem } { tasks = tasks } = + let tasks = Option.get tasks in + + (* Sort tasks by PID. *) + let cmp { task_pid = p1 } { task_pid = p2 } = compare p1 p2 in + let tasks = List.sort cmp tasks in + + printf " PID STAT COMMAND\n"; + + List.iter ( + fun task -> + printf "%5Ld %s\n" task.task_pid task.task_comm + ) tasks +*) + +let run debug _ = () let summary = s_"list processes in virtual machine" let description = s_"\ virt-ps prints a process listing for virtual machines running under libvirt." -let () = Virt_mem.register "ps" summary description ~run +let () = + Virt_mem.register "ps" summary description ~needs_tasks:true ~run