linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leo Yan <leo.yan@arm.com>
To: Yonghong Song <yonghong.song@linux.dev>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Namhyung Kim <namhyung@kernel.org>, Jiri Olsa <jolsa@kernel.org>,
	Ian Rogers <irogers@google.com>,
	James Clark <james.clark@linaro.org>,
	"Liang, Kan" <kan.liang@linux.intel.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	Eduard Zingerman <eddyz87@gmail.com>, Song Liu <song@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@kernel.org>,
	Stanislav Fomichev <sdf@fomichev.me>, Hao Luo <haoluo@google.com>,
	Matt Bobrowski <mattbobrowski@google.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	bpf@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Mike Leach <mike.leach@linaro.org>
Subject: Re: [PATCH v1 2/7] bpf: Add bpf_perf_event_aux_pause kfunc
Date: Fri, 18 Jul 2025 16:38:01 +0100	[thread overview]
Message-ID: <20250718153801.GB3137075@e132581.arm.com> (raw)
In-Reply-To: <ba5c04f4-a33d-4d7f-9272-eee4a4389def@linux.dev>

Hi Yonghong,

On Tue, Jul 15, 2025 at 10:12:02AM -0700, Yonghong Song wrote:

[...]

> > I'm not certain whether using __bpf_kfunc is appropriate here, or if I
> > should stick to BPF_CALL to ensure support for accessing bpf_map
> > pointers?
> 
> Using helpers (BPF_CALL) is not an option as the whole bpf ecosystem
> moves to kfunc mechanism. You can certainly use kfunc with 'struct bpf_map *'
> as the argument. For example the following kfunc:
>   __bpf_kfunc s64 bpf_map_sum_elem_count(const struct bpf_map *map)
> in kernel/bpf/map_iter.c

Thanks a lot for suggestion. I followed the idea to refactor the patch
with kfunc, see the new version:
https://lore.kernel.org/linux-perf-users/20250718-perf_aux_pause_resume_bpf_rebase-v2-0-992557b8fb16@arm.com/T/#m27a72255c93fa672e164cb87a322b979fe8f9408

Just clarify one thing, I defined the kfunc in new patch:

  int bpf_perf_event_aux_pause(void *p__map, u64 flags, u32 pause)

Unlike your suggestion, I defined the first parameter as "void
*p__map" (I refers to bpf_arena_alloc_pages()) rather than
"struct bpf_map *map". This is because the BPF program will pass a
variable from the map section, rather than passing a map pointer.

TBH, I do not watch closely the BPF mailing list, so I may not be
fully following the conventions. If anything is incorrect, please
correct it as needed.

Thank you,

Leo

  reply	other threads:[~2025-07-18 15:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-15 19:34 [PATCH v1 0/7] perf auxtrace: Support AUX pause with BPF backend Leo Yan
2024-12-15 19:34 ` [PATCH v1 1/7] perf/core: Make perf_event_aux_pause() as external function Leo Yan
2024-12-15 19:34 ` [PATCH v1 2/7] bpf: Add bpf_perf_event_aux_pause kfunc Leo Yan
2024-12-16 17:21   ` Yonghong Song
2025-07-14 17:45     ` Leo Yan
2025-07-15 17:12       ` Yonghong Song
2025-07-18 15:38         ` Leo Yan [this message]
2025-07-21 22:32           ` Eduard Zingerman
2024-12-15 19:34 ` [PATCH v1 3/7] bpf: Sync bpf_perf_event_aux_pause in tools UAPI bpf.h Leo Yan
2024-12-15 19:34 ` [PATCH v1 4/7] perf: auxtrace: Introduce eBPF program for AUX pause Leo Yan
2024-12-15 19:34 ` [PATCH v1 5/7] perf: auxtrace: Support BPF backend " Leo Yan
2024-12-15 19:34 ` [PATCH v1 6/7] perf record: Support AUX pause with BPF Leo Yan
2024-12-15 19:34 ` [PATCH v1 7/7] perf docs: Document " Leo Yan

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=20250718153801.GB3137075@e132581.arm.com \
    --to=leo.yan@arm.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=haoluo@google.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mattbobrowski@google.com \
    --cc=mhiramat@kernel.org \
    --cc=mike.leach@linaro.org \
    --cc=namhyung@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=sdf@fomichev.me \
    --cc=song@kernel.org \
    --cc=suzuki.poulose@arm.com \
    --cc=yonghong.song@linux.dev \
    /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).