libunwind-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Libunwind-devel] User stack unwind issue on mips64r6el platform


From: Yan Archer
Subject: [Libunwind-devel] User stack unwind issue on mips64r6el platform
Date: Mon, 4 Mar 2019 16:05:04 +0000

Hi,
  I am trying to capture user stack callgraph on MIPS64R6EL platform(Boston), but unfortunately I failed to get the user stack unwind info.
  My environment info is:
      kernel version: 5.0-rc1
      libunwind: 1.3.1
      test platform: Qemu for boston
  I applied the patch from David Daney and made some modification for linux kernel 5.0.
  I use 'perf record --call-graph dwarf ./test' to record, but only get following info:
  #
    38.95%    38.95%  2-mips-2  2-mips-2           [.] .L12
            |
            ---test_hi (inlined!!)

    38.95%     0.00%  2-mips-2  2-mips-2           [.] test_hi (inlined)
            |
            ---test_hi (inlined!!)

    30.05%    30.05%  2-mips-2  2-mips-2           [.] .L9
            |
            ---test_high (inlined!!)

    30.05%     0.00%  2-mips-2  2-mips-2           [.] test_high (inlined)
            |
            ---test_high (inlined!!)

   The same test program running under x86 can get full call graph from main to test_high etc:
   -   41.12%    41.10%  2        2                  [.] test_hi                  
     41.09% _start                                                             
        __libc_start_main                                                      
        main                                                                   
        test_hi                                                                
-   32.44%    32.39%  2        2                  [.] test_high                
     32.39% _start                                                             
        __libc_start_main                                                      
        main                                                                   
        test_high                                                          
   According to the discuss between Luke and Sapir(https://lists.libreplanet.org/archive/html/libunwind-devel/2018-07/msg00005.html), I double checked .eh_frame section has already been generated. 
  Two things are weird:
  1. in _Umips_dwarf_search_unwind_table, IP register value is out of the range betwee pi->start_ip and pi->end_ip, this directs unw_step return error and could find the stack levels.
  2. The test_high function are cross assembled into following three sections and in the perf sample, the user IP register always pointer to section .L9 not section test_high. I am not sure if this directs the unwind info can't be decoded correctly.
  
0000000000000da0 <test_high>:
     da0:       67bdffd0        daddiu  sp,sp,-48
     da4:       ffbf0028        sd      ra,40(sp)
     da8:       ffbe0020        sd      s8,32(sp)
     dac:       ffbc0018        sd      gp,24(sp)
     db0:       03a0f025        move    s8,sp
     db4:       3c1c0002        lui     gp,0x2
     db8:       0399e02d        daddu   gp,gp,t9
     dbc:       679c8670        daddiu  gp,gp,-31120
     dc0:       df828060        ld      v0,-32672(gp)
     dc4:       0040c825        move    t9,v0
     dc8:       f8190000        jalrc   t9
     dcc:       afc00000        sw      zero,0(s8)
     dd0:       c8000005        bc      de8 <.L8>

0000000000000dd4 <.L9>:
     dd4:       8fc20000        lw      v0,0(s8)
     dd8:       afc20004        sw      v0,4(s8)
     ddc:       8fc20000        lw      v0,0(s8)
     de0:       24420001        addiu   v0,v0,1
     de4:       afc20000        sw      v0,0(s8)

0000000000000de8 <.L8>:
     de8:       8fc20000        lw      v0,0(s8)
     dec:       3c03055d        lui     v1,0x55d
     df0:       34634a7f        ori     v1,v1,0x4a7f
     df4:       5862fff7        bgec    v1,v0,dd4 <.L9>
     df8:       00000000        nop
     dfc:       03c0e825        move    sp,s8
     e00:       dfbf0028        ld      ra,40(sp)
     e04:       dfbe0020        ld      s8,32(sp)
     e08:       dfbc0018        ld      gp,24(sp)
     e0c:       67bd0030        daddiu  sp,sp,48
     e10:       d81f0000        jrc     ra
   
  Could you please help with this? Any suggestion is welcomed:).

Attachment: 0001-Hack-up-the-Makefile-and-add-support-code-for-mips-u.patch
Description: 0001-Hack-up-the-Makefile-and-add-support-code-for-mips-u.patch

Attachment: 0002-Fit-old-perf-mips-patch-with-latest-kernel-version.patch
Description: 0002-Fit-old-perf-mips-patch-with-latest-kernel-version.patch


reply via email to

[Prev in Thread] Current Thread [Next in Thread]