[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201229181629.GJ521329@kernel.org>
Date: Tue, 29 Dec 2020 15:16:29 -0300
From: Arnaldo Carvalho de Melo <acme@...nel.org>
To: Song Liu <songliubraving@...com>
Cc: Namhyung Kim <namhyung@...nel.org>,
linux-kernel <linux-kernel@...r.kernel.org>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Mark Rutland <mark.rutland@....com>,
Jiri Olsa <jolsa@...hat.com>, Kernel Team <Kernel-team@...com>
Subject: Re: [PATCH v6 2/4] perf: support build BPF skeletons with perf
Em Tue, Dec 29, 2020 at 05:14:12PM +0000, Song Liu escreveu:
> > On Dec 29, 2020, at 3:48 AM, Arnaldo Carvalho de Melo <acme@...nel.org> 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 <songliubraving@...com> 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
s/some//
> > 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
s/exit/entry/
> > 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. :-)
There, a patch :-)
- Arnaldo
Powered by blists - more mailing lists