RCUG RootCause Command Reference
RootCause User Guide
Contents
- 1 RootCause Command Reference
- 1.1 RootCause and Different Shells
- 1.2 rootcause
- 1.3 rootcause build
- 1.4 rootcause collect
- 1.5 rootcause config
- 1.6 rootcause decollect
- 1.7 rootcause deploy
- 1.8 rootcause format
- 1.9 rootcause log
- 1.10 rootcause merge
- 1.11 rootcause new
- 1.12 rootcause_off
- 1.13 rootcause_on
- 1.14 rootcause open
- 1.15 rootcause register
- 1.16 rootcause run
- 1.17 rootcause status
- 1.18 rootcause xrun
RootCause Command Reference
The following commands are available from the command line after RootCause has been installed and the setup script in the RootCause installation directory has been executed (see Chapter 4, "Getting Started").
RootCause and Different Shells
Different shells on Solaris have different capabilities. The following differences apply to the different shells:
sh (Bourne shell)
The rootcause_on
and rootcause_off
commands are not available. Instead, you must use the dot commands:
. rootcause_enable . rootcause_disable
ksh (Korn shell)
You may use rootcause on
and rootcause off
instead of rootcause_on
, and rootcause_off
, because rootcause is defined as a shell function. Note that RootCause requires that ksh
be installed, though you need not use it as your shell. On Linux you may have to install pdksh
.
csh (C shell)
rootcause_on and rootcause_off are aliases defined in your shell when you "source" setup.csh. C shell does not support shell functions, so "rootcause on" and "rootcause off" won't work.
bash
The setup script and shell functions for ksh
work for bash
as well. However, ksh is still needed for install_rootcause, rootcause_status, and other scripts.
rootcause
The rootcause
command is designed to run in a simple, intuitive manner when default file names are used. When run with no arguments, it gives version and license information. When run with rootcause -h, it shows the following commands, which are described in detail in this chapter.
- rootcause build
- build traces/probes in workspace.
- rootcause collect
- collect agent workspace data for analysis.
- rootcause config
- show current configuration information.
- rootcause decollect
- unpack collected workspace data for analysis.
- rootcause deploy
- package a workspace for remote deployment.
- rootcause format
- format data in workspace.
- rootcause log
- perform operations on rootcause log file.
- rootcause merge
- merge two workspaces to create a third.
- rootcause new
- create a new workspace.
- rootcause_off
- disable rootcause intercept of applications.
- rootcause_on
- enable rootcause intercept of applications.
- rootcause open
- start the RootCause GUI.
- rootcause register
- register an application with a workspace.
- rootcause run
- run any command under rootcause.
- rootcause status
- show if rootcause is enabled.
- rootcause xrun
- run a command under rootcause in a separate window.
rootcause build
The rootcause build
command updates a RootCause workspace without opening the GUI. This is useful for maintaining workspaces as part of a script-driven product development process. The location of a workspace is provided, along with paths to all relevant programs and modules whose locations or contents may have changed. Note that a side-effect of this process may be to lose traces that no longer apply to a changed module.
Syntax:
rootcause build [-Fh] [ -xprogram_file | file.class | file.jar ] [-mmodule]* [-w] workspace.aws
Options:
- '-F'
- force the build even if the workspace is locked.
- '-h'
- give this command's usage
- '-x program_file'
- the executable program, or the
.class
or.jar
file containing your Java application's main entry. This is the same as the argument to Reset Program in the GUI. - '-m module'
- the path of a dynamic module that the program applies to. This is the same as the argument to Reset Dynamic Module in the GUI.
- '-w workspace'.aws
- an existing RootCause workspace.
Examples:
- Rebuild workspace pi_demo.aws against current modules in case they've changed: rootcause build Pi.aws
- Update the RootCause self-analysis workspace for the current installation location: rootcause build -x $APROBE/lib/probeit.jar -m $APROBE/lib/libdebugInfo.so -w $APROBE/arca.aws
rootcause collect
The rootcause collect
command is executed on a remote computer where the RootCause Agent component has been installed to gather the RootCause data together into a single .clct
file to be transmitted to a computer where the RootCause GUI component has been installed for subsequent decollection and analysis. It examines the rootcause registry to determine the workspace for the applications, if no workspace is specified. Multiple applications and workspaces may be specified for collection. If no arguments are supplied, the RootCause log and registry are collected.
Syntax:
rootcause collect [-AFh] [ -o clct_file ] [ -f other_file ] [ [-x] program_file | -c class | [-w] workspace.aws ]...
Options:
- '-A'
- suppress generation and collection of ADI files for native modules. This might be done to reduce the download size if you are sure the local and remote modules are identical.
- '-F'
- force overwriting of clct_file, if present.
- '-h'
- give this command's usage
- '-o clct_file'
- the collect file to create (default: first_argument.clct)
- '-f other_file'
- any other file (not directory) to be added to the clct_file. You can also simply copy files or directories into the workspace.
- '-x program_file'
- the registered program to which deployed workspace applies
- '-c class'
- the registered Java class to which deployed workspace applies
- '-w workspace'
- the workspace contents to be collected if program or class is not known
Examples:
rootcause collect -x converter.exe -w fred.aws -o myserver.clct
rootcause config
The rootcause config command reports current configuration information. With no arguments it shows the installation directory and license information.
Syntax:
rootcause config [ -dhlLnRuvV ]
Options:
- '-d'
- give installation directory (that is, the value of $APROBE)
- '-h'
- give this command's usage
- '-l'
- give license information
- '-L'
- give application log path ($APROBE_LOG or default location).
- '-n'
- give product name (Console or Agent).
- '-R'
- give application log path ($APROBE_REGISTRY or default location).
- '-u'
- give user directory ($APROBE_HOME or default).
- '-v'
- give product version number.
- '-V'
- give product version description (default).
Examples:
$ rootcause config RootCause Console 2.0.5 (030405) Installed in /app1/product/aprobe This product is licensed to 1111 OC Systems, Inc. This license will expire on 31-dec-2006.
rootcause decollect
The rootcause decollect command unpackas a .clct file built by the rootcause collect command. This function is also performed by the Decollect operation in the RootCause GUI (see "Decollect Data Dialog").
The result of this operation is a directory tree whose root directory has suffix .dclct.
Syntax:
rootcause decollect [-F] [-o directory] clct_file
Options:
- '-F'
- force delete of directory, if present
- '-o directory'
- extract into directory (default: clct_file_name.dclct)
- clct_file
- collect file that was built by rootcause collect
Examples:
myserver.clct
into myserver.dclct
rootcause decollect myserver.clct
rootcause deploy
The rootcause deploy command packages a workspace for use in a remote (agent) environment. This function is also performed by the Deploy operation in the RootCause GUI (see "Deploy Dialog"). The result of this operation is a zip file with suffix .dply. Note that this command does not verify the workspace is already built. If you're not sure, do rootcause build first.
Syntax:
rootcause deploy
[-Fh][ [-x] program_file | [-c class] [-w] workspace.aws ]
[-l license_file] [-m module][-o dply_file]
Options:
- '-c class'
- the Java class registered with the workspace you wish to deploy.
- '-F'
- force overwriting of dply_file, if present.
- '-h'
- give this command's usage
- '-l license_file'
- the agent license file to include in the deployed workspace (default
$APROBE/licenses/agent_license.dat
. - '-m module'
- is a module (shared library) for which an ADI file should be generated.
- '-o dply_file'
- the deploy file to create (default: workspace.clct)
- '-x program_file'
- the program registered with the workspace you wish to deploy.
- '-w workspace'.aws
- an existing, built RootCause workspace.
Examples:
- Deploy workspace pi_demo.aws.
rootcause deploy pi_demo.aws.
- Deploy workspace for factor and module libFactor.so into Factor.dply.
rootcause deploy -x /app/bin/factor -m -o Factor.dply
rootcause format
The rootcause format command runs apformat on the data collected in the specified workspace. This produces output similar to that produced by Save As Text in the RootCause GUI. By default rootcause format
operates on the most current process. Because it formats all the data it can take a while for large amounts of data. You can use the -O option in conjunction with the apformat "-n" option to limit it to specific APD files, as shown in Example 3 below.
Syntax:
rootcause format [-hlr][-p PID][-O "options"][-t tmpdir] [-w] workspace.aws
Options:
- '-h'
- give this command's usage
- '-l'
- list the APD rings (Process Data Sets) in the workspace, but don't format anything. The newest data set is listed first.
- '-r'
- raw: just run apformat directly on the APD file (with options specified using -O) rather than using the workspace's formatting script.
- '-p PID'
- format data for the process given by PID
- '-O "options"'
- pass options to the apformat command. The options must be in quotes, and quotes in the options themselves must be preceded by a backslash.
- '-t tmpdir'
- specifies the directory where intermediate files are to be produced. These can get very large--up to 10 times the size of the APD files depending on the formatting--and this can be used to avoid disk-space restrictions where the workspace resides.
- '-w workspace'.aws
- the RootCause workspace containing the data to be formatted.
Examples:
- Format the newest data set in pi_demo.aws the file
pi_demo.txt
.$ rootcause format pi_demo.aws > pi_demo.txt
- List the Process Data Set in workspace pi_demo.aws.
$ rootcause format -l pi_demo.aws /work/pi_demo.aws/pi_demo.apd.11991/pi_demo.apd /work/pi_demo.aws/pi_demo.apd.11785/pi_demo.apd
- Run apformat directly on the newest data file for process 11785 in pi_demo.aws.
$ rootcause format -r -O "-n 0" -p 11785 pi_demo.aws
rootcause log
The rootcause log
command provides information about the RootCause Log, and allows its maximum size to be changed.
Syntax:
rootcause log [-hlnsFZ | -s size ]
Options:
- '-F'
- force -s size or -Z operation without confirmation
- '-h'
- give command-line help
- '-l'
- list log file contents to standard output
- '-n'
- list the log file name to standard output
- '-s'
- list the log file size to standard output
- '-s size'
- set the maximum size of the log to size bytes (size > 1000)
- '-Z'
- clear the contents of the log file
Examples:
- Write the contents of the log to standard output:
$ rootcause log
- Set the size of the log to 20000 bytes:
$ rootcause log -s 20000
rootcause merge
The rootcause merge
command merges two workspaces to create a new, third workspace. It works by copying the first primary workspace to the third result workspace, then adding compatible traces and UALs from the second secondary workspace. A module must exist in both the primary and secondary workspaces in order that traces for that module appear in the result workspace.
There is no GUI operation equivalent to rootcause merge. You can use it in conjunction with the GUI by:
- Using Workspace->Close to close your current workspace
- Applying
rootcause merge
from the command line - Using Workspace->Open on the result workspace.
Note: The rootcause build and rootcause register operations must be applied to the result workspace before the result workspace can be used to trace an application.
Syntax:
rootcause merge [-Fh] primary.aws secondary.aws result.aws
Options:
- '-F'
- force result.aws to be overwritten if it exists
- '-h'
- give command-line help
- primary.aws
- The primary workspace, on which the result workspace is based.
- secondary.aws
- The secondary workspace, from which additional traces and UALS are added to the result workspace.
- result.aws
- The new workspace that is created.
Examples:
- Merge traces in file_ops.aws into pi_demo.aws to produce pi_demo2.aws and make pi_demo2.aws the new workspace for tracing pi_demo
$ rootcause merge file_ops.aws pi_demo.aws pi_demo2.aws $ rootcause build pi_demo2.aws $ rootcause register -F -x pi_demo -w pi_demo2.aws
rootcause new
The rootcause new command creates a new workspace. Generally this is done through the RootCause GUI using the New menu item or Open Associated Workspace; (see "New Workspace Dialog"). The result of this operation is the named workspace, initialized to do default tracing. If the -r option is used, the workspace is also registered with the specified program or Java class.
Syntax:
rootcause new [-Fhr][-c class] -x program_file [-w] workspace.aws ]
Options:
- '-c class'
- the Java class registered with the workspace you wish to deploy.
- '-F'
- force overwriting of workspace.aws if it exists.
- '-h'
- give this command's usage
- '-r'
- register the new workspace with the specified program or Java class
- '-x program_file'
- the executable program or Java
.class
or.jar
file the workspace will be used to trace (as on the rootcause open command). - '-w workspace'.aws
- the new workspace to be created.
Examples:
- Create and register a new workspace for pi_demo.exe.
$ rootcause new -r -x pi_demo.exe -w pi_demo.aws.
rootcause_off
Use the rootcause_off
command to disable rootcause interception of processes on your machine.
Syntax:
rootcause_off
rootcause_on
Use the rootcause_on
command to start the inspection and interception of processes on your machine to determine if they should be traced with rootcause.
Syntax:
rootcause_on
rootcause open
The rootcause open
command starts the RootCause GUI. If the application class specified on the command line is registered, the GUI will automatically set the workspace from the registry entry for the application. If the application is not registered, the GUI will prompt for a new workspace name and register the application. If no arguments are specified, the current RootCause Log file is opened.
Syntax:
rootcause open [[-x] program_file] [-c classname] [[-w] workspace.aws] [ [-d] dir.dclct | [-z] file.clct ]
Options:
- program_file
- the executable program file, or the the
.class
or.jar
file containing your Java application's main entry - classname
- the main class name. This is required if classname is not the same as file
- workspace.aws
- a new or existing RootCause workspace
- dir.dclct
- a directory created by the RootCause Decollect operation
- file.clct
- a file created by the
rootcause collect
command
Examples:
- Start the RootCause GUI and examine the RootCause Log file in a Trace Display window.
$ rootcause open
- Start the RootCause GUI to open new or existing workspace converter.aws.
$ rootcause open converter.aws
- Start the RootCause GUI to open a new or existing workspace for program converter.exe
$ rootcause open converter.exe
- Start the RootCause GUI to unpack (decollect) the collected rootcause data in pi_demo.clct.
$ rootcause open pi_demo.clct
rootcause register
The rootcause register
command provides the interface to the RootCause registry. The GUI will allow you to add or delete the current workspace from the registry, but you must use the register command to otherwise manipulate the registry. It is likely that, over time, more GUI support will be added to manipulate the registry, but on computers where only the RootCause Agent is installed, there is no GUI and the register
command must be used.
Syntax:
rootcause register [subcommand ] options [deploy_file]
Description:
subcommand
The subcommand flag designates the operation to be performed:
- '-a'
- add a new entry in the registry (default)
- '-d'
- delete an entry from the registry
- '-h'
- give command help
- '-k'
- return 0 iff specified args are already registered & enabled
- '-l'
- lists all registry contents
- '-lr'
- list registry name only
- '-lw'
- list workspace name only
- '-lx'
- list only registered program only
- '-s'
debug
- enable/disable debug mode with -e
on
/off
(off by default) - '-s'
verbose
- enable/disable verbose mode with -e
on
/off
(on by default) With verbose mode on, all processes are recorded in the log; with verbose off, only traced applications are recorded. - '-Z'
- clear entire registry contents, including -s settings, returning them to their default values.
options
- Options further qualifying the above are:
- '-c'classname
- probe Java commands naming main class classname
- '-e'
on
|off
- off specifies 'disabled' (default: on)
- '-F'
- force without confirmation
- '-j'dir
- dir is root of JRE containing java exe to probe
- '-m'file
- file is a module required for deploy_file consistency checking
- '-r'file
- file is registry file to use
- '-w'dir.aws
- file is workspace to use
- '-x'file
- file is executable to probe
- deploy_file
- is a
.dply
file to unpack into a registered workspace
Examples:
- List the registry name and contents:
$ rootcause register -l
- Delete the registry entry for
driver.exe
:$ rootcause register -d -x /build/bin/driver
- Turn off recording of all processes in the RootCause log:
$ rootcause register -s verbose -e off
- The following command will do the following all in one step:
- register the program
- create the workspace (if it does not exist)
- deploy the trace into the workspace; and
- check it's consistency with the modules to be traced
This would be the typical command used on a remote computer where only the RootCause Agent component was installed in order to implement a .dply file generated by the RootCause GUI component. After this command is issued, you would merely execute rootcause_on in the context of the shell and run the application.
$ rootcause register -x /opt/frobco/bin/frobit frobit.dply
rootcause run
Use rootcause run
before your command to cause it to be run with rootcause on, independent of the current
rootcause status. The command specified will be run in the current window exactly as if it were not preceded by rootcause run. This is equivalent to
rootcause_
on commandrootcause_
off
Syntax:
rootcause run command
Options:
- command
- any shell command
Example:
- Run the pi_demo application with rootcause on:
$ rootcause run $APROBE/demo/RootCause/C++/pi_demo
rootcause status
Use the rootcause status
command to show whether rootcause tracing is currently enabled or disabled.
Syntax:
rootcause status
rootcause xrun
Identical to rootcause run, but the command is run in a separate window. This is used by the Run button in the RootCause GUI.
Syntax:
rootcause xrun command