PV - A Program Visualization System
PV is a program visualization system developed at IBM Research. The system was developed to aid software developers in finding program faults and tuning performance. Executing programs involve both hardware, operating system, and application level operations. As such, PV provides users with views of all three levels of activity and performance. PV has been used in a number of systems to aid developers in finding performance problems.
Implementation
PV is built of a framework and a number of plug-in components. The system consists of event traces that are analyzed and displayed. An event has both a timestamp and some event-specific data. This data can contain information about a page fault, memory allocation, or even completion of some step of an algorithm. PV was built on top of the AIX system (IBM's Univx operating system) which provides an embedded tracing facility that PV uses to store the event traces.
Views
PV has been built thus far with a number of different views displaying various events. The following are examples:
- Process Tree. One view is a process tree representing the processes in the system at a given time. The processes are colored according to the time taken recently. The user can then run this view over the execution period to get an overview of when certain processes are active.
- Color histograms. Color histrograms show process information as a mural of lines, each line being a time step in the execution of the program. The lines could represent user processes, with the color of the line representing which process is running at that time. This colorstrip can also indicate which system-level activities (system calls, clock interrupts, page faults, etc.) are occurring during the execution, with different colors representing different activities.
- LineGraphs. Another view is a linegraph which plots certain performance statistics over execution time, with each statistic being a different color. These statistics could be kernel statistics or hardware performance (instruction execution rates, cache miss rates, etc.)
- Colorstrips. Colorstrips can also represent memory allocation, with each line representing a data location. Color can then represent who allocated the block, the size of the block, or even the status of the memory location.
- Textual Views. In addition to the visualizations, text can be used to provide the full event detail as well as code.
All of the above views can be configured to run during the same execution sequence, or on the same memory. Thus, multiple views can be shown at the same time to provide greater detail and information about the running program.
Examples
PV has been used on several systems to improve performance. PV was used to investigate why the startup of an interactive graphics application was taking 12 seconds. The first figure below shows a screen shot of this activity. Using the color histograms and line graphs to display user and system activities, it was discovered that the delay was caused by network delay in reading configuration files, waiting for a system utility to determine the amount of physical memory, and page faults. This enabled the developers to greatly improve the beginning performance. For a compiler, PV was able to determine that there were no huge memory leaks, but instead that memory was being used inefficiently and was causing delays as pages were repeatedly becoming inactive then active again. Figure 2 below shows a screen shot from PV for the compiler. For a computation-intensive scientific application, PV helped find hardware inefficiencies for a long running loop, allowing the developers to achieve a 12% improvement in the performance of the application.

Figure 1. PV with a process tree, color histograms, and line graph.

Figure 2. PV showing colorstrips of memory allocation.