Version 1.0.8.
[virt-top.git] / virt-top / virt-top.pod
old mode 100644 (file)
new mode 100755 (executable)
index af31c27..4d81608
@@ -22,6 +22,12 @@ different virtualization systems.
 =item B<-1>
 
 Display physical CPUs by default (instead of domains).
+
+Under each domain column, two numbers are shown.  The first is
+the percentage of the physical CPU used by the domain and the
+hypervisor together.  The second is the percentage used by just
+the domain.
+
 When virt-top is running, use the I<1> key to toggle
 between physical CPUs and domains display.
 
@@ -43,8 +49,21 @@ Batch mode.  In this mode keypresses are ignored.
 
 =item B<-c uri> or B<--connect uri>
 
-Connect to URI given.  The default is to connect to the Xen
-hypervisor.
+Connect to the libvirt URI given.
+
+To connect to QEMU/KVM you would normally do I<-c qemu:///system>
+
+To connect to Xen on the same host, do I<-c xen:///>
+
+To connect to libvirtd on a remote machine you would normally do
+I<-c qemu://host/system>
+
+If this option is not given then virt-top connects by default
+to whatever is the default hypervisor for libvirt, although
+this can be overridden by setting environment variables.
+
+See the libvirt documentation at L<http://libvirt.org/uri.html>
+for further information.
 
 =item B<-d delay>
 
@@ -61,7 +80,7 @@ is to run continuously.
 
 Set the sort order to one of:
 B<cpu> (sort by %CPU used),
-B<mem> (sort by memory used),
+B<mem> (sort by total memory),
 B<time> (sort by total time),
 B<id> (sort by domain ID),
 B<name> (sort by domain name),
@@ -99,10 +118,25 @@ Not every version of virt-top supports CSV output - it depends how the
 program was compiled (see I<README> file in the source distribution
 for details).
 
+To save space you can compress your CSV files (if your shell supports
+this feature, eg. I<bash>):
+
+ virt-top --csv >(gzip -9 > output.csv.gz)
+
+You can use a similar trick to split the CSV file up.  In this example
+the CSV file is split every 1000 lines into files called
+I<output.csv.00>, I<output.csv.01> etc.
+
+ virt-top --csv >(split -d -l 1000 - output.csv.)
+
 =item B<--no-csv-cpu>
 
 Disable domain CPU stats in CSV output.
 
+=item B<--no-csv-mem>
+
+Disable domain memory stats in CSV output.
+
 =item B<--no-csv-block>
 
 Disable domain block device stats in CSV output.
@@ -134,10 +168,62 @@ Do not read any init file.
 Script mode.  There will be no user interface.  This is most useful
 when used together with the I<--csv> and I<-n> options.
 
+=item B<--stream>
+
+Stream mode.  All output is sent to stdout.  This can be used from
+shell scripts etc.  There is no user interface.
+
+=item B<--block-in-bytes>
+
+Show I/O statistics in Bytes. Default is shown in the number of Requests.
+
+=item B<--end-time time>
+
+The program will exit at the I<time> given.
+
+The time may be given in one of the following formats:
+
+=over 4
+
+=item I<YYYY-MM-DD HH:MM:SS>
+
+End time is the date and time given.
+
+=item I<HH:MM:SS>
+
+End time is the time given, today.
+
+=item I<+HH:MM:SS>
+
+End time is HH hours, MM minutes, SS seconds in the future (counted
+from the moment that program starts).
+
+=item I<+secs>
+
+End time is I<secs> seconds in the future.
+
+=back
+
+For example to run the program for 3 minutes you could do:
+
+ virt-top --end-time +00:03:00
+
+or:
+
+ virt-top --end-time +180
+
+Not every version of virt-top supports this option - it depends how the
+program was compiled (see I<README> file in the source distribution
+for details).
+
 =item B<--help>
 
 Display usage summary.
 
+=item B<--version>
+
+Display version number and exit.
+
 =back
 
 =head1 KEYS
@@ -164,6 +250,10 @@ Displays help.
 
 Change the delay between screen updates.
 
+=item I<B>
+
+Toggle Block I/O statistics so they are shown in either bytes or requests.
+
 =item I<0> (number 0)
 
 Show the normal list of domains display.
@@ -190,7 +280,8 @@ Sort by %CPU.
 
 =item I<M>
 
-Sort by memory.
+Sort by total memory.  Note that this shows the total memory
+allocated to the guest, not the memory being used.
 
 =item I<T>
 
@@ -270,6 +361,10 @@ Enables CSV output to the named file.
 
 Enable or disable domain CPU stats in CSV output.
 
+=item B<csv-mem> I<true|false>
+
+Enable or disable domain memory stats in CSV output.
+
 =item B<csv-block> I<true|false>
 
 Enable or disable domain block device stats in CSV output.
@@ -290,6 +385,19 @@ Sets secure mode.
 
 Sets script mode.
 
+=item B<stream> I<true|false>
+
+Sets stream mode.
+
+=item B<block-in-bytes> I<true|false>
+
+Show block device statistics in bytes.
+
+=item B<end-time> I<time>
+
+Set the time at which the program exits.  See above for the
+time formats supported.
+
 =item B<overwrite-init-file> I<false>
 
 If set to I<false> then the I<W> key will not overwrite the
@@ -297,19 +405,159 @@ init file.
 
 =back
 
-
 Note that in the current implementation, options specified in
 the init file override options specified on the command line.
 This is a bug and this behaviour may change in the future.
 
+=head1 COLUMN HEADINGS
+
+=over 4
+
+=item B<%CPU>
+
+Percentage of CPU used.  As with L<top(1)>, 100% means that
+all physical CPUs are being fully used.
+
+=item B<DEVICE>
+
+The block device name.
+
+=item B<DOMAIN>
+
+=item B<NAME>
+
+The name of the libvirt domain.
+
+=item B<ID>
+
+The libvirt domain ID.
+
+=item B<INTERFACE>
+
+The network interface name.
+
+=item B<%MEM>
+
+The percentage of host memory assigned to the guest.
+
+=item B<PHYCPU>
+
+The physical CPU.
+
+=item B<RDBY>
+
+Disk bytes read since last displayed.
+
+=item B<RDRQ>
+
+Disk read requests since last displayed.
+
+=item B<RXBY>
+
+Network bytes received since last displayed.
+
+=item B<RXPK>
+
+Network packets received since last displayed.
+
+=item B<S>
+
+The state of the domain, one of:
+
+=over 4
+
+=item B<?>
+
+Unknown.
+
+=item B<R>
+
+Running.
+
+=item B<S>
+
+Blocked.
+
+=item B<P>
+
+Paused.
+
+=item B<D>
+
+=item B<O>
+
+Shutdown.
+
+=item B<X>
+
+Crashed.
+
+=back
+
+=item B<TIME>
+
+Total CPU time used.
+
+=item B<TXBY>
+
+Network bytes transmitted since last displayed.
+
+=item B<TXPK>
+
+Network packets transmitted since last displayed.
+
+=item B<WRBY>
+
+Disk bytes written since last displayed.
+
+=item B<WRRQ>
+
+Disk write requests since last displayed.
+
+=back
+
+=head1 NOTES
+
+=head2 Block I/O statistics
+
+This I/O value is the amount of I/O since the previous iteration
+of virt-top. To calculate speed of I/O, you should divide
+the number by delay secs.
+
+=head2 NETWORK RX BYTES AND PACKETS
+
+Libvirt/virt-top has no way to know that a packet transmitted to a
+guest was received (eg. if the guest is not listening).  In the
+network RX stats, virt-top reports the packets transmitted to the
+guest, on the basis that the guest might receive them.
+
+In particular this includes broadcast packets.  Because of the way
+that Linux bridges work, if the guest is connected to a bridge, it
+will probably see a steady "background noise" of RX packets even when
+the network interface is idle or down.  These are caused by STP
+packets generated by the bridge.
+
+=head2 DEBUGGING LIBVIRT ISSUES
+
+virt-top tries to turn libvirt errors into informative messages.
+However if libvirt initialization fails then this is not possible.
+Instead you will get an obscure error like:
+
+ libvir: error : Unknown failure
+ Fatal error: exception Libvirt.Virterror(...)
+
+To see the cause of libvirt errors in more detail, enable libvirt
+debugging by setting this environment variable:
+
+ export LIBVIRT_DEBUG=1
+
 =head1 SEE ALSO
 
 L<top(1)>,
 L<virsh(1)>,
-L<xm(1)>,
-L<xentop(1)>,
+L<http://www.libvirt.org/ocaml/>,
 L<http://www.libvirt.org/>,
-L<http://et.redhat.com/~rjones/>,
+L<http://people.redhat.com/~rjones/>,
 L<http://caml.inria.fr/>
 
 =head1 AUTHORS
@@ -318,7 +566,7 @@ Richard W.M. Jones <rjones @ redhat . com>
 
 =head1 COPYRIGHT
 
-(C) Copyright 2007 Red Hat Inc., Richard W.M. Jones
+(C) Copyright 2007-2012 Red Hat Inc., Richard W.M. Jones
 http://libvirt.org/
 
 This program is free software; you can redistribute it and/or modify
@@ -361,9 +609,12 @@ should submit with your bug report.
 
 =item 3. Get version of virt-top and version of libvirt.
 
-In virt-top, press the I<h> (help) key, and write down the version of
-virt-top and the version of libvirt.  They are shown in the first
-line.
+Use:
+
+ virt-top --version
+
+If you can get the precise version of libvirt you are using
+then that too is helpful.
 
 =item 4. Submit a bug report.
 
@@ -380,5 +631,3 @@ spaces).  You can also send me an email with the bug number if you
 want a faster response.
 
 =back
-
-=end