TotalView: Thread Debugging Features

TotalView Thread Debugging Benefits:

  • See through the complexity
  • Essential to solving 'race condition' problems
  • Control a single thread or step them all together – your choice
  • Switch between threads easily
  • Dynamically manage thread groups and add newly spawned threads to groups in the CLI
  • Multithreaded core file support
  • View thread-specific and shared data
  • Easily and automatically acquires threads as they are created and according to type

 

Best Threads Debugger Available

Given the choice between a sharp stick in the eye and debugging multi-threaded code, many developers would think long and hard. The use of threads has become a necessity for many of today’s mission critical applications. As a result, many programmers now face a maze of threads too complex to follow using traditional debuggers. TotalView helps you see through this complexity.

TotalView was built from the ground up to understand parallelism; that heritage makes it particularly well-suited to debugging threaded code. Its built-in features make it easier than ever to untangle and control threads. For example, TotalView easily and automatically acquires threads as they are created, and dynamically groups them according to type. That makes debugging threaded code as easy as serial code. And TotalView takes threads support all the way down to the single thread level (on most platforms).

Here are just a few of the benefits of debugging threaded code with TotalView:

  • Control individual threads and set breakpoints at the thread level
  • Control groups of threads if you want to
  • Dig into critical mutexes, queues and sections of your code
  • Dynamically manage thread groups and add newly spawned threads to groups in the CLI
  • Switch between threads, view objects, and control execution
  • View data for an individual thread or for a specific object across all threads.
TotalView gives you a single window for many threads of execution. You can control (e.g., step, run) a single thread individually, or create a group of threads and control them in lockstep. It’s your choice. Track, step, and control threads to meet your debugging needs. If your code is threaded, you owe it to yourself to try TotalView.

 

Multithreaded Core Files

TotalView also supports debugging of multithreaded core files. It shows you in which thread the error occurred and lets you view state information about other threads. (Multithreaded core file debugging is not available on all platforms.)

If you're new to threads, you may want to read our Threads Primer. If you're a seasoned threads programmer, you might still be interested in reviewing Chapter 11 of our Users Guide.

 

Control your program at the thread level

On most operating systems, TotalView lets you control your program at the thread level. For example, if you think your problem is in thread 3 of process 2, you can hold all processes and threads in your program except thread 3 of process 2. You can then proceed to debug just that thread.

 

Viewing Data

TotalView makes viewing data in a threaded program as easy as viewing data for single process code. You can view data from an individual thread, or you can choose to view data across all threads with TotalView’s laminate feature.

 

Navigating Threaded Code

Navigating among hundreds of threads can feel cumbersome. TotalView simplifies navigation with both the Root Window and the Thread Tab of the Process Window .

 

Both windows display the threads in your program. The Root Window displays all threads in relation to the parent process in a hierarchical manner, so that all threads that comprise a process are grouped together. The Thread Tab displays threads in context of the process that currently is executing in the Process Window. Each window displays the current status as well as other information about the threads. In addition to viewing status at a glance, you can use the thread lists for navigation.

 

Write thread-specific conditional breakpoints

The TotalView $tid built-in function lets you write thread-specific conditional breakpoints. For example, if you want your program to stop on thread 5, you can create a conditional breakpoint with the following expression:

if ($tid == 5) $stop;

When this breakppoint executes, TotalView will only stop thread 5. (figure 3). Other threads will continue running.

 

Related Links