linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>,
	Tom Zanussi <tom.zanussi@linux.intel.com>,
	Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Subject: Re: [PATCH v2 01/12] tracing/uprobes: Add busy check when cleanup all uprobes
Date: Fri, 7 Dec 2018 11:19:57 +0900	[thread overview]
Message-ID: <20181207111957.b3889ecdca0e0b296c18787d@kernel.org> (raw)
In-Reply-To: <20181204124333.00f4c5ee@vmware.local.home>

On Tue, 4 Dec 2018 12:43:33 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:

> On Mon,  5 Nov 2018 18:00:15 +0900
> Masami Hiramatsu <mhiramat@kernel.org> wrote:
> 
> > Add a busy check loop in cleanup_all_probes() before
> > trying to remove all events in uprobe_events as same as
> > kprobe_events does.
> > 
> > Without this change, writing null to uprobe_events will
> > try to remove events but if one of them is enabled, it
> > stopped there but some of events are already cleared.
> > 
> > With this change, writing null to uprobe_events make
> > sure all events are not enabled before removing events.
> > So, it clears all events, or return an error (-EBUSY)
> > with keeping all events.
> > 
> 
> Hmm, should this patch be marked as stable?

Hmm, OK, let this go to stable. Since anyway, this will cause
a wired result on uprobe_events from user point of view.

Thank you!

> 
> -- Steve
> 
> > Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> > ---
> >  kernel/trace/trace_uprobe.c |    7 +++++++
> >  1 file changed, 7 insertions(+)
> > 
> > diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c
> > index 31ea48eceda1..b708e4ff7ea7 100644
> > --- a/kernel/trace/trace_uprobe.c
> > +++ b/kernel/trace/trace_uprobe.c
> > @@ -587,12 +587,19 @@ static int cleanup_all_probes(void)
> >  	int ret = 0;
> >  
> >  	mutex_lock(&uprobe_lock);
> > +	/* Ensure no probe is in use. */
> > +	list_for_each_entry(tu, &uprobe_list, list)
> > +		if (trace_probe_is_enabled(&tu->tp)) {
> > +			ret = -EBUSY;
> > +			goto end;
> > +		}
> >  	while (!list_empty(&uprobe_list)) {
> >  		tu = list_entry(uprobe_list.next, struct trace_uprobe, list);
> >  		ret = unregister_trace_uprobe(tu);
> >  		if (ret)
> >  			break;
> >  	}
> > +end:
> >  	mutex_unlock(&uprobe_lock);
> >  	return ret;
> >  }
> 


-- 
Masami Hiramatsu <mhiramat@kernel.org>

  reply	other threads:[~2018-12-07  2:20 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-05  8:59 [PATCH v2 00/12] tracing: Unifying dynamic event interface Masami Hiramatsu
2018-11-05  9:00 ` [PATCH v2 01/12] tracing/uprobes: Add busy check when cleanup all uprobes Masami Hiramatsu
2018-12-04 17:43   ` Steven Rostedt
2018-12-07  2:19     ` Masami Hiramatsu [this message]
2018-11-05  9:00 ` [PATCH v2 02/12] tracing: Lock event_mutex before synth_event_mutex Masami Hiramatsu
2018-11-05  9:01 ` [PATCH v2 03/12] tracing: Simplify creation and deletion of synthetic event Masami Hiramatsu
2018-11-05  9:01 ` [PATCH v2 04/12] tracing: Integrate similar probe argument parsers Masami Hiramatsu
2018-11-05  9:02 ` [PATCH v2 05/12] tracing: Add unified dynamic event framework Masami Hiramatsu
2018-11-05  9:02 ` [PATCH v2 06/12] tracing/kprobes: Use dyn_event framework for kprobe events Masami Hiramatsu
2018-11-05  9:03 ` [PATCH v2 07/12] tracing/uprobes: Use dyn_event framework for uprobe events Masami Hiramatsu
2018-11-05  9:03 ` [PATCH v2 08/12] tracing: Use dyn_event framework for synthetic events Masami Hiramatsu
2018-11-05  9:04 ` [PATCH v2 09/12] tracing: Remove unneeded synth_event_mutex Masami Hiramatsu
2018-11-05  9:04 ` [PATCH v2 10/12] tracing: Remove orphaned trace_add/remove_event_call functions Masami Hiramatsu
2018-12-04 18:51   ` Steven Rostedt
2018-12-07  2:22     ` Masami Hiramatsu
2018-11-05  9:04 ` [PATCH v2 11/12] tracing: Add generic event-name based remove event method Masami Hiramatsu
2018-11-05  9:05 ` [PATCH v2 12/12] selftests/ftrace: Add testcases for dynamic event Masami Hiramatsu
2018-11-28  7:31 ` [PATCH v2 00/12] tracing: Unifying dynamic event interface Masami Hiramatsu
2018-11-28 23:42   ` Tom Zanussi
2018-11-29  3:46     ` Steven Rostedt
2018-11-29  5:20     ` Masami Hiramatsu
2018-11-29 15:08       ` Tom Zanussi

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=20181207111957.b3889ecdca0e0b296c18787d@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=ravi.bangoria@linux.vnet.ibm.com \
    --cc=rostedt@goodmis.org \
    --cc=tom.zanussi@linux.intel.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 NNTP newsgroup(s).