public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Roland McGrath <roland@redhat.com>
To: Jim Keniston <jkenisto@us.ibm.com>
Cc: systemtap <systemtap@sources.redhat.com>
Subject: Re: updated uprobes patches
Date: Mon, 11 Jun 2007 20:18:00 -0000	[thread overview]
Message-ID: <20070611201810.BE7724D05B5@magilla.localdomain> (raw)
In-Reply-To: Jim Keniston's message of  Tuesday, 29 May 2007 15:24:20 -0700 <1180477460.3889.61.camel@ibm-ni9dztukfq8.beaverton.ibm.com>

> 1. __put_task_struct() wasn't exported, so uprobes couldn't call
> put_task_struct().

You should not need this.  The intent is that utrace facilities give you
all the synchronization you need.  At cold attach time, things are
admittedly a little sketchy, but rcu_read_lock may be all you need.

In report_clone the child can't go anywhere until your callback returns.
Let me know if you don't think this is clear in the documentation.

I don't want to dwell too much on the life-cycle tracking details.  In the
long run I expect all of that to be handled by another component so the
full complexity of the picture won't be your problem.  In the immediate
term, it's not hard to get it going well enough for experimentation.  Not
every corner has to be covered to make something to develop with.

> 2. access_process_vm() wasn't exported, so uprobes couldn't call that.

get_user_pages is.  It is more efficient to use a single read-copy-write
done with get_user_pages et al than separate access_process_vm calls anyway.
I may come up with some convenience functions related to this eventually.
But the code is short, doing it directly is just a few minutes' work.

> 3. I couldn't figure out how to build a module consisting of
> kernel/uprobes.o and arch/i386/kernel/uprobes.o.  (So I put 'em both in
> the same directory for my experiment.)

I'm not going to worry about build trivia for the moment, just the code.
That sort of issue can always be worked out one way or another.

> Er, do Fedora kernels export access_process_vm() and
> __put_task_struct()?  (I'm currently running a kernel.org kernel.)  If
> not, is it still worthwhile to modularize uprobes?

I think we are approaching the discussion from rather different points of view.

I mentioned immediate ease of development because I thought it would be
motivational for you, not because it is my own primary motivation behind my
arguments.  The basis of my view is that utrace exists to enable the
implementation of things just like uprobes without further modifications to
the core kernel.  When that is difficult, it points to needs for
improvements in the utrace API, or for components to build on top of it.
My real motivation is the general growth of the infrastructure and ecology
of such components.  Frankly, I am not very interested in implementation
details of uprobes per se, which I consider a prototype in its basic
structure.  This is why I began the separate thread of discussion on a few
detailed subtopics of "breakpoint assistance".  My own interest is in the
robust fleshing out of the "interesting" components of that work, like
truly robust instruction decoding.

> Current practice is to deallocate the uprobe_process graph when the
> count of registered probes hits zero.  If the uprobe_process graph
> becomes the only place to remember where the SSOL vma lives, I think the
> path of least resistance is to discard (munmap) the SSOL vma along with
> the uprobe_process.  (Haven't tried that yet.)

Yes, that is what I meant to imply as the natural "unoptimized" plan.



Thanks,
Roland

  parent reply	other threads:[~2007-06-11 20:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-26  0:29 Jim Keniston
2007-05-26  2:16 ` Frank Eigler
2007-05-27  1:50   ` Jim Keniston
2007-05-27  1:44 ` Roland McGrath
2007-05-29 23:24   ` Jim Keniston
2007-05-30  5:33     ` Ananth N Mavinakayanahalli
2007-06-11 20:18     ` Roland McGrath [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-08-23 17:30 Updated " Srikar Dronamraju
2007-09-06 20:12 ` David Wilder
2007-09-07  9:12   ` Jim Keniston
2007-05-17  0:48 updated " Jim Keniston

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=20070611201810.BE7724D05B5@magilla.localdomain \
    --to=roland@redhat.com \
    --cc=jkenisto@us.ibm.com \
    --cc=systemtap@sources.redhat.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).