TotalView Reference Guide : Part I: CLI Commands : Batch Debugging Using tvscript : tvscript Command Syntax

tvscript Command Syntax
The syntax for the tvscript command is:
tvscript [ options ] [ filename ] [ -a program_args ]
options
TotalView and tvscript command-line options. You can use any options described in Chapter 7, “TotalView Command Syntax”. tvscript command-line options are described in the next section.
filename
The program being debugged.
-a program_args
Program arguments.
The command-line options most often used with tvscript are:
*
-mpi (The MPI environments supported are those listed in the Parallel tab of the File > New Program dialog box.)
*
*
*
-np or -procs or -tasks
For more information on these command-line options, see Chapter 7, “TotalView Command Syntax”.
Blue Gene/L and
Blue Gene/P
The syntax for using tvscript with an MPI on Blue Gene/L and Blue Gene/P systems is:
tvscript [ options ] -mpi BlueGene - np number-of-instances -starter_args
          "filename [ mpi-arguments] [-args program_args]" mpirun
-np number-of-instances
The number of processes or tasks that the starter program will create.
-starter_args
Required, with the arguments following enclosed in quotes; the application executable (filename) to be debugged must be the first argument.
-mpi-arguments
The command arguments for mpirun, such as "-cwd",
"
-mode", and "-partition".
-args
Command argument for mpirun that passes to the launched application on the compute node.
mpirun
Required; the executable at the end of the command line.
Blue Gene/Q with SLURM
The syntax for using tvscript with an MPI on Blue Gene/Q systems using SLURM is:
tvscript [ options ] -mpi BlueGeneQ-SLURM - np number-of-instances -starter_args
          "[srun-arguments] filename [program_args]" srun
-np number-of-instances
The number of processes or tasks that the starter program will create.
-starter_args
Required, with the arguments following enclosed in quotes; the application executable (filename) to be debugged must follow the arguments for srun.
srun-arguments
The command arguments for srun.
filename
The program being debugged.
program_args
The arguments for the program being debugged.
srun
Required; the executable at the end of the command line.
 
Blue Gene/Q for ANL's Cobalt Job Manager and IBM’s runjob
The syntax for using tvscript on Blue Gene/Q for ANL's Cobalt job manager and IBM's runjob: is:
tvscript [ options ] -mpi BlueGeneQ-Cobalt - np number-of-ranks -starter_args
          "[runjob-arguments] : filename [program_args]" runjob
-np number-of-ranks
The number of processes or tasks that the starter program will create.
-starter_args
Required, with the arguments following enclosed in quotes; the application executable (filename) to be debugged must follow the arguments for runjob and be separated by a colon (:).
runjob-arguments
The command arguments for runjob.
filename
The program being debugged.
program_args
The arguments for the program being debugged.
runjob
Required; the executable at the end of the command line.
tvscript Options
-create_actionpoint "source_location_expr [ =>action1 [, action2] ... ]"
Creates an action point at a source location using an expression. (See Action Point API” for writing expressions.) When the action point is hit, tvscript can trigger one or more actions. Add one -create_watchpoint command-line option for each action point.
See -event_action for information about actions.
-event_action "event_action_list"
Performs an action when an event occurs. Events represent an unanticipated condition, such as free_not_allocated in the Memory Debugger. You can use more than one -event_action command-line option when invoking tvscript.
Here is how you enter an event_action_list :
event1=action1,event2=action2
or
event1=>action1,action2,action3
Supported tvscript Events:
For each occurring event, define the action to perform:
display_backtrace
[
-level level-num ]
[
num_levels ]
[
options ]
-level level-num sets the level at which information starts being logged.
num_levels restricts output to this number of levels in the call stack.
If you do not set a level, tvscript displays all levels in the call stack.
options is one or more of the following:
print [ -slice {slice_exp}]
{variable | exp}
Writes the value of a variable or an expression into the log file. If the variable is an array, the -slice option limits the amount of data defined by slice_exp. A slice expression is a way to define the slice, such as var[100:130] in C and C++. (This displays all values from var[100] to var[130].) To display every fourth value, add an additional argument; for example, var[100:130:4]. For additional information, see Chapter 14 Examining Arrays” in the TotalView User Guide.
-display_specifiers "display_specifiers_list"
By default, tvscript writes all of the information in the following table to the log file. You can exclude information by using one of the following specifiers:
-memory_debugging
Enables memory debugging and memory event notification. This option is required with any option that begins with -mem. These options are TotalView command line options, as they can be invoked directly by TotalView.
-mem_detect_leaks
Performs leak detection before generating memory information.
-mem_detect_use_after_free
Tests for use after memory is freed.
-mem_guard_blocks
Adds guard blocks to an allocated memory block.
-mem_hoard_freed_memory
Holds onto freed memory rather than returning it to the heap.
-mem_hoard_low_memory_threshold nnnn
Sets the low memory threshold amount. When memory falls below this amount, an event is fired.
-mem_paint_all
Paints memory blocks with a bit pattern when a memory is allocated or deallocated.
-mem_paint_on_alloc
Paints memory blocks with a bit pattern when a memory block is allocated.
-mem_paint_on_dealloc
Paints memory blocks with a bit pattern when a memory block is deallocated.
-mem_red_zones_overruns
Turns on testing for Red Zone overruns.
-mem_red_zones_size_ranges min:max,min:max,...
Defines the memory allocations ranges for which Red Zones are in effect. Ranges can be specified as follows:
x:y allocations from x to y
:y allocations from 1 to y
x: allocations of x and higher
x allocation of x
-mem_red_zones_underruns
Turns on testing for Red Zone underruns.
-maxruntime "hh:mm:ss"
Specifies how long the script can run.
-script_file script_file
Names a file containing tvscript API calls and Tcl callback procedures that you create.
-script_log_filename logFilename
Overrides the name of the TVScript log file.
WARNING: Previous log files of the same name are overwritten.
-script_summary_log_filename summaryLogFilename
Overrides the name of the TVScript summary log file.
WARNING: Previous summary log files with the same name are overwritten.
tvscript Example:
The following example is similar to that shown in Batch Debugging Using tvscript”.
tvscript \
-create_actionpoint "method1=>display_backtrace -show_arguments" \
-create_actionpoint "method2#37=>display_backtrace -show_locals -level 1" \
-event_action "error=>display_backtrace -show_arguments -show_locals" \
-display_specifiers "noshow_pid,noshow_tid" \
-maxruntime "00:00:30" \
filterapp -a 20
This script performs the following actions:
*
Creates an action point at the beginning of method1. When tvscript reaches that breakpoint, it logs a backtrace and the method’s arguments.
*
Creates an action point at line 37 of method2. When tvscript reaches this line, it logs a backtrace and the local variables. The backtrace information starts at level 1.
*
*
*
Limits tvscript execution time to 30 seconds.
*

Rogue Wave Software, Inc.
Voice: (303) 473-9118
support@roguewave.com