ProbeVue

Last updated

ProbeVue is IBM's implementation of a lightweight dynamic tracing environment introduced in AIX version 6.1. [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.

Contents

Because modifications are not required of a probed process [2] 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 C-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.

@@syscall:*:read:entrywhen(__pid==123456){/* This is a comment: The process with a PID of 123456 has called read(); */printf("read() system call entered.\n");}

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 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. [3]

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 casting 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.

Data classes

Vue uses scoping 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.

globals - Variables that have scope across the entire Vue script
shell - Variables that follow shell conventions and are read from the Unix environment
kernel - 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 operators 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, [4] recursion, 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 SQL.

Usage

A Vue script can be invoked with interpreter magic 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. [5] 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 DTrace 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. [6] 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.

See also

Related Research Articles

<span class="mw-page-title-main">AWK</span> Programming language

AWK is a domain-specific language designed for text processing and typically used as a data extraction and reporting tool. Like sed and grep, it is a filter, and is a standard feature of most Unix-like operating systems.

In computing, Common Gateway Interface (CGI) is an interface specification that enables web servers to execute an external program to process HTTP or HTTPS user requests.

<span class="mw-page-title-main">JavaScript</span> High-level programming language

JavaScript, often abbreviated as JS, is a programming language and core technology of the World Wide Web, alongside HTML and CSS. As of 2024, 98.9% of websites use JavaScript on the client side for webpage behavior, often incorporating third-party libraries. All major web browsers have a dedicated JavaScript engine to execute the code on users' devices.

<span class="mw-page-title-main">Fortran</span> General-purpose programming language

Fortran is a third generation, compiled, imperative programming language that is especially suited to numeric computation and scientific computing.

PL/I is a procedural, imperative computer programming language initially developed by IBM. It is designed for scientific, engineering, business and system programming. It has been in continuous use by academic, commercial and industrial organizations since it was introduced in the 1960s.

<span class="mw-page-title-main">System call</span> Way for programs to access kernel services

In computing, a system call is the programmatic way in which a computer program requests a service from the operating system on which it is executed. This may include hardware-related services, creation and execution of new processes, and communication with integral kernel services such as process scheduling. System calls provide an essential interface between a process and the operating system.

<span class="mw-page-title-main">OpenMP</span> Open standard for parallelizing

OpenMP is an application programming interface (API) that supports multi-platform shared-memory multiprocessing programming in C, C++, and Fortran, on many platforms, instruction-set architectures and operating systems, including Solaris, AIX, FreeBSD, HP-UX, Linux, macOS, and Windows. It consists of a set of compiler directives, library routines, and environment variables that influence run-time behavior.

<span class="mw-page-title-main">C99</span> C programming language standard, 1999 revision

C99 is an informal name for ISO/IEC 9899:1999, a past version of the C programming language standard. It extends the previous version (C90) with new features for the language and the standard library, and helps implementations make better use of available computer hardware, such as IEEE 754-1985 floating-point arithmetic, and compiler technology. The C11 version of the C programming language standard, published in 2011, updates C99.

In some programming languages, eval, short for the English evaluate, is a function which evaluates a string as though it were an expression in the language, and returns a result; in others, it executes multiple lines of code as though they had been included instead of the line including the eval. The input to eval is not necessarily a string; it may be structured representation of code, such as an abstract syntax tree, or of special type such as code. The analog for a statement is exec, which executes a string as if it were a statement; in some languages, such as Python, both are present, while in other languages only one of either eval or exec is.

RPG is a high-level programming language for business applications, introduced in 1959 for the IBM 1401. It is most well known as the primary programming language of IBM's midrange computer product line, including the IBM i operating system. RPG has traditionally featured a number of distinctive concepts, such as the program cycle, and the column-oriented syntax. The most recent version is RPG IV, which includes a number of modernization features, including free-form syntax.

<span class="mw-page-title-main">DTrace</span> Dynamic tracing framework for kernel and applications

DTrace is a comprehensive dynamic tracing framework originally created by Sun Microsystems for troubleshooting kernel and application problems on production systems in real time. Originally developed for Solaris, it has since been released under the free Common Development and Distribution License (CDDL) in OpenSolaris and its descendant illumos, and has been ported to several other Unix-like systems.

Advanced Function Presentation (AFP) is a presentation architecture and family of associated printer software and hardware that provides for document and information presentation independent of specific applications and devices.

strace Diagnostic, debugging and instructional userspace utility for Linux

strace is a diagnostic, debugging and instructional userspace utility for Linux. It is used to monitor and tamper with interactions between processes and the Linux kernel, which include system calls, signal deliveries, and changes of process state. The operation of strace is made possible by the kernel feature known as ptrace.

<span class="mw-page-title-main">IBM TPNS</span> Test automation tool developed by IBM

Teleprocessing Network Simulator (TPNS) is an IBM licensed program, first released in 1976 as a test automation tool to simulate the end-user activity of network terminal(s) to a mainframe computer system, for functional testing, regression testing, system testing, capacity management, benchmarking and stress testing.

In the context of computer programming, instrumentation refers to the measure of a product's performance, in order to diagnose errors and to write trace information. Instrumentation can be of two types: source instrumentation and binary instrumentation.

<span class="mw-page-title-main">SystemTap</span> Scripting language and tool

In computing, SystemTap is a scripting language and tool for dynamically instrumenting running production Linux-based operating systems. System administrators can use SystemTap to extract, filter and summarize data in order to enable diagnosis of complex performance or functional problems.

A batch file is a script file in DOS, OS/2 and Microsoft Windows. It consists of a series of commands to be executed by the command-line interpreter, stored in a plain text file. A batch file may contain any command the interpreter accepts interactively and use constructs that enable conditional branching and looping within the batch file, such as IF, FOR, and GOTO labels. The term "batch" is from batch processing, meaning "non-interactive execution", though a batch file might not process a batch of multiple data.

<span class="mw-page-title-main">Scripting language</span> Programming language for run-time events

A scripting language or script language is a programming language that is used to manipulate, customize, and automate the facilities of an existing system. Scripting languages are usually interpreted at runtime rather than compiled.

<span class="mw-page-title-main">Rexx</span> Command/scripting/programming language

Rexx is a programming language that can be interpreted or compiled. It was developed at IBM by Mike Cowlishaw. It is a structured, high-level programming language designed for ease of learning and reading. Proprietary and open source Rexx interpreters exist for a wide range of computing platforms; compilers exist for IBM mainframe computers.

PL/SQL is Oracle Corporation's procedural extension for SQL and the Oracle relational database. PL/SQL is available in Oracle Database, Times Ten in-memory database, and IBM Db2. Oracle Corporation usually extends PL/SQL functionality with each successive release of the Oracle Database.

References

  1. "1.4: ProbeVue". IBM RedBooks: IBM AIX Version 6.1 Differences Guide. 10 Mar 2008. p. 21. ISBN   0738485799.
  2. ProbeVue entry of AIX 7.1 Knowledge center page
  3. Discussion of Vue language concepts can be found in the Vue programming language section and the ProbeVue: Extended Users Guide Specification.
  4. Pre-defined functions are available within the ProbeVue environment. See the AIX 6.1 Differences RedBook or the ProbeVue: Extended Users Guide Specification for a list of pre-defined functions.
  5. ProbeVue command entry of AIX 6.1 Knowledge Center page
  6. These are called Providers in DTrace.