dprobes − IBM Dynamic Probe Facility |
dprobes {--help|-h} dprobes {--version|-v} dprobes {--insert|-i <probe-program-file>} |
[-D key = value] |
[--unformatted-output|-f] |
dprobes {--remove|-r} |
{--name <loadable_module_name>| --all|-a} |
dprobes {--getvars|-g} |
{--name <loadable_module_name>| --all|-a} |
[--index|-i=index1-index2] |
[--local | --global] [--reset] |
dprobes {--query|-q} |
{--name <loadable_module_name>| --all|-a} |
[--extended|-x] |
dprobes {--build-ppdf|-b <rpn_file_name> } |
[--outfile|-o <ppdf_file_name> ] |
dprobes {--apply-ppdf|-p <ppdf_file_name> } |
[--group|-u = <group_list> ] |
[--type|-t = <type_list> ] |
The dprobes facility can be used to insert software probes dynamically into executing code modules. When a probe is fired, a user written probe-handler is executed. The probe-handler is a program written in an assembly-like language, based on the Reverse Polish Notation (RPN). Instructions are provided to enable the probe-handler to access all the hardware registers, system data structures and memory. This is equivalent to inserting a breakpoint, monitoring various context specific values, dumping out certain data areas when the breakpoint is hit. So, in short, it is a dynamic debug session that runs without disrupting the code being debugged and with only a very small runtime performance hit. The dprobes facility is particularly useful for diagnosing problems that show up rarely in frequently hit areas of code. DProbes also allows the probing storage accesses, implemented using the debug registers available on Intel x86 processors. These probes, called the watchpoint probes, can be specified to be fired on a specific type of memory access (execute|write|readwrite|io). Watchpoints are not currently available for S/390. Another interesting aspect of the Dynamic Probes facility
is that the probes are effective globally and they
interoperate well with other debuggers. This means that
probes placed in an executable module will be applied on all
instances of that executable, under the context of all
processes. Some of the unique aspects of the Dynamic Probes facility
are: At the heart of the mechanism is an interpreter which executes a "probe program" when a probe fires. A probe program is registered per executable module and contains the probe handlers to be run for each probe placed in that module. Probes may be registered before a process is created or a module is loaded. Refer to the man page of dprobes.lang(8) for the details of the probe program file format and language to be used for writing probe handlers. |
This facility can be used by root only. |
This command works in the following basic operating modes: insert: remove: getvars: querying: building ppdf: applying ppdf: miscellaneous: |
The general form of a dprobes insert command is: dprobes --insert <probe-program-file> |
[-D key = value] |
[--unformatted-output] |
-i -D key = value -u -t Both group and type are optional on the command line. If
nothing is specified then all the probes present in the ppdf
file will be applied. If both --group AND
--type are present then only the probes belonging to
both one of the groups <group_name> as well as
one of the types <type_name> will be
applied. -s -m -c --dont-verify-opcodes --stop-cpus -l PROCNAME - log the process name for each probe PID - log the pid of the process for which the |
probe was hit |
UID - log the uid of the process for which the |
probe was hit |
CSEIP - log caller’s CS:EIP (IA32) SSESP - log caller’s SS:ESP (IA32) PSW - log caller’s PSW (S/390) UPSW - log caller’s user mode PSW. If the probe point is in the |
kernel, then the psw of the program that made the call is stored. |
Otherwise acts the same as PSW (S/390) |
TSC - log Pentium high resolution Time Stamp Counter (IA32), |
log the STCK value (S/390), |
or ignore if not supported by the hardware |
ALL - log all special data By default, none of these will be added to the log record. -f --log-target <KLOG | COM1 | COM2 | LTT | EVL> After a probe is successfully executed, the logs generated by the probe handler will be written to the target specified by this option. KLOG: COM1: COM2: The serial port logging options can be used to collect the log generated by one machine in another machine using serial connections. LTT: EVL: |
The general form of a dprobes command for removing the probes is: dprobes --remove |
{--name=loadable_module_name | --all} |
-r |
--remove |
dprobes remove command. One of the following options must be specified. -n |
--name |
If the loadable module name is specified, this command will remove all the probes inserted for this module. -a |
--all |
This option removes all the probes in the system. |
The general form of this dprobes command is: dprobes --getvars {[--name <loadable_module_name>] |--all} |
[--index = index1-index2] |
[--local | global] |
[--reset] |
-g |
--getvars |
dprobes command for displaying the value of variables. --name = loadable_module_name |
This option will list the values of variables of the dynamic probes inserted for the specified loadable module. -e |
This option will retrieve the dynamic probe variables from index1 to index2. If this option is not specified the default is to retrieve all variables. --reset |
This option will zero out the variables specified --local |
This option will retrieve the values of local variables. --global |
This option will return the values of global variables. --all |
This option will return values of all the variables presently being used in all probe programs. |
The general form of a dprobes query command is: dprobes --query {--name = loadable_module_name | --all} |
[--extended] |
-q |
--query |
dprobes query command. -a |
--all |
This option will list all the dynamic probe definitions, including those that are not currently active. If this option is not specified, only those probes that are currently active and inserted will be listed. --name = loadable_module_name |
This option will list all the dynamic probe definitions inserted for the specified loadable module i.e. a executable, shared object,kernel module etc. --extended |
− probe point number with in the loadable module, |
− major and minor codes for the probe point, |
− address of the probe point location, |
− opcode at the probe point location, |
− probe point status, |
− local variables. |
The probe point states could be one of the following: COMPILED not yet applied as the module is not in memory |
ACTIVE applied successfully and is active |
MISMATCH not applied due to opcode mismatch |
|
INVALID OFFSET not applied due to invalid offset. |
DISABLED disabled as probe is hit max-hit number of times |
REMOVED permanently, due to recursion or due to explicit remove RPN command |
|
WATCHPOINT RANGE INVALID The range of memory specified for the watchpoint probe is inconsistent with the ranges allowed by the processor. |
This builds a pre-built probe definition file (PPDF) , which is essentially the filed version of the package built by the build-ppdf function. The value in providing this function is that probe definitions can be pre-built from a Makefile and later inserted using the dprobes command apply-ppdf function. This would allow a module to be installed along with its PPDF so that is debug-ready, without being a special built with the debugging code present. Pre-building is made necessary because the probe location may be expressed symbolically using symbols from the module’s symbol table. The general form of a dprobes ppdf command is: dprobes --build-ppdf | -b <rpn_file_name> |
[--outfile | -o <ppdf_file_name>] |
-b = rpn_filename |
--build-ppdf = rpn_filename -o = ppdf_file_name |
--outfile = ppdf_file_name -s = symbol_file |
--sym = symbol_file -D key = value |
This command works in the same way as insert
command and thus it accepts all the options accepted by the
insert except -D and --sym suboptions. The general form of a dprobes applyppdf command is: dprobes --apply-ppdf | -p <ppdf_file_name> |
[--group = <group_list>] |
--apply-ppdf ppdf_file_name |
Please refer to the man page of dprobes.lang(8) for the syntax and details of how to write a probe program file. |
The following are the restrictions in this version of dprobes: Short options cannot be clubbed together |
dprobes -qax is invalid |
dprobes -q -a -x is valid |
The following options are not supported: |
Insert Options: --stop-cpus |
If the name of any file contains any character other than [a-z,A-Z] then the name should be specified in double-quotes and double-quotes should be given with escape sequence in the --name and --insert options. |
For Example: |
If the file name is 3c59x.o then it should be
specified in the following manner: |
Send all the bug-reports to: |
DProbes mailing list dprobes@www-124.ibm.com |
IBM Corporation |
DProbes version: 3.6.5 |
Dynamic Probes is licensed under GNU General Public License version 2 or later. Copyright (c) International Business Machines Corp., 2000 |