From: Oleg Nesterov <oleg@redhat.com>
To: "zhangwei(Jovi)" <jovi.zhangwei@huawei.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
Ingo Molnar <mingo@redhat.com>,
Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
Srikar Dronamraju <srikar@linux.vnet.ibm.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] tracing/uprobes: Support ftrace_event_file base multibuffer
Date: Fri, 14 Jun 2013 16:44:42 +0200 [thread overview]
Message-ID: <20130614144442.GA1943@redhat.com> (raw)
In-Reply-To: <51BA7578.4080108@huawei.com>
On 06/14, zhangwei(Jovi) wrote:
>
> Support multi-buffer on uprobe-based dynamic events by
> using ftrace_event_file.
>
> The code change is based on kprobe-based dynamic events
> multibuffer support work commited by Masami(commit 41a7dd420c)
And the change in probe_event_enable() doesn't look right, but
let me repeat I didn't read the patch carefully yet.
> +static DEFINE_MUTEX(uprobe_enable_lock);
> +
> static inline bool is_trace_uprobe_enabled(struct trace_uprobe *tu)
> {
> return tu->flags & (TP_FLAG_TRACE | TP_FLAG_PROFILE);
> @@ -607,33 +655,123 @@ typedef bool (*filter_func_t)(struct uprobe_consumer *self,
> struct mm_struct *mm);
>
> static int
> -probe_event_enable(struct trace_uprobe *tu, int flag, filter_func_t filter)
> +probe_event_enable(struct trace_uprobe *tu, struct ftrace_event_file *file,
> + filter_func_t filter)
> {
> + int enabled = 0;
> int ret = 0;
>
> + mutex_lock(&uprobe_enable_lock);
Do we really need this? Can't we really on mutex_event hold by the caller?
> if (is_trace_uprobe_enabled(tu))
> - return -EINTR;
> + enabled = 1;
> +
> + if (file) {
> + struct ftrace_event_file **new, **old;
> + int n = trace_uprobe_nr_files(tu);
> +
> + old = rcu_dereference_raw(tu->files);
> + /* 1 is for new one and 1 is for stopper */
> + new = kzalloc((n + 2) * sizeof(struct ftrace_event_file *),
> + GFP_KERNEL);
> + if (!new) {
> + ret = -ENOMEM;
> + goto out_unlock;
> + }
> + memcpy(new, old, n * sizeof(struct ftrace_event_file *));
> + new[n] = file;
> + /* The last one keeps a NULL */
> +
> + rcu_assign_pointer(tu->files, new);
> + tu->flags |= TP_FLAG_TRACE;
> +
> + if (old) {
> + /* Make sure the probe is done with old files */
> + synchronize_sched();
> + kfree(old);
> + }
> + } else
> + tu->flags |= TP_FLAG_PROFILE;
So it can set both TP_FLAG_TRACE and TP_FLAG_PROFILE, yes?
If yes, this is not right. Until we change the pre-filtering at least.
Currently TP_FLAG_TRACE/TP_FLAG_PROFILE are mutually exclusive.
I think it makes sense to remove this limitation anyway, and in fact
I do not remember why I didn't do this... But this needs a separate
change.
Oleg.
next prev parent reply other threads:[~2013-06-14 14:49 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-14 1:44 [PATCH] tracing/uprobes: Support ftrace_event_file base multibuffer zhangwei(Jovi)
2013-06-14 13:21 ` Masami Hiramatsu
2013-06-14 13:51 ` Oleg Nesterov
2013-06-14 14:09 ` Oleg Nesterov
2013-06-14 15:31 ` Steven Rostedt
2013-06-14 16:21 ` Paul E. McKenney
2013-06-14 16:33 ` Steven Rostedt
2013-06-14 17:25 ` Paul E. McKenney
2013-06-17 2:54 ` Masami Hiramatsu
2013-06-17 12:33 ` Steven Rostedt
2013-06-18 1:31 ` Masami Hiramatsu
2013-06-18 2:02 ` Steven Rostedt
2013-06-14 14:44 ` Oleg Nesterov [this message]
2013-06-14 16:04 ` ftrace multibuffer && rcu (Was: tracing/uprobes: Support ftrace_event_file base multibuffer) Oleg Nesterov
2013-06-14 16:18 ` Oleg Nesterov
2013-06-14 16:26 ` Steven Rostedt
2013-06-14 17:02 ` Oleg Nesterov
2013-06-20 16:43 ` [PATCH] tracing/uprobes: Support ftrace_event_file base multibuffer Oleg Nesterov
2013-06-21 8:17 ` zhangwei(Jovi)
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=20130614144442.GA1943@redhat.com \
--to=oleg@redhat.com \
--cc=fweisbec@gmail.com \
--cc=jovi.zhangwei@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
--cc=srikar@linux.vnet.ibm.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