linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexei Starovoitov <ast@fb.com>
To: Song Liu <songliubraving@fb.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Cc: "peterz@infradead.org" <peterz@infradead.org>,
	"acme@kernel.org" <acme@kernel.org>,
	"ast@kernel.org" <ast@kernel.org>,
	"daniel@iogearbox.net" <daniel@iogearbox.net>,
	Kernel Team <Kernel-team@fb.com>
Subject: Re: [PATCH v6 perf, bpf-next 3/7] perf, bpf: introduce PERF_RECORD_BPF_EVENT
Date: Thu, 10 Jan 2019 03:06:56 +0000	[thread overview]
Message-ID: <38c544aa-92b9-978c-98ff-baccb8a750b2@fb.com> (raw)
In-Reply-To: <20190109192111.130995-4-songliubraving@fb.com>

On 1/9/19 11:21 AM, Song Liu wrote:
> For better performance analysis of BPF programs, this patch introduces
> PERF_RECORD_BPF_EVENT, a new perf_event_type that exposes BPF program
> load/unload information to user space.
> 
> Each BPF program may contain up to BPF_MAX_SUBPROGS (256) sub programs.
> The following example shows kernel symbols for a BPF program with 7
> sub programs:
> 
>      ffffffffa0257cf9 t bpf_prog_b07ccb89267cf242_F
>      ffffffffa02592e1 t bpf_prog_2dcecc18072623fc_F
>      ffffffffa025b0e9 t bpf_prog_bb7a405ebaec5d5c_F
>      ffffffffa025dd2c t bpf_prog_a7540d4a39ec1fc7_F
>      ffffffffa025fcca t bpf_prog_05762d4ade0e3737_F
>      ffffffffa026108f t bpf_prog_db4bd11e35df90d4_F
>      ffffffffa0263f00 t bpf_prog_89d64e4abf0f0126_F
>      ffffffffa0257cf9 t bpf_prog_ae31629322c4b018__dummy_tracepoi
> 
> When a bpf program is loaded, PERF_RECORD_KSYMBOL is generated for
> each of these sub programs. Therefore, PERF_RECORD_BPF_EVENT is not
> needed for simple profiling.
> 
> For annotation, user space need to listen to PERF_RECORD_BPF_EVENT
> and gather more information about these (sub) programs via sys_bpf.
> 
> Signed-off-by: Song Liu <songliubraving@fb.com>
> ---
>   include/linux/filter.h          |   7 ++
>   include/linux/perf_event.h      |   6 ++
>   include/uapi/linux/perf_event.h |  29 +++++++-
>   kernel/bpf/core.c               |   2 +-
>   kernel/bpf/syscall.c            |   2 +
>   kernel/events/core.c            | 120 ++++++++++++++++++++++++++++++++
>   6 files changed, 164 insertions(+), 2 deletions(-)

Acked-by: Alexei Starovoitov <ast@kernel.org>

The bpf bits are small comparing to perf bits, so it's probably
better to get the whole thing via tip tree in one go.
Splitting perf patches into perf tree also seems unnecessary.

Peter, Arnaldo, thoughts?

  reply	other threads:[~2019-01-10  3:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-09 19:21 [PATCH v6 perf, bpf-next 0/7] reveal invisible bpf programs Song Liu
2019-01-09 19:21 ` [PATCH v6 perf, bpf-next 1/7] perf, bpf: Introduce PERF_RECORD_KSYMBOL Song Liu
2019-01-10 18:24   ` Arnaldo Carvalho de Melo
2019-01-10 18:40     ` Song Liu
2019-01-10 18:55       ` Arnaldo Carvalho de Melo
2019-01-10 19:30         ` Song Liu
2019-01-10 19:45           ` Song Liu
2019-01-11  1:05             ` David Ahern
2019-01-10 19:52           ` Arnaldo Carvalho de Melo
2019-01-09 19:21 ` [PATCH v6 perf, bpf-next 2/7] sync tools/include/uapi/linux/perf_event.h Song Liu
2019-01-09 19:21 ` [PATCH v6 perf, bpf-next 3/7] perf, bpf: introduce PERF_RECORD_BPF_EVENT Song Liu
2019-01-10  3:06   ` Alexei Starovoitov [this message]
2019-01-09 19:21 ` [PATCH v6 perf, bpf-next 4/7] sync tools/include/uapi/linux/perf_event.h Song Liu
2019-01-09 19:21 ` [PATCH v6 perf, bpf-next 5/7] perf util: handle PERF_RECORD_KSYMBOL Song Liu
2019-01-09 19:21 ` [PATCH v6 perf, bpf-next 6/7] perf util: handle PERF_RECORD_BPF_EVENT Song Liu
2019-01-09 19:21 ` [PATCH v6 perf, bpf-next 7/7] perf tools: synthesize PERF_RECORD_* for loaded BPF programs Song Liu

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=38c544aa-92b9-978c-98ff-baccb8a750b2@fb.com \
    --to=ast@fb.com \
    --cc=Kernel-team@fb.com \
    --cc=acme@kernel.org \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=songliubraving@fb.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).