dmtracedump

dmtracedump is a tool that generatesgraphical call-stack diagrams from trace log files. The tool uses the GraphvizDot utility to create the graphical output, so you need to install Graphvizbefore running dmtracedump. If you haven't yet generated trace logs andsaved them from your connected device to your local machine, go toGenerate trace logs by instrumenting your app.

The dmtracedump tool generates the call stack data as a tree diagram, where eachnode represents a method call. It shows call flow (from parent node to child nodes)using arrows. The diagram below shows a sample output of dmtracedump.

The dmtracedump tool is provided in the Android SDK Tools package and islocated in android-sdk/platform-tools/.

Syntax

The usage for dmtracedump is:

  1. dmtracedump [-ho] [-s sortable] [-d trace-base-name] [-g outfile] trace-base-name

The tool then loads trace log data from trace-base-name.data andtrace-base-name.key.

Global options

Global optionsDescription
-hTurn on HTML output
-oDump the trace file instead of profiling

Commands and command options

Commands and optionsDescription
-d trace-base-nameDiff with this trace name
-g outfileGenerate output to outfile
-s sortableURL base to the location of the sortable javascript file
-t percentMinimum threshold for including child nodes in the graph (child's inclusive time as a percentage of parent inclusive time). If this option is not used, the default threshold is 20%.

Output

dmtracedump - 图1

Figure 1. Screenshot of dmtracedump

For each node in the graph, dmtracedump shows the followinginformation:

  1. ref callname (inc-ms, exc-ms,numcalls)
  • ref — Call reference number, as used in trace logs
  • inc-ms — Inclusive elapsed time (milliseconds spent in method, including all child methods)
  • exc-ms — Exclusive elapsed time (milliseconds spent in method, not including any child methods)
  • numcalls — Number of calls