From: "Frank Ch. Eigler" <fche@redhat.com>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>, systemtap@sourceware.org
Subject: Re: [RFC] systemtap: begin the process of using proper kernel APIs (part1: use kprobe symbol_name/offset instead of address)
Date: Tue, 15 Jul 2008 18:18:26 -0400 [thread overview]
Message-ID: <20080715221826.GD4280@redhat.com> (raw)
In-Reply-To: <1216153462.3312.126.camel@localhost.localdomain>
Hi -
On Tue, Jul 15, 2008 at 03:24:22PM -0500, James Bottomley wrote:
> [...]
> > > > > This is highly undesirable because it represents a subversion of the
> > > > > kernel API to gain access to unexported symbols.
> > [...]
> > Maybe, but what "subversion" are you talking about?
>
> using a hand crafted relocation function to gain access to kernel
> symbols instead of the provided API.
Please choose your words more carefully. We don't "subvert" anything,
where one would mean sneaking around some sort of protection. We use
an established, existing facility (placing kprobes by address). We
compute addresses correctly (an error would be obvious), and is
conceptually not so different from an address being passed in at run
time from /proc/kallsyms.
> > Of course, but for our purposes, the kernel will be just one amongst
> > many probing targets. We will be tracking multiple symbol tables and
> > unwind data for user-space.
>
> You're going to hand roll your own symbol resolution for user space too?
> Isn't it pretty easy simply to get ld.so to do that for you?
I don't see how. We can't call into ld.so from kernel space. One may
need to probe ld.so itself.
> [...] I made sure that pure addressed based kprobes still work even
> when they have to use the symbol_name/offset resolution method
> ... the new code just works out the closest symbol and applies an
> offset.
(Not important, but did you consider the possibility that this chosen
reference symbol may, for whatever reason, not be listed in the
kernel's kprobe-assisting symbol table?)
> > Again, please consider user-space. The runtime will need similar
> > symbol resolution code *for user space* anyway. Keeping it in there
> > for the kernel is no incremental complexity - if anything, the
> > opposite.
>
> I really think there might have to be separate runtime pieces for
> user space and for the kernel. Trying to build a single scheme that
> works in both places looks cumbersome. In the separate case, the
> kernel piece, which is potentially movable inside the kernel,
> becomes a lot simpler. [...]
It may just be in the eye of the beholder. To me, a single scheme
that supports all the various address spaces (and kernel versions and
configurations!) we deal with is just as appealing to me as increasing
kernel specialization is to you.
> OK, with -ffunction-sections you can't offset from _stext which
> seems to be what _stp_module_relocate() uses. [...] That means
> that each function address can potentially move depending on the
> number of relocation stubs embedded between it and the next
> function.
I may be missing something, but doesn't all that happen during
linking? We process linked executables, not object files subject to
further run-time relaxation/shrinkage.
- FChE
next prev parent reply other threads:[~2008-07-15 22:20 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1216146802.3312.95.camel__45052.4692344063$1216146917$gmane$org@localhost.localdomain>
2008-07-15 19:41 ` [RFC] systemtap: begin the process of using proper kernel APIs (part1: use kprobe symbol_name/offset instead of address) Frank Ch. Eigler
2008-07-15 19:52 ` James Bottomley
2008-07-15 20:07 ` Frank Ch. Eigler
2008-07-15 20:24 ` James Bottomley
2008-07-15 22:18 ` Frank Ch. Eigler [this message]
2008-07-16 2:06 ` James Bottomley
2008-07-16 10:56 ` Frank Ch. Eigler
2008-07-16 14:56 ` James Bottomley
2008-07-15 18:33 James Bottomley
2008-07-16 22:40 ` Masami Hiramatsu
2008-07-16 23:03 ` James Bottomley
2008-07-17 0:05 ` Masami Hiramatsu
2008-07-17 1:49 ` James Bottomley
2008-07-17 14:18 ` James Bottomley
2008-07-17 16:58 ` James Bottomley
2008-07-17 21:36 ` Masami Hiramatsu
2008-07-17 22:03 ` James Bottomley
2008-07-21 14:20 ` James Bottomley
[not found] ` <1216313914.5515.25.camel__21144.9282979176$1216314027$gmane$org@localhost.localdomain>
2008-07-17 18:30 ` Frank Ch. Eigler
2008-07-17 20:12 ` James Bottomley
2008-07-17 20:26 ` Frank Ch. Eigler
2008-07-17 21:06 ` James Bottomley
2008-07-17 21:33 ` Frank Ch. Eigler
2008-07-17 22:03 ` Masami Hiramatsu
2008-07-22 18:00 ` Rik van Riel
2008-07-22 18:11 ` Frank Ch. Eigler
2008-07-22 18:31 ` Peter Zijlstra
[not found] ` <1216751477.7257.115.camel__19834.5970632092$1216751567$gmane$org@twins>
2008-07-22 18:48 ` Frank Ch. Eigler
2008-07-18 9:11 ` Andi Kleen
2008-07-18 9:23 ` Peter Zijlstra
2008-07-18 10:31 ` Andi Kleen
2008-07-18 10:44 ` Peter Zijlstra
2008-07-18 10:52 ` Andi Kleen
2008-07-18 13:02 ` Frank Ch. Eigler
2008-07-18 13:07 ` Andi Kleen
2008-07-18 13:10 ` Peter Zijlstra
2008-07-18 13:28 ` Frank Ch. Eigler
2008-07-18 13:35 ` Andi Kleen
2008-07-18 13:21 ` James Bottomley
2008-07-18 13:37 ` Frank Ch. Eigler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080715221826.GD4280@redhat.com \
--to=fche@redhat.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=linux-kernel@vger.kernel.org \
--cc=systemtap@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox