Blame src/components/vmware/VMwareComponentDocument.txt

Packit 577717
PAPI-V VMware Component Document
Packit 577717
Matthew R. Johnson <mrj@eecs.utk.edu>
Packit 577717
John Nelson <jnelso37@utk.edu>
Packit 577717
21 November 2011
Packit 577717
Revised: 23 January 2012
Packit 577717

Packit 577717

Packit 577717
This document is intended to detail the features of the PAPI-V VMware component, and more specifically the installation, usage, and pseudo performance counters available. In order to make this component possible, extensive research into the actual counters available, as well as the leveraging of the VMware Guest API1, was needed. As this is the first of the PAPI-V components, we seem to be stepping into a new realm of performance measurements that, previously, has been a new frontier, or unexplored all-together. 
Packit 577717

Packit 577717

Packit 577717
Installation:
Packit 577717

Packit 577717
To make PAPI with the VMware component you must go to the PAPI_ROOT/papi/src/components/vmware directory and configure with the flag: --with-vmware_incdir=<path>, where <path> is the path to the VMware Guest SDK for your machine.
Packit 577717

Packit 577717
NOTE: The VMware Guest SDK is normally found in the following default vmware-tools path: 
Packit 577717

Packit 577717
	/usr/lib/vmware-tools/GuestSDK
Packit 577717

Packit 577717
or:
Packit 577717

Packit 577717
	/opt/GuestSDK
Packit 577717

Packit 577717
	e.g.: ./configure --with-vmware_incdir=/usr/lib/vmware-tools/GuestSDK
Packit 577717

Packit 577717

Packit 577717
After running configure in the vmware directory, go to PAPI_CVS_ROOT/papi/src and configure again using the flag:
Packit 577717

Packit 577717
	--with-components=vmware
Packit 577717

Packit 577717
	e.g.: ./configure --with-components=vmware
Packit 577717

Packit 577717
After running the main configure script you can then type make, the Makefiles have been automatically generated. If at any point you would like to uninstall PAPI and the VMware comonent, from the PAPI_ROOT/papi/src directory, just type: 
Packit 577717

Packit 577717
	make clean clobber
Packit 577717

Packit 577717
To make use of VMWare timekeeping pseudo-performance counters, the following configuration must be added through the vSphere client:
Packit 577717

Packit 577717
        monitor_control.pseudo_perfctr = TRUE
Packit 577717

Packit 577717
As well as adding the 
Packit 577717

Packit 577717
	--with-vmware_pseudo_perfctr
Packit 577717
	
Packit 577717
		WARNING: If you do not enable the monitor_control.pseudo_perfctr on the host side, and give configure the --with-vmware_pseudo_perfctr, you will get a segmentation fault upon readpmc trying to access protected memory wiothout priveledged access. This is expected behavior. 
Packit 577717
	
Packit 577717
flag during component configure in the vmware component directory.
Packit 577717

Packit 577717
Available Performance Counters:
Packit 577717

Packit 577717
Below is the list of available performance metrics available to PAPI through the VMware component. If at any time you would like to see a full list of counters available to PAPI type ./papi_native_avail from within the utils directory.
Packit 577717

Packit 577717
It is important to know that the counters VMWARE_HOST_TSC, VMWARE_ELAPSED_TIME, and VMWARE_ELAPSED_APPARENT are currently the only true to name register counters available from withing a VMware virtual machine. Any Guest OS running on a VMware host must have the access enabled from within the VMware vSphere client managing the system for each virtual machine that wishes to use the VMware component, this exposes the counters to the virtual machine. All other counters you will see in the following lost are software counters that are being exposed through the use of the VMware API1. 
Packit 577717

Packit 577717

Packit 577717

Packit 577717
Event Code | Symbol  | Long Description |
Packit 577717
--------------------------------------------------------------------------------
Packit 577717
0x44000000 | VMWARE_HOST_TSC  | Physical host TSC                              |
Packit 577717
--------------------------------------------------------------------------------
Packit 577717
0x44000001 | VMWARE_ELAPSED_TIME  | Elapsed real time in ns.                   |
Packit 577717
--------------------------------------------------------------------------------
Packit 577717
0x44000002 | VMWARE_ELAPSED_APPARENT  | Elapsed apparent time in ns.           |
Packit 577717
--------------------------------------------------------------------------------
Packit 577717
0x44000003 | VMWARE_CPU_LIMIT  | Retrieves the upper limit of processor use in |
Packit 577717
           |  MHz available to the virtual machine.                            |
Packit 577717
--------------------------------------------------------------------------------
Packit 577717
0x44000004 | VMWARE_CPU_RESERVATION  | Retrieves the minimum processing power  |
Packit 577717
           | in MHz reserved for the virtual machine.                          |
Packit 577717
--------------------------------------------------------------------------------
Packit 577717
0x44000005 | VMWARE_CPU_SHARES  | Retrieves the number of CPU shares allocated |
Packit 577717
           |  to the virtual machine.                                          |
Packit 577717
--------------------------------------------------------------------------------
Packit 577717
0x44000006 | VMWARE_CPU_STOLEN  | Retrieves the number of milliseconds that th |
Packit 577717
           | e virtual machine was in a ready state (able to transition to a r |
Packit 577717
           | un state), but was not scheduled to run.                          |
Packit 577717
--------------------------------------------------------------------------------
Packit 577717
0x44000007 | VMWARE_CPU_USED  | Retrieves the number of milliseconds during wh |
Packit 577717
           | ich the virtual machine has used the CPU. This value includes the |
Packit 577717
           |  time used by the guest operating system and the time used by vir |
Packit 577717
           | tualization code for tasks for this virtual machine. You can comb |
Packit 577717
           | ine this value with the elapsed time (VMWARE_ELAPSED) to estimate |
Packit 577717
           |  the effective virtual machine CPU speed. This value is a subset  |
Packit 577717
           | of elapsedMs.                                                     |
Packit 577717
--------------------------------------------------------------------------------
Packit 577717
0x44000008 | VMWARE_ELAPSED  | Retrieves the number of milliseconds that have  |
Packit 577717
           | passed in the virtual machine since it last started running on th |
Packit 577717
           | e server. The count of elapsed time restarts each time the virtua |
Packit 577717
           | l machine is powered on, resumed, or migrated using VMotion. This |
Packit 577717
           |  value counts milliseconds, regardless of whether the virtual mac |
Packit 577717
           | hine is using processing power during that time. You can combine  |
Packit 577717
           | this value with the CPU time used by the virtual machine (VMWARE_ |
Packit 577717
           | CPU_USED) to estimate the effective virtual machine xCPU speed. c |
Packit 577717
           | puUsedMS is a subset of this value.                               |
Packit 577717
--------------------------------------------------------------------------------
Packit 577717
0x44000009 | VMWARE_MEM_ACTIVE  | Retrieves the amount of memory the virtual m |
Packit 577717
           | achine is actively using in MB€”its estimated working set size.     |
Packit 577717
--------------------------------------------------------------------------------
Packit 577717
0x4400000a | VMWARE_MEM_BALLOONED  | Retrieves the amount of memory that has b |
Packit 577717
           | een reclaimed from this virtual machine by the vSphere memory bal |
Packit 577717
           | loon driver (also referred to as the “vmmemctl” driver) in MB.    |
Packit 577717
--------------------------------------------------------------------------------
Packit 577717
0x4400000b | VMWARE_MEM_LIMIT  | Retrieves the upper limit of memory that is a |
Packit 577717
           | vailable to the virtual machine in MB.                            |
Packit 577717
--------------------------------------------------------------------------------
Packit 577717
0x4400000c | VMWARE_MEM_MAPPED  | Retrieves the amount of memory that is alloc |
Packit 577717
           | ated to the virtual machine in MB. Memory that is ballooned, swap |
Packit 577717
           | ped, or has never been accessed is excluded.                      |
Packit 577717
--------------------------------------------------------------------------------
Packit 577717
0x4400000d | VMWARE_MEM_OVERHEAD  | Retrieves the amount of €œoverhead mem       |
Packit 577717
           | ory associated with this virtual machine that is currently consum |
Packit 577717
           | ed on the host system in MB. Overhead memory is additional memory |
Packit 577717
           |  that is reserved for data structures required by the virtualizat |
Packit 577717
           | ion layer.                                                        |
Packit 577717
--------------------------------------------------------------------------------
Packit 577717
0x4400000e | VMWARE_MEM_RESERVATION  | Retrieves the minimum amount of memory  |
Packit 577717
           | that is reserved for the virtual machine in MB.                   |
Packit 577717
--------------------------------------------------------------------------------
Packit 577717
0x4400000f | VMWARE_MEM_SHARED  | Retrieves the amount of physical memory asso |
Packit 577717
           | ciated with this virtual machine that is copy €on €write (COW)      |
Packit 577717
           | shared on the host in MB.                                         |
Packit 577717
--------------------------------------------------------------------------------
Packit 577717
0x44000010 | VMWARE_MEM_SHARES  | Retrieves the number of memory shares alloca |
Packit 577717
           | ted to the virtual machine.                                       |
Packit 577717
--------------------------------------------------------------------------------
Packit 577717
0x44000011 | VMWARE_MEM_SWAPPED  | Retrieves the amount of memory that has bee |
Packit 577717
           | n reclaimed from this virtual machine by transparently swapping g |
Packit 577717
           | uest memory to disk in MB.                                        |
Packit 577717
--------------------------------------------------------------------------------
Packit 577717
0x44000012 | VMWARE_MEM_TARGET_SIZE  | Retrieves the size of the target memory |
Packit 577717
           |  allocation for this virtual machine in MB.                       |
Packit 577717
--------------------------------------------------------------------------------
Packit 577717
0x44000013 | VMWARE_MEM_USED  | Retrieves the estimated amount of physical hos |
Packit 577717
           | t memory currently consumed for this virtual machine’s physical   |
Packit 577717
           | memory.                                                           |
Packit 577717
--------------------------------------------------------------------------------
Packit 577717
0x44000014 | VMWARE_HOST_CPU  | Retrieves the speed of the ESX system’€™s phys   |
Packit 577717
           | ical CPU in MHz.                                                  |
Packit 577717

Packit 577717

Packit 577717

Packit 577717

Packit 577717
Timekeeping Counters:
Packit 577717

Packit 577717

Packit 577717
        The pseudo-performance counter feature uses a trap to catch a privileged machine instruction issued by software running in the virtual machine and therefore has more overhead than reading a performance counter or the TSC on physical hardware. The feature will only trap correctly if the configuration setting is applied as described in Installation. 
Packit 577717

Packit 577717

Packit 577717
The timekeeping counters behave as follows:
Packit 577717

Packit 577717

Packit 577717
VMWARE_HOST_TSC - Provides access the the Time Stamp Counter on the host machine which counts ticks since reset.
Packit 577717
VMWARE_ELAPSED_TIME - Provides access to the elapsed time in ns since reset as measured on the host machine.
Packit 577717
VMWARE_ELAPSED_APPARENT - Apparent time is the time visible the Guest OS using virtualized timer devices. This timer may fall behind real time and catch up as needed.
Packit 577717

Packit 577717

Packit 577717
Usage:
Packit 577717

Packit 577717

Packit 577717
        After installation of the VMware Component, you may use the papi_commmand_line interface, found in PAPI_ROOT/papi/src/utils to read out an instantaneous value from a certain counter from the above list. If you would like to read out a counter, type: ./papi_command_line COUNTER_SYMBOL_NAME.
Packit 577717

Packit 577717

Packit 577717
e.g.: To read out the value of the VMWARE_MEM_USED counter
Packit 577717

Packit 577717

Packit 577717
user@vm1:~/papi/src/utils$ ./papi_command_line VMWARE_MEM_USED
Packit 577717
Successfully added: VMWARE_MEM_USED
Packit 577717

Packit 577717

Packit 577717
VMWARE_MEM_USED :         13074
Packit 577717

Packit 577717

Packit 577717
----------------------------------
Packit 577717
Verification: Checks for valid event name.
Packit 577717
This utility lets you add events from the command line interface to see if they work.
Packit 577717
command_line.c                       PASSED
Packit 577717

Packit 577717

Packit 577717
For further usage of PAPI and it’s API on how to incorporate these counters into a program of your own please see the PAPI Documentation2.
Packit 577717

Packit 577717

Packit 577717
________________
Packit 577717

Packit 577717

Packit 577717
References:
Packit 577717

Packit 577717

Packit 577717
[1]        VMware: http://www.vmware.com/support/developer/guest-sdk. Last accessed November 28, 2011
Packit 577717
 [2]        PAPI :        http://icl.cs.utk.edu/projects/papi/wiki/Main_Page. Last accessed November 28, 2011