ProbeVue
Encyclopedia
ProbeVue is IBM
's implementation of a lightweight dynamic tracing
environment introduced in AIX version 6.1. ProbeVue provides the ability to probe running processes in order to provide statistical analysis as well as retrieve data from the probed process. The dynamic nature of ProbeVue allows it to be used as a global system performance tool while retaining the ability to drill into very specific events on a single process or thread.
Because modifications are not required of a probed process or system and the lightweight design of ProbeVue as a tracing tool, it is suitable for use in a production environment where previous tracing tools would have been performance prohibitive.
-like syntax with a limited set of built in functions.
The following is an example of a probe that is defined for whenever a process with a PID of 123456 enters the read system call. When that event happens this script will call the built-in printf function to print a message to its output trace buffers. The first line in the action block is a C-style comment and therefore will not execute in the ProbeVue environment.
Probes like the above sample can be written and run without the extensive testing normally required of a production system. The ProbeVue environment protects the user from errant code or resource hungry tracing frequently seen with previous IBM tracing tools. The runtime compile feature of ProbeVue provides a powerful ad-hoc environment for data gathering.
Probe Point Specifications
Currently IBM provides the following probe providers on AIX 6.1: syscall, uft, interval, trace, and the probevue probes (BEGIN and END). The syscall provider defines probe points for a subset of the available system calls. User Function Tracing (uft) probes can be defined for entry points of functions defined in a C or C++ program. Both syscall and uft probes must include a valid function prototype in the Vue script before function parameters (for the entry probes) or return values (for syscall exit probes only) can be accessed. The interval probes fire on a timer and can be defined on 100 millisecond intervals. The trace provider allows ProbeVue to access traditional trace hooks. Finally the probevue probes called BEGIN and END will fire as the probevue environment itself starts and exits.
The Vue Language
Because ProbeVue is designed as a tool to monitor operating system system events, the Vue language uses an event driven
style that is used to describe how to process data derived from these events.
Like most dynamic tracing languages found on other Unices, the Vue language has a C-like syntax and is frequently presented in this context. Vue's relationship to C has many parallels but deviates most significantly from the imperative
nature of C. Some of the contrasts and similarities are shown here.
and automatic type promotion during operations with mixed types is similar to C behavior as well.
Pointers to arrays and data structures behave in ProbeVue the same as they would in a C program, with the key difference from C is that when pointers refer to a location in memory they are referencing a location in another process space. To access that memory it is necessary to first copy the memory location into the local ProbeVue environment. If the memory has been paged out, ProbeVue cannot force a page fault
to access it. Another difference is that the size of pointers in C are determined at compile time, while in ProbeVue they are determined by the 32
or 64
bitness of the application that is probed.
Floating point data types are valid data types for assignment from a probed process, but cannot be used for floating point mathematical operations.
rules similar to C, but must also account for the externally derived nature of much of the data in probes. As a result, not all data classes are available or relevant in all probes or all portions of a View script. The basic classifications of data are as follows.
follow C conventions closely with the exception of when used with strings. When used with strings, the + operator performs concatenation, and the operator is used for comparisons.
, or looping constructs but does offer conditional if-then expressions within a probe action block. The lightweight nature of ProbeVue prohibits a Vue script from defining expensive looping or extensive branching operations that could degrade performance.
.
and set executable like a shell script or can be run as input to the probevue command in the form of a command line parameter or stdin input. By convention, Vue scripts have a .e filename extension.
offers an aggregation data type and a powerful set of aggregating functions
to represent statistical data. The list data type offers only basic aggregating functions on a single item (as opposed to an associative arrays
of aggregations that DTrace offers). The list data type offers a slight simplification over keeping the stats manually but does not allow the list to be reset (say, over an interval) that can easily be done when using manual summaries and basic types. IBM has committed to associative arrays on future versions of the Vue language.
Because of the long development lead time DTrace has over ProbeVue, DTrace has considerably more probe point specifications. IBM has plans to add a considerable number of new probe points in future technology level releases of AIX 6.1 and in the next major AIX release.
IBM
International Business Machines Corporation or IBM is an American multinational technology and consulting corporation headquartered in Armonk, New York, United States. IBM manufactures and sells computer hardware and software, and it offers infrastructure, hosting and consulting services in areas...
's implementation of a lightweight dynamic tracing
Tracing (software)
In software engineering, tracing is a specialized use of logging to record information about a program's execution. This information is typically used by programmers for debugging purposes, and additionally, depending on the type and detail of information contained in a trace log, by experienced...
environment introduced in AIX version 6.1. ProbeVue provides the ability to probe running processes in order to provide statistical analysis as well as retrieve data from the probed process. The dynamic nature of ProbeVue allows it to be used as a global system performance tool while retaining the ability to drill into very specific events on a single process or thread.
Because modifications are not required of a probed process or system and the lightweight design of ProbeVue as a tracing tool, it is suitable for use in a production environment where previous tracing tools would have been performance prohibitive.
Description
ProbeVue provides a series of probe point specifications that are potential events that can be probed. A script written in the Vue language allows the user to define a probe that is a block of code called an action block that will run when those events occur on the system. The execution of the action block can be limited to specific events by use of a conditional statement placed on the probe called a predicate. The code in the action block follows a CC (programming language)
C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....
-like syntax with a limited set of built in functions.
The following is an example of a probe that is defined for whenever a process with a PID of 123456 enters the read system call. When that event happens this script will call the built-in printf function to print a message to its output trace buffers. The first line in the action block is a C-style comment and therefore will not execute in the ProbeVue environment.
Probes like the above sample can be written and run without the extensive testing normally required of a production system. The ProbeVue environment protects the user from errant code or resource hungry tracing frequently seen with previous IBM tracing tools. The runtime compile feature of ProbeVue provides a powerful ad-hoc environment for data gathering.
Probe Point Specifications
Currently IBM provides the following probe providers on AIX 6.1: syscall, uft, interval, trace, and the probevue probes (BEGIN and END). The syscall provider defines probe points for a subset of the available system calls. User Function Tracing (uft) probes can be defined for entry points of functions defined in a C or C++ program. Both syscall and uft probes must include a valid function prototype in the Vue script before function parameters (for the entry probes) or return values (for syscall exit probes only) can be accessed. The interval probes fire on a timer and can be defined on 100 millisecond intervals. The trace provider allows ProbeVue to access traditional trace hooks. Finally the probevue probes called BEGIN and END will fire as the probevue environment itself starts and exits.
The Vue Language
Because ProbeVue is designed as a tool to monitor operating system system events, the Vue language uses an event driven
Event-driven programming
In computer programming, event-driven programming or event-based programming is a programming paradigm in which the flow of the program is determined by events—i.e., sensor outputs or user actions or messages from other programs or threads.Event-driven programming can also be defined as an...
style that is used to describe how to process data derived from these events.
Like most dynamic tracing languages found on other Unices, the Vue language has a C-like syntax and is frequently presented in this context. Vue's relationship to C has many parallels but deviates most significantly from the imperative
Imperative programming
In computer science, imperative programming is a programming paradigm that describes computation in terms of statements that change a program state...
nature of C. Some of the contrasts and similarities are shown here.
Data Types
Because ProbeVue is used to monitor applications written primarily in C, it supports all C data types as well as C data structures. Vue also supports a String, list, and time stamp data types. The String and list types are both actually arrays, while the time stamp is a high resolution representation of a point in time. Type castingType conversion
In computer science, type conversion, typecasting, and coercion are different ways of, implicitly or explicitly, changing an entity of one data type into another. This is done to take advantage of certain features of type hierarchies or type representations...
and automatic type promotion during operations with mixed types is similar to C behavior as well.
Pointers to arrays and data structures behave in ProbeVue the same as they would in a C program, with the key difference from C is that when pointers refer to a location in memory they are referencing a location in another process space. To access that memory it is necessary to first copy the memory location into the local ProbeVue environment. If the memory has been paged out, ProbeVue cannot force a page fault
Page fault
A page fault is a trap to the software raised by the hardware when a program accesses a page that is mapped in the virtual address space, but not loaded in physical memory. In the typical case the operating system tries to handle the page fault by making the required page accessible at a location...
to access it. Another difference is that the size of pointers in C are determined at compile time, while in ProbeVue they are determined by the 32
32-bit application
On the x86 architecture, a 32-bit application normally means software that typically uses the 32-bit linear address space possible with the 80386 and later chips...
or 64
64-bit
64-bit is a word size that defines certain classes of computer architecture, buses, memory and CPUs, and by extension the software that runs on them. 64-bit CPUs have existed in supercomputers since the 1970s and in RISC-based workstations and servers since the early 1990s...
bitness of the application that is probed.
Floating point data types are valid data types for assignment from a probed process, but cannot be used for floating point mathematical operations.
Data Classes
Vue uses scopingScope (programming)
In computer programming, scope is an enclosing context where values and expressions are associated. Various programming languages have various types of scopes. The type of scope determines what kind of entities it can contain and how it affects them—or semantics...
rules similar to C, but must also account for the externally derived nature of much of the data in probes. As a result, not all data classes are available or relevant in all probes or all portions of a View script. The basic classifications of data are as follows.
- globalsGlobal variableIn computer programming, a global variable is a variable that is accessible in every scope . Interaction mechanisms with global variables are called global environment mechanisms...
- Variables that have scope across the entire Vue script - shell - Variables that follow shell conventions and are read from the Unix environment
- kernelKernel (computing)In computing, the kernel is the main component of most computer operating systems; it is a bridge between applications and the actual data processing done at the hardware level. The kernel's responsibilities include managing the system's resources...
- Variables that are provided by the kernel - local - Variables that are local to a probe action block
- thread local - Variables that are local to a thread, but have scope across multiple probe action blocks
- entry/exit - Variables that are defined by, and local to, the probe
- built in - Pre defined variables that have values relevant to the current firing probe
Operators
Vue operatorsOperator (programming)
Programming languages typically support a set of operators: operations which differ from the language's functions in calling syntax and/or argument passing mode. Common examples that differ by syntax are mathematical arithmetic operations, e.g...
follow C conventions closely with the exception of when used with strings. When used with strings, the + operator performs concatenation, and the operator is used for comparisons.
Flow Control
Vue does not allow the definition of user functions, recursionRecursion (computer science)
Recursion in computer science is a method where the solution to a problem depends on solutions to smaller instances of the same problem. The approach can be applied to many types of problems, and is one of the central ideas of computer science....
, or looping constructs but does offer conditional if-then expressions within a probe action block. The lightweight nature of ProbeVue prohibits a Vue script from defining expensive looping or extensive branching operations that could degrade performance.
Tentative Tracing
Tentative tracing is a concept that allows the trace output of a block of code to be labeled as tentative. The output of this code can later be committed to the trace buffers as visible output or it can be discarded. This works conceptually much like transaction controls in SQLSQL
SQL is a programming language designed for managing data in relational database management systems ....
.
Usage
A Vue script can be invoked with interpreter magicShebang (Unix)
In computing, a shebang is the character sequence consisting of the characters number sign and exclamation point , when it occurs as the first two characters on the first line of a text file...
and set executable like a shell script or can be run as input to the probevue command in the form of a command line parameter or stdin input. By convention, Vue scripts have a .e filename extension.
Deficiencies
The Vue language lacks aggregations and instead uses a list data type that offers similar yet limited functionality. The equivalent product from Solaris called DTraceDTrace
DTrace is a comprehensive dynamic tracing framework created by Sun Microsystems for troubleshooting kernel and application problems on production systems in real time...
offers an aggregation data type and a powerful set of aggregating functions
Aggregate function
In computer science, an aggregate function is a function where the values of multiple rows are grouped together as input on certain criteria to form a single value of more significant meaning or measurement such as a set, a bag or a list....
to represent statistical data. The list data type offers only basic aggregating functions on a single item (as opposed to an associative arrays
Associative array
In computer science, an associative array is an abstract data type composed of a collection of pairs, such that each possible key appears at most once in the collection....
of aggregations that DTrace offers). The list data type offers a slight simplification over keeping the stats manually but does not allow the list to be reset (say, over an interval) that can easily be done when using manual summaries and basic types. IBM has committed to associative arrays on future versions of the Vue language.
Because of the long development lead time DTrace has over ProbeVue, DTrace has considerably more probe point specifications. IBM has plans to add a considerable number of new probe points in future technology level releases of AIX 6.1 and in the next major AIX release.