All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexei Starovoitov <ast@fb.com>
To: Song Liu <songliubraving@fb.com>, Alexei Starovoitov <ast@kernel.org>
Cc: "David S . Miller" <davem@davemloft.net>,
	"daniel@iogearbox.net" <daniel@iogearbox.net>,
	"peterz@infradead.org" <peterz@infradead.org>,
	"acme@kernel.org" <acme@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Kernel Team <Kernel-team@fb.com>
Subject: Re: [PATCH bpf-next 1/3] perf/core: introduce perf_event_mmap_bpf_prog
Date: Thu, 20 Sep 2018 00:53:02 +0000	[thread overview]
Message-ID: <847ab103-da9f-64e7-67fa-1a29deeb6d28@fb.com> (raw)
In-Reply-To: <4DBB524C-09B1-46BD-A56E-1E372E87F2E8@fb.com>

On 9/19/18 4:30 PM, Song Liu wrote:
>
>
>> On Sep 19, 2018, at 3:39 PM, Alexei Starovoitov <ast@kernel.org> wrote:
>>
>> introduce perf_event_mmap_bpf_prog() helper to emit RECORD_MMAP events
>> into perf ring buffer.
>> It's used by bpf load/unload logic to notify user space of addresses
>> and names of JITed bpf programs.
>>
>> Note that event->mmap.pid == -1 is an existing indicator of kernel event.
>> In addition use event->mmap.tid == BPF_FS_MAGIC to indicate bpf related
>> RECORD_MMAP event.
>>
>> Alternatively it's possible to introduce new 'enum perf_event_type' command
>> specificially for bpf prog load/unload, but existing RECORD_MMAP
>> is very close, so the choice made by this patch is to extend it.
>>
>> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
>
> Acked-by: Song Liu <songliubraving@fb.com>
>
> I guess we should also use this for kernel modules load/unload?

yes. that's possible.
There is similar issue with modules today that get unloaded
before 'perf report'.
Synthetic record_mmap for modules that perf emits into perf.data
has filename==module_name. It solves typical use case though.
We can extend record_mmap further and let kernel emit them
for module load/unload.
Some new magic for 'tid' would be necessary.

  reply	other threads:[~2018-09-20  6:34 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-19 22:39 [PATCH bpf-next 0/3] perf, bpf: reveal invisible bpf programs Alexei Starovoitov
2018-09-19 22:39 ` [PATCH bpf-next 1/3] perf/core: introduce perf_event_mmap_bpf_prog Alexei Starovoitov
2018-09-19 23:30   ` Song Liu
2018-09-20  0:53     ` Alexei Starovoitov [this message]
2018-09-19 22:39 ` [PATCH bpf-next 2/3] bpf: emit RECORD_MMAP events for bpf prog load/unload Alexei Starovoitov
2018-09-19 23:44   ` Song Liu
2018-09-20  0:59     ` Alexei Starovoitov
2018-09-20  5:48       ` Song Liu
2018-09-20  8:44   ` Peter Zijlstra
2018-09-20 13:25     ` Arnaldo Carvalho de Melo
2018-09-20 13:56       ` Peter Zijlstra
2018-09-21  3:14         ` Alexei Starovoitov
2018-09-21 12:25           ` Arnaldo Carvalho de Melo
2018-09-21 13:55             ` Peter Zijlstra
2018-09-21 13:59             ` Peter Zijlstra
2018-09-21 22:13             ` Alexei Starovoitov
2018-10-15 23:33               ` Song Liu
2018-10-16 23:43                 ` David Ahern
2018-10-17  6:43                   ` Song Liu
2018-10-17 12:11                     ` Arnaldo Carvalho de Melo
2018-10-17 12:50                       ` Arnaldo Carvalho de Melo
2018-10-17 16:06                         ` Song Liu
2018-11-02  1:08                       ` Song Liu
2018-10-17 15:09                     ` David Ahern
2018-10-17 16:18                       ` Song Liu
2018-10-17 16:36                       ` Alexei Starovoitov
2018-10-17 18:53                         ` Arnaldo Carvalho de Melo
2018-10-17 19:08                           ` Alexei Starovoitov
2018-10-17 21:31                             ` Arnaldo Carvalho de Melo
2018-10-17 22:01                               ` Alexei Starovoitov
2018-09-20 13:36     ` Peter Zijlstra
2018-09-19 22:39 ` [PATCH perf 3/3] tools/perf: recognize and process RECORD_MMAP events for bpf progs Alexei Starovoitov
2018-09-20 13:36   ` Arnaldo Carvalho de Melo
2018-09-20 14:05     ` Arnaldo Carvalho de Melo
2018-09-21 22:57   ` 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=847ab103-da9f-64e7-67fa-1a29deeb6d28@fb.com \
    --to=ast@fb.com \
    --cc=Kernel-team@fb.com \
    --cc=acme@kernel.org \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.