lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 29 Dec 2020 17:14:12 +0000
From:   Song Liu <>
To:     Arnaldo Carvalho de Melo <>
CC:     Namhyung Kim <>,
        linux-kernel <>,
        Peter Zijlstra <>,
        "Ingo Molnar" <>,
        Alexander Shishkin <>,
        Mark Rutland <>,
        Jiri Olsa <>, Kernel Team <>
Subject: Re: [PATCH v6 2/4] perf: support build BPF skeletons with perf

> On Dec 29, 2020, at 3:48 AM, Arnaldo Carvalho de Melo <> wrote:
> Em Tue, Dec 29, 2020 at 04:01:41PM +0900, Namhyung Kim escreveu:
>> On Tue, Dec 29, 2020 at 2:41 AM Song Liu <> wrote:
>>> BPF programs are useful in perf to profile BPF programs. BPF skeleton is
>> I'm having difficulties understanding the first sentence - looks like a
>> recursion. :)  So do you want to use two (or more) BPF programs?
> Yeah, we use perf to perf perf, so we need to use bpf with perf to perf
> bpf :-)
> Look at tools/perf/util/bpf_skel/bpf_prog_profiler.bpf.c, the BPF
> skeleton used to create the in-kernel scaffold to profile BPF programs.
> It uses two BPF programs (fentry/XXX and fexit/XXX) and some a
> PERF_EVENT_ARRAY map and an array to diff counters read at exit from
> counters read at exit of the profiled BPF programs and then accumulate
> those diffs in another PERCPU_ARRAY.
> This all ends up composing a "BPF PMU" that is what the userspace perf
> tooling will read (from "accum_readings" BPF map)  and 'perf stat' will
> consume as if reading from an "old style perf counter" :-)
> Song, did I get it right? :-)

Thanks Arnaldo! I don't think anyone can explain it better. :-)



Powered by blists - more mailing lists