Td User Manual: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 7: Line 7:
tda (Thread Dump Analyzer) is a command-line utility that can be used to process Java thread dumps.  
tda (Thread Dump Analyzer) is a command-line utility that can be used to process Java thread dumps.  


This documentation defines a [[Java_Threads#Thread_Dump|thread dump]] as the result of one invocation of the [[jstack]] command, or of sending [[Linux_Signals#SIGQUIT_.283.29|SIGQUIT]] (-3) into the Java virtual machine process. A thread dump consists in a set of [[|Java_Threads#Stack_Trace|stack traces]], one stack trace for each thread in the Java virtual machine.
This documentation defines a [[Java_Threads#Thread_Dump|thread dump]] as the result of one invocation of the [[jstack]] command, or of sending [[Linux_Signals#SIGQUIT_.283.29|SIGQUIT]] (-3) into the Java virtual machine process. A thread dump consists in a set of [[Java_Threads#Stack_Trace|stack traces]], one stack trace for each thread in the Java virtual machine.





Revision as of 01:34, 22 July 2017

Internal

Overview

tda (Thread Dump Analyzer) is a command-line utility that can be used to process Java thread dumps.

This documentation defines a thread dump as the result of one invocation of the jstack command, or of sending SIGQUIT (-3) into the Java virtual machine process. A thread dump consists in a set of stack traces, one stack trace for each thread in the Java virtual machine.


or a similar utility

The utility works by default in a manner similar to grep, processing the thread dump file sequentially, one thread dump at a time. It filters the thread stacks based on given regular expression and displays the output, subject to options. More than one thread dump in a single file are supported.

Syntax

tda [options] <regex|command> <thread-dump-file> [thread-dump-file, ...]

grep Mode

The utility filters and displays at standard output only the stack traces that match the given regular expression. For example:

   tda http- thread-dump-file.txt

will display at stdout only the stack traces that contain "http-", anywhere in the stack trace, including method invocation lines. The regular expression is optional. If missing, all stack traces present in the file will be displayed. The output can be modified with the following options:

-c

Counts the number of threads that match the regular expression, and display the number. If only the file name is specified, the regular expression is assumed to be "match all".

-v

Invert match. Select the stack traces that do not match the regular expression.

Regular Expression Syntax

tda is designed to use the same regular expressions as grep.

   Spaces - enclosing the regular expression in double quotes preserves spaces. Example
           tda "on object monitor" thread-dump-file.txt

Other commands:

   -s (split) extracts individual thread dumps from the log file and places them into separate
           files. The name of the files is built based on the counter and timestamp (if
           available).
   --<ExtensionClassName> (example --FSI, --FFM) where the class should be available in
           com/novaordis/universus/tdanalyzer/extensions


   diff <thread-dump-file-1> <thread-dump-file-2> shows the difference between the thread dumps.
   help
   version

Other Commands

count

diff

tda diff <thread-dump-file1.out> <thread-dump-file2.out>

The simplest form of the diff command compares the thread dump files and displays the names of the names of the threads that are present in one file and not in the other.

version

help

In-line help.