From: Masami Hiramatsu <mhiramat@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: "Arnaldo Carvalho de Melo" <acme@kernel.org>,
"Steven Rostedt" <rostedt@goodmis.org>,
"Jiri Olsa" <jolsa@kernel.org>, "Ingo Molnar" <mingo@kernel.org>,
"Naveen N . Rao" <naveen.n.rao@linux.ibm.com>,
"Anil S Keshavamurthy" <anil.s.keshavamurthy@intel.com>,
"David S . Miller" <davem@davemloft.net>,
"Namhyung Kim" <namhyung@kernel.org>,
"Toke Høiland-Jørgensen" <thoiland@redhat.com>,
"Jean-Tsung Hsiao" <jhsiao@redhat.com>,
"Jesper Dangaard Brouer" <brouer@redhat.com>,
"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] tracing/uprobe: Fix double perf_event linking on multiprobe uprobe
Date: Tue, 21 Jan 2020 00:32:23 +0900 [thread overview]
Message-ID: <20200121003223.b823d8ccefc38f3220869618@kernel.org> (raw)
In-Reply-To: <20200120124022.GA14897@hirez.programming.kicks-ass.net>
On Mon, 20 Jan 2020 13:40:22 +0100
Peter Zijlstra <peterz@infradead.org> wrote:
> On Fri, Jan 10, 2020 at 10:45:39AM +0900, Masami Hiramatsu wrote:
>
> > diff --git a/kernel/trace/trace_probe.h b/kernel/trace/trace_probe.h
> > index 4ee703728aec..03e4e180058d 100644
> > --- a/kernel/trace/trace_probe.h
> > +++ b/kernel/trace/trace_probe.h
> > @@ -230,6 +230,7 @@ struct trace_probe_event {
> > struct trace_event_call call;
> > struct list_head files;
> > struct list_head probes;
> > + char data[0];
> > };
>
> Would it make sense to make the above:
>
> struct trace_uprobe_filter filter[0];
>
> instead? That would ensure that alignment is respected. While I think
> the current code works by accident.
Hmm, if we consider the alignment, shouldn't we allocate the structure
with the alignment gap? Currently it just added the
sizeof(struct trace_uprobe_filter) when kzalloc().
In this case, I think we should introduce a new data structure,
trace_uprobe_event.
Thank you,
>
> > @@ -264,6 +263,14 @@ process_fetch_insn(struct fetch_insn *code, struct pt_regs *regs, void *dest,
> > }
> > NOKPROBE_SYMBOL(process_fetch_insn)
> >
> > +static struct trace_uprobe_filter *
> > +trace_uprobe_get_filter(struct trace_uprobe *tu)
> > +{
> > + struct trace_probe_event *event = tu->tp.event;
> > +
> > + return (struct trace_uprobe_filter *)&event->data[0];
> > +}
>
>
--
Masami Hiramatsu <mhiramat@kernel.org>
next prev parent reply other threads:[~2020-01-20 15:32 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-10 1:45 [PATCH] tracing/uprobe: Fix double perf_event linking on multiprobe uprobe Masami Hiramatsu
2020-01-10 1:47 ` Masami Hiramatsu
2020-01-14 17:35 ` Arnaldo Carvalho de Melo
2020-01-14 17:44 ` Steven Rostedt
2020-01-14 17:45 ` Arnaldo Carvalho de Melo
2020-01-14 18:32 ` Steven Rostedt
2020-01-15 1:44 ` Masami Hiramatsu
2020-01-20 12:40 ` Peter Zijlstra
2020-01-20 15:32 ` Masami Hiramatsu [this message]
2020-01-21 7:46 ` [PATCH] tracing/uprobe: Fix to make trace_uprobe_filter alignment safe Masami Hiramatsu
2020-01-21 15:50 ` Steven Rostedt
2020-01-22 3:08 ` Masami Hiramatsu
2020-01-22 3:23 ` [PATCH v2] " Masami Hiramatsu
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=20200121003223.b823d8ccefc38f3220869618@kernel.org \
--to=mhiramat@kernel.org \
--cc=acme@kernel.org \
--cc=anil.s.keshavamurthy@intel.com \
--cc=brouer@redhat.com \
--cc=davem@davemloft.net \
--cc=jhsiao@redhat.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=naveen.n.rao@linux.ibm.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=thoiland@redhat.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).