There are two ways in invoke Puma's command-line interface. You can enter Puma's
command environment to execute any number of Puma commands. Or, you
can direct Puma from a shell or shell script to execute a single command.
Invoking Puma's Command Environment |
 |
To invoke the Puma command environment, at the
shell prompt type:
As a result, Puma displays its prompt:
Enter Puma commands at this prompt. For example:
The monitor command directs Puma to collect data from a target program. The
monitor options -invoke pathname and -existing PID are
comparable to the actions of graphical Puma in invoking the target program or
attaching to a program that is already running. With command-line Puma, you
should use the option -executable pathname along with -existing
so that Puma can find the symbol table for the running process. For example:
puma>monitor -invoke vanderbilt
|
or
puma>monitor -existing 1054 -executable vanderbilt
|
Exit Puma's command environment by entering exit or quit at the
puma> prompt or by typing Ctrl-c.
Invoking Puma Commands from the Shell |
 |
Rather than invoking the Puma command environment, you can execute
Puma commands one at a time directly from the shell. Do this by
specifying a Puma command as an option to the puma command
(prefacing the command with a hyphen).
For example, if you wanted to collect performance data from process number
1054 without entering the Puma environment, you would enter the following
command line at the shell:
puma -monitor -existing 1054 -executable vanderbilt
|
This interface allows you to invoke Puma from a script. Suppose your
application is invoked by a script which, prior to the
invocation, sets up the environment necessary to run the application.
Insert this line into the script as the program's invocation:
puma -monitor -invoke application_name
|
Or use its abbreviated form:
puma -mon -inv application_name
|
As a result, Puma invokes the application, collects its data, and then exits just
after the application exits.