From: Song Liu <songliubraving@fb.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: lkml <linux-kernel@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"peterz@infradead.org" <peterz@infradead.org>,
"ast@kernel.org" <ast@kernel.org>,
"daniel@iogearbox.net" <daniel@iogearbox.net>,
Kernel Team <Kernel-team@fb.com>,
"dsahern@gmail.com" <dsahern@gmail.com>
Subject: Re: [PATCH v7 perf, bpf-next 8/8] perf tools: synthesize PERF_RECORD_* for loaded BPF programs
Date: Fri, 11 Jan 2019 19:23:43 +0000 [thread overview]
Message-ID: <491DEF9F-2974-47F4-ACCC-4F585DEC53C5@fb.com> (raw)
In-Reply-To: <20190111184412.GA22483@kernel.org>
> On Jan 11, 2019, at 10:44 AM, Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
>
> Em Thu, Jan 10, 2019 at 04:19:33PM -0800, Song Liu escreveu:
>> This patch synthesize PERF_RECORD_KSYMBOL and PERF_RECORD_BPF_EVENT for
>> BPF programs loaded before perf-record. This is achieved by gathering
>> information about all BPF programs via sys_bpf.
>>
>> Signed-off-by: Song Liu <songliubraving@fb.com>
>> ---
>> tools/perf/builtin-record.c | 6 ++
>> tools/perf/util/bpf-event.c | 205 ++++++++++++++++++++++++++++++++++++
>> tools/perf/util/bpf-event.h | 5 +
>> 3 files changed, 216 insertions(+)
>>
>> diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
>> index deaf9b902094..88ea11d57c6f 100644
>> --- a/tools/perf/builtin-record.c
>> +++ b/tools/perf/builtin-record.c
>> @@ -41,6 +41,7 @@
>> #include "util/perf-hooks.h"
>> #include "util/time-utils.h"
>> #include "util/units.h"
>> +#include "util/bpf-event.h"
>> #include "asm/bug.h"
>>
>> #include <errno.h>
>> @@ -1082,6 +1083,11 @@ static int record__synthesize(struct record *rec, bool tail)
>> return err;
>> }
>>
>> + err = perf_event__synthesize_bpf_events(tool, process_synthesized_event,
>> + machine, opts);
>> + if (err < 0)
>> + pr_warning("Couldn't synthesize bpf events.\n");
>> +
>
> There should be no warnings on older systems, I build a kernel and tools
> with your changes and then, before rebooting, I tried:
>
> [root@quaco ~]# perf record ls
> Couldn't synthesize bpf events.
> <SNIP>
> [root@quaco ~]# uname -a
> Linux quaco 4.19.13-300.fc29.x86_64 #1 SMP Sat Dec 29 22:54:28 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
> [root@quaco ~]#
>
> At most this should be a pr_debug(), but then it should check if the
> system is bpf capable and if not only warn if the user explicitely asked
> for bpf events.
Thanks Arnaldo! I will fix it in the next version.
Song
next prev parent reply other threads:[~2019-01-11 19:24 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-11 0:19 [PATCH v7 perf, bpf-next 0/8] reveal invisible bpf programs Song Liu
2019-01-11 0:19 ` [PATCH v7 perf, bpf-next 1/8] perf, bpf: Introduce PERF_RECORD_KSYMBOL Song Liu
2019-01-11 0:19 ` [PATCH v7 perf, bpf-next 2/8] sync tools/include/uapi/linux/perf_event.h Song Liu
2019-01-11 0:19 ` [PATCH v7 perf, bpf-next 3/8] perf, bpf: introduce PERF_RECORD_BPF_EVENT Song Liu
2019-01-11 0:19 ` [PATCH v7 perf, bpf-next 4/8] sync tools/include/uapi/linux/perf_event.h Song Liu
2019-01-11 0:19 ` [PATCH v7 perf, bpf-next 5/8] perf, bpf: emit PERF_RECORD_KSYMBOL for BPF program load/unload Song Liu
2019-01-11 0:19 ` [PATCH v7 perf, bpf-next 6/8] perf util: handle PERF_RECORD_KSYMBOL Song Liu
2019-01-14 17:11 ` Arnaldo Carvalho de Melo
2019-01-15 17:56 ` Arnaldo Carvalho de Melo
2019-01-15 19:58 ` Song Liu
2019-01-11 0:19 ` [PATCH v7 perf, bpf-next 7/8] perf util: handle PERF_RECORD_BPF_EVENT Song Liu
2019-01-14 17:12 ` Arnaldo Carvalho de Melo
2019-01-11 0:19 ` [PATCH v7 perf, bpf-next 8/8] perf tools: synthesize PERF_RECORD_* for loaded BPF programs Song Liu
2019-01-11 18:44 ` Arnaldo Carvalho de Melo
2019-01-11 19:23 ` Song Liu [this message]
2019-01-11 16:26 ` [PATCH v7 perf, bpf-next 0/8] reveal invisible bpf programs Arnaldo Carvalho de Melo
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=491DEF9F-2974-47F4-ACCC-4F585DEC53C5@fb.com \
--to=songliubraving@fb.com \
--cc=Kernel-team@fb.com \
--cc=acme@kernel.org \
--cc=ast@kernel.org \
--cc=daniel@iogearbox.net \
--cc=dsahern@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=peterz@infradead.org \
/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).