menu

hjk41的日志

Avatar

HP Caliper v.s Intel VTune

HP Caliper and Intel VTune Performance Analyzer are both good performance analysis tools which can identify the bottleneck of a program and the possible causes of the bottleneck. They use the performance counters provided by the CPUs to measure the critical CPU events, such the number of instructions executed, the number of cache misses, ect. One of the advantages of using performance-counter-based tools to analyze a program is that little, if any, instrumentation is required. Compared to instrumentation tools, such as PIN and ATOM, which inject code into the original program and thus change the behavior of the program a lot, these performance-counter-based tools requires no modification of the original program. The instrumented program usually runs 10 or more times slower than the original one. So the performance-counter-based approach is also more time-efficient.

There are several performance-counter-based performance analysis tools. HP Caliper and Intel VTune are two of the most popular among them. However, there are still other tools, such as PAPI, but I haven't got a chance to use them. So I will just compare these two.

1. platforms supported
HP Caliper: Itanium only
Intel VTune: Itanium & Intel x86 processors

2. OS
HP Caliper: HP-UX, Linux
Intel VTune: Linux, Windows

3. interface
HP Caliper: command line & GUI
Intel VTune: command line & GUI

4. data collecting mode
To fetch the values in performance counters quickly, the softwares need the help of the OS kernel.
HP Caliper uses a bunch of APIs called perfmon, which is usually implemented in the Linux kernels. However, newer version of Caliper would require new version of perfmon, which those in Linux kernels are usually too old. Fortunately, HP provides new versions of perfmon in the form of kernel patches. One can download them from sourceforge and apply them to his own kernel souce. The process seem to be easy for those who have compiled Linux kernel before, but it may turn out hard for those who haven't. And due to the fact that Caliper is based on the perfmon API, which the Windows family do not provide, Caliper cannot be installed on Windows.
Intel VTune, however, performns this task in another way. It uses a driver to collect the performance counter values. As far as I know, they have the driver for most of the famous Linux distributions, such as RedHat AS, Fedora Core, Ubuntu, SuSE and Debian. However, the latest versions may not be supported, but you can compile the driver yourselves. Compiling the driver means that you will need kernel headers, which are not provided by some distributions such as Fedora Core 4 and later. In this case, you would have to install the kernel headers first. VTune works fine in Windows XP, but not so good in VISTA.

5. functionality
Caliper and VTune are almost the same in terms of the things they are capable of. However, Caliper users are not allowed to specify the opcode values, so it would be impossible to collect such events as "L2 cache misses caused by prefetch of a program on Itanium", for that would required the opcode of event "L2_MISSES" with opcode set to "lfetch". Except for this, these two tools differs little in their functionality.

6. ease of use
To install Caliper, one typically downloads an "rpm" file from HP software depoit, and a simple rpm command would finish the installation, if you don't get caught by the "newer version of perfmon required" issue.
One the other hand, VTune is divided into several parts, namely the driver, the remote data collector and the interface, which makes it a little bit more difficult. And if you want to use GUI on windows, and collect data on a Linux box, it would become even more complexed. Wierd issues may arise and make your exhausted just to analyze a simple "Hello World" program.
As far as I know, there are much more bugs in VTune than Caliper. One reason may be that the VTune driver is unstable, for it sometimes hangs for unknown reasons, and makes the OS stop responding, even to the "reboot" command. If I am not required to use the PMU to specify opcode, I would always prefer Caliper to VTune.

In summary, Caliper is easier to use and more robust. If you work under Linux or HP-UX and uses Itanium processors, and don't need to specify opcode for PMU, I would suggest using Caliper. But if you are so unlucky as to use Windows or has a x86 box, you will have to do with VTune. And I strongly recommend that you don't upgrade your Windows to VISTA if you want to use Intel. For VTune is still very unstable on Windows VISTA.

Hi,
Caliper does provides option to specify opcode for PMU. It's "--omr".

评论已关闭