Re: [PATCH 1/2 v3] tracing/uprobes: Support ftrace_event_file basemultibuffer

From: Masami Hiramatsu
Date: Tue Jun 25 2013 - 06:19:13 EST


(2013/06/25 12:30), zhangwei(Jovi) wrote:
> @@ -605,33 +629,84 @@ 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;
>
> + /* we cannot call uprobe_register twice for same tu */
> if (is_trace_uprobe_enabled(tu))
> - return -EINTR;
> + enabled = 1;
> +
> + if (file) {
> + struct event_file_link *link;
> +
> + if (tu->flags & TP_FLAG_PROFILE)
> + return -EINTR;
> +
> + link = kmalloc(sizeof(*link), GFP_KERNEL);
> + if (!link)
> + return -ENOMEM;
> +
> + link->file = file;
> + list_add_rcu(&link->list, &tu->files);

Maybe, list_add_tail_rcu() ? :) (but this is a minor one)

Other parts looks good for me.

Reviewed-by: Masami Hiramatsu <masami.hiramatsu.pt@xxxxxxxxxxx>

Thank you,

--
Masami HIRAMATSU
IT Management Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@xxxxxxxxxxx


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/