This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [BUG] syscall.unlink no longer works after upgrading kernel to 3.7.3


On 05/28/2013 04:52 PM, Zheng Da wrote:
>>>  [43d72e9]    subprogram
>>>              external             (flag) Yes
>>>              name                 (strp) "scsi_device_unbusy"
>>>              decl_file            (data1) 1
>>>              decl_line            (data2) 318
>>>              prototyped           (flag) Yes
>>>              low_pc               (addr) 0xffffffff81480e80
>>>              high_pc              (addr) 0xffffffff81480f44
>>>              frame_base           (data4) location list [e061d3]
>>>              sibling              (ref4) [43d7492]
>>>  [43d730b]      formal_parameter
>>>                name                 (strp) "sdev"
>>>                decl_file            (data1) 1
>>>                decl_line            (data2) 318
>>>                type                 (ref4) [43d22ff]
>>>                location             (data4) location list [e06233]

...
> I think I can also see the 5-byte difference here.
> 
>  [e061d3]  0xffffffff81480e80..0xffffffff81480e86 [   0] breg7 8
>            0xffffffff81480e86..0xffffffff81480e89 [   0] breg7 16
>            0xffffffff81480e89..0xffffffff81480f43 [   0] breg6 16
>            0xffffffff81480f43..0xffffffff81480f44 [   0] breg7 8
>  [e06233]  0xffffffff81480e85..0xffffffff81480eae [   0] reg5
>            0xffffffff81480edf..0xffffffff81480f36 [   0] reg3

Right, so your function starts at e80, while sdev starts at e85.

> Output of objdump -d:
> ffffffff81480e80 <scsi_device_unbusy>:
> ffffffff81480e80:       e8 7b 6c 22 00          callq
> ffffffff816a7b00 <__fentry__>
> ffffffff81480e85:       55                      push   %rbp
> ffffffff81480e86:       48 89 e5                mov    %rsp,%rbp
> ffffffff81480e89:       48 83 ec 20             sub    $0x20,%rsp

And indeed it lines up with the fentry call.

> I added lines in the source code of systemtap to print msg when
> dwflpp::pr15123_retry_addr returns 0.
> The problem is that the producer string returned by
> dwarf_formstring(&cudie_producer) is "GNU C 4.6.3". There isn't
> "-mfentry". I guess that is what you mean.

Yes.

> Do you want me to use -grecord-gcc-switches to rebuilt the kernel?

Yes, it appears this is needed.  Or if you're building your own
SystemTap, you could just patch out the lines which look for mfentry.
The heuristic is erring on the side of caution, so we don't produce
invalid data.  In any case, gcc 4.8 has fixed this issue directly.

For the record, I figured out that Fedora actually has
-grecord-gcc-switches by default for the whole distro in gcc.spec, with
this:
> sed -i '/dwarf_record_gcc_switches/s/Init(0)/Init(1)/' gcc/common.opt


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]