[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170728142130.ceifp63lcmp2wce2@hirez.programming.kicks-ass.net>
Date: Fri, 28 Jul 2017 16:21:30 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Jiri Olsa <jolsa@...hat.com>
Cc: Ingo Molnar <mingo@...nel.org>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Andres Freund <andres@...razel.de>, x86@...nel.org,
linux-kernel@...r.kernel.org, live-patching@...r.kernel.org,
Linus Torvalds <torvalds@...ux-foundation.org>,
Andy Lutomirski <luto@...nel.org>, Jiri Slaby <jslaby@...e.cz>,
"H. Peter Anvin" <hpa@...or.com>, Mike Galbraith <efault@....de>,
Arnaldo Carvalho de Melo <acme@...radead.org>,
Namhyung Kim <namhyung@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Subject: Re: [RFC] perf: Delayed userspace unwind (Was: [PATCH v3 00/10] x86:
ORC unwinder)
On Fri, Jul 28, 2017 at 04:13:25PM +0200, Jiri Olsa wrote:
> On Tue, Jul 25, 2017 at 01:55:12PM +0200, Peter Zijlstra wrote:
>
> SNIP
>
> >
> > diff --git a/kernel/events/callchain.c b/kernel/events/callchain.c
> > index 1b2be63c8528..c98a12f3592c 100644
> > --- a/kernel/events/callchain.c
> > +++ b/kernel/events/callchain.c
> > @@ -12,6 +12,7 @@
> > #include <linux/perf_event.h>
> > #include <linux/slab.h>
> > #include <linux/sched/task_stack.h>
> > +#include <linux/task_work.h>
> >
> > #include "internal.h"
> >
> > @@ -178,19 +179,94 @@ put_callchain_entry(int rctx)
> > put_recursion_context(this_cpu_ptr(callchain_recursion), rctx);
> > }
> >
> > +static struct perf_callchain_entry __empty = { .nr = 0, };
> > +
> > +static void perf_callchain_work(struct callback_head *work)
> > +{
> > + struct perf_event *event = container_of(work, struct perf_event, pending_callchain);
> > + struct perf_output_handle handle;
> > + struct perf_sample_data sample;
> > + size_t size;
> > + int ret;
> > +
> > + struct {
> > + struct perf_event_header header;
> > + } callchain_event = {
> > + .header = {
> > + .type = PERF_RECORD_CALLCHAIN,
> > + .misc = 0,
> > + .size = sizeof(callchain_event),
> > + },
> > + };
>
> how about we make this generic for all user space sample_type?
>
> I think we could certainly use it for PERF_SAMPLE_STACK_USER,
> maybe PERF_SAMPLE_REGS_USER would also help.. just a little ;-)
>
> I'll check on that
Right, so I put all the magic in the callchain code itself, which would
make that a wee bit harder. But yes, putting all the USER stuff in there
makes sense.
Powered by blists - more mailing lists