foss-for-synopsys-dwc-arc-processors / linux

Helpful resources for users & developers of Linux kernel for ARC
22 stars 13 forks source link

[ARC64] stack unwinding not working #38

Closed vineetgarc closed 2 years ago

vineetgarc commented 3 years ago

In kernel dwarf unwinding doesn't seem to be working for ARC64. Here's a run on QEMU.

# cat /proc/cpuinfo

IDENTITY    : ARCVER [0x70] ARCNUM [0x0] CHIPID [0xffff]
processor [0]   : HS68 (ARC64 ARCv3 ISA) 
ISA Extn    : atomic unalign 
MMU [v6]    : MMU48 hwalk 4 levels, 4k PAGE, JTLB 256 uD/I 8/4
         tlb_flush_mm Incr ASID
I-Cache     : 64K, 4way/set, 64B Line, VIPT aliasing
D-Cache     : 64K, 2way/set, 64B Line, PIPT
Timers      : Timer0 Timer1 
Vector Table    : 0x80000000 [64-bit]
Extn [CCM]  : DCCM @ 85b2d9f8, 0 KB / ICCM: @ 85752a6c, 3129485 KB
CPU speed   : 50.00 Mhz
Bogo MIPS   : 321.94

# ps
PID   USER     COMMAND
    1 root     init
    2 root     [kthreadd]
    3 root     [rcu_gp]
    4 root     [rcu_par_gp]
    5 root     [kworker/0:0-eve]
    6 root     [kworker/0:0H-ev]
    7 root     [kworker/u2:0-ev]
    8 root     [mm_percpu_wq]
    9 root     [ksoftirqd/0]
   10 root     [rcu_preempt]
   11 root     [kdevtmpfs]
   12 root     [netns]
   13 root     [rcu_tasks_kthre]
   14 root     [oom_reaper]
   15 root     [writeback]
   16 root     [kblockd]
   17 root     [kworker/0:1-eve]
   18 root     [rpciod]
   19 root     [kworker/u3:0]
   20 root     [xprtiod]
   21 root     [kswapd0]
   22 root     [nfsiod]
   38 root     /sbin/syslogd -n
   42 root     /sbin/klogd -n
   67 root     -sh
   68 root     [kworker/u2:1-ev]
   70 root     {runltp} /bin/sh ./runltp -l arc.log -p -q
  149 root     /usr/lib/ltp-testsuite/bin/ltp-pan -q -e -S -a 70 -n 70 -p -f /t
  478 root     [kworker/0:1H]
  485 root     [kworker/0:2-eve]
15169 root     [kworker/u2:2-ev]
15172 root     [kworker/u2:3-ev]
19556 root     pselect01_64
19557 root     pselect01_64
19561 root     ps
# 
# 
# cat /proc/67/stack 
# 

There seems to be enough drwarf information as both mdb and qemu can generate backtraces.

vineetgarc commented 2 years ago

Fixed. 2021-08-13 b9cdc22c46e1 ARCv3: fix stack unwinding from sleep

vineetgarc commented 2 years ago
# cat /proc/59/stack 
[<0>] do_wait+0x180/0x1ac
[<0>] kernel_wait4+0x88/0x104
[<0>] EV_Trap+0xcc/0xd0