Version 2.2

;Connect to boot core only Load Awareness for v3.x/v4.x CORE.ASSIGN TASK.CONFIG \ ~~/demo//kernel/linux/linux-3.x/linux3.t32 ;Connect debugger and try to stop at reset vector MENU.ReProgram \ SYStem.Up ~~/demo//kernel/linux/linux-3.x/linux.men Define Groups ;Let bootloader (e.g. U-Boot) initialize the system GROUP.Create "kernel" \ Go /RED WAIT 5.s Break Linux Debugging Reference Card Linux Resource Displays ;Load FIT image (Flattened-Image-Tree) to physical address Processes ;Linux menu Display Processes This reference card gives you an overview of frequently-used Data.LOAD.Binary image.FIT TRACE32® commands for debugging targets running Linux TASK. ;Load kernel symbols (stop mode). Detailed task info Data.LOAD.Elf vmlinux /NoCODE ;Linux menu Display Processes Display Tasks Configure Linux for Debugging ;Continue bootloader – set temporary breakpoint to ‘start_kernel’ TASK.DTask "" Compile kernel with debug info CONFIG_DEBUG_INFO=y Go start_kernel /Onchip "ps" #CONFIG_DEBUG_INFO_REDUCED not set ;Patch bootargs for debugging (in terminal window) ;Linux menu Display ps-like For module debugging set CONFIG_KALLSYMS=y setenv bootargs … nowatchdog \ TASK.PS Trace and task specific CONFIG_PID_IN_CONTEXTIDR=y breakpoints (ARM only) rcupdate.rcu_cpu_stall_suppress=1 File system internals ;Linux menu Display File System Disable KASLR (x86/x64 only) #CONFIG_RANDOMIZE_BASE not set ;Start FIT image with bootloader (in terminal window) TASK.FS.* Compile applications with option -g bootm Kernel log buffer ;Wait until breakpoint (at start_kernel) is hit Attach to a Running Linux Target ;Linux menu Display Kernel Log WAIT !STATE.RUN() ;Initialize debugger TASK.DMESG Continue with Configure Linux Awareness. Actual sequence Device tree blob SYStem.CPU heavily depends on target system and loading mechanisms. SYStem.Option

www.lauterbach.com

www.lauterbach.com Lauterbach GmbH • Altlaufstraße 40 • 85635 Höhenkirchen • [email protected] • Höhenkirchen 85635 • 40 Altlaufstraße • GmbH Lauterbach

>" name "< TASK.sYmbol.LOADMod

;task+libraries

Load Module Symbols Module Load >" name "< TASK.MAPS

to e.g. range adapt to ;Use

/TraceEnable "magic" on click Right Modules Display ;Linux menu menu ;Linux

>:0x0--0xffffffffffffffff ID space < Break.Set

Load module symbols module Load

trace this task this trace

> module < mod_debug

"magic" on right-click Processes Display ;Linux menu menu ;Linux

\ >/kernel/linux/linux-3.x/ arch ~~/demo/< DO

Example: Filter Kernel, Modules, Userspace running in Task context Task in running Userspace Modules, Kernel, Filter Example:

Debug Module on init on Module Debug Debugging Module ;Linux menu menu ;Linux

__switch_to /TraceEnable __switch_to Var.Break.Set

Start debugging at module init routine init module at debugging Start

__switch_to Example: Filter Kernel function Kernel Filter Example:

AutoLoad Module AutoLoad TASK.sYmbol.Option

/TraceEnable

[email protected] Symbol Autoloader Symbol ;Linux menu menu ;Linux

> range address virtual >:< ID space < Break.Set

offices, sales local Support

Configure symbol loader symbol Configure

Generic syntax Generic

demo//kernel/linux scripts Example TASK.MODule Filter Trace Recording Trace Filter

Display Modules Display menu ;Linux

pdf/training_rtos_linux_x86.pdf

Display modules Display

pdf/training_rtos_linux.pdf manual Training

Debug Kernel Modules Kernel Debug 32 ETM.ContextID

pdf/rtos_linux_run.pdf Using Context ID (ARM only) (ARM ID Context Using

pdf/rtos_linux_stop.pdf manuals User TASK.sYmbol.LOADLib > lib < > proc <

/TraceData /Write ) magic ( TASK.CONFIG Break.Set

Documentation / Help / Support / Help / Documentation Load Library Symbols Library Load Using data trace (e.g. PowerPC) (e.g. trace data Using

Configure Trace-based Task Detection Task Trace-based Configure "magic" library on Right-click ;Display maps maps ;Display

Load symbols Load

>" name "< /TASK Trace.Chart.Func

AutoLoad Library AutoLoad TASK.sYmbol.Option

;Filter specific task in the recorded trace e.g. offchip-trace e.g. trace recorded the in task specific ;Filter automatically to core that hits the breakpoint. the hits that core to automatically

Symbol Autoloader Symbol ;Linux menu menu ;Linux

Trace.Chart.Func Are set on all cores, current view switches switches view current cores, all on set Are Breakpoints

Configure symbol loader symbol Configure

> > x < /CORE

Task function runtime runtime function Task Show graphical Show ;Perf menu menu ;Perf option in window context. window in option Use

> > x < CORE.select

>" name "< TASK.MAPS Charts command. Use

Right-click on core number in state line. state in number core on Right-click core Change

Display maps Display >" name "< /TASK Trace.STATistic.Func

right-click on "magic" "magic" on right-click Processes Display menu ;Linux

Data/Register windows change color. change windows Data/Register

;Filter specific task in the recorded trace e.g. offchip-trace e.g. trace recorded the in task specific ;Filter

Display libraries Display

State line shows current core number. core current shows line State

Trace.STATistic.Func Debug Libraries Debug

Debugger shows context of one core. one of context shows Debugger View

Task function runtime runtime function Task menu ;Perf Show numerical Show

Attach SYStem.Mode

Statistics

>" name "< /TASK > addr < Break.Set

… 2. 1. CORE.ASSIGN

Trace-based Function Profiling Function Trace-based

TASK advanced ;Select breakpoint breakpoint ;Select Down SYStem.Mode

ON ON TrOnchip.ContextID

;Set to ON (ARM only) only) (ARM ON to ;Set !STATE.RUN() WAIT

Thread specific breakpoints specific Trace.Chart.TASK smp_init_done Go

>" name "< /TASK Frame

Task runtime runtime Task Show graphical Show menu ;Perf is called. is

smp_init_done

core and switch to SMP after after SMP to switch and core

Charts

Display Stack Frame Stack Display

CORE.ASSIGN CORE.ASSIGN

to select the physical boot boot physical the select to Use Trace.STATistic.TASK "magic" on click Right Processes Display ;Linux menu menu ;Linux

Debugging Start

Show thread context thread Show Task runtime runtime Task Show numerical Show ;Perf menu menu ;Perf

> cpu < SYStem.CPU

. when executing executing when Statistics TASK.sYmbol.LOAD >" name "<

List.TASK /DEFault List.TASK Trace.List The debugger automatically selects all cores cores all selects automatically debugger The

Load Process Symbols Process Load

Debugging Attach Setup

Display task switches task Display Right click on "magic" "magic" on click Right Processes Display menu ;Linux

SMP Support SMP Trace-based Task Profiling Task Trace-based Load symbols for running processes running for symbols Load