This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [RFC] systemtap: begin the process of using proper kernel APIs (part1: use kprobe symbol_name/offset instead of address)
- From: James Bottomley <James dot Bottomley at HansenPartnership dot com>
- To: "Frank Ch. Eigler" <fche at redhat dot com>
- Cc: Masami Hiramatsu <mhiramat at redhat dot com>, linux-kernel <linux-kernel at vger dot kernel dot org>, systemtap at sourceware dot org
- Date: Thu, 17 Jul 2008 15:12:26 -0500
- Subject: Re: [RFC] systemtap: begin the process of using proper kernel APIs (part1: use kprobe symbol_name/offset instead of address)
- Dkim-signature: v=1; a=rsa-sha256; c=simple/simple; d=hansenpartnership.com; s=2007; t=1216325548; bh=HXFX4bo+pXWhVvKu/2lltDOMcmZz+Vrs2rDBJquuRM 4=; l=1362; h=Subject:From:To:Cc:In-Reply-To:References: Content-Type:Date:Message-Id:Mime-Version: Content-Transfer-Encoding; b=L4ccFNeGjDOyYJh/AyLX3TKWxWrhzHqnrbKkq JUHxyQk3/63I1gublNT4AvAmRa35xH8QkQYWjXKWhEcSflaKIoh4heIRcxPv1f5KADj RGjQZIb5vJ8D84OwuGmC5CCYb8oMbuxrVbUD9DvPANYOrXZWY+wEBtUVEB+V6JHxO5s =
- Dkim-signature: v=1; a=rsa-sha256; c=simple/simple; d=hansenpartnership.com; s=2007; t=1216325546; bh=HXFX4bo+pXWhVvKu/2lltDOMcmZz+Vrs2rDBJquuRM 4=; l=1362; h=Subject:From:To:Cc:In-Reply-To:References: Content-Type:Date:Message-Id:Mime-Version: Content-Transfer-Encoding; b=h376GQjvoXN4EJcfsx/SImAcPr978n/qcjOVo SQIE2v1gstoYGW68qImINHmfL3I8q7yooO6ObVNY9YSVOY3W8cBb75ntgz2352yXRy7 CtASgKUI795o0615pfpNVE8h+SJEqzXxR+SlqJ6iI3hOrNDIq9Yw4KP632zTWuuVrZw =
- References: <1216146802.3312.95.camel@localhost.localdomain> <487E78ED.30804@redhat.com> <1216249383.3358.69.camel@localhost.localdomain> <487E8CE4.70105@redhat.com> <1216259391.3358.85.camel@localhost.localdomain> <1216304290.5515.11.camel@localhost.localdomain> <1216313914.5515.25.camel__21144.9282979176$1216314027$gmane$org@localhost.localdomain> <y0m7ibkjrcj.fsf@ton.toronto.redhat.com>
On Thu, 2008-07-17 at 14:30 -0400, Frank Ch. Eigler wrote:
> James Bottomley <James.Bottomley@HansenPartnership.com> writes:
>
> > [...]
> > Just by way of illustration, this is systemtap fixed up according to
> > suggestion number 1. You can see now using your test case that we get:
> >
> > # probes
> > kernel.function("do_open@fs/block_dev.c:929") /* pc=<lookup_bdev+0x90> */ /* <- kernel.function("do_open") */
> > kernel.function("do_open@fs/nfsctl.c:24") /* pc=<sys_nfsservctl+0x6a> */ /* <- kernel.function("do_open") */
> > kernel.function("do_open@ipc/mqueue.c:642") /* pc=<sys_mq_unlink+0x130> */ /* <- kernel.function("do_open") */
> > [...]
>
> Can you explain in detail how you believe this is materially
> different from offsetting from _stext?
Basically because _stext is an incredibly dangerous symbol; being linker
generated it doesn't actually get put in the right place if you look:
jejb@sparkweed> nm vmlinux |egrep -w '_stext|_text'
ffffffff80209000 T _stext
ffffffff80200000 A _text
Since we can't do negative offsets, you've lost access to the symbols in
the sections that start before _stext. Assuming you meant _text (which
is dangerous because it's a define in the kernel linker script and could
change). Then you can't offset into other sections, like init sections
or modules.
James
James