This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [RFC][PATCH 1/2] uprobes: utrace-based user-space probes
- From: Ernie Petrides <petrides at redhat dot com>
- To: Jim Keniston <jkenisto at us dot ibm dot com>
- Cc: "Frank Ch. Eigler" <fche at redhat dot com>, Linda Wang <lwang at redhat dot com>, systemtap at sources dot redhat dot com
- Date: Fri, 11 May 2007 18:17:35 -0400
- Subject: Re: [RFC][PATCH 1/2] uprobes: utrace-based user-space probes
On Thursday, 10-May-2007 at 15:13 PDT, Jim Keniston wrote:
> On Tue, 2007-05-08 at 20:50 -0400, Ernie Petrides wrote:
>
> > On Monday, 7-May-2007 at 11:42 PDT, Jim Keniston wrote:
> >
> > > On Fri, 2007-05-04 at 21:07 -0400, Ernie Petrides wrote:
> > >
> > > > Secondly, I'd recommend that everything except the consumer/infrastructure
> > > > interface be moved from include/linux/uprobes.h to kernel/uprobes.c in
> > > > order to prevent a consumer module from using/modifying/depending on
> > > > anything that it shouldn't. This is simply basic "information hiding"
> > > > to prevent future incompatibility issues.
> > >
> > > arch/*/kernel/uprobes.c typically needs access to certain internal
> > > data structures (uprobe_kimg, uprobe_task), so I think the best we
> > > could do for some of those data structures is to move them to a
> > > separate "implementation" header. I don't see much precedent for
> > > that, but I'm open to examples.
> >
> > Right. I'm suggesting moving all internal-only-use declarations out of
> > the one header file and *into* the only C source file that needs them.
>
> Again, uprobe_kimg and uprobe_task are used both in kernel/urobes.c and
> the architecture-specific uprobes.c. So is uprobe_ssol_slot. But I
> should be able to move some other struct decls to uprobes.c.
Oh, one more thing on this subject. Now that I've understood the need
for some internal-use-only declarations being in a header file, I would
not recommend creating a 2nd header file. Maybe you could bracket the
internal stuff with an "#ifdef UPROBES_INTERNAL_USE_ONLY" and then define
that identifier inside the C files (before the uprobes.h inclusion) for
the uprobes infrastructure (but not in the example).
But the key thing is to make the consumer interface functions and structures
free of any internal-use-only declarations so you can easily preserve the
uprobes kABI (to a 3rd-party uprobes consumer module).
Cheers. -ernie