[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180928071809.GG3439@hirez.programming.kicks-ass.net>
Date: Fri, 28 Sep 2018 09:18:09 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Song Liu <songliubraving@...com>, linux-kernel@...r.kernel.org,
kernel-team@...com, Masami Hiramatsu <mhiramat@...nel.org>,
Oleg Nesterov <oleg@...hat.com>,
Srikar Dronamraju <srikar@...ux.vnet.ibm.com>,
"Naveen N . Rao" <naveen.n.rao@...ux.vnet.ibm.com>
Subject: Re: [PATCH RESEND] trace_uprobe: support reference counter in
fd-based uprobe
On Wed, Sep 26, 2018 at 12:06:23PM -0400, Steven Rostedt wrote:
> On Mon, 24 Sep 2018 14:12:36 -0700
> Song Liu <songliubraving@...com> wrote:
>
> > This patch enables uprobes with reference counter in fd-based uprobe.
> > Highest 40 bits of perf_event_attr.config is used to stored offset
> > of the reference counter (semaphore).
> >
> > Format information in /sys/bus/event_source/devices/uprobe/format/ is
> > updated to reflect this new feature.
> >
> > Signed-off-by: Song Liu <songliubraving@...com>
> > Reviewed-and-tested-by: Ravi Bangoria <ravi.bangoria@...ux.ibm.com>
> > Cc: Masami Hiramatsu <mhiramat@...nel.org>
> > Cc: Oleg Nesterov <oleg@...hat.com>
> > Cc: Srikar Dronamraju <srikar@...ux.vnet.ibm.com>
> > Cc: Naveen N. Rao <naveen.n.rao@...ux.vnet.ibm.com>
> > Cc: Steven Rostedt (VMware) <rostedt@...dmis.org>
> > ---
> > include/linux/trace_events.h | 3 +-
> > kernel/events/core.c | 49 ++++++++++++++++++++++++++-------
> > kernel/trace/trace_event_perf.c | 7 +++--
>
> Peter,
>
> This is based off of some uprobe code in my tree (which I just finished
> testing and need to push to linux-next). But can you give an ack to the
> perf parts?
> > diff --git a/kernel/events/core.c b/kernel/events/core.c
> > index c80549bf82c6..a4ad5235ec9b 100644
> > --- a/kernel/events/core.c
> > +++ b/kernel/events/core.c
> > @@ -8368,30 +8368,39 @@ static struct pmu perf_tracepoint = {
> > *
> > * PERF_PROBE_CONFIG_IS_RETPROBE if set, create kretprobe/uretprobe
> > * if not set, create kprobe/uprobe
> > + *
> > + * The following values specify a reference counter (or semaphore in the
> > + * terminology of tools like dtrace, systemtap, etc.) Userspace Statically
> > + * Defined Tracepoints (USDT). Currently, we use 40 bit for the offset.
> > + *
> > + * PERF_UPROBE_REF_CTR_OFFSET_BITS # of bits in config as th offset
> > + * PERF_UPROBE_REF_CTR_OFFSET_SHIFT # of bits to shift left
> > */
> > enum perf_probe_config {
> > PERF_PROBE_CONFIG_IS_RETPROBE = 1U << 0, /* [k,u]retprobe */
> > + PERF_UPROBE_REF_CTR_OFFSET_BITS = 40,
> > + PERF_UPROBE_REF_CTR_OFFSET_SHIFT = 64 - PERF_UPROBE_REF_CTR_OFFSET_BITS,
> > };
> >
> > PMU_FORMAT_ATTR(retprobe, "config:0");
There's a PMU_FORMAT_ATTR() missing for the new part.
Powered by blists - more mailing lists