All of lore.kernel.org
 help / color / mirror / Atom feed
From: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@elte.hu>,
	Linux-mm <linux-mm@kvack.org>,
	Arnaldo Carvalho de Melo <acme@infradead.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Christoph Hellwig <hch@infradead.org>,
	Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
	Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
	Oleg Nesterov <oleg@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>,
	SystemTap <systemtap@sources.redhat.com>,
	Jim Keniston <jkenisto@linux.vnet.ibm.com>,
	Roland McGrath <roland@hack.frob.com>,
	Andi Kleen <andi@firstfloor.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Subject: Re: [PATCH v2 2.6.38-rc8-tip 5/20] 5: Uprobes: register/unregister probes.
Date: Tue, 15 Mar 2011 23:34:23 +0530	[thread overview]
Message-ID: <20110315180423.GA10429@linux.vnet.ibm.com> (raw)
In-Reply-To: <1300211411.2203.290.camel@twins>

* Peter Zijlstra <peterz@infradead.org> [2011-03-15 18:50:11]:

> On Tue, 2011-03-15 at 13:47 -0400, Steven Rostedt wrote:
> > On Tue, 2011-03-15 at 22:45 +0530, Srikar Dronamraju wrote:
> > > > > +   }
> > > > > +   list_for_each_entry_safe(mm, tmpmm, &tmp_list, uprobes_list) {
> > > > > +           down_read(&mm->mmap_sem);
> > > > > +           if (!install_uprobe(mm, uprobe))
> > > > > +                   ret = 0;
> > > > 
> > > > Installing it once is success ?
> > > 
> > > This is a little tricky. My intention was to return success even if one
> > > install is successful. If we return error, then the caller can go
> > > ahead and free the consumer. Since we return success if there are
> > > currently no processes that have mapped this inode, I was tempted to
> > > return success on atleast one successful install.
> > 
> > What about an all or nothing approach. If one fails, remove all that
> > were installed, and give up.
> 
> That sounds like a much saner semantic and is what we generally do in
> the kernel.

One of the install_uprobe could be failing because the process was
almost exiting, something like there was no mm->owner. Also lets
assume that the first few install_uprobes go thro and the last
install_uprobe fails. There could be breakpoint hits corresponding to
the already installed uprobes that get displayed. i.e all
breakpoint hits from the first install_uprobe to the time we detect a
failed a install_uprobe and revert all inserted breakpoints will be
shown as being captured.

Also register_uprobe will only install probes for processes that are
actively and have mapped the inode.  However install_uprobe called from
uprobe_mmap which also registers the probe can fail. Now should we take
the same yardstick and remove all the probes corresponding to the
successful register_uprobe?

WARNING: multiple messages have this Message-ID (diff)
From: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@elte.hu>,
	Linux-mm <linux-mm@kvack.org>,
	Arnaldo Carvalho de Melo <acme@infradead.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Christoph Hellwig <hch@infradead.org>,
	Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
	Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
	Oleg Nesterov <oleg@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>,
	SystemTap <systemtap@sources.redhat.com>,
	Jim Keniston <jkenisto@linux.vnet.ibm.com>,
	Roland McGrath <roland@hack.frob.com>,
	Andi Kleen <andi@firstfloor.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Subject: Re: [PATCH v2 2.6.38-rc8-tip 5/20] 5: Uprobes: register/unregister probes.
Date: Tue, 15 Mar 2011 23:34:23 +0530	[thread overview]
Message-ID: <20110315180423.GA10429@linux.vnet.ibm.com> (raw)
In-Reply-To: <1300211411.2203.290.camel@twins>

* Peter Zijlstra <peterz@infradead.org> [2011-03-15 18:50:11]:

> On Tue, 2011-03-15 at 13:47 -0400, Steven Rostedt wrote:
> > On Tue, 2011-03-15 at 22:45 +0530, Srikar Dronamraju wrote:
> > > > > +   }
> > > > > +   list_for_each_entry_safe(mm, tmpmm, &tmp_list, uprobes_list) {
> > > > > +           down_read(&mm->mmap_sem);
> > > > > +           if (!install_uprobe(mm, uprobe))
> > > > > +                   ret = 0;
> > > > 
> > > > Installing it once is success ?
> > > 
> > > This is a little tricky. My intention was to return success even if one
> > > install is successful. If we return error, then the caller can go
> > > ahead and free the consumer. Since we return success if there are
> > > currently no processes that have mapped this inode, I was tempted to
> > > return success on atleast one successful install.
> > 
> > What about an all or nothing approach. If one fails, remove all that
> > were installed, and give up.
> 
> That sounds like a much saner semantic and is what we generally do in
> the kernel.

One of the install_uprobe could be failing because the process was
almost exiting, something like there was no mm->owner. Also lets
assume that the first few install_uprobes go thro and the last
install_uprobe fails. There could be breakpoint hits corresponding to
the already installed uprobes that get displayed. i.e all
breakpoint hits from the first install_uprobe to the time we detect a
failed a install_uprobe and revert all inserted breakpoints will be
shown as being captured.

Also register_uprobe will only install probes for processes that are
actively and have mapped the inode.  However install_uprobe called from
uprobe_mmap which also registers the probe can fail. Now should we take
the same yardstick and remove all the probes corresponding to the
successful register_uprobe?

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2011-03-15 18:10 UTC|newest]

Thread overview: 200+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-14 13:34 [PATCH v2 2.6.38-rc8-tip 0/20] 0: Inode based uprobes Srikar Dronamraju
2011-03-14 13:34 ` Srikar Dronamraju
2011-03-14 13:34 ` [PATCH v2 2.6.38-rc8-tip 1/20] 1: mm: Move replace_page() to mm/memory.c Srikar Dronamraju
2011-03-14 13:34   ` Srikar Dronamraju
2011-03-14 14:16   ` Steven Rostedt
2011-03-14 14:16     ` Steven Rostedt
2011-03-14 17:02     ` Srikar Dronamraju
2011-03-14 17:02       ` Srikar Dronamraju
2011-03-14 17:13       ` Steven Rostedt
2011-03-14 17:13         ` Steven Rostedt
2011-03-14 17:29         ` Srikar Dronamraju
2011-03-14 17:29           ` Srikar Dronamraju
2011-03-14 13:34 ` [PATCH v2 2.6.38-rc8-tip 2/20] 2: X86 specific breakpoint definitions Srikar Dronamraju
2011-03-14 13:34   ` Srikar Dronamraju
2011-03-14 13:34 ` [PATCH v2 2.6.38-rc8-tip 3/20] 3: uprobes: Breakground page replacement Srikar Dronamraju
2011-03-14 13:34   ` Srikar Dronamraju
2011-03-14 15:29   ` Steven Rostedt
2011-03-14 15:29     ` Steven Rostedt
2011-03-14 15:38   ` Steven Rostedt
2011-03-14 15:38     ` Steven Rostedt
2011-03-14 17:24     ` Srikar Dronamraju
2011-03-14 17:24       ` Srikar Dronamraju
2011-03-14 18:21       ` Steven Rostedt
2011-03-14 18:21         ` Steven Rostedt
2011-03-14 18:22       ` Steven Rostedt
2011-03-14 18:22         ` Steven Rostedt
2011-03-14 16:58   ` Stephen Wilson
2011-03-14 16:58     ` Stephen Wilson
2011-03-14 17:30     ` Srikar Dronamraju
2011-03-14 17:30       ` Srikar Dronamraju
2011-03-15 13:22   ` Thomas Gleixner
2011-03-15 13:22     ` Thomas Gleixner
2011-03-15 17:51     ` Srikar Dronamraju
2011-03-15 17:51       ` Srikar Dronamraju
2011-03-15 18:03       ` Thomas Gleixner
2011-03-15 18:03         ` Thomas Gleixner
2011-03-15 18:07         ` Srikar Dronamraju
2011-03-15 18:07           ` Srikar Dronamraju
2011-03-14 13:34 ` [PATCH v2 2.6.38-rc8-tip 4/20] 4: uprobes: Adding and remove a uprobe in a rb tree Srikar Dronamraju
2011-03-14 13:34   ` Srikar Dronamraju
2011-03-15 13:38   ` Thomas Gleixner
2011-03-15 13:38     ` Thomas Gleixner
2011-03-15 13:43     ` Steven Rostedt
2011-03-15 13:43       ` Steven Rostedt
2011-03-15 17:30     ` Srikar Dronamraju
2011-03-15 17:30       ` Srikar Dronamraju
2011-03-15 19:22       ` Thomas Gleixner
2011-03-15 19:22         ` Thomas Gleixner
2011-03-15 19:48         ` Peter Zijlstra
2011-03-15 19:48           ` Peter Zijlstra
2011-03-15 22:42           ` Eric Dumazet
2011-03-15 22:42             ` Eric Dumazet
2011-03-16  7:54             ` Peter Zijlstra
2011-03-16  7:54               ` Peter Zijlstra
2011-03-14 13:34 ` [PATCH v2 2.6.38-rc8-tip 5/20] 5: Uprobes: register/unregister probes Srikar Dronamraju
2011-03-14 13:34   ` Srikar Dronamraju
2011-03-14 16:00   ` Steven Rostedt
2011-03-14 16:00     ` Steven Rostedt
2011-03-14 17:32     ` Srikar Dronamraju
2011-03-14 17:32       ` Srikar Dronamraju
2011-03-15 14:28   ` Thomas Gleixner
2011-03-15 14:28     ` Thomas Gleixner
2011-03-15 17:15     ` Srikar Dronamraju
2011-03-15 17:15       ` Srikar Dronamraju
2011-03-15 17:47       ` Steven Rostedt
2011-03-15 17:47         ` Steven Rostedt
2011-03-15 17:50         ` Peter Zijlstra
2011-03-15 17:50           ` Peter Zijlstra
2011-03-15 18:04           ` Srikar Dronamraju [this message]
2011-03-15 18:04             ` Srikar Dronamraju
2011-03-15 18:15             ` Peter Zijlstra
2011-03-15 18:15               ` Peter Zijlstra
2011-03-18 18:53               ` Srikar Dronamraju
2011-03-18 18:53                 ` Srikar Dronamraju
2011-03-15 18:15       ` Thomas Gleixner
2011-03-15 18:15         ` Thomas Gleixner
2011-03-14 13:35 ` [PATCH v2 2.6.38-rc8-tip 6/20] 6: x86: analyze instruction and determine fixups Srikar Dronamraju
2011-03-14 13:35   ` Srikar Dronamraju
2011-03-15 14:36   ` Thomas Gleixner
2011-03-15 14:36     ` Thomas Gleixner
2011-03-18 18:24     ` Srikar Dronamraju
2011-03-18 18:24       ` Srikar Dronamraju
2011-03-18 18:36       ` Roland McGrath
2011-03-18 18:36         ` Roland McGrath
2011-03-18 18:49         ` Srikar Dronamraju
2011-03-18 18:49           ` Srikar Dronamraju
2011-03-18 19:07           ` Srikar Dronamraju
2011-03-18 19:07             ` Srikar Dronamraju
2011-03-18 19:10           ` Roland McGrath
2011-03-18 19:10             ` Roland McGrath
2011-03-14 13:35 ` [PATCH v2 2.6.38-rc8-tip 7/20] 7: uprobes: store/restore original instruction Srikar Dronamraju
2011-03-14 13:35   ` Srikar Dronamraju
2011-03-14 18:09   ` Stephen Wilson
2011-03-14 18:09     ` Stephen Wilson
2011-03-15  9:22     ` Srikar Dronamraju
2011-03-15  9:22       ` Srikar Dronamraju
2011-03-15 13:47       ` Steven Rostedt
2011-03-15 13:47         ` Steven Rostedt
2011-03-15 16:15         ` Stephen Wilson
2011-03-15 16:15           ` Stephen Wilson
2011-03-15 16:17           ` Srikar Dronamraju
2011-03-15 16:17             ` Srikar Dronamraju
2011-03-15 16:21           ` Steven Rostedt
2011-03-15 16:21             ` Steven Rostedt
2011-03-15 17:57       ` Peter Zijlstra
2011-03-15 17:57         ` Peter Zijlstra
2011-03-15 18:58         ` Balbir Singh
2011-03-15 18:58           ` Balbir Singh
2011-03-15 19:30           ` Peter Zijlstra
2011-03-15 19:30             ` Peter Zijlstra
2011-03-15 19:32             ` Steven Rostedt
2011-03-15 19:32               ` Steven Rostedt
2011-03-16  5:51               ` Balbir Singh
2011-03-16  5:51                 ` Balbir Singh
2011-03-16 17:40                 ` Steven Rostedt
2011-03-16 17:40                   ` Steven Rostedt
2011-03-15 14:41   ` Thomas Gleixner
2011-03-15 14:41     ` Thomas Gleixner
2011-03-15 16:25     ` Srikar Dronamraju
2011-03-15 16:25       ` Srikar Dronamraju
2011-03-14 13:35 ` [PATCH v2 2.6.38-rc8-tip 8/20] 8: uprobes: mmap and fork hooks Srikar Dronamraju
2011-03-14 13:35   ` Srikar Dronamraju
2011-03-14 13:35 ` [PATCH v2 2.6.38-rc8-tip 9/20] 9: x86: architecture specific task information Srikar Dronamraju
2011-03-14 13:35   ` Srikar Dronamraju
2011-03-14 13:36 ` [PATCH v2 2.6.38-rc8-tip 10/20] 10: uprobes: task specific information Srikar Dronamraju
2011-03-14 13:36   ` Srikar Dronamraju
2011-03-14 13:36 ` [PATCH v2 2.6.38-rc8-tip 11/20] 11: uprobes: slot allocation for uprobes Srikar Dronamraju
2011-03-14 13:36   ` Srikar Dronamraju
2011-03-15 19:10   ` Jonathan Corbet
2011-03-15 19:10     ` Jonathan Corbet
2011-03-16  4:58     ` Srikar Dronamraju
2011-03-16  4:58       ` Srikar Dronamraju
2011-03-15 20:31   ` Stephen Wilson
2011-03-15 20:31     ` Stephen Wilson
2011-03-16  4:50     ` Srikar Dronamraju
2011-03-16  4:50       ` Srikar Dronamraju
2011-03-14 13:36 ` [PATCH v2 2.6.38-rc8-tip 12/20] 12: uprobes: get the breakpoint address Srikar Dronamraju
2011-03-14 13:36   ` Srikar Dronamraju
2011-03-14 13:36 ` [PATCH v2 2.6.38-rc8-tip 13/20] 13: x86: x86 specific probe handling Srikar Dronamraju
2011-03-14 13:36   ` Srikar Dronamraju
2011-03-14 13:36 ` [PATCH v2 2.6.38-rc8-tip 14/20] 14: uprobes: Handing int3 and singlestep exception Srikar Dronamraju
2011-03-14 13:36   ` Srikar Dronamraju
2011-03-14 13:36 ` [PATCH v2 2.6.38-rc8-tip 15/20] 15: x86: uprobes exception notifier for x86 Srikar Dronamraju
2011-03-14 13:36   ` Srikar Dronamraju
2011-03-14 13:37 ` [PATCH v2 2.6.38-rc8-tip 16/20] 16: uprobes: register a notifier for uprobes Srikar Dronamraju
2011-03-14 13:37   ` Srikar Dronamraju
2011-03-15 19:56   ` Stephen Wilson
2011-03-15 19:56     ` Stephen Wilson
2011-03-18 19:28     ` Srikar Dronamraju
2011-03-18 19:28       ` Srikar Dronamraju
2011-03-14 13:37 ` [PATCH v2 2.6.38-rc8-tip 17/20] 17: uprobes: filter chain Srikar Dronamraju
2011-03-14 13:37   ` Srikar Dronamraju
2011-03-15 19:49   ` Stephen Wilson
2011-03-15 19:49     ` Stephen Wilson
2011-03-18 19:16     ` Srikar Dronamraju
2011-03-18 19:16       ` Srikar Dronamraju
2011-03-18 22:10       ` Stephen Wilson
2011-03-18 22:10         ` Stephen Wilson
2011-03-14 13:37 ` [PATCH v2 2.6.38-rc8-tip 18/20] 18: uprobes: commonly used filters Srikar Dronamraju
2011-03-14 13:37   ` Srikar Dronamraju
2011-03-14 13:37 ` [PATCH v2 2.6.38-rc8-tip 19/20] 19: tracing: Extract out common code for kprobes/uprobes traceevents Srikar Dronamraju
2011-03-14 13:37   ` Srikar Dronamraju
2011-03-14 13:37 ` [PATCH v2 2.6.38-rc8-tip 20/20] 20: tracing: uprobes trace_event interface Srikar Dronamraju
2011-03-14 13:37   ` Srikar Dronamraju
2011-03-14 23:30 ` [PATCH v2 2.6.38-rc8-tip 0/20] 0: Inode based uprobes Andrew Morton
2011-03-14 23:30   ` Andrew Morton
2011-03-14 23:47   ` Andi Kleen
2011-03-14 23:47     ` Andi Kleen
2011-03-15  0:22     ` Thomas Gleixner
2011-03-15  0:22       ` Thomas Gleixner
2011-03-15 18:06       ` Andi Kleen
2011-03-15 18:06         ` Andi Kleen
2011-03-15 19:43         ` Thomas Gleixner
2011-03-15 19:43           ` Thomas Gleixner
2011-03-15 20:01           ` Steven Rostedt
2011-03-15 20:01             ` Steven Rostedt
2011-03-15 20:09             ` Thomas Gleixner
2011-03-15 20:09               ` Thomas Gleixner
2011-03-15 20:44               ` Steven Rostedt
2011-03-15 20:44                 ` Steven Rostedt
2011-03-16 17:32                 ` Tom Tromey
2011-03-16 17:32                   ` Tom Tromey
2011-03-16 17:44                   ` Steven Rostedt
2011-03-16 17:44                     ` Steven Rostedt
2011-03-16 17:27               ` Tom Tromey
2011-03-16 17:27                 ` Tom Tromey
2011-03-15  1:13   ` Frank Ch. Eigler
2011-03-15  1:13     ` Frank Ch. Eigler
2011-03-15  1:35     ` Thomas Gleixner
2011-03-15  1:35       ` Thomas Gleixner
2011-03-15  5:21       ` Srikar Dronamraju
2011-03-15  5:21         ` Srikar Dronamraju
2011-03-15 11:02         ` Thomas Gleixner
2011-03-15 11:02           ` Thomas Gleixner
2011-03-15 11:37           ` Srikar Dronamraju
2011-03-15 11:37             ` Srikar Dronamraju
2011-03-15  1:57   ` Srikar Dronamraju
2011-03-15  1:57     ` Srikar Dronamraju
2011-03-15  2:52   ` Steven Rostedt
2011-03-15  2:52     ` Steven Rostedt

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=20110315180423.GA10429@linux.vnet.ibm.com \
    --to=srikar@linux.vnet.ibm.com \
    --cc=acme@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=ananth@in.ibm.com \
    --cc=andi@firstfloor.org \
    --cc=hch@infradead.org \
    --cc=jkenisto@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mingo@elte.hu \
    --cc=oleg@redhat.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=roland@hack.frob.com \
    --cc=rostedt@goodmis.org \
    --cc=systemtap@sources.redhat.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.