From: Arjan van de Ven <arjan@infradead.org>
To: prasanna@in.ibm.com
Cc: Andrew Morton <akpm@osdl.org>, Andi Kleen <ak@suse.de>,
davem@davemloft.net, suparna@in.ibm.com,
richardj_moore@uk.ibm.com, linux-kernel@vger.kernel.org,
Christoph Hellwig <hch@infradead.org>,
"Theodore Ts'o" <tytso@mit.edu>,
Nick Piggin <nickpiggin@yahoo.com.au>
Subject: Re: RFC - Approaches to user-space probes
Date: Mon, 27 Mar 2006 09:37:48 +0200 [thread overview]
Message-ID: <1143445068.2886.20.camel@laptopd505.fenrus.org> (raw)
In-Reply-To: <20060327065447.GA25745@in.ibm.com>
On Mon, 2006-03-27 at 12:24 +0530, Prasanna S Panchamukhi wrote:
> Hi All,
>
> As Andrew Morton suggested, here is a document on user-space probes
> discussing known approaches and design issues.
>
> Please provide your comments and suggestions.
>
> Thanks
> Prasanna
> ----
>
> The basic need is to provide infrastructure for user-space dynamic
> instrumentation. As with kprobes, there is no need to recompile or
> restart the applications for instrumentation, under a debugger for
> instance.
>
> Some of the use-cases are:
>
> - To find out the memory leaks dynamically just by inserting probes on
> malloc and free library routines.
for that you do need to do that from the start of an application, at
which point perfectly good tooling exists already; leak tracking without
full state is, well, not something that'll work too well I suspect.
Also I don't see really why this needs kernel help :)
> - Low overhead and user can have thousands of active probes on the
> system and detect any instance when the probe was hit including
> probes on shared library etc.
I suspect this is the only reason for doing it inside the kernel;
anything else still really shouts "do it in userspace via ptrace" to me.
> ===========================================================
> LOCAL PROBES(PER PROCESS) VS GLOBAL PROBES(EXECUTABLE FILE)
> ===========================================================
>
> - All processes take a trap since the same executable file
> gets mapped into different address_space.
is that true for breakpoints inserted after start?
The reason I ask because... what if half the processed took a COW on the
page with the instruction you want to trap on. Are you going to edit all
those COW'd pages?
Also you no longer have the option to only do it on a selected subset of
processes (eg the workload vs the system)
> - Compare this with ptrace breakpoints (hence strace and gdb) where
> tracepoints and breakpoints are localized to a specified set of
> processes. To support local probes the text pages are privatized
> for that process. Global user-probes does not have the side effects
> (privatization of pages) that ptrace has.
No instead it gets to "deal" with that already having happened ;)
Overall I see only one possible reason to do this in the kernel:
performance. Anything else really suggests that a userspace approach is
more than reasonable to me. (It might not be always be super easy, but
on the other hand you gain a lot back by doing that, for example you
have a lot better backtrace and debuginformation there so that you can
do far more advanced probes like "probe only if the caller is ..." etc)
next prev parent reply other threads:[~2006-03-27 7:38 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-27 6:54 Prasanna S Panchamukhi
2006-03-27 7:37 ` Arjan van de Ven [this message]
2006-03-27 10:00 ` Prasanna S Panchamukhi
2006-03-27 20:03 ` Arjan van de Ven
2006-03-28 9:42 ` Richard J Moore
2006-03-28 9:47 ` Andi Kleen
2006-03-28 10:10 ` Richard J Moore
2006-03-28 14:54 ` Prasanna S Panchamukhi
2006-03-28 17:29 ` Arjan van de Ven
2006-03-28 20:35 ` Frank Ch. Eigler
2006-03-28 20:44 ` Andi Kleen
2006-03-31 11:55 ` Prasanna S Panchamukhi
2006-03-31 16:25 ` 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=1143445068.2886.20.camel@laptopd505.fenrus.org \
--to=arjan@infradead.org \
--cc=ak@suse.de \
--cc=akpm@osdl.org \
--cc=davem@davemloft.net \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nickpiggin@yahoo.com.au \
--cc=prasanna@in.ibm.com \
--cc=richardj_moore@uk.ibm.com \
--cc=suparna@in.ibm.com \
--cc=tytso@mit.edu \
/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
all inboxes | Powered by JetHome®