The Debug ASCII Tracing Tool

The debug trace analysis tool is the tool that provides basic debugging capabilities for small workloads. It dumps the executed instructions, memory accesses and modified registers values into a text file.

The debug trace output file can grow to huge size, therefore it is recommended to use The Controller to define the region of interest.

% sde -skx -debugtrace -control start:address:foo,stop:icount:1000 -- myapp

In this example you can see instructions that modify registers (general purpose and vector), read from memory and write to memory.

INS 0x401144   BASE         push rbp                          | rsp = 0x7fffffffd220
Write *(UINT64*)0x7fffffffd220 = 0x7fffffffd250
INS 0x401145   BASE         mov rbp, rsp                      | rbp = 0x7fffffffd220
INS 0x401148   BASE         sub rsp, 0x80                     | rsp = 0x7fffffffd1a0, rflags = 0x206
Read 7b5b5465_73745665_63746f72_5d53475d = *(UINT128*)0x402010
INS 0x40114f   AVX          vmovdqu xmm0, xmmword ptr [rip+0xeb9]
    XMM0 := 7b5b5465_73745665_63746f72_5d53475d
    XMM0 :=      1.62559e+286      1.23396e+171    (doubles)
    XMM0 := 1.13882e+36 1.93584e+31 4.50904e+21 9.51515e+17    (floats)

The debug trace analysis tool also dumps information on system calls and exceptions.

Note

Normally, the debug trace tool writes its output using a buffer, this means that when the application crash, it will not include the lines which are in the buffer. Use the -dt-flush knob to force flush after every instruction.

There are many options to control which data will be dumped into the output file. This includes the thread ID, symbol (function name), and line information (if exists). Alternatively, you can turn off some of the data dumped by default. This includes the instructions (disassembly and registers), system calls and memory accesses. See the knobs list below for more details.

-debugtrace

Activate the debugtrace feature [default 0]

-dt_amx

Format of tile data, use ‘-dt_amx LIST’ for dump options [default none]

-dt_call

Trace calls [default 0]

-dt_circular_buffer

Use a circular buffer, specifying the number of lines in the buffer [default 0]

-dt_cmp_replay

Special output format for comparing log with replay. Removes the following from output: flags register, prefetch instructions, translation memory strings and system calls information [default 0]

-dt_color

Add ANSI color codes to output for highlighting [default 0]

-dt_filter_end

End address of a code region to trace. [default 0]

-dt_filter_no_shared_libs

Do not instrument shared libraries [default 0]

-dt_filter_rtn

Routines to instrument [default none]

-dt_filter_start

Start address of a code region to trace [default 0]

-dt_flush

Flush output after every instruction [default 0]

-dt_fp16

Print vector values as an array of fp16 values [default 0]

-dt_instruction

Trace instructions [default 1]

-dt_lines

Include line number information [default 0]

-dt_memory

Trace memory accesses [default 1]

-dt_mxcsr

Emit MXCSR for each instruction [default 0]

-dt_out

Trace output file name [default sde-debugtrace-out.txt]

-dt_print_tid

Print TID for each line [default 0]

-dt_rawinst

Add raw instruction bytes to the disassembly [default 0]

-dt_region_icount

Print instruction count according to region [default 0]

-dt_short_fn

Limit the image file name to just the trailing path component [default 1]

-dt_silent

Do everything but write file (for debugging) [default 0]

-dt_symbols

Include symbol information [default 0]

-dt_syscall

Trace system calls [default 1]

-dt_watch_thread

Thread to watch, -1 for all [default -1]