This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [BUG] syscall.unlink no longer works after upgrading kernel to 3.7.3
- From: Zheng Da <zhengda1936 at gmail dot com>
- To: Mark Wielaard <mjw at redhat dot com>
- Cc: Josh Stone <jistone at redhat dot com>, agentzh <agentzh at gmail dot com>, "systemtap at sourceware dot org" <systemtap at sourceware dot org>
- Date: Tue, 28 May 2013 17:35:42 -0400
- Subject: Re: [BUG] syscall.unlink no longer works after upgrading kernel to 3.7.3
- References: <CAB4Tn6PdW3GOa09z_tfjQs=F+7XLOqMr5+c5GourX5e0v8FMeQ at mail dot gmail dot com> <1360054656 dot 3837 dot 13 dot camel at bordewijk dot wildebeest dot org> <51114188 dot 60400 at redhat dot com> <CAFLer83DQhCQg7Y3NKR0EUYePzp+fETDTeYEthUXKarAySM0_g at mail dot gmail dot com> <20130528191449 dot GA31042 at toonder dot wildebeest dot org> <CAFLer81NE1bocCbufPTtLLZ-pZz2kVA5r3rKoCgjmc_6w+fwng at mail dot gmail dot com> <51A511FD dot 8010006 at redhat dot com> <20130528203223 dot GA768 at toonder dot wildebeest dot org>
Yes, it's my own script. Here is the code:
probe kernel.function("scsi_device_unbusy") {
if ($sdev->host->host_no == 9 && $sdev->id == 1) {
printf("sdev on node %d, host on node %d\n",
addr_to_node($sdev), addr_to_node($sdev->host));
exit();
}
}
The script works in Linux 3.2.12.
systemtap actually can find the right location of scsi_device_unbusy,
but it doesn't show its parameters.
$ stap -L 'kernel.function("scsi_device_unbusy")'
kernel.function("scsi_device_unbusy@drivers/scsi/scsi_lib.c:318")
I run eu-readelf -N --debug-dump=info
/usr/lib/debug/lib/modules/3.8.12/vmlinux and the info of
scsi_device_unbusy is shown below:
[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]
[43d731b] variable
name (strp) "shost"
decl_file (data1) 1
decl_line (data2) 320
type (ref4) [43d286d]
location (data4) location list [e06269]
[43d732b] variable
name (strp) "starget"
decl_file (data1) 1
decl_line (data2) 321
type (ref4) [43d29be]
[43d7337] variable
name (strp) "flags"
decl_file (data1) 1
decl_line (data2) 322
type (ref4) [43c2d16]
location (data4) location list [e062b4]
It seems the function isn't inlined and eu-readelf can read all right
info of its parameter.
Right now the OS has debug info of two kernels.
$ ls /usr/lib/debug/lib/modules/
3.2.30 3.8.12
When the OS uses kernel v3.8.12, stap can still read the right info of
scsi_device_unbusy if I specify version 3.2.30.
$ stap -r 3.2.30 -L 'kernel.function("scsi_device_unbusy")'
kernel.function("scsi_device_unbusy@drivers/scsi/scsi_lib.c:302")
$sdev:struct scsi_device*
I built kernel 3.8.12 with debug info in the same way as I did with
3.2.30. I checked the config file of kernel 3.8.12, all configs
mentioned in http://sourceware.org/systemtap/wiki/SystemTapWithSelfBuiltKernel
has been enabled.
Basically, I run the following in Ubuntu.
fakeroot make-kpkg -j8 --initrd --revision=1.0 kernel_image kernel_debug
Josh, when you say "DWARF dump", do you mean the output of eu-readelf
as I did above?
Thanks,
Da
On Tue, May 28, 2013 at 4:32 PM, Mark Wielaard <mjw@redhat.com> wrote:
> On Tue, May 28, 2013 at 01:22:21PM -0700, Josh Stone wrote:
>> But there are other reasons for "not accessible" errors, as described in
>> "man error::dwarf". Just optimization or inlining can be enough to make
>> variables unavailable from certain addresses.
>>
>> Are you able to look at the DWARF dump to see where that variable can be
>> reached?
>
> See also http://sourceware.org/systemtap/wiki/TipContextVariables
> for some hints and tips on tracking down what could be the real issue.