[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM9d7cjytSO9chTZBnKLnNsOz4LtwZo4G1LbEBJbLGGpPieaxA@mail.gmail.com>
Date: Fri, 29 Apr 2022 10:27:23 -0700
From: Namhyung Kim <namhyung@...nel.org>
To: Hao Luo <haoluo@...gle.com>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>,
Jiri Olsa <jolsa@...nel.org>, Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
LKML <linux-kernel@...r.kernel.org>,
Andi Kleen <ak@...ux.intel.com>,
Ian Rogers <irogers@...gle.com>,
Song Liu <songliubraving@...com>, bpf <bpf@...r.kernel.org>,
linux-perf-users <linux-perf-users@...r.kernel.org>,
Blake Jones <blakejones@...gle.com>
Subject: Re: [PATCH 2/4] perf record: Enable off-cpu analysis with BPF
Hi Hao,
On Wed, Apr 27, 2022 at 4:07 PM Hao Luo <haoluo@...gle.com> wrote:
>
> Hi Namhyung,
>
> On Fri, Apr 22, 2022 at 8:05 AM Namhyung Kim <namhyung@...nel.org> wrote:
> >
>
> [...]
>
> >
> > Signed-off-by: Namhyung Kim <namhyung@...nel.org>
> > ---
> > tools/perf/Makefile.perf | 1 +
> > tools/perf/builtin-record.c | 21 +++
> > tools/perf/util/Build | 1 +
> > tools/perf/util/bpf_off_cpu.c | 208 +++++++++++++++++++++++++
> > tools/perf/util/bpf_skel/off_cpu.bpf.c | 137 ++++++++++++++++
> > tools/perf/util/off_cpu.h | 22 +++
> > 6 files changed, 390 insertions(+)
> > create mode 100644 tools/perf/util/bpf_off_cpu.c
> > create mode 100644 tools/perf/util/bpf_skel/off_cpu.bpf.c
> > create mode 100644 tools/perf/util/off_cpu.h
> >
>
> [...]
>
> > diff --git a/tools/perf/util/bpf_skel/off_cpu.bpf.c b/tools/perf/util/bpf_skel/off_cpu.bpf.c
> > new file mode 100644
> > index 000000000000..2bc6f7cc59ea
> > --- /dev/null
> > +++ b/tools/perf/util/bpf_skel/off_cpu.bpf.c
> >
> > +struct {
> > + __uint(type, BPF_MAP_TYPE_HASH);
> > + __uint(key_size, sizeof(__u32));
> > + __uint(value_size, sizeof(struct tstamp_data));
> > + __uint(max_entries, MAX_ENTRIES);
> > +} tstamp SEC(".maps");
>
> I think using task local storage for this tstamp would be more
> efficient. There is an example in
> tools/bpf/runqslower/runqslower.bpf.c
Right, will change in v2.
Thanks,
Namhyung
Powered by blists - more mailing lists