[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <491DEF9F-2974-47F4-ACCC-4F585DEC53C5@fb.com>
Date: Fri, 11 Jan 2019 19:23:43 +0000
From: Song Liu <songliubraving@...com>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
CC: lkml <linux-kernel@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"peterz@...radead.org" <peterz@...radead.org>,
"ast@...nel.org" <ast@...nel.org>,
"daniel@...earbox.net" <daniel@...earbox.net>,
Kernel Team <Kernel-team@...com>,
"dsahern@...il.com" <dsahern@...il.com>
Subject: Re: [PATCH v7 perf, bpf-next 8/8] perf tools: synthesize
PERF_RECORD_* for loaded BPF programs
> On Jan 11, 2019, at 10:44 AM, Arnaldo Carvalho de Melo <acme@...nel.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@...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@...co ~]# perf record ls
> Couldn't synthesize bpf events.
> <SNIP>
> [root@...co ~]# 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@...co ~]#
>
> 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
Powered by blists - more mailing lists