OCS: What Are Probes?

From OC Systems Wiki!
Jump to: navigation, search

What are probes?

Probes are machine-code patches that provide a way to alter the image of an executable while it is in memory. Aprobe's probes are lightweight and non-intrusive. They are designed to be used in production systems.

The probes are written in simple C or Java, with a few commands added. Virtually anything you can do in C or Java can be done with a probe.

To see what probes look like, visit our probe library.

How do probes work?

When aprobe is invoked on an application, it loads the executable, the libraries it references and the specified UALs, and reads in all the symbol table information. The aprobe runtime applies all the statically defined probes described in the UALs, then invokes any probe program on_entry actions. It is in such a probe that all the start-up actions for a predefined probe occur: UAL command-line arguments are read, the configuration file is read and recorded, and the Java GUI process is started if requested. Using the GUI, the user may request a list of all the symbols in a module from which to select those to be probed, and specify other options.

When the final configuration is set and execution is continued, the probes on the functions specified in the configuration file are applied. When all probes have been applied successfully, and any other probe program and probe thread on_entry actions have been executed, the application program continues its normal execution.

As the application executes, the probes are invoked. They collect or update the data according to their function. If snapshots are used, the data is written to the APD file at that point—otherwise the data is written out when execution finishes.