Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1456844

Re: [PATCH v2 1/3] perf/core: Add a tracepoint for perf sampling

From Alexei Starovoitov <alexei.starovoitov@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 1/3] perf/core: Add a tracepoint for perf sampling
Date 2016-08-05 03:50 +0200
Message-ID <s2CqR-WV-1@gated-at.bofh.it> (permalink)
References <s1UpP-4Lj-9@gated-at.bofh.it> <s1Uzv-4PA-1@gated-at.bofh.it> <s21rj-1e7-13@gated-at.bofh.it> <s29yy-6kO-15@gated-at.bofh.it> <s2rON-1X4-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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?

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 1/3] perf/core: Add a tracepoint for perf sampling Brendan Gregg <bgregg@netflix.com> - 2016-08-03 05:00 +0200
  Re: [PATCH v2 1/3] perf/core: Add a tracepoint for perf sampling Peter Zijlstra <peterz@infradead.org> - 2016-08-03 12:20 +0200
    Re: [PATCH v2 1/3] perf/core: Add a tracepoint for perf sampling Brendan Gregg <bgregg@netflix.com> - 2016-08-03 21:00 +0200
      Re: [PATCH v2 1/3] perf/core: Add a tracepoint for perf sampling Peter Zijlstra <peterz@infradead.org> - 2016-08-04 16:30 +0200
        Re: [PATCH v2 1/3] perf/core: Add a tracepoint for perf sampling Alexei Starovoitov <alexei.starovoitov@gmail.com> - 2016-08-05 03:50 +0200
          Re: [PATCH v2 1/3] perf/core: Add a tracepoint for perf sampling Brendan Gregg <bgregg@netflix.com> - 2016-08-05 06:50 +0200
            Re: [PATCH v2 1/3] perf/core: Add a tracepoint for perf sampling Alexei Starovoitov <alexei.starovoitov@gmail.com> - 2016-08-05 07:30 +0200
              Re: [PATCH v2 1/3] perf/core: Add a tracepoint for perf sampling Peter Zijlstra <peterz@infradead.org> - 2016-08-05 13:00 +0200
                Re: [PATCH v2 1/3] perf/core: Add a tracepoint for perf sampling Brendan Gregg <bgregg@netflix.com> - 2016-08-05 19:30 +0200
                Re: [PATCH v2 1/3] perf/core: Add a tracepoint for perf sampling Peter Zijlstra <peterz@infradead.org> - 2016-08-08 12:00 +0200
                Re: [PATCH v2 1/3] perf/core: Add a tracepoint for perf sampling Alexei Starovoitov <alexei.starovoitov@gmail.com> - 2016-08-05 21:50 +0200
                Re: [PATCH v2 1/3] perf/core: Add a tracepoint for perf sampling Peter Zijlstra <peterz@infradead.org> - 2016-08-08 12:10 +0200

csiph-web