From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Brendan Gregg <bgregg@netflix.com>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
linux-kernel@vger.kernel.org, Alexei Starovoitov <ast@kernel.org>,
Wang Nan <wangnan0@huawei.com>
Subject: Re: [PATCH v2 1/3] perf/core: Add a tracepoint for perf sampling
Date: Thu, 4 Aug 2016 18:43:43 -0700 [thread overview]
Message-ID: <20160805014341.GB52225@ast-mbp.thefacebook.com> (raw)
In-Reply-To: <20160804142853.GO6862@twins.programming.kicks-ass.net>
On Thu, Aug 04, 2016 at 04:28:53PM +0200, Peter Zijlstra wrote:
> On Wed, Aug 03, 2016 at 11:57:05AM -0700, Brendan Gregg wrote:
>
> > As for pmu tracepoints: if I were to instrument it (although I wasn't
> > planning to), I'd put a tracepoint in perf_event_overflow() called
> > "perf:perf_overflow", with the same arguments. That could then be used
> > for all PMU overflow events, without needing to add specific
> > tracepoints.
>
> Could we not teach BPF to replace event->overflow_handler and inject
> itself there?
>
> We don't currently have nice interfaces for doing that, but it should be
> possible to do I think. We already have the indirect function call, so
> injecting ourself there has 0 overhead.
you're right. All makes sense. I guess I was too lazy to look into
how to do it properly. Adding a tracepoint looked like quick and
easy way to achieve the same.
As far as api goes probably existing IOC_SET_BPF ioctl will do too.
Currently overflow_handler is set at event alloc time. If we start
changing it on the fly with atomic xchg(), afaik things shouldn't
break, since each overflow_handler is run to completion and doesn't
change global state, right?
next prev parent reply other threads:[~2016-08-05 1:43 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-03 2:47 [PATCH v2 0/3] Add a tracepoint for BPF " Brendan Gregg
2016-08-03 2:47 ` [PATCH v2 1/3] perf/core: Add a tracepoint for " Brendan Gregg
2016-08-03 9:48 ` Peter Zijlstra
2016-08-03 18:57 ` Brendan Gregg
2016-08-04 14:28 ` Peter Zijlstra
2016-08-05 1:43 ` Alexei Starovoitov [this message]
2016-08-05 4:13 ` Brendan Gregg
2016-08-05 5:24 ` Alexei Starovoitov
2016-08-05 10:52 ` Peter Zijlstra
2016-08-05 17:22 ` Brendan Gregg
2016-08-08 9:57 ` Peter Zijlstra
2016-08-05 19:45 ` Alexei Starovoitov
2016-08-08 10:03 ` Peter Zijlstra
2016-08-03 2:47 ` [PATCH v2 2/3] samples/bpf: Add a sampling BPF example Brendan Gregg
2016-08-03 2:47 ` [PATCH v2 3/3] perf script: add bpf-output field to usage message Brendan Gregg
2016-08-09 19:16 ` [tip:perf/urgent] perf script: Add 'bpf-output' " tip-bot for Brendan Gregg
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=20160805014341.GB52225@ast-mbp.thefacebook.com \
--to=alexei.starovoitov@gmail.com \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=ast@kernel.org \
--cc=bgregg@netflix.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=wangnan0@huawei.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
all inboxes | Powered by JetHome®