TotalView Quick View
TotalView Quick View
Quick View
version 8.12
Copyright © 2010-2013 by Rogue Wave Software, Inc. All rights reserved.
Copyright © 2007-2009 by TotalView Technologies, LLC
Copyright © 1998–2007 by Etnus LLC. All rights reserved.
Copyright © 1996–1998 by Dolphin Interconnect Solutions, Inc.
Copyright © 1993–1996 by BBN Systems and Technologies, a division of BBN Corporation.
No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or
by any means, electronic, mechanical, photocopying, recording, or otherwise without the prior written per-
mission of Rogue Wave Software, Inc. (“Rogue Wave”).
Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph
(c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013.
Rogue Wave has prepared this manual for the exclusive use of its customers, personnel, and licensees. The
information in this manual is subject to change without notice, and should not be construed as a commit-
ment by Rogue Wave. Rogue Wave assumes no responsibility for any errors that appear in this document.
TotalView and TotalView Technologies are registered trademarks of Rogue Wave Software, Inc. TVD is a
trademark of Rogue Wave.
Rogue Wave uses a modified version of the Microline widget library. Under the terms of its license, you are
entitled to use these modifications. The source code is available at:
http://www.roguewave.com/support/knowledge-base.aspx.
All other brand names are the trademarks of their respective holders.
ii
TotalView Quick View
Downloading TotalView
You can download a fully-functional, time-limited evaluation copy of TotalView at:
http://www.roguewave.com/evaluate.aspx
Installing TotalView
TotalView and MemoryScape are generally distributed in a tar format with an install
script. Full installation documentation is provided online.
Generally speaking, you unpack the tar ball in a temporary directory and run the
install script, telling it where to put the program files. The installer installs all the
files necessary to run both TotalView and/or MemoryScape and TotalView’s license
server.
If you are using a floating license configuration, the license server only needs to be
installed on a single machine, which can be different from that on which TotalView
will be run. Various mechanisms, including setting environment variables, can be
used to tell TotalView where to find the license server. See the installation docu-
ment for details.
If you use TotalView in a cluster or in a client-server configuration you should install
TotalView on a common file system or in a common location on all the file systems.
Otherwise, you may need to customize the installation-wide configuration files.
TotalView uses a lightweight debugger server which runs out of the installation with
user privileges on the compute nodes of a cluster or on the remote end of any
remote debugging configuration.
Note: If your program uses a starter program, you may need to read the section
"Setting Up MPI Debugging Sessions" in the TotalView User Guide.
Here, select the type of debugging session you wish to launch and then configure
your session. For example, selecting A new program launches the Program Session
window where you enter the program name, any arguments, and other specifics.
You can use the Root Window to navigate to any of your programs, processes, or
threads by diving on them.
Diving simply means clicking on something to see more information. You can dive
by a double left-click, a middle-click, or via a contextual menu accessed by a right-
click.
What happens when you dive depends on what you’re diving on. Some windows
contain an undive button ( ) that lets you return to where you came from.
The Process Window (Figure 5) displays the current program being debugged.
This Process Window is where you’ll find your source code and information about
the process and any threads.
Stack Trace Pane: Displays the routines in your program’s call stack. When you
dive on a routine’s name, TotalView displays it in the Source Pane and changes
the information displayed in the Stack Frame Pane.
Stack Frame Pane: Contains all of the variables associated with the stack rou-
tine selected in the Stack Trace Pane. For simple objects such as an int or a
float, the information appears in this pane. If the variable refers to a com-
pound object or an array, or if the variable is a pointer, you’ll see its data type.
After diving, TotalView shows information in a separate Variable Window.
If TotalView displays a data value in bold, you can click within it, and alter its
value. TotalView writes the changed value into your program’s memory.
Source Pane: Displays your program’s source code. This is where you set
breakpoints, dive on variables to see their values, dive on functions to change
the source being displayed, and perform other related activities.
Tabbed Area: Contains three tabs. The Processes Tab contains colored boxes.
Each box represents a process. The Threads tab lists the threads that are part
of the current process. (In both, clicking on a box or thread shifts the Process
Window’s focus.) The Action Points Tab shows you the line number of each ac-
tion point. (Action point is the TotalView term for the various types of break-
points that you can set. Diving on an action point refocuses the Source Pane
to the line where the action point was created.)
When you dive on a variable, TotalView displays information about the variable in a
window, Figure 3.
The top part of a Variable Window contains information about the variable. If you
are displaying an array, the Slice and Filter fields let you select which of the array’s
elements TotalView displays. The bottom part of a Variable Window contains ele-
ment values, Figure 4.
Figure 7: Editing in the Variable Window
You can edit almost anything in the top part of the window as well as data values in
the bottom part.
You can even dive in a Variable Window. For example, diving on a pointer derefer-
ences the pointer to show what it points to. You can also dive on array elements
and on fields of structures.
Setting Breakpoints
Breakpoints are set with a single left-click on the line number. TotalView displays a
sign.
Figure 8: Breakpoint Set At a Line
Be careful not to double-click. The first click creates the breakpoint and a second
click deletes it, and you might not realize that anything happened.
If you want to get to a line without individually stepping each line in between,
select the line (not the line number) to highlight it, then click the Run To button.
The $count statement is another TotalView built-in function. When the count
reaches 20 in this example, TotalView automatically calls the $stop statement.
Here are two ways to place information in the Expression List Window:
Select a variable, right-click, then select the Add to Expression List command.
You can do this in the Source Pane, Stack Frame Pane, or a Variable Window.
Type the variable’s name in the Expression List Window.
The information you enter can include expressions. For example, you can type
my_var[idx_var[obj.get()][j/3]+25].
If you dive on a variable in the Expression List Window, TotalView displays the vari-
able in a Variable Window.
Sliced
Sliced
and
Filtered
The top window shows the raw int* data type. The middle window casts it into an
array of pointers. After diving, TotalView displays the array, as the bottom window
shows.
When you click on a leak in the top part of the window, MemoryScape places the
backtrace associated with the leak in the bottom part. When you click on a stack
frame in this backtrace, MemoryScape displays the line within your program that
allocated the memory.
Red Zones are used to find both read and write memory access violations, notifying
you immediately if your program oversteps the bounds of your allocated block.
Turn them on by selecting High from Basic Memory Debugging Options, or by
selecting Use Red Zones to find memory access violations from Advanced Memory
Debugging Options.
Analyzing Memory
You can also use MemoryScape to analyze how your program is using memory. Select the
Heap Graphical Report on the Memory Reports Page to see the memory your pro-
gram is using, Figure 19.
Figure 22: Heap Status Graphical Report
When you select a block in the top area, MemoryScape displays information about
the selected block in the lower area. In addition, and perhaps more importantly, it
displays how many other allocations are associated with the same backtrace and
the amount of memory allocated from the same place. Other reports within the
Heap Status Reports Page let you display the backtrace and source line associated
with an allocation.
Pressing the New Allocations or New Leaks button displays more information.
Some reports within MemoryScape also have Relative to baseline buttons that
allow you to limit the display to allocations and leaks occurring only since you set
the baseline.
What Is ReplayEngine?
ReplayEngine is a separately licensed product for linux-86 and linux-x86-64 that
records all of your program’s activities as it executes within TotalView. After record-
ing information, ReplayEngine lets you move forward and backwards within these
previously executed instructions.
Figure 23 shows the ReplayEngine commands added to the tool bar.
Figure 26: Tool Bar with ReplayEngine Buttons
When replaying instructions, you are seeing your program’s state as it was when
that instruction was executed. The information being displayed is read-only. For
example, you cannot change the value of variables.
After entering information in the Client window, press the Launch Debug Session
button.
Behind the scenes the Client connects to the remote system. Remote Display then
displays a Viewer on your system that contains TotalView. You can interact with
TotalView in exactly the same way as if you were interacting with it on the remote
machine.
While the Remote Display Client executes only on Linux-x86, Linux-x86-64, Apple
Mac OS X Intel, and Microsoft Windows 7, Vista and XP, the remote host can be any
of the platforms on which TotalView and MemoryScape run.